Link balancing method and device, electronic equipment and computer readable storage medium
By determining the link allowance deviation and number of retained links in the server cluster, disconnecting and reassigning links, the problem of link imbalance is solved, and the link balance and user experience of the server cluster is improved.
Patent Information
- Application Number
- CN202510005261.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-13
AI Technical Summary
After the server cluster undergoes a failure drill or disaster recovery scenario recovery scenario recovery, link imbalance may occur, resulting in some servers having no links and other servers having too high links, affecting resource utilization and service timeliness.
By determining the link allowable deviation of the server cluster, the number of retained links for each server is calculated, and the links are broken according to these retained links, and the broken links are then evenly distributed to each server to achieve equalization of the link numbers.
It realizes that the number of links of the server cluster can be balanced through one link reconnection, reduces the number of client link disconnection, and improves user experience and service timeliness.
Smart Images

Figure CN119996412A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network technology, and in particular to a link balancing method, device, electronic device and computer-readable storage medium. Background Art
[0002] In actual applications, the client obtains service data from the server by establishing a link (such as a long link) with the server cluster. Each server in the server cluster takes on a certain number of client long links to provide services to the clients that have established the link. After the server cluster performs some operation and maintenance operations such as fault drills or disaster recovery scenarios, there may be an imbalance in server links. For example, after the fault drill, some disconnected machines resume service, but the clients have already migrated the links to normal servers during the disconnection process, resulting in no links for the machines that have been restored after the disconnection, and resources cannot be effectively utilized. The number of links for other machines that have not been disconnected is too high, which is prone to imbalanced links. Therefore, after performing the above operation and maintenance operations, it is necessary to redistribute the links, that is, require some servers with too many links to disconnect some links, and then reconnect the disconnected links to each server to achieve a balanced link effect between the servers.
[0003] When performing link balancing operations on links, the related technology usually disconnects some of the links of servers with too many links first. After the disconnection operation, due to the client's random reconnection mechanism, the number of links of some machines that have not been disconnected is too high, so that load imbalance may still exist. Then, disconnection and reconnection are continuously performed through polling until the number of links of each server is balanced.
[0004] This method of the related art may cause some clients to repeatedly disconnect and reconnect due to the need for repeated balancing, affecting the service timeliness of the client and causing poor user experience. Summary of the invention
[0005] The present application provides a link balancing method, device, electronic device and computer-readable storage medium, which can achieve link balancing of a server cluster through a single link reconnection without repeated link reconnection, reduce the number of link disconnections of the client during the link reallocation process, reduce the impact of link reallocation on the service timeliness of the client, and improve user experience. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a link balancing method, the method comprising:
[0007] Determine an allowable link deviation corresponding to the server cluster, wherein the allowable link deviation is used to limit the difference in the number of links between the server with the most links and the server with the least links in the server cluster after link redistribution;
[0008] Determine the number of reserved links corresponding to each server in the server cluster according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the least current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links;
[0009] The links of the servers are disconnected according to the number of reserved links corresponding to each server, and the disconnected links in the server cluster are evenly distributed to each server, so that the link deviation of the server cluster after redistribution is less than or equal to the link allowable deviation.
[0010] Optionally, the determining of the link allowable deviation corresponding to the server cluster includes at least one of the following:
[0011] Determine the link allowable deviation corresponding to the server cluster according to the current average link number, wherein the current average link number is the average value of the current link numbers corresponding to the servers in the server cluster;
[0012] Determine the preset deviation value as the link allowable deviation corresponding to the server cluster;
[0013] The number of links of each server in the server cluster in a historical time period is obtained, and the link allowable deviation corresponding to the server cluster is determined according to the number of links corresponding to each server in the historical time period.
[0014] Optionally, determining the link allowable deviation corresponding to the server cluster according to the current average number of links includes:
[0015] Obtaining a link deviation factor, where the link deviation factor is greater than or equal to 1;
[0016] The link allowable deviation corresponding to the server cluster is determined according to the quotient of the current average number of links and the link deviation factor.
[0017] Optionally, disconnecting the links of the servers according to the number of reserved links corresponding to each server includes:
[0018] For the i-th server in the server cluster, when the current number of links of the i-th server is greater than the corresponding number of reserved links, the number of links corresponding to the i-th server is reduced to the corresponding number of reserved links, where i traverses 1 to n, and n is the number of servers included in the server cluster.
[0019] Optionally, the configurations of the servers in the server cluster are the same, the number of reserved links corresponding to the servers in the server cluster is the same, and the number of reserved links is equal to the sum of the link allowable deviation and the minimum number of links.
[0020] Optionally, before determining the link allowable deviation corresponding to the server cluster, the method further includes:
[0021] Determine whether the current total number of links corresponding to the server cluster exceeds the maximum total load number of links that the server cluster can bear;
[0022] The determining the link allowable deviation corresponding to the server cluster includes:
[0023] When the current total number of links does not exceed the maximum total load number of links, the link allowable deviation corresponding to the server cluster is determined.
[0024] Optionally, before disconnecting the links of the servers according to the number of reserved links corresponding to the servers, the method further includes:
[0025] Calculating whether the number of reallocated links corresponding to each server exceeds the maximum load link number corresponding to each server after link reallocation for each server according to the target reallocation method, wherein the target reallocation method is: disconnecting the existing links of each server according to the number of reserved links corresponding to each server, and evenly distributing the disconnected links of the server cluster to each server;
[0026] The disconnecting the links of the servers according to the number of reserved links corresponding to the servers comprises:
[0027] When it is calculated that the number of reallocated links corresponding to each of the servers does not exceed the number of maximum load links corresponding to each of the servers, the links of the servers are disconnected according to the number of reserved links corresponding to each of the servers.
[0028] Optionally, the method further comprises:
[0029] When the current total number of links exceeds the maximum total number of load links, or when the calculated number of reallocated links corresponding to each server exceeds the corresponding maximum load link number, the server cluster is expanded, and the link balancing process from determining the allowable deviation of the links corresponding to the server cluster to evenly distributing the disconnected links in the server cluster to each of the servers is performed for the expanded server cluster.
[0030] Optionally, the triggering timing of the link balancing method includes at least one of the following:
[0031] The difference between the maximum number of current links and the minimum number of current links among the current link numbers corresponding to the servers in the server cluster exceeds a preset threshold;
[0032] The server cluster performs operation and maintenance operations, and the operation and maintenance operations include at least one of the following: the server cluster performs capacity expansion, the server cluster performs network disconnection drill, and registers / deregisters address servers.
[0033] Optionally, disconnecting the links of the servers according to the number of reserved links corresponding to each server includes:
[0034] Obtaining an access frequency of a link corresponding to the server, where the access frequency refers to a frequency at which a client accesses the server through the link;
[0035] The links of the server exceeding the reserved link number are disconnected in the order of the access frequency from low to high and based on the reserved link number corresponding to the server.
[0036] In a second aspect, the present application further provides a link balancing device, the device comprising:
[0037] A first determining unit, configured to determine an allowable link deviation corresponding to a server cluster, wherein the allowable link deviation is used to limit a difference in the number of links between a server with the most links and a server with the least links in the server cluster after link redistribution;
[0038] A second determination unit is used to determine the number of reserved links corresponding to each server in the server cluster according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the least current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links;
[0039] The allocation unit is used to disconnect the links of the servers according to the number of reserved links corresponding to each server, and evenly distribute the disconnected links in the server cluster to each server, so that the link deviation of the server cluster after reallocation is less than or equal to the link allowable deviation.
[0040] In a third aspect, the present application further provides an electronic device comprising: a processor, a memory, and computer program instructions stored in the memory and executable on the processor; when the processor executes the computer program instructions, the method as described in any one of the first aspects is implemented.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement any of the methods described in the first aspect.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method as described in any one of the first aspects.
[0043] Compared with the prior art, this application has the following advantages:
[0044] The link balancing method provided in the embodiment of the present application determines the link allowable deviation corresponding to the server cluster, and the link allowable deviation is used to limit the difference in the number of links between the server with the most links and the server with the least links in the server cluster. The link allowable deviation is subsequently used to guide the difference in the number of links between the server with the most links and the server with the least links when performing link redistribution, and then the number of reserved links corresponding to each server in the server cluster is determined according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the smallest current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links, and then the links of the servers are disconnected according to the reserved number of links corresponding to each of the servers. In this way, after each server executes the link disconnection operation and evenly distributes the disconnected links in the server cluster to each of the servers, that is, after link redistribution, the number of links corresponding to the server with the largest number of links is the sum of the largest number of retained links and the evenly distributed number of links, and the number of links corresponding to the server with the smallest number of links is the sum of the number of links corresponding to the server with the smallest number of links before the disconnection operation (that is, the above-mentioned minimum number of links) and the evenly distributed number of links. In this way, the number of links corresponding to the server with the largest number of links after redistribution minus the number of links corresponding to the server with the smallest number of links (that is, the link deviation after redistribution) is the difference between the largest number of retained links and the above-mentioned minimum number of links. Since the largest number of retained links is less than or equal to the sum of the link allowable deviation and the minimum number of links, the link deviation after redistribution is less than or equal to the above-mentioned link allowable deviation.
[0045] It can be seen that the solution provided by the present application can first calculate the number of reserved links corresponding to the server through the logic corresponding to the software, and then after disconnecting the link once and reallocating the disconnected links according to the solution provided by the present application, the number of links corresponding to each server in the server cluster can satisfy that the link deviation of the server cluster is less than or equal to the link allowable deviation. Thus, the number of links of each server in the server cluster can meet the link allowable deviation through one link reconnection, without the need for repeated link reconnection, reducing the number of link disconnections of the client during the link reallocation process, reducing the impact on the service timeliness of the client due to link reallocation, and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1This is a schematic diagram of the application scenario of the link balancing solution provided by this application;
[0047] Figure 2 It is a flowchart of an example of a link balancing method provided in an embodiment of the present application;
[0048] Figure 3 is a flowchart of another example of the link balancing method provided in an embodiment of the present application;
[0049] Figure 4 is a structural block diagram of an example of a link equalization device provided in an embodiment of the present application;
[0050] Figure 5 A structural block diagram of an electronic device provided in this application. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is described clearly and completely below in conjunction with the drawings in the embodiments of the present application. However, the present application can be implemented in many other ways different from the following description. Therefore, based on the embodiments provided by the present application, all other embodiments obtained by those of ordinary skill in the art without creative work should fall within the scope of protection of the present application.
[0052] It should be noted that the terms "first", "source domain", "third", etc. in the claims, description and drawings of the present application are used to distinguish similar objects and are not used to describe a specific order or sequence. The data used in this way are interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including", "having" and their variants are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0053] In order to facilitate understanding of the various embodiments of the present application, the application background of the embodiments is described.
[0054] The server pushes service data to the client in real time by establishing a link with the client. The number of clients corresponding to the server is usually very large, so the server usually has a large number of client long links. One server usually cannot meet the link and service needs of a large number of clients. In order to better push services to a large number of clients, the server usually includes many servers, each of which takes on a certain number of client long links to provide services to the clients that establish links. This can make effective use of server resources and ensure the timeliness of services provided to clients. After the server performs some operation and maintenance operations, such as capacity expansion, fault drills, network disconnection drills, disaster recovery scenario recovery, registration / deregistration address servers, there may be an imbalance in server links. For example, after the network disconnection drill, some of the disconnected machines resume service, but the clients have already migrated the links to normal servers during the network disconnection process, resulting in no links for the machines that have been restored after the network disconnection, so that resources cannot be effectively utilized. For other machines that are not disconnected, the number of links is too high, which is prone to problems such as machine resource utilization approaching the limit and service timeliness cannot be guaranteed. Therefore, after performing the above operation and maintenance operations, it is necessary to balance the links, that is, to require some servers with too many links to actively disconnect some links, triggering the client to randomly reconnect to the machine with less load, so as to achieve a balancing effect.
[0055] When performing link balancing operations on related technologies, it is usually the case that some of the links of servers with too many links are disconnected first. After the disconnection operation, due to the random reconnection mechanism of the client, the number of links of some machines that have not been disconnected is too high, so that load imbalance may still exist. Then, disconnection and reconnection are continuously performed through polling until the number of links of each server is balanced.
[0056] This method of the related art may cause some clients to repeatedly disconnect and reconnect due to the need for repeated balancing, affecting the service timeliness of the client and causing poor user experience.
[0057] In order to solve the above problems, the embodiments of the present application provide a link balancing method, device, electronic device and computer-readable storage medium. The purpose is to achieve link balancing of each server through one link reconnection, without the need for repeated link reconnection, reduce the number of link disconnections of the client during the link reallocation process, reduce the impact of link reallocation on the service timeliness of the client, and improve user experience.
[0058] The link balancing method provided in the present application can be used to reallocate each long link that has been established between a server cluster and a client.
[0059] In order to facilitate understanding of the method embodiments of the present application, the application scenarios are introduced. Figure 1 , Figure 1The following is a schematic diagram of an application scenario of the solution provided in the embodiment of the present application. The application scenario is a schematic illustration and is not intended to be a specific description of the application scenario. Figure 1 As shown, in this application scenario, a server 102, a client 101 and a link control terminal 103 are provided. In this embodiment, a link is established between the client 101 and the server 102 through network communication, so that data is transmitted through the established link.
[0060] The client 101 can be an electronic device with data processing capabilities, such as a mobile phone, a tablet computer (pad), a smart watch, a desktop computer, a smart TV, a VR device, a vehicle-mounted device, a wearable device, a laptop computer, etc. The client 101 is used to send a service request to the server 102. The service request can be a video download request, an image acquisition request, a user data query request, an application access request, a website access request, etc., which is not specifically limited in this application, and obtains service data from the server 102.
[0061] The server 102 is a server cluster, which is a distributed system. The server cluster includes multiple servers. The server cluster has high computing power, high-speed central processing unit (CPU) computing power, long-term reliable operation, strong input / output (I / O) external data throughput capacity and better scalability. The server 102 is used to receive service requests from the client 101 and provide corresponding service data to the client according to the service request.
[0062] The client 101 and the server 102 communicate by establishing a link, and specifically, data transmission can be performed by establishing a long link. The client 101 and the server 102 can communicate with each other using various communication systems, such as a wired communication system or a wireless communication system. The wireless communication system can be, for example, a global system for mobile communications (GSM) system, a code division multiple access (CDMA) system, a wideband code division multiple access (WCDMA) system, a general packet radio service (GPRS), a long term evolution (LTE) system, a LTE frequency division duplex (FDD) system, a LTE time division duplex (TDD) system, a universal mobile telecommunication system (UMTS), a worldwide interoperability for microwave access (WiMAX) communication system, a future fifth generation (5G) system or a new radio (NR), a satellite communication system, etc.
[0063] The link control terminal 103 is used to perform link redistribution. The link control terminal 103 can be a server in the above-mentioned server cluster, or an electronic device specifically used for link redistribution. The electronic device specifically used for link redistribution can be a mobile phone, a tablet computer (pad), a smart watch, a desktop computer, a smart TV, a VR device, a vehicle-mounted device, a wearable device, a laptop computer, a server, and other electronic devices with data processing functions. The link control terminal 103 is installed with an execution program of the link balancing method, so that the link control terminal 103 can perform link redistribution according to the execution program corresponding to the link balancing method. The link control terminal 103 is connected to each server in the server cluster to obtain the current number of links of each server and allocate new links.
[0064] Embodiment 1
[0065] The first embodiment of the present application provides a link balancing method, which is applied to an electronic device, which may be a server, a laptop, a tablet computer, a desktop computer, a mobile phone, a smart TV, a smart watch, a VR device, or other electronic device with data processing functions. The link balancing method is used to reallocate links that have been created in a server cluster corresponding to a distributed system, wherein the links that have been created in the server cluster are specifically long links that have been created between each client.
[0066] like Figure 2 As shown, the link balancing method provided in the first embodiment of the present application includes the following steps S110 to S130.
[0067] Step S110: Determine the link tolerance corresponding to the server cluster.
[0068] The link allowable deviation is used to limit the difference in the number of links between the server with the most links and the server with the least links in the server cluster after link redistribution. Specifically, the link allowable deviation is used to limit the difference in the number of links between the server with the most links and the server with the least links in the server cluster after redistribution to be less than or equal to the link allowable deviation when link redistribution is performed subsequently.
[0069] The above-mentioned link allowable deviation may be a preset deviation, and may be specifically preset manually based on experience. The electronic device may determine the manually preset link allowable deviation as the link allowable deviation corresponding to the server cluster.
[0070] Alternatively, the link allowable deviation corresponding to the server cluster may also be determined based on the historical link characteristics of the server cluster. Specifically, the number of links of each server in the server cluster in the historical time period may be obtained, and the link allowable deviation corresponding to the server cluster may be determined according to the number of links corresponding to each server in the historical time period. For example, the number of links of each server in the past period may be recorded, including the number of links during peak hours and off-peak hours, and the average number of links corresponding to each server during this period may be calculated, and the link allowable deviation corresponding to the server cluster may be determined according to the average number of links corresponding to each server. For example, the mean of the average number of links corresponding to each server can be determined as the link allowable deviation corresponding to the server cluster, or the quotient of the mean of the average number of links corresponding to each server and the link deviation factor can be determined as the link allowable deviation corresponding to the server cluster. The link deviation factor is a number greater than or equal to 1. For example, the link deviation factor can be 1, 1.1, 1.2, and so on. The link deviation factor can be less than 2 to avoid setting the link allowable deviation too small and failing to achieve a balance that meets the allowable deviation. The link deviation factor is used to indicate the degree of restriction on the size of the deviation range. The larger the link deviation factor is set, the higher the degree of restriction on the size of the deviation range, thereby indicating that the link allowable deviation is smaller.
[0071] In this embodiment, since the number of links of each server in the server cluster in the historical time period can well reflect the number of links of the server under normal circumstances, the allowable link deviation that meets the overall performance and overall link situation of the server cluster can be determined based on the number of links in the historical time period.
[0072] Optionally, the link allowable deviation corresponding to the server cluster can also be determined according to the current average number of links, and the current average number of links is the average value of the current number of links corresponding to each server in the server cluster. Specifically, the current average number of links can be determined as the link allowable deviation corresponding to the server cluster, or a link deviation factor can be obtained, and the link deviation factor is greater than or equal to 1. The size setting method of the link deviation factor can refer to the above, and will not be repeated here. The link allowable deviation corresponding to the server cluster is determined according to the quotient of the current average number of links and the link deviation factor. Specifically, the quotient of the current average number of links and the link deviation factor can be determined as the link allowable deviation corresponding to the server cluster. By setting the link deviation factor, the quotient of the current average number of links and the link deviation factor is determined as the link allowable deviation corresponding to the server cluster, so that the determined link allowable deviation can be set relatively small after considering various influencing factors, so that the cluster load is more balanced after the link redistribution is finally performed. In this embodiment, the link allowable deviation corresponding to the server cluster is determined by the current average number of links, so that the determined link allowable deviation can better meet the current link situation, so as to be more suitable for more balanced redistribution of the current cluster links.
[0073] Step S120: determining the number of reserved links corresponding to each server in the server cluster according to the link allowable deviation and the minimum number of links.
[0074] The minimum link number refers to the current link number corresponding to the server with the least current link number in the server cluster, and the maximum reserved link number among the reserved link numbers is less than or equal to the sum of the link allowable deviation and the minimum link number.
[0075] In the embodiment of the present application, the number of reserved links corresponding to each server may be the same or different. For example, when the configurations corresponding to each server are different, such as some servers have better hardware configurations, software configurations, etc., while some servers are not so good. In this case, due to the different data processing capabilities of each server, the number of reserved links corresponding to each server may be set to be different. For example, the number of reserved links corresponding to a server with a high configuration may be higher than the number of reserved links corresponding to a server with a low configuration. In this case, the largest number of reserved links among the reserved numbers of links is less than or equal to the sum of the above-mentioned link allowable deviation and the above-mentioned minimum number of links, and the other number of reserved links may be any number value less than the maximum number of reserved links; or, when the configurations corresponding to each server are different, the number of reserved links corresponding to each server may also be the same, so as to facilitate link balancing and link control of each server.
[0076] In order to facilitate balanced control of each server, the configuration of each server in the server cluster can be the same, for example, the hardware configuration, software configuration, etc. can be the same. In this case, it is easier to balance the servers, and accordingly each server can have the same number of reserved links.
[0077] When each server in the server cluster corresponds to the same number of reserved links, the number of reserved links is less than or equal to the sum of the link allowable deviation and the minimum number of links.
[0078] In step S120, the sum of the link allowable deviation and the minimum link number can be determined as the maximum number of reserved links among the reserved link numbers, and the number less than the sum of the link allowable deviation and the minimum link number can be determined as the maximum number of reserved links among the reserved link numbers. When the sum of the link allowable deviation and the minimum link number is determined as the maximum number of reserved links, more links can be retained and a better number of links can be disconnected when performing connection balancing, so that the number of clients affected by disconnected links is better, and the service real-time and stability requirements of the client are better guaranteed. When a value less than the sum of the link allowable deviation and the minimum link number is determined as the maximum number of reserved links, load balancing can be achieved more efficiently when performing connection balancing. When each server corresponds to the same number of reserved links, the number of reserved links corresponding to each server can be the sum of the link allowable deviation and the minimum link number or a number less than the sum of the link allowable deviation and the minimum link number.
[0079] Step S130: disconnecting the links of the servers according to the number of reserved links corresponding to each server, and evenly distributing the disconnected links in the server cluster to each server, so that the link deviation of the server cluster after redistribution is less than or equal to the link allowable deviation.
[0080] For example, when the number of reserved links corresponding to a server is 50 and the current number of links of the server is 60, the server disconnects 10 links. When a total of 200 links in the server cluster are disconnected and the server cluster includes 20 servers, 10 links can be allocated to each server to achieve link redistribution.
[0081] Optionally, before step S130, the following step S120a may also be included.
[0082] Step S120a: Calculate whether the number of reallocated links corresponding to each server exceeds the maximum load link number corresponding to each server after the links of each server are reallocated according to the target reallocation method.
[0083] The target reallocation method is as follows: disconnect the existing links of each server according to the number of reserved links corresponding to each server, and evenly distribute the disconnected links of the server cluster to each server.
[0084] The maximum load link number refers to the maximum value of the number of links that the server can carry. Each server has its own corresponding maximum load link number. In the embodiment of the present application, the maximum load link number corresponding to the server can be pre-set according to various factors such as the server's hardware resources, operating system configuration, network environment, and server content of the program. Specifically, the maximum load link number corresponding to each server can be determined in advance by the staff according to these factors, or the maximum load link number corresponding to the server can be continuously adjusted and updated during the service provided by the server. The determination of the maximum load link number is not the focus of the present application. Those skilled in the art can flexibly set the corresponding maximum load link number according to the specific configuration of the server, the service content of the application, etc.
[0085] Before step S120a, the following step may be further included: obtaining the maximum number of load links that each server can bear. Since the maximum number of load links that each server can bear is preset, the electronic device can easily obtain the maximum number of load links that each server can bear.
[0086] Correspondingly, step S130 can be implemented according to the following step S131.
[0087] Step S131: when it is calculated that the reallocated link numbers corresponding to each server do not exceed the maximum load link numbers corresponding to each server, disconnect the links of the servers according to the reserved link numbers corresponding to each server, and evenly distribute the disconnected links in the server cluster to each server.
[0088] Step S131, after the links are redistributed in accordance with the above-mentioned method of retaining the number of links and evenly distributing them, if each server does not exceed its own maximum load link, that is, each server can bear the number of links after redistribution, then the subsequent link disconnection and reallocation steps are performed. This can effectively avoid the situation where the number of reallocated links exceeds the maximum number of links that the server can bear during link redistribution, thereby better ensuring the normal operation of the server cluster.
[0089] In a specific embodiment, when disconnecting the server link according to the reserved link number corresponding to the server, step S130 can disconnect the server link in the following manner: obtain the access frequency of the link corresponding to the server, and disconnect the links of the server that exceed the reserved link number in order of access frequency from low to high and based on the reserved link number corresponding to the server.
[0090] The access frequency of a link refers to the frequency with which a client accesses a server through the link. The lower the access frequency, the less often the client uses the created long link to obtain service data from the server, which indicates that the client is less active. Therefore, this embodiment disconnects links in order of access frequency from low to high, and can preferentially disconnect links with low access frequencies, that is, preferentially disconnect links corresponding to clients with low activity, so as not to affect the experience of active users as much as possible. Since inactive users are most likely not currently accessing the server, temporarily disconnecting inactive users usually does not affect the users' normal use of the service.
[0091] In other embodiments, step S130 may also randomly disconnect the server links according to the number of reserved links corresponding to the server, so as to make the link disconnection simpler and more convenient, and at the same time prevent concentrated disconnection from causing excessive impact on certain user groups, which helps to disperse the risks brought by the link disconnection.
[0092] Optionally, the link balancing method may further include the following step S140.
[0093] Step S140: when it is calculated that the reallocated link numbers corresponding to each server exceed the corresponding maximum load link numbers, the server cluster is expanded, and the link balancing process from step S110 to step S131 is performed on the expanded server cluster.
[0094] Expanding the capacity of a server cluster may be by increasing the number of servers in the server cluster, or by increasing the configuration of an existing server, for example, increasing the memory and storage of the server. This application does not specifically limit the method of expansion.
[0095] In this embodiment, when it is calculated that the number of reallocated links corresponding to each server exceeds the corresponding maximum load link number, it means that when the links are reallocated in accordance with the number of retained links calculated in the above steps and the method of evenly distributing the disconnected links, the maximum load link number of at least one server will be exceeded. In this case, link reallocation may cause server operation failures. Therefore, the server cluster can be expanded to better ensure that the server cluster can meet the service requirements of the client.
[0096] In a specific embodiment, step S130 may disconnect the server link according to step S132.
[0097] Step S132: For the i-th server in the server cluster, when the current number of links of the i-th server is greater than the corresponding number of reserved links, the number of links corresponding to the i-th server is reduced to the corresponding number of reserved links, where i traverses 1 to n, n is the number of servers included in the server cluster, and n is a positive integer.
[0098] When the current number of links of the i-th server is less than or equal to the corresponding number of reserved links, the number of links corresponding to the i-th server is kept unchanged.
[0099] In one implementation, before step S110, the link balancing method may further include the following step S110a.
[0100] Step S110a: Determine whether the current total number of links corresponding to the server cluster exceeds the maximum total number of load links that the server cluster can bear.
[0101] Specifically, when the maximum load link numbers corresponding to each server are the same, the following steps can be used to determine whether the current total number of links corresponding to the server cluster exceeds the maximum total number of links that the server cluster can bear: determine whether the current total number of links corresponding to the server cluster exceeds the maximum total number of links that the server cluster can bear based on whether the ratio of the total number of links corresponding to the server cluster to the number of servers included in the server cluster is greater than the maximum load link number corresponding to the server. When the ratio of the total number of links corresponding to the server cluster to the number of servers included in the server cluster is greater than the maximum load link number corresponding to the server, determine that the current total number of links corresponding to the server cluster exceeds the maximum total number of links that the server cluster can bear; otherwise, determine that the current total number of links corresponding to the server cluster does not exceed the maximum total number of links that the server cluster can bear.
[0102] Correspondingly, step S110 can be implemented according to the following step S111.
[0103] Step S111: When the current total number of links does not exceed the maximum total load number of links, the link allowable deviation corresponding to the server cluster is determined.
[0104] This implementation method performs subsequent link redistribution when it is determined that the maximum total load link number that the server cluster can bear can meet the current total link number. In this way, invalid redistribution can be better avoided and the system operation efficiency of the redistribution process is improved.
[0105] Optionally, the link reallocation method may further include the following steps: when the current total number of links exceeds the maximum total load number of links, the server cluster is expanded, and the link balancing process from step S110 to step S131 is performed on the expanded server cluster.
[0106] The specific method of capacity expansion is as described above, and will not be described again here. This embodiment can better ensure that the server cluster can meet the service requirements of the client through capacity expansion.
[0107] The following takes the scenario where the number of reserved links corresponding to each server is the same as an example to demonstrate why when the number of reserved links is less than or equal to the sum of the allowed link deviation and the minimum number of links, the method of splicing and allocating the disconnected links can make the link deviation after reallocation less than or equal to the allowed link deviation. The demonstration method for different scenarios of the number of reserved links corresponding to each server is similar to the demonstration method for this scenario, and this application will not list them one by one in detail.
[0108] Assume that the current number of links corresponding to the i-th server in the server cluster is a i , d is the number of reserved links determined during link redistribution, when the current number of links in each server is a i The current number of links corresponding to servers greater than d is disconnected according to d, and then the links are redistributed in an evenly distributed manner. The average number of disconnected links y allocated to each server is:
[0109]
[0110] n represents the number of servers included in the server cluster. Indicates the total number of links that were disconnected in the server cluster during link reallocation.
[0111] After disconnecting the current links of each server according to d, a i The number of links of servers greater than d becomes d after disconnection, a i Servers not greater than d will not be disconnected and remain at a i After adding y to the number of links corresponding to each server after the disconnection operation, the number of links corresponding to each server is b i for:
[0112] when a i >d, b i =d+y
[0113] when a i When ≤d, b i =a i +y (2)
[0114] Therefore, after link redistribution, the largest number of redistributed links among the redistributed links corresponding to each server is b max and the minimum number of redistribution links b min They are:
[0115] b max =d+y
[0116] b min =a min +y (3)
[0117] Among them, a min It is the minimum number of current links among the current numbers of links corresponding to each server before reallocation.
[0118] Therefore, after link redistribution, the maximum number of redistributed links minus the minimum number of redistributed links among the redistributed links corresponding to each server is:
[0119] b max –b min =d+y-(a min +y)=da min (4)
[0120] Since the number of links retained in this application is less than or equal to the sum of the link allowable deviation and the minimum number of links, that is, d≤x+a min , where x is the allowable deviation of the above link, therefore, d≤x+a min Substituting into formula (4) is b max –b min =da min ≤x+a min -a min = x, that is, b max –b min ≤x, which means the maximum number of reallocated links minus the minimum number of reallocated links is less than or equal to x.
[0121] Therefore, the following conclusion can be drawn: when link balancing is performed through link redistribution, if the number of retained links is less than or equal to the sum of the link allowable deviation and the minimum number of links, then after disconnecting the current links of the server cluster according to the reserved number of links and evenly distributing the disconnected links to each server to complete link redistribution, the link deviation of the server cluster is less than or equal to the above-mentioned link allowable deviation, that is, the maximum number of reallocated links minus the minimum number of reallocated links is less than or equal to x.
[0122] In one embodiment, the link reallocation method may be triggered when the current number of links of at least one server in the server cluster exceeds the corresponding maximum load number of links. The link reallocation method may also be triggered when the server cluster performs an operation and maintenance operation, and the operation and maintenance operation includes at least one of the following: the server cluster has expanded its capacity, the server cluster has performed a network disconnection drill, and the address server has been registered / de-registered. The link reallocation method may also be triggered when the difference between the maximum number of current links and the minimum number of current links corresponding to the servers in the server cluster exceeds a preset threshold, and the preset threshold may be the allowable deviation of the links corresponding to the server cluster, or may be a manually preset threshold. The link reallocation method may also be triggered when other load imbalance situations occur, which are not specifically limited in the present application.
[0123] Optionally, the link reallocation method may further include the following steps: after detecting that the link reallocation is completed, monitoring the link connection status in the server cluster. Thus, it is possible to determine in real time whether the reallocation is successful in achieving link balancing through the monitored status. In a specific embodiment, monitoring the link connection status in the server cluster may be achieved by the following steps: real-time monitoring whether the difference in the number of links between the server with the most links and the server with the least links in the server cluster exceeds the link allowable deviation. If so, executing the steps of the link balancing method from step S110 to step S130; if not, continuing monitoring.
[0124] The link balancing method provided in the embodiment of the present application determines the link allowable deviation corresponding to the server cluster, and the link allowable deviation is used to limit the difference in the number of links between the server with the most links and the server with the least links in the server cluster. The link allowable deviation is subsequently used to guide the difference in the number of links between the server with the most links and the server with the least links when performing link redistribution, and then the number of reserved links corresponding to each server in the server cluster is determined according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the smallest current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links, and then the links of the servers are disconnected according to the reserved number of links corresponding to each of the servers. In this way, after each server executes the link disconnection operation and evenly distributes the disconnected links in the server cluster to each of the servers, that is, after link redistribution, the number of links corresponding to the server with the largest number of links is the sum of the largest number of retained links and the evenly distributed number of links, and the number of links corresponding to the server with the smallest number of links is the sum of the number of links corresponding to the server with the smallest number of links before the disconnection operation (that is, the above-mentioned minimum number of links) and the evenly distributed number of links. In this way, the number of links corresponding to the server with the largest number of links after redistribution minus the number of links corresponding to the server with the smallest number of links (that is, the link deviation after redistribution) is the difference between the largest number of retained links and the above-mentioned minimum number of links. Since the largest number of retained links is less than or equal to the sum of the link allowable deviation and the minimum number of links, the link deviation after redistribution is less than or equal to the above-mentioned link allowable deviation.
[0125] It can be seen that the solution provided by the present application can first calculate the number of reserved links corresponding to the server through the logic corresponding to the software, and then after disconnecting the link once and reallocating the disconnected links according to the solution provided by the present application, the number of links corresponding to each server in the server cluster can satisfy that the link deviation of the server cluster is less than or equal to the link allowable deviation. Thus, the number of links of each server in the server cluster can meet the link allowable deviation through one link reconnection, without the need for repeated link reconnection, reducing the number of link disconnections of the client during the link reallocation process, reducing the impact on the service timeliness of the client due to link reallocation, and improving the user experience.
[0126] The following is an illustrative example of the link balancing method provided by the present application. This example is described by taking the same number of reserved links determined for each server as an example. Figure 3 As shown, the link balancing method provided in this example includes the following steps S1 to S7.
[0127] Step S1: sort the current link numbers corresponding to the servers in the server cluster in order of link numbers from large to small or from small to large, and determine the current link number corresponding to the server with the least current link number among the servers according to the sorting.
[0128] Step S2: Determine the link allowable deviation x corresponding to the server cluster.
[0129] Step S3: Based on the link allowable deviation x and the minimum number of links a min Determine the number of reserved links d corresponding to each server.
[0130] Minimum number of links a min Refers to the current number of links corresponding to the server with the least number of links in the server cluster. The number of reserved links d is equal to the link allowable deviation x and the minimum number of links a min The sum of, that is, d = x + a min .
[0131] Step 4: Determine whether the current number of links corresponding to the i-th server is greater than the number of reserved links d.
[0132] Step 5: If the judgment result of step 4 is greater than, disconnect the link of the i-th server according to the reserved link number d.
[0133] Step 5 is to balance the number of links of the i-th server to the reserved number of links d.
[0134] Step 6: If the judgment result of step 4 is not greater than, keep the link of the i-th server unchanged.
[0135] Here, i traverses 1 to n, and n is the number of servers included in the server cluster.
[0136] Step 7: Evenly distribute the disconnected links in the server cluster to each server to achieve link balancing.
[0137] The specific execution process of steps S1 to S7 may refer to steps S110 to S130 mentioned above, which will not be described in detail here.
[0138] Embodiment 2
[0139] The second embodiment of the present application also provides a link equalization device corresponding to the link equalization method embodiment provided in the first embodiment. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For the details of the relevant technical features and the effects achieved, please refer to the corresponding description of the link equalization method embodiment provided above. Figure 4 As shown, the link balancing device provided in this embodiment includes:
[0140] A first determining unit 210 is used to determine an allowable link deviation corresponding to a server cluster, wherein the allowable link deviation is used to limit the difference in the number of links between a server with the most links and a server with the least links in the server cluster after link redistribution;
[0141] A second determining unit 220 is used to determine the number of reserved links corresponding to each server in the server cluster according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the least current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links;
[0142] The allocation unit 230 is used to disconnect the links of the servers according to the number of reserved links corresponding to each server, and evenly distribute the disconnected links in the server cluster to each server, so that the link deviation of the server cluster after reallocation is less than or equal to the link allowable deviation.
[0143] Optionally, the first determining unit 210 is specifically configured to perform at least one of the following:
[0144] Determine the link allowable deviation corresponding to the server cluster according to the current average link number, wherein the current average link number is the average value of the current link numbers corresponding to the servers in the server cluster;
[0145] Determine the preset deviation value as the link allowable deviation corresponding to the server cluster;
[0146] The number of links of each server in the server cluster in a historical time period is obtained, and the link allowable deviation corresponding to the server cluster is determined according to the number of links corresponding to each server in the historical time period.
[0147] Optionally, the first determining unit 210 is specifically configured to: obtain a link deviation factor, where the link deviation factor is greater than or equal to 1; and determine an allowable link deviation corresponding to the server cluster according to a quotient of a current average number of links and the link deviation factor.
[0148] Optionally, the allocation unit 230 is specifically used to: for the i-th server in the server cluster, when the current number of links of the i-th server is more than the corresponding number of reserved links, reduce the number of links corresponding to the i-th server to the corresponding number of reserved links, where i traverses 1 to n, and n is the number of servers included in the server cluster.
[0149] Optionally, the configurations of the servers in the server cluster are the same, the number of reserved links corresponding to the servers in the server cluster is the same, and the number of reserved links is equal to the sum of the link allowable deviation and the minimum number of links.
[0150] Optionally, the device further comprises:
[0151] A determination unit, configured to determine whether the current total number of links corresponding to the server cluster exceeds the maximum total number of load links that the server cluster can bear;
[0152] The first determination unit is specifically configured to determine the link allowable deviation corresponding to the server cluster when the current total number of links does not exceed the maximum total load number of links.
[0153] Optionally, the device further comprises: calculating whether the number of reallocated links corresponding to each server exceeds the maximum load link number corresponding to each server after link reallocation for each server according to a target reallocation method, wherein the target reallocation method is: disconnecting the existing links of each server according to the number of reserved links corresponding to each server, and evenly distributing the disconnected links of the server cluster to each server;
[0154] The allocation unit is specifically used for disconnecting the links of the servers according to the number of reserved links corresponding to each server when it is calculated that the number of reallocated links corresponding to each server does not exceed the number of maximum load links corresponding to each server.
[0155] Optionally, the device further comprises:
[0156] An expansion unit is used to expand the server cluster when the current total number of links exceeds the maximum total load number of links, or when the number of reallocated links corresponding to each of the servers is calculated to exceed the corresponding maximum load number of links, and to execute a link balancing process from determining the allowable deviation of the links corresponding to the server cluster to evenly distributing the disconnected links in the server cluster to each of the servers after the expansion.
[0157] Optionally, the triggering timing of the link balancing device includes at least one of the following:
[0158] The difference between the maximum number of current links and the minimum number of current links among the current link numbers corresponding to the servers in the server cluster exceeds a preset threshold;
[0159] The server cluster performs operation and maintenance operations, and the operation and maintenance operations include at least one of the following: the server cluster performs capacity expansion, the server cluster performs network disconnection drill, and registers / deregisters address servers.
[0160] The third embodiment of the present application also provides an electronic device embodiment corresponding to the link equalization method provided in the first embodiment. The following description of the electronic device embodiment is only illustrative. The electronic device embodiment is as follows:
[0161] Please refer to Figure 5 Understand the above electronic devices, Figure 5 The electronic device provided in this embodiment includes: a processor 1001, a memory 1002, a communication bus 1003, and a communication interface 1004;
[0162] The memory 1002 is used to store computer instructions for data processing. When the computer instructions are read and executed by the processor 1001, the following steps are performed:
[0163] Determine an allowable link deviation corresponding to the server cluster, wherein the allowable link deviation is used to limit the difference in the number of links between the server with the most links and the server with the least links in the server cluster after link redistribution;
[0164] Determine the number of reserved links corresponding to each server in the server cluster according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the least current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links;
[0165] The links of the servers are disconnected according to the number of reserved links corresponding to each server, and the disconnected links in the server cluster are evenly distributed to each server, so that the link deviation of the server cluster after redistribution is less than or equal to the link allowable deviation.
[0166] The fourth embodiment of the present application also provides a computer-readable storage medium for implementing the method described in the first embodiment. The computer-readable storage medium embodiment provided in the present application is described relatively simply. For the relevant parts, please refer to the corresponding description of the above method embodiment. The embodiment described below is only illustrative.
[0167] The computer readable storage medium provided in this embodiment stores computer instructions, and when the instructions are executed by a processor, the following steps are implemented:
[0168] Determine an allowable link deviation corresponding to the server cluster, wherein the allowable link deviation is used to limit the difference in the number of links between the server with the most links and the server with the least links in the server cluster after link redistribution;
[0169] Determine the number of reserved links corresponding to each server in the server cluster according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the least current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links;
[0170] The links of the servers are disconnected according to the number of reserved links corresponding to each server, and the disconnected links in the server cluster are evenly distributed to each server, so that the link deviation of the server cluster after redistribution is less than or equal to the link allowable deviation.
[0171] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0172] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0173] 1. Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0174] 2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0175] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
Claims
1. A link balancing method, characterized in that: The method comprises: Determine an allowable link deviation corresponding to the server cluster, wherein the allowable link deviation is used to limit the difference in the number of links between the server with the most links and the server with the least links in the server cluster after link redistribution; Determine the number of reserved links corresponding to each server in the server cluster according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the least current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links; The links of the servers are disconnected according to the number of reserved links corresponding to each server, and the disconnected links in the server cluster are evenly distributed to each server, so that the link deviation of the server cluster after redistribution is less than or equal to the link allowable deviation.
2. The link balancing method according to claim 1, characterized in that: The determining of the link allowable deviation corresponding to the server cluster includes at least one of the following: Determine the link allowable deviation corresponding to the server cluster according to the current average link number, wherein the current average link number is the average value of the current link numbers corresponding to the servers in the server cluster; Determine the preset deviation value as the link allowable deviation corresponding to the server cluster; The number of links of each server in the server cluster in a historical time period is obtained, and the link allowable deviation corresponding to the server cluster is determined according to the number of links corresponding to each server in the historical time period.
3. The link balancing method according to claim 2, characterized in that: Determining the link allowable deviation corresponding to the server cluster according to the current average number of links includes: Obtaining a link deviation factor, where the link deviation factor is greater than or equal to 1; The link allowable deviation corresponding to the server cluster is determined according to the quotient of the current average number of links and the link deviation factor.
4. The link balancing method according to claim 1, characterized in that: The disconnecting the links of the servers according to the number of reserved links corresponding to the servers comprises: For the i-th server in the server cluster, when the current number of links of the i-th server is greater than the corresponding number of reserved links, the number of links corresponding to the i-th server is reduced to the corresponding number of reserved links, where i traverses 1 to n, and n is the number of servers included in the server cluster.
5. The link balancing method according to claim 1, characterized in that: The configurations of the servers in the server cluster are the same, the number of reserved links corresponding to the servers in the server cluster is the same, and the number of reserved links is equal to the sum of the link allowable deviation and the minimum number of links.
6. The link balancing method according to claim 5, characterized in that: Before determining the link allowable deviation corresponding to the server cluster, the method further includes: Determine whether the current total number of links corresponding to the server cluster exceeds the maximum total load number of links that the server cluster can bear; The determining the link allowable deviation corresponding to the server cluster includes: When the current total number of links does not exceed the maximum total load number of links, the link allowable deviation corresponding to the server cluster is determined.
7. The link balancing method according to claim 6, characterized in that: Before disconnecting the links of the servers according to the number of reserved links corresponding to the servers, the method further includes: Calculating whether the number of reallocated links corresponding to each server exceeds the maximum load link number corresponding to each server after link reallocation for each server according to the target reallocation method, wherein the target reallocation method is: disconnecting the existing links of each server according to the number of reserved links corresponding to each server, and evenly distributing the disconnected links of the server cluster to each server; The disconnecting the links of the servers according to the number of reserved links corresponding to the servers comprises: When it is calculated that the number of reallocated links corresponding to each of the servers does not exceed the number of maximum load links corresponding to each of the servers, the links of the servers are disconnected according to the number of reserved links corresponding to each of the servers.
8. The link balancing method according to claim 7, characterized in that: The method further comprises: When the current total number of links exceeds the maximum total number of load links, or when the calculated number of reallocated links corresponding to each server exceeds the corresponding maximum load link number, the server cluster is expanded, and the link balancing process from determining the allowable deviation of the links corresponding to the server cluster to evenly distributing the disconnected links in the server cluster to each of the servers is performed for the expanded server cluster.
9. The link balancing method according to any one of claims 1 to 6, characterized in that: The triggering timing of the link balancing method includes at least one of the following: The difference between the maximum number of current links and the minimum number of current links among the current link numbers corresponding to the servers in the server cluster exceeds a preset threshold; The server cluster performs operation and maintenance operations, and the operation and maintenance operations include at least one of the following: the server cluster performs capacity expansion, the server cluster performs network disconnection drill, and registers / deregisters address servers.
10. The link balancing method according to any one of claims 1 to 6, characterized in that: The disconnecting the links of the servers according to the number of reserved links corresponding to the servers comprises: Obtaining an access frequency of a link corresponding to the server, where the access frequency refers to a frequency at which a client accesses the server through the link; The links of the server exceeding the reserved link number are disconnected in the order of the access frequency from low to high and based on the reserved link number corresponding to the server.
11. A link equalization device, characterized in that: The device comprises: A first determining unit, configured to determine an allowable link deviation corresponding to a server cluster, wherein the allowable link deviation is used to limit a difference in the number of links between a server with the most links and a server with the least links in the server cluster after link redistribution; A second determination unit is used to determine the number of reserved links corresponding to each server in the server cluster according to the link allowable deviation and the minimum number of links, wherein the minimum number of links refers to the current number of links corresponding to the server with the least current number of links in the server cluster, and the maximum number of reserved links among the reserved numbers of links is less than or equal to the sum of the link allowable deviation and the minimum number of links; The allocation unit is used to disconnect the links of the servers according to the number of reserved links corresponding to each server, and evenly distribute the disconnected links in the server cluster to each server, so that the link deviation of the server cluster after reallocation is less than or equal to the link allowable deviation.
12. An electronic device, characterized in that: include: A processor, a memory, and computer program instructions stored on the memory and executable on the processor; When the processor executes the computer program instructions, the method according to any one of claims 1 to 10 is implemented.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of claims 1 to 10.