Link redistribution method and device, electronic equipment and computer readable storage medium
Through the method of link reconnection and predicting the number of links, the problem of unbalanced links after server cluster operation and maintenance is solved, and link balance and user experience are improved.
Patent Information
- Application Number
- CN202510003249.6
- 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 is operated and maintained, the server link may be unbalanced, resulting in the inability to effectively utilize resources and the service timeliness cannot be guaranteed.
Through a link reconnection, the number of retained links for each server is determined, and the number of links for each server after redistribution is predicted based on the preset link redistribution method is completed until the preset equilibrium conditions are met.
It realizes the equalization of link counts of each server, without repeated link reconnection, reduces the number of link disconnections of the client and improves the user experience.
Smart Images

Figure CN119996411A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network technology, and in particular to a link reallocation method, device, electronic device and computer-readable storage medium. Background Art
[0002] The server cluster pushes service data to the client in real time by establishing a link with the client. 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 capacity expansion, network disconnection drills, and registration / deregistration of 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 resumed after the network disconnection, so that resources cannot be effectively utilized. The number of links of other machines that have not been disconnected 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 redistribute the links, that is, require some servers with too many links to disconnect some links, and then trigger the client to randomly reconnect to each server to achieve a balanced effect.
[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 be repeatedly disconnected and reconnected due to the need for repeated balancing, affecting the timeliness of the client's services and causing poor user experience. Summary of the invention
[0005] The present application provides a link reallocation method, device, electronic device, and computer-readable storage medium, which can achieve a balanced number of links for each server through a single 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 of link reallocation on the service timeliness of the client, and improving user experience. The specific solution is as follows:
[0006] In a first aspect, the present application provides a link reallocation method, the method comprising:
[0007] Determine the number of reserved links corresponding to each server in the server cluster when link redistribution is performed;
[0008] According to the number of reserved links corresponding to each server and the current number of links of each server, and based on a preset link redistribution method for redistributing broken links, predicting the number of reallocated links corresponding to each server after link redistribution;
[0009] Detecting whether the number of reallocated links corresponding to each of the servers meets a preset balance condition;
[0010] If not satisfied, reducing the number of reserved links corresponding to the server, determining the reduced number of reserved links as the number of reserved links corresponding to the server, and returning to the step of determining the number of reallocated links;
[0011] If satisfied, the link of the server is disconnected according to the number of reserved links corresponding to the server, and the disconnected links in the server cluster are distributed to each of the servers according to the link reallocation method to complete the link reallocation.
[0012] Optionally, the preset equilibrium condition includes:
[0013] The number of reallocated links corresponding to each of the servers is not greater than the number of corresponding maximum load links.
[0014] Optionally, the determining the number of reserved links corresponding to the server when link reallocation is performed includes:
[0015] Determine the maximum load link number corresponding to the server as the corresponding reserved link number when link reallocation is performed;
[0016] Alternatively, a number which is 1 less than the maximum load link number corresponding to the server is determined as the corresponding reserved link number when link reallocation is performed.
[0017] Optionally, the link reallocation method is to evenly distribute the disconnected links in the server cluster to each server, the number of reserved links corresponding to each server in the server cluster is the same, and the configurations of each server in the server cluster are the same.
[0018] Optionally, reducing the number of reserved links corresponding to the server includes:
[0019] The number of reserved links corresponding to the server is reduced by 1.
[0020] Optionally, the maximum load link numbers corresponding to the servers are the same, and the detecting whether the reallocated link numbers corresponding to the servers meet a preset balancing condition includes:
[0021] It is detected whether the number of reallocated links corresponding to the maximum link server in the server cluster meets a preset balance condition, the maximum link server being the server with the largest number of reallocated links determined.
[0022] Optionally, before determining the number of reserved links corresponding to each server in the server cluster when link reallocation is performed, the method further includes:
[0023] 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;
[0024] The determining of the number of reserved links corresponding to each server in the server cluster when link reallocation is performed includes:
[0025] When the current total number of links does not exceed the maximum total load number of links, the number of reserved links corresponding to each server in the server cluster is determined when link reallocation is performed.
[0026] Optionally, the determining 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 includes:
[0027] According to 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, it is determined whether the current total number of links corresponding to the server cluster exceeds the maximum total load link number that the server cluster can bear.
[0028] Optionally, the method further comprises:
[0029] 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 determining the number of reserved links corresponding to the server when the current total number of links does not exceed the maximum total load number of links to completing link redistribution is performed for the expanded server cluster.
[0030] Optionally, the triggering timing of the link reallocation method includes at least one of the following:
[0031] The current number of links of at least one server in the server cluster exceeds the corresponding maximum load number of links;
[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] In a second aspect, the present application further provides a link reallocation device, the device comprising:
[0034] A first determining unit is used to determine the number of reserved links corresponding to each server in the server cluster when link reallocation is performed;
[0035] A second determining unit is used to predict the number of reallocated links corresponding to each of the servers after link reallocation based on the number of reserved links corresponding to each of the servers, the current number of links of each of the servers, and a preset link reallocation method for reallocating broken links;
[0036] A detection unit, used to detect whether the number of reallocated links corresponding to each of the servers meets a preset balance condition;
[0037] a value updating unit, configured to reduce the number of reserved links corresponding to the server when the detection result of the detection unit is not satisfied, determine the reduced number of reserved links as the number of reserved links corresponding to the server, and return to execute the step of determining the number of reallocated links;
[0038] The allocation unit is used to disconnect the link of the server according to the number of reserved links corresponding to the server when the detection result of the detection unit is satisfied, and allocate the disconnected links in the server cluster to each of the servers according to the link reallocation method to complete the link reallocation.
[0039] 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.
[0040] 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.
[0041] 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.
[0042] Compared with the prior art, this application has the following advantages:
[0043] The link reallocation method provided in the embodiment of the present application first determines the number of reserved links corresponding to each server in the server cluster when link reallocation is performed. At this time, the preliminary number of reserved links is determined, and then the number of reallocated links corresponding to each server after link reallocation is determined based on the number of reserved links corresponding to each server, the current number of links of each server, and the link reallocation method. That is, the electronic device predicts the number of reallocated links corresponding to each server when link reallocation is performed on each server according to the link reallocation method. The electronic device then detects whether the number of reallocated links corresponding to each server meets the preset balance condition. If not, it means that the predicted number of reallocated links corresponding to each server still has link imbalance, which means that the number of reallocated links of each server after link reallocation according to the current number of reserved links cannot meet the balance condition. Therefore, it is necessary to adjust the number of reserved links. When calculating the number of reallocated links corresponding to the server, the number of reallocated links corresponding to the server is closely related to the number of reserved links. The specific relationship is that the smaller the number of reserved links is set, the more links are disconnected, and the easier it is to achieve link balance. Therefore, in order to make the predicted reallocated links The number satisfies the preset balance condition. When the present application detects that the number of reallocated links corresponding to each server does not meet the preset balance condition, the number of reserved links corresponding to the server will be reduced, and the reduced number of reserved links will be determined as the number of reserved links corresponding to the server, and then the step of determining the number of reallocated links will be returned to execute, and the subsequent detection steps and the subsequent steps executed according to the detection steps will be executed in sequence, that is, the embodiment of the present application will cyclically execute the process from determining the number of reserved links to detecting whether the number of reallocated links meets the preset balance condition and then reducing the number of reserved links according to the detection result, until it is detected that the number of reallocated links corresponding to each server meets the preset balance condition, indicating that the number of reallocated links of each server can meet the preset balance condition after link reallocation according to the current number of reserved links. In this case, the link of the server can be disconnected according to the number of reserved links corresponding to the server, and the disconnected links in the server cluster can be distributed to each server according to the link reallocation method. After link reallocation in this way, the number of reallocated links of each server can be less than its own maximum load link number, and link reallocation is completed to achieve link balance of each server. That is to say, the solution provided by the present application first predicts the number of reallocated links of each server after reallocation based on the link reallocation method and the determined number of reserved links, and continuously reduces the number of reserved links according to the number of reallocated links, until the final predicted number of reallocated links of each server meets the preset equilibrium condition, and then disconnects and reallocates the links of each server in the server cluster according to the link reallocation method and the final determined number of reserved links.
[0044] It can be seen that the solution provided by the present application first predicts the number of reallocated links when performing link reallocation. When the predicted numbers of reallocated links meet the preset balance conditions, the links are reallocated according to the parameters and methods during the prediction. Since the number of retained links that meet the preset balance conditions is predicted in advance, the number of links to each server can be reconnected once to meet the preset balance conditions. There is no need to repeatedly reconnect the links, which reduces the number of times the client's links are disconnected during the link reallocation process, reduces the impact on the client's business timeliness due to link reallocation, and improves user experience.
[0045] In addition, the solution provided by the present application gradually reduces the number of retained links when it is detected that the number of reallocated links does not meet the preset balance conditions, so that the final number of retained links can be as large as possible while meeting the preset balance conditions, which can reduce the number of links that need to be disconnected, thereby reducing the number of clients affected by link disconnection, further ensuring the timeliness of client services and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a schematic diagram of the application scenario of the link reallocation solution provided by this application;
[0047] Figure 2 It is a flowchart of an example of a link reallocation method provided in an embodiment of the present application;
[0048] Figure 3 is a flowchart of another example of the link reallocation method provided in an embodiment of the present application;
[0049] Figure 4 is a structural block diagram of an example of a link reallocation 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, network disconnection drills, and registration / deregistration of 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 resumed 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 be repeatedly disconnected and reconnected due to the need for repeated balancing, affecting the timeliness of the client's services and causing poor user experience.
[0057] In order to solve the above problems, the embodiments of the present application provide a link reallocation method, device, electronic device and computer-readable storage medium. The purpose is to achieve a balanced number of links for each server through a single 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 reallocation 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 1 The 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 end 102 is a server cluster, which 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 end 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, for example, 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 reallocation. The link control terminal 103 can be a server in the above-mentioned server cluster, or an electronic device specifically used for link reallocation. The electronic device specifically used for link reallocation 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 reallocation method, so that the link control terminal 103 can perform link reallocation according to the execution program corresponding to the link reallocation 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 reallocation 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 function. The link reallocation method is used to reallocate links that have been created in a server cluster, wherein the links that have been created in the server cluster are specifically long links that have been created between various clients.
[0066] like Figure 2 As shown, the link reallocation method provided in the first embodiment of the present application includes the following steps S110 to S150.
[0067] Step S110: determining the number of reserved links corresponding to each server in the server cluster when link reallocation is performed.
[0068] Among them, step S110 is the preliminary determination of the number of reserved links. It can be understood that the number of reserved links corresponding to the server must be less than or equal to the maximum load link number corresponding to the server, so that the number of links reallocated to each server after link reallocation according to the reserved link number does not exceed the maximum load link number. The maximum load link number refers to the maximum value of the number of links that the server can carry.
[0069] Each server has its own maximum load link number. In the embodiment of the present application, the maximum load link number corresponding to the server can be pre-set based on 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 based on these factors, or the maximum load link number corresponding to the server can be continuously adjusted and updated during the service provision process of the server. The determination of the maximum load link number is not the focus of the present application. Technical personnel in this field can flexibly set the corresponding maximum load link number based on the specific configuration of the server, the service content of the application, etc.
[0070] When preliminarily determining the number of reserved links in step S110, the maximum load link number corresponding to the server can be determined as the number of reserved links corresponding to the server when performing connection redistribution, or a number smaller than the maximum load link number corresponding to the server can be determined as the number of reserved links corresponding to the server, for example, a number that is 1 less than the maximum load link number corresponding to the server or other values less than the maximum load link number corresponding to the server can be determined as the number of reserved links corresponding to the server. In the embodiment of the present application, the number of reserved links preliminarily determined in step S110 can be relatively large, for example, it can be the maximum load link number or a number that is 1 less than the maximum load link number, so that the server can retain as many links as possible when performing subsequent link redistribution, thereby reducing the number of links that need to be disconnected and the number of clients affected by disconnected links, further ensuring the timeliness of client services and improving user experience.
[0071] When the number of reserved links is determined according to the maximum load link number, before step S110, the following step may be further included: obtaining the maximum load link number that each server can bear. Since the maximum load link number that each server can bear is preset, the electronic device can easily obtain the maximum load link number that each server can bear.
[0072] In one embodiment, the configurations of the servers in the server cluster may be identical, so that the maximum load link numbers corresponding to the servers are also identical, and the determined reserved link numbers corresponding to the servers are also identical. That is, when the servers in the server cluster are identical, the servers have the same maximum load link number and the same reserved link number, and such a server cluster with the same configuration is more convenient for operations such as data management, link allocation and scheduling.
[0073] In other embodiments, the configurations of the servers in the server cluster may also be different. In this case, the maximum load link numbers corresponding to the servers are also different, and the determined reserved link numbers corresponding to the servers may also be different. Specifically, the reserved link numbers corresponding to the servers are determined based on the principle that the determined reserved link numbers are positively correlated with the corresponding maximum load link numbers, so that when link redistribution is performed later, the server with a large maximum load link number maintains more links, and the server with a small maximum load link number maintains fewer links. Optionally, in order to facilitate balanced calculation, when the configurations of the servers are different, the reserved link numbers corresponding to the servers may also be the same. In this case, the initially determined reserved link number is not greater than the smallest maximum load link number among the maximum load link numbers corresponding to the servers.
[0074] For ease of description, the following text mainly describes the situation where the servers in the server cluster have the same configuration and the corresponding number of reserved links. The situation where the server configurations are different is similar to the situation where the link reallocation method is the same, so only a brief description is given.
[0075] Step S120: predicting the number of reallocated links corresponding to each server after link reallocation based on the number of reserved links corresponding to each server, the current number of links of each server, and a preset link reallocation method for reallocating broken links.
[0076] The link reallocation method is used to indicate the method of reallocating the disconnected links to the servers. The link reallocation method may be to evenly distribute the disconnected links to the servers. This link reallocation method is more applicable to the case where the configurations of the servers are the same and the corresponding number of reserved links is the same. The link reallocation method may also be to distribute the disconnected links to the servers according to the principle that the remaining computing resources of each server are proportional to the number of allocated links. The link reallocation method may also be other link reallocation methods, which are not specifically limited in this application.
[0077] When predicting the number of reallocated links, the links in the current links of each server that are greater than the corresponding number of reserved links can be determined as disconnected links that need to be disconnected, and then the disconnected links are reallocated on each server according to the link reallocation method to obtain the corresponding number of reallocated links for each server.
[0078] Specifically, in step S120, when determining the number of reallocated links, the number of links that need to be disconnected for each server can be determined based on the current number of links for each server and the number of reserved links corresponding to each server, and then the number of reallocated links corresponding to each server after the links are reallocated in this manner can be predicted based on the link reallocation method.
[0079] When each server corresponds to the same number of reserved links and the above-mentioned link redistribution method is to evenly distribute the disconnected links to each server, the number of reallocated links corresponding to the servers that need to disconnect the links among the servers can be predicted according to the following formula (1), and the number of reallocated links corresponding to the servers that do not need to disconnect the links among the servers can be predicted according to the following formula (2), wherein the servers that need to disconnect the links refer to the servers whose current link numbers are greater than the number of reserved links, and the servers that do not need to disconnect the links refer to the servers whose current link numbers are not greater than the number of reserved links.
[0080]
[0081] Among them, y represents the number of reallocated links corresponding to the server that needs to disconnect the link, x represents the number of reserved links, and a irepresents the current number of links of the i-th server that needs to be disconnected, k represents the number of servers that need to be disconnected, and n represents the total number of servers in the server cluster.
[0082] The above formula (1) means that all the links that need to be disconnected After being evenly distributed to n servers, the current number of links of each server that needs to disconnect the link is y.
[0083]
[0084] Among them, z j represents the number of reallocated links corresponding to the jth server that does not need to disconnect the link, b j represents the current number of connections to the jth server that does not need to disconnect, b j ≤x.
[0085] Step S130: Detect whether the number of reallocated links corresponding to each of the servers meets a preset balance condition.
[0086] The above preset balancing condition can be that the number of redistributed links corresponding to each server is not greater than the maximum load link number corresponding to each server, or the difference between the largest number of redistributed links and the smallest number of redistributed links in the number of redistributed links corresponding to each server is less than the preset difference, or the variance or standard deviation of the number of redistributed links corresponding to each server is less than the preset threshold, etc., which is not specifically limited in this application. It can be understood that the link balance in the embodiment of this application refers to the generalized load balance that the links carried by each server in the server cluster are basically balanced, and there is no situation that some servers are overloaded and some servers are idle, etc., and it does not mean that the number of links of each server is equal.
[0087] Among them, when the preset balance condition is that the number of reallocated links corresponding to each server is not greater than the respective maximum load link number, it can not only ensure that each server operates within its own load limit, but also make the calculation process of link reallocation simpler and easier to implement, making link reallocation more efficient. Therefore, the above preset balance condition can be that the number of reallocated links corresponding to each server is less than the respective maximum load link number.
[0088] Step S130 is to detect whether the number of reallocated links corresponding to each server satisfies a preset balance condition, that is, the number of reallocated links of each server must satisfy the preset balance condition.
[0089] In a specific embodiment, when the preset balance condition is that the number of reallocated links corresponding to each of the servers is not greater than the corresponding maximum load link number, and the maximum load link number corresponding to each server is the same, step S130 can detect whether the number of reallocated links corresponding to each of the servers meets the preset balance condition according to the following steps: detect whether the number of reallocated links corresponding to the maximum link server in the server cluster meets the preset balance condition, and the maximum link server is the server with the largest number of reallocated links determined. That is to say, when detecting whether the number of reallocated links corresponding to each server meets the preset balance condition, this embodiment only needs to detect whether the server with the largest number of reallocated links meets the condition that the number of reallocated links is not greater than the corresponding maximum load link number. When the server with the largest number of reallocated links meets the preset balance condition, other servers with smaller numbers of reallocated links than this server must also meet the preset balance condition. This embodiment can reduce the amount of detection and improve the efficiency of connection reallocation.
[0090] Step S140: If the detection result of step S130 is not satisfied, the number of reserved links corresponding to the server is reduced, the reduced number of reserved links is determined as the number of reserved links corresponding to the server, and the process returns to the step of determining the number of reallocated links.
[0091] The detection result of not satisfying means that the reallocated link numbers corresponding to all servers do not satisfy the preset balance condition. That is to say, as long as the reallocated link number corresponding to one server does not satisfy the preset balance condition, the detection result of step S130 is determined to be not satisfied.
[0092] When the number of reserved links corresponding to each server is the same, that is, each server corresponds to the same number of reserved links, the number of reserved links commonly corresponding to each server can be directly reduced. When the number of reserved links corresponding to each server is different, the number of reserved links corresponding to each server can be reduced, or the number of reserved links corresponding to some servers can be reduced, which is not specifically limited in this application.
[0093] When reducing the number of reserved links, the number of reserved links can be reduced by 1, that is, the number of reserved links can be reduced with the smallest reduction unit to make the final number of reserved links as large as possible, thereby reducing the number of links that need to be disconnected and increasing the number of clients that maintain continuous connections, so as to better provide real-time service data for more clients.
[0094] Step S140 returns to the step of determining the number of reallocated links, i.e., returns to step S120. After executing step S120, the detection step of step S130 is executed, and the step of reducing the number according to the detection result of step S140 is executed, etc. That is to say, steps S120 to S150 are a loop execution process, and the loop execution process ends when the detection result of step S130 is satisfied.
[0095] In a specific embodiment, step S130 can be implemented according to the following steps: in response to monitoring that the number of new reallocated links corresponding to each of the servers is predicted, detecting whether the number of reallocated links corresponding to each of the servers meets the preset balance condition. That is, each time the electronic device predicts a new number of reallocated links, that is, each time the electronic device executes step 120, it will perform the step of detecting whether the number of reallocated links corresponding to each of the servers meets the preset balance condition for the predicted number of reallocated links.
[0096] Step S150: If the detection result of step S130 is satisfied, disconnect the link of the server according to the number of reserved links corresponding to the server, and distribute the disconnected links in the server cluster to each of the servers according to the link redistribution method to complete link redistribution.
[0097] Since step S120 predicts the number of reallocated links according to the link reallocation method, when performing actual link reallocation later, it is also necessary to reallocate the disconnected links according to the link reallocation method in step S120, so that the number of reallocated links of each server after reallocation can meet the preset balance condition.
[0098] The server is disconnected according to the number of reserved links corresponding to the server. For example, when the number of reserved links corresponding to the server is 50 and the current number of links of the server is 60, the server disconnects 10 links. When the link redistribution method is to evenly distribute the disconnected links to each server, a total of 200 links are disconnected in the server cluster, and the server cluster includes 20 servers, 10 links can be allocated to each server to achieve link redistribution.
[0099] Below, we take the scenario where the number of reserved links corresponding to each server is the same, the link redistribution method is to evenly distribute each disconnected link to each server in the server cluster, the preset balancing condition is that the number of reallocated links corresponding to each server is not greater than the corresponding maximum load link number, and the maximum load link number corresponding to each server is the same as an example to demonstrate why reducing the number of reserved links can make each server more likely to meet the preset balancing condition. The demonstration methods in other scenarios are similar to those in this scenario, and this application will not list them one by one in detail.
[0100] According to the above link reallocation scenario, the relationship of formula (3) can be obtained.
[0101]
[0102] Among them, y represents the number of reallocated links corresponding to the server that needs to disconnect the link, x represents the number of reserved links, and a i represents the current number of links of the i-th server that needs to be disconnected, n represents the total number of servers in the server cluster, and ω represents the maximum load link number corresponding to the server.
[0103] In formula (3), when the current number of links of a server is less than x, the server does not need to disconnect the links. Therefore, when calculating the total number of links that need to be reallocated, the number of links that need to be disconnected corresponding to the server is 0. Therefore, max(0, a i -x) formula to select 0 and a i The larger value in -x is used as the number of links that need to be disconnected.
[0104] Define k as the number of servers that need to be disconnected for this balancing, that is, the number of servers whose own link number is higher than x, and we can get the relationship shown in the following formula (4).
[0105]
[0106] f(x) represents the number of servers that need to be disconnected. f(x) will increase as x decreases, that is, the fewer the number of links retained by the server, the more machines that need to be disconnected. k is less than the total number of servers in the server cluster n. When the positive integer x decreases, k may remain unchanged or increase. When x decreases by 1, k may surge to n. In reality, x is lower than the number of links of the machine with the smallest load. In this way, all machines will have their links closed.
[0107] set up:
[0108]
[0109] According to the above analysis of f(x), we can assume that when the positive integer x decreases by 1, the number of k increases is d, satisfying d>=0, d+k<=n, and we can get the recursive relationship:
[0110]
[0111] Right now:
[0112]
[0113] Right now:
[0114]
[0115] It can be seen from formula (8) that when x is a positive integer, g(x) is a monotonically increasing function. Therefore, the following conclusion can be drawn: after the client link is reconnected according to the link redistribution method of evenly distributing the disconnected links, the corresponding reallocated link number y of the server will decrease as the number of links x retained after the disconnection operation decreases. Therefore, reducing the number of retained links can make the corresponding reallocated link number y of the server smaller, so that each server can be more inclined to be less than the corresponding maximum load link number, that is, it is more inclined to meet the preset balance condition. Therefore, the method of gradually reducing the number of retained links provided in the present application can determine the number of retained links that meets the preset balance condition, so that the connection redistribution according to the retained link number can meet the balance condition.
[0116] In one implementation, before step S110, the connection reallocation method may further include the following step S110a.
[0117] 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.
[0118] Specifically, when the maximum load link numbers of each server are the same, the following steps can be used to determine whether the current total link number corresponding to the server cluster exceeds the maximum total load link number that the server cluster can bear: determine whether the current total link number corresponding to the server cluster exceeds the maximum total load link number that the server cluster can bear based on whether the ratio of the total link number 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 link number 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, it is determined that the current total link number corresponding to the server cluster exceeds the maximum total load link number that the server cluster can bear; otherwise, it is determined that the current total link number corresponding to the server cluster does not exceed the maximum total load link number that the server cluster can bear.
[0119] Step S110 can be implemented according to the following step S111.
[0120] Step S111: When the current total number of links does not exceed the maximum total load number of links, the number of reserved links corresponding to the server is determined.
[0121] 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.
[0122] Optionally, the link reallocation method may further include the following step S160.
[0123] Step S160: When the current total number of links exceeds the maximum total load number of links, the server cluster is expanded, and the link reallocation process from step S110 to step S150 is performed on the expanded server cluster.
[0124] The expansion of the server cluster may be to increase the number of servers in the server cluster, or to increase the configuration of the existing servers, for example, to increase the memory and storage of the server, etc. This application does not specifically limit the expansion method. This embodiment expands the capacity by detecting whether the server cluster can meet the link requirements, which can better ensure that the server cluster can meet the service requirements of the client.
[0125] 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. It may also be that 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 performs capacity expansion, the server cluster performs a network disconnection drill, and registers / deregisters an address server. The link reallocation method may also be triggered when other load imbalance situations occur, which are not specifically limited in this application.
[0126] 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, so that it is possible to determine in real time whether the reallocation is successful in achieving link balancing through the monitored status.
[0127] The link reallocation method provided in the embodiment of the present application first determines the number of reserved links corresponding to each server in the server cluster when link reallocation is performed. At this time, the preliminary number of reserved links is determined, and then the number of reallocated links corresponding to each server after link reallocation is determined based on the number of reserved links corresponding to each server, the current number of links of each server, and the link reallocation method. That is, the electronic device predicts the number of reallocated links corresponding to each server when link reallocation is performed on each server according to the link reallocation method. The electronic device then detects whether the number of reallocated links corresponding to each server meets the preset balance condition. If not, it means that the predicted number of reallocated links corresponding to each server still has link imbalance, which means that the number of reallocated links of each server after link reallocation according to the current number of reserved links cannot meet the balance condition. Therefore, it is necessary to adjust the number of reserved links. When calculating the number of reallocated links corresponding to the server, the number of reallocated links corresponding to the server is closely related to the number of reserved links. The specific relationship is that the smaller the number of reserved links is set, the more links are disconnected, and the easier it is to achieve link balance. Therefore, in order to make the predicted reallocated links The number satisfies the preset balance condition. When the present application detects that the number of reallocated links corresponding to each server does not meet the preset balance condition, the number of reserved links corresponding to the server will be reduced, and the reduced number of reserved links will be determined as the number of reserved links corresponding to the server, and then the step of determining the number of reallocated links will be returned to execute, and the subsequent detection steps and the subsequent steps executed according to the detection steps will be executed in sequence, that is, the embodiment of the present application will cyclically execute the process from determining the number of reserved links to detecting whether the number of reallocated links meets the preset balance condition and then reducing the number of reserved links according to the detection result, until it is detected that the number of reallocated links corresponding to each server meets the preset balance condition, indicating that the number of reallocated links of each server can meet the preset balance condition after link reallocation according to the current number of reserved links. In this case, the link of the server can be disconnected according to the number of reserved links corresponding to the server, and the disconnected links in the server cluster can be distributed to each server according to the link reallocation method. After link reallocation in this way, the number of reallocated links of each server can be less than its own maximum load link number, and link reallocation is completed to achieve link balance of each server. That is to say, the solution provided by the present application first predicts the number of reallocated links of each server after reallocation based on the link reallocation method and the determined number of reserved links, and continuously reduces the number of reserved links according to the number of reallocated links, until the final predicted number of reallocated links of each server meets the preset equilibrium condition, and then disconnects and reallocates the links of each server in the server cluster according to the link reallocation method and the final determined number of reserved links.
[0128] It can be seen that the solution provided by the present application first predicts the number of reallocated links when performing link reallocation. When the predicted numbers of reallocated links meet the preset balance conditions, the links are reallocated according to the parameters and methods during the prediction. Since the number of retained links that meet the preset balance conditions is predicted in advance, the number of links to each server can be reconnected once to meet the preset balance conditions. There is no need to repeatedly reconnect the links, which reduces the number of times the client's links are disconnected during the link reallocation process, reduces the impact on the client's business timeliness due to link reallocation, and improves user experience.
[0129] In addition, the solution provided by the present application gradually reduces the number of retained links when it is detected that the number of reallocated links does not meet the preset balance conditions, so that the final number of retained links can be as large as possible while meeting the preset balance conditions, which can reduce the number of links that need to be disconnected, thereby reducing the number of clients affected by link disconnection, further ensuring the timeliness of client services and improving user experience.
[0130] The following is an illustrative example of the link reallocation method provided by the present application. This example is described by taking the case where the maximum load link numbers corresponding to each server are the same and the reserved link numbers determined for each server are also the same. Figure 3 As shown, the link reallocation method provided in this example includes the following steps S1 to S8.
[0131] Step S1: Determine whether the ratio of the total number of links corresponding to a server cluster to the number n of servers included in the server cluster is greater than the maximum load link number ω corresponding to the server.
[0132] Step S2: If the judgment result of step S1 is yes, the server cluster is expanded.
[0133] Step S3: If the judgment result of step S1 is no, determine that the number of reserved links x corresponding to the server when link reallocation is performed is the maximum load link number ω, that is, determine x=ω.
[0134] Step S4: Determine the number y of reallocated links of the server that needs to be disconnected according to the above formula (1).
[0135] Step S5: Determine whether the determined reallocated link number y is less than or equal to the corresponding maximum load link number ω.
[0136] Step S6: If the judgment result of step S5 is no, then x=x-1, and then return to step S4.
[0137] Step S7: If the judgment result of step S5 is yes, disconnect the link of the server according to the number of reserved links corresponding to the server, and distribute the disconnected links in the server cluster to each of the servers according to the link redistribution method to complete the link redistribution.
[0138] Step S6 is to reallocate links according to the latest determined number of reserved links.
[0139] Step S8: monitor the link reconnection status.
[0140] The specific execution process of steps S1 to S8 can refer to steps S110 to S160 mentioned above, which will not be described in detail here.
[0141] Embodiment 2
[0142] The second embodiment of the present application also provides a link reallocation device corresponding to the link reallocation 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 reallocation method embodiment provided above. Figure 4 As shown, the link reallocation device provided in this embodiment includes:
[0143] The first determining unit 210 is used to determine the number of reserved links corresponding to each server in the server cluster when link reallocation is performed;
[0144] The second determining unit 220 is used to predict the number of reallocated links corresponding to each server after link reallocation based on the number of reserved links corresponding to each server, the current number of links of each server, and a preset link reallocation method for reallocating broken links;
[0145] A detection unit 230, configured to detect whether the number of reallocated links corresponding to each of the servers meets a preset balance condition;
[0146] The value updating unit 240 is used to reduce the number of reserved links corresponding to the server when the detection result of the detection unit is not satisfied, determine the reduced number of reserved links as the number of reserved links corresponding to the server, and return to the step of determining the number of reallocated links;
[0147] The allocation unit 250 is used to disconnect the link of the server according to the number of reserved links corresponding to the server when the detection result of the detection unit is satisfied, and allocate the disconnected links in the server cluster to each of the servers according to the link reallocation method to complete the link reallocation.
[0148] Optionally, the preset equilibrium condition includes:
[0149] The number of reallocated links corresponding to each of the servers is not greater than the number of corresponding maximum load links.
[0150] Optionally, the first determination unit is specifically used to: determine the maximum load link number corresponding to the server as the corresponding reserved link number when link reallocation is performed; or, determine a number that is 1 less than the maximum load link number corresponding to the server as the corresponding reserved link number when link reallocation is performed.
[0151] Optionally, the link reallocation method is to evenly distribute the disconnected links in the server cluster to each server, the number of reserved links corresponding to each server in the server cluster is the same, and the configurations of each server in the server cluster are the same.
[0152] Optionally, the value updating unit is specifically used to: reduce the number of reserved links corresponding to the server by 1.
[0153] Optionally, the maximum load link numbers corresponding to each of the servers are the same, and the detection unit is specifically used to detect whether the number of redistributed links corresponding to the maximum link server in the server cluster meets a preset balance condition, and the maximum link server is the server with the largest number of redistributed links determined.
[0154] Optionally, the device further comprises:
[0155] A judging unit, configured to judge 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;
[0156] The first determining unit is specifically configured to determine the number of reserved links corresponding to each server in the server cluster when link reallocation is performed when the current total number of links does not exceed the maximum total load number of links.
[0157] Optionally, the judgment unit is specifically used to judge whether the current total number of links corresponding to the server cluster exceeds the maximum total load link number 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.
[0158] Optionally, the device further comprises:
[0159] 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, and to execute a link balancing process from determining the number of reserved links corresponding to the server when the current total number of links does not exceed the maximum total load number of links to completing link redistribution for the expanded server cluster.
[0160] Optionally, the triggering timing of the link reallocation device includes at least one of the following:
[0161] The current number of links of at least one server in the server cluster exceeds the corresponding maximum load number of links;
[0162] 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.
[0163] The third embodiment of the present application also provides an electronic device embodiment corresponding to the link reallocation method provided in the first embodiment. The following description of the electronic device embodiment is only illustrative. The electronic device embodiment is as follows:
[0164] 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;
[0165] 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:
[0166] Determine the number of reserved links corresponding to each server in the server cluster when link redistribution is performed;
[0167] According to the number of reserved links corresponding to each server and the current number of links of each server, and based on a preset link redistribution method for redistributing broken links, predicting the number of reallocated links corresponding to each server after link redistribution;
[0168] Detecting whether the number of reallocated links corresponding to each of the servers meets a preset balance condition;
[0169] If not satisfied, reducing the number of reserved links corresponding to the server, determining the reduced number of reserved links as the number of reserved links corresponding to the server, and returning to the step of determining the number of reallocated links;
[0170] If satisfied, the link of the server is disconnected according to the number of reserved links corresponding to the server, and the disconnected links in the server cluster are distributed to each of the servers according to the link reallocation method to complete the link reallocation.
[0171] 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.
[0172] 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:
[0173] Determine the number of reserved links corresponding to each server in the server cluster when link redistribution is performed;
[0174] According to the number of reserved links corresponding to each server and the current number of links of each server, and based on a preset link redistribution method for redistributing broken links, predicting the number of reallocated links corresponding to each server after link redistribution;
[0175] Detecting whether the number of reallocated links corresponding to each of the servers meets a preset balance condition;
[0176] If not satisfied, reducing the number of reserved links corresponding to the server, determining the reduced number of reserved links as the number of reserved links corresponding to the server, and returning to the step of determining the number of reallocated links;
[0177] If satisfied, the link of the server is disconnected according to the number of reserved links corresponding to the server, and the disconnected links in the server cluster are distributed to each of the servers according to the link reallocation method to complete the link reallocation.
[0178] The fifth embodiment of the present application also provides a computer program product for implementing the method described in the first embodiment, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0179] Determine the number of reserved links corresponding to each server in the server cluster when link redistribution is performed;
[0180] According to the number of reserved links corresponding to each server and the current number of links of each server, and based on a preset link redistribution method for redistributing broken links, predicting the number of reallocated links corresponding to each server after link redistribution;
[0181] Detecting whether the number of reallocated links corresponding to each of the servers meets a preset balance condition;
[0182] If not satisfied, reducing the number of reserved links corresponding to the server, determining the reduced number of reserved links as the number of reserved links corresponding to the server, and returning to the step of determining the number of reallocated links;
[0183] If satisfied, the link of the server is disconnected according to the number of reserved links corresponding to the server, and the disconnected links in the server cluster are distributed to each of the servers according to the link reallocation method to complete the link reallocation.
[0184] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0185] 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.
[0186] 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.
[0187] 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.
[0188] 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 reallocation method, characterized in that: The method comprises: Determine the number of reserved links corresponding to each server in the server cluster when link redistribution is performed; According to the number of reserved links corresponding to each server and the current number of links of each server, and based on a preset link redistribution method for redistributing broken links, predicting the number of reallocated links corresponding to each server after link redistribution; Detecting whether the number of reallocated links corresponding to each of the servers meets a preset balance condition; If not satisfied, reducing the number of reserved links corresponding to the server, determining the reduced number of reserved links as the number of reserved links corresponding to the server, and returning to the step of determining the number of reallocated links; If satisfied, the link of the server is disconnected according to the number of reserved links corresponding to the server, and the disconnected links in the server cluster are distributed to each of the servers according to the link reallocation method to complete the link reallocation.
2. The link reallocation method according to claim 1, characterized in that: The preset equilibrium conditions include: The number of reallocated links corresponding to each of the servers is not greater than the number of corresponding maximum load links.
3. The link reallocation method according to claim 2, characterized in that: The determining the number of reserved links corresponding to the server when link reallocation is performed includes: Determine the maximum load link number corresponding to the server as the corresponding reserved link number when link reallocation is performed; Alternatively, a number which is 1 less than the maximum load link number corresponding to the server is determined as the corresponding reserved link number when link reallocation is performed.
4. The link reallocation method according to claim 2, characterized in that: The link redistribution method is to evenly distribute the disconnected links in the server cluster to each server, the number of reserved links corresponding to each server in the server cluster is the same, and the configurations of each server in the server cluster are the same.
5. The link reallocation method according to claim 4, characterized in that: The reducing the number of reserved links corresponding to the server comprises: The number of reserved links corresponding to the server is reduced by 1.
6. The link reallocation method according to claim 4, characterized in that: The maximum load link numbers corresponding to the servers are the same, and the detecting whether the reallocated link numbers corresponding to the servers meet a preset balancing condition includes: It is detected whether the number of reallocated links corresponding to the maximum link server in the server cluster meets a preset balance condition, the maximum link server being the server with the largest number of reallocated links determined.
7. The link reallocation method according to claim 4, characterized in that: Before determining the number of reserved links corresponding to each server in the server cluster when link reallocation is performed, 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 of the number of reserved links corresponding to each server in the server cluster when link reallocation is performed includes: When the current total number of links does not exceed the maximum total load number of links, the number of reserved links corresponding to each server in the server cluster is determined when link reallocation is performed.
8. The link reallocation method according to claim 7, characterized in that: The determining 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 includes: According to 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, it is determined whether the current total number of links corresponding to the server cluster exceeds the maximum total load link number that the server cluster can bear.
9. The link reallocation method according to claim 7, characterized in that: The method further comprises: 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 determining the number of reserved links corresponding to the server when the current total number of links does not exceed the maximum total load number of links to completing link redistribution is performed for the expanded server cluster.
10. The link reallocation method according to claim 1, characterized in that: The triggering timing of the link reallocation method includes at least one of the following: The current number of links of at least one server in the server cluster exceeds the corresponding maximum load number of links; 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.
11. A link reallocation device, characterized in that: The device comprises: A first determining unit is used to determine the number of reserved links corresponding to each server in the server cluster when link reallocation is performed; A second determining unit is used to predict the number of reallocated links corresponding to each of the servers after link reallocation based on the number of reserved links corresponding to each of the servers, the current number of links of each of the servers, and a preset link reallocation method for reallocating broken links; A detection unit, used to detect whether the number of reallocated links corresponding to each of the servers meets a preset balance condition; a value updating unit, configured to reduce the number of reserved links corresponding to the server when the detection result of the detection unit is not satisfied, determine the reduced number of reserved links as the number of reserved links corresponding to the server, and return to execute the step of determining the number of reallocated links; The allocation unit is used to disconnect the link of the server according to the number of reserved links corresponding to the server when the detection result of the detection unit is satisfied, and allocate the disconnected links in the server cluster to each of the servers according to the link reallocation method to complete the link reallocation.
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.