Point-to-point load balancing method and device, equipment, storage medium and program product

By using a network test connection in an enhanced Ethernet network to perform load balancing tests, the problem of traffic imbalance in point-to-point communication is resolved. This allows full utilization of the Bonding network port for traffic balancing without affecting service traffic, overcoming the limitations of traditional methods.

CN120602415AActive Publication Date: 2025-09-05CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510824309.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-05
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

In a bonding-based aggregation network, existing technologies suffer from traffic imbalance in point-to-point communications, causing congestion on some links and idleness on others. Traditional solutions also cannot be expanded online, impacting service traffic.

Method used

By using the network test connection to perform load balancing tests in the enhanced Ethernet network, a new network test connection is established when load imbalance is determined until a balanced state is achieved, and the business network connection is replaced, using low-priority test traffic for balancing tests.

Benefits of technology

It achieves point-to-point network load balancing without affecting the original business traffic, making full use of the Bonding network port traffic on the entire link, and solving the problem that traditional methods cannot be expanded online.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120602415A_ABST
    Figure CN120602415A_ABST
Patent Text Reader

Abstract

The invention relates to a point-to-point load balancing method and device, equipment, a storage medium and a program product, is applied to a first node in an enhanced Ethernet, and comprises the following steps: generating a balancing task when a service network connection between the first node and a second node is established, and when the balancing task is executed, if the second node is in an idle state, executing the balancing task; and configuring a network test connection with a priority lower than that of the service network connection between the first node and the second node, carrying out a balance test on the first node and the second node through the network test connection, if a test result shows that the load is unbalanced, establishing a new network test connection between the first node and the second node, and carrying out the balance test again. The target network test connection with the test result of load balancing is obtained; and replacing the service network connection between the first node and the second node with the target network test connection. By adopting the method, point-to-point load balancing can be realized under the condition that the original service flow is not influenced in an online environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data communication technology, and in particular to a point-to-point load balancing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] To address traffic imbalance in bonding-based aggregation networks, an ECMP (Equal-Cost Multi-Path) hashing strategy is typically used. This strategy involves sending nodes and switches calculating the hash value of a packet's five-tuple information to determine which network port to forward the packet. However, if multiple high-traffic connections (such as point-to-point communications) have the same hash value, they will be mapped to the same path, resulting in uneven load (congestion on some links while idle on others).

[0003] The existing solution to the problem of uneven load is to fix the connection path before service deployment. However, this approach lacks online scalability and can only be tested offline in advance. If applied to online services, the large amount of test traffic generated by the point-to-point load balancing process would seriously impact the service. Summary of the Invention

[0004] Based on this, it is necessary to provide a point-to-point load balancing method, device, computer equipment, computer-readable storage medium and computer program product that can achieve load balancing in an online environment without affecting the original business traffic to address the above technical problems.

[0005] In a first aspect, the present application provides a point-to-point load balancing method, applied to a first node in an enhanced Ethernet network, the method comprising:

[0006] determining a balancing task currently to be processed by the first node and a second node corresponding to the balancing task; the balancing task between the first node and the second node is generated when a service network connection between the first node and the second node is established;

[0007] When the second node is in an idle state, configuring a network test connection between the first node and the second node, performing a balancing test on the first node and the second node through the network test connection, and obtaining a test result; the service network connection has a higher priority than the network test connection;

[0008] If the test result is load imbalance, a new network test connection is established between the first node and the second node, and a balancing test is performed again until a target network test connection with a load balanced test result is obtained;

[0009] The service network connection between the first node and the second node is replaced with the target network test connection.

[0010] In one embodiment, configuring a network test connection between the first node and the second node includes:

[0011] Randomly select the source port number and destination port number;

[0012] A network test connection is established between the first node and the second node according to the source port number and the destination port number.

[0013] In one embodiment, the first node and the second node both aggregate multiple physical network ports into a virtual interface through network aggregation technology, and the load balancing method is applied to load balancing between the first virtual interface of the first node and the second virtual interface of the second node;

[0014] The performing a balancing test on the first node and the second node through the network test connection to obtain a test result includes:

[0015] At the first node, periodically sending a probe packet to the second node through the network test connection;

[0016] If traffic at each physical network port associated with the first virtual interface of the first node and traffic at each physical network port associated with the second virtual interface of the second node increases periodically, it is determined that the first node and the second node are load balanced.

[0017] In one embodiment, determining the balancing task currently to be processed by the first node includes:

[0018] A current balancing task to be processed is selected from a balancing task list corresponding to the first node; each balancing task in the balancing task list corresponds to a different second node.

[0019] In one embodiment, the method further comprises:

[0020] When the second node is busy or the service network connection between the first node and the second node has been replaced by the target network test connection, exit the current pending balancing task and determine the traversal status of other balancing tasks in the balancing task list;

[0021] If there is an untraversed balancing task in the balancing task list, the next balancing task is selected as a new balancing task to be processed, and the process returns to the step of determining the second node corresponding to the balancing task.

[0022] In one embodiment, the method further comprises:

[0023] If all balancing tasks in the balancing task list have been traversed and completed, setting the state of the first node to an idle state;

[0024] Monitor the duration of the idle state of the first node. If the duration exceeds a threshold, enter the next round of balancing task traversal process.

[0025] In a second aspect, the present application further provides a point-to-point load balancing device, which is provided at a first node in an enhanced Ethernet network, and the device comprises:

[0026] a node determination module, configured to determine a balancing task currently to be processed by the first node and a second node corresponding to the balancing task; the balancing task between the first node and the second node is generated when a service network connection between the first node and the second node is established;

[0027] a balancing test module, configured to, when the second node is in an idle state, configure a network test connection between the first node and the second node, perform a balancing test on the first node and the second node through the network test connection, and obtain a test result; the service network connection has a higher priority than the network test connection;

[0028] A result processing module is configured to establish a new network test connection between the first node and the second node if the test result is load imbalance, and perform a balancing test again until a target network test connection with a load balanced test result is obtained;

[0029] A connection replacement module is configured to replace the service network connection between the first node and the second node with the target network test connection.

[0030] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any of the above methods when executing the computer program.

[0031] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the method as described in any one of the above items when the computer program is executed by a processor.

[0032] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the method described in any one of the above items when executed by a processor.

[0033] The above-mentioned point-to-point load balancing method, apparatus, computer device, computer-readable storage medium, and computer program product generate a balancing task between the first node and the second node when establishing a service network connection between the first node and the second node. When the first node executes the balancing task, it first determines the state of the second node corresponding to the balancing task. When the second node is in an idle state, a network test connection with a lower priority than the service network connection is configured between the first node and the second node. A balancing test is performed on the first node and the second node through the network test connection to obtain a test result. If the test result is load imbalance, a new network test connection is established between the first node and the second node, and the balancing test is performed again until a target network test connection with a load-balanced test result is obtained, and the service network connection between the first node and the second node is replaced with the target network test connection. In an enhanced Ethernet environment, this method can determine a load-balanced target network test connection to replace the original service network connection without affecting the original service traffic, thereby achieving point-to-point network load balancing, thereby enabling the traffic of the bonding network port to be fully utilized across the entire link. On the other hand, since the test traffic does not affect the original business traffic, it can be applied to online testing, which facilitates the replacement of network test connections, thus overcoming the defects of traditional methods that are difficult to expand and can only be done offline in advance. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0035] Figure 1 A hash collision diagram of the Bonding aggregation network;

[0036] Figure 2 This is an application environment diagram of a point-to-point load balancing method in one embodiment;

[0037] Figure 3 1 is a flow chart of a point-to-point load balancing method according to an embodiment;

[0038] Figure 4 A schematic flow chart of a point-to-point load balancing method according to another embodiment;

[0039] Figure 5 A schematic diagram of an online point-to-point traffic balancing strategy in one embodiment;

[0040] Figure 6 is a structural block diagram of a point-to-point load balancing device in one embodiment;

[0041] Figure 7 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0043] It should be noted that the terms "first," "second," and the like in the specification and claims of this application and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0044] The advantage of bonding technology in Linux systems lies in achieving bandwidth aggregation and redundancy by binding multiple physical network ports into a single virtual interface. This technology combines the bandwidth of multiple network connections, providing higher total bandwidth and improving network throughput. Furthermore, if one or more physical network ports fail, traffic is automatically switched to other available physical ports, improving network reliability and fault tolerance. Through load balancing at the flow or session level, a converged network can optimize network resource utilization.

[0045] However, when using the ECMP (Equal-Cost Multi-Path) hashing strategy in a bonding aggregation network, if multiple high-traffic connections (such as point-to-point communications) have the same hash value, they will be mapped to the same path, resulting in traffic imbalance between the points. For example, Figure 1 The hash collision diagram of the Bonding aggregation network is shown in Figure 1 As shown in Figure (a), taking the point-to-point communication between node 0 and node 1 as an example, node 0 and node 1 each have two physical network ports (port 0 and port 1), which are connected to the switch's ports 0 and 1 and 4 and 5 respectively through the bonding aggregation network. Two independent network connections (such as TCP connections) are established between the two nodes. Ideally, Figure 1As shown in Figure (b), the traffic will evenly enter the two entrances of node 0 and enter the switch. The switch will also evenly distribute the two flows to the switch's network ports 4 and 5, and finally deliver them to node 1. This ideal traffic distribution can maximize the bandwidth utilization between point-to-point connections. However, if Figure 1 As shown in Figure (c), when the switch selects the same sending port No. 4, then the No. 5 switch port will not provide transmission services. At this time, the transmission bandwidth between points will be only half of the ideal situation. In addition, the traffic imbalance caused by the hash conflict on the switch side will also cause network congestion. If the sender cannot reduce the sending rate in time through the congestion control algorithm, the cache occupancy of the No. 4 switch port will increase, eventually leading to network packet loss. Another situation is as follows Figure 1 As shown in Figure (d), when node 0 uses the ECMP strategy to select the same sending network port, even if the switch side disperses the network traffic, the overall network bandwidth from node 0 to node 1 is still limited by the maximum transmission rate of a single network card port.

[0046] The existing solution is to establish multiple network connections between nodes before actual business applications are deployed, identify connection paths that can achieve load balancing, and record them. During actual deployment, these recorded connection paths are activated to ensure point-to-point network balance during actual business operations. However, this approach is not easy to scale and can only be tested offline in advance. If applied to online business, the large amount of test traffic generated by the point-to-point load balancing process would seriously impact business operations. Furthermore, the testing process is complex and difficult to implement.

[0047] Based on the above problems, the present application proposes a point-to-point load balancing strategy for enhanced Ethernet converged networks without affecting business traffic. Converged Enhanced Ethernet (CEE) is an extension of traditional Ethernet. It supports traffic classification, flow control, and bandwidth management, and can provide quality of service (QoS) guarantees for different types of data streams, thereby achieving more efficient network resource utilization. Compared with traditional Ethernet, enhanced Ethernet can provide different traffic priority services. It generally adopts a bonding network to improve the bandwidth performance and fault tolerance of the system. The point-to-point load balancing method of the present application can be run on each node in this network scenario.

[0048] refer to Figure 2, is a schematic diagram of an application scenario for the point-to-point load balancing method provided in an embodiment of the present application. This method can be applied to any node (denoted as the first node) in an enhanced Ethernet network. The second node is any node other than the first node, and the first and second nodes communicate via the network. Each node has communication capabilities for communicating with other nodes. For example, each node can be a terminal, server, or client. Terminals include, but are not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart car devices, and projectors. Portable wearable devices can include smart watches, smart bracelets, head-mounted devices, and the like. Head-mounted devices can include virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, and the like. The server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.

[0049] In the application scenario of the present application, the first node 202 determines the current balancing task to be processed and the second node 204 corresponding to the balancing task; wherein the balancing task between the first node 202 and the second node 204 is generated when the service network connection between the first node 202 and the second node 204 is established; when the second node 204 is in an idle state, a network test connection between the first node 202 and the second node 204 is configured; a balancing test is performed on the first node 202 and the second node 204 through the network test connection to obtain a test result; if the test result is load imbalance, a new network test connection is established between the first node 202 and the second node 204, and the balancing test is performed again until a target network test connection with a load balance test result is obtained; the service network connection between the first node 202 and the second node 204 is replaced with the target network test connection. Thus, by using a low-priority network test connection for traffic balancing testing, bonding traffic balancing between nodes is achieved without interfering with the original service traffic, so that the traffic of the bonding network port can be fully utilized on the entire link.

[0050] In an exemplary embodiment, Figure 3 As shown, a point-to-point load balancing method is provided, which is applied to Figure 1 Taking the first node 202 in FIG. 1 as an example, the method includes the following steps S310 to S340. In which:

[0051] Step S310 , determining a balancing task currently to be processed by the first node and a second node corresponding to the balancing task; the balancing task between the first node and the second node is generated when a service network connection between the first node and the second node is established.

[0052] The first node and the second node are both nodes in an enhanced Ethernet network. That is, the first node and the second node both use bonding to aggregate multiple network ports into a single virtual interface. Load balancing between the first node and the second node indicates that the network ports of the first node and the second node are balanced in sending and receiving data packets.

[0053] The service network connection refers to a network connection for service communication between the first node and the second node.

[0054] In a specific implementation, when a first node establishes a service network connection with a second node in response to a connection request, it can simultaneously generate a balancing task between the first and second nodes and record the balancing task in the first node's balancing task list. When the first node selects the balancing task from the task balancing list as the current balancing task to be processed, it can simultaneously determine the second node associated with the balancing task based on the record.

[0055] Step S320, when the second node is in an idle state, configure a network test connection between the first node and the second node, perform a balancing test on the first node and the second node through the network test connection, and obtain a test result; the service network connection has a higher priority than the network test connection.

[0056] Among them, the priority of the business network connection is higher than the network test connection, which means that when there is a business communication demand between the first node and the second node, the business communication is performed through the business network connection.

[0057] The idle state indicates that the system is not currently in a balancing task, that is, it is not currently performing a balancing test with any node, but is able to perform business communications.

[0058] In a specific implementation, when a first node determines the second node associated with a balancing task to be processed, i.e., the second node to be subjected to a balancing test, it first determines the current state of the second node. If the second node is currently busy, i.e., already in a balancing task and performing a balancing test with another node, the first node will exit the current balancing task with the second node. If the second node is currently idle, indicating that a balancing test can be performed with it, a network test connection is configured with the second node to facilitate the balancing test of the first and second nodes via the network test connection.

[0059] It can be understood that the balance of the network test connection between the first node and the second node is the same as the balance of the business network connection between the first node and the second node. Therefore, performing a balance test on the network test connection is equivalent to performing a balance test on the business network connection. If the test result is balanced, it also indicates that the business network connection between the first node and the second node is load balanced, then the initially established business network connection can be replaced, or it can be retained without replacement. If the test result is unbalanced, it indicates that the load of the business network connection between the first node and the second node is unbalanced, and it is necessary to test out a target network test connection that can achieve load balancing to replace the initially established business network connection and ensure load balancing between the first node and the second node.

[0060] Step S330: If the test result is load imbalance, a new network test connection is established between the first node and the second node, and a balancing test is performed again until a target network test connection with a load balance test result is obtained.

[0061] In the specific implementation, if the balancing test result of the network test connection between the first node and the second node is load imbalance, it is necessary to replace the network test connection, establish a new network test connection between the first node and the second node, and perform the balancing test again until a network test connection with a load balanced test result is obtained, which is recorded as the target network test connection, and the cycle ends.

[0062] Step S340: Replace the service network connection between the first node and the second node with the target network test connection.

[0063] In a specific implementation, after determining a target network test connection that can achieve load balancing between the first and second nodes, the target network test connection can be used to replace the initially established load-unbalanced service network connection. That is, the target network test connection is used as the new service network connection between the first and second nodes to achieve load balancing between the first and second nodes. Furthermore, the target network test connection can be used to replace the initially established load-unbalanced service network connection at idle times when the first node is not engaged in service communications, thereby avoiding interference with normal service communications between the first and second nodes.

[0064] In the above-mentioned point-to-point load balancing method, when establishing a business network connection between the first node and the second node, a balancing task between the first node and the second node is generated. When the first node executes the balancing task, the state of the second node corresponding to the balancing task is first determined. When the second node is in an idle state, a network test connection with a lower priority than the business network connection is configured between the first node and the second node, and a balancing test is performed on the first node and the second node through the network test connection to obtain a test result; if the test result is load imbalance, a new network test connection is established between the first node and the second node, and a balancing test is performed again until a target network test connection with a load-balanced test result is obtained, and the business network connection between the first node and the second node is replaced with the target network test connection. In an enhanced Ethernet environment, this method can determine the target network test connection for load balancing without affecting the original business traffic, so as to replace the original business network connection and achieve point-to-point network load balancing, thereby enabling the traffic of the Bonding network port to be fully utilized on the entire link. On the other hand, since the test traffic does not affect the original business traffic, it can be applied to online testing, which facilitates the replacement of network test connections, thus overcoming the defects of traditional methods that are difficult to expand and can only be done offline in advance.

[0065] In an exemplary embodiment, configuring the network test connection between the first node and the second node in step S320 includes: randomly selecting a source port number and a destination port number; and establishing the network test connection between the first node and the second node according to the source port number and the destination port number.

[0066] The port number is a numerical label used to identify different applications or services in computer networks, ranging from 0 to 65535. In the packet structure of protocols such as TCP / UDP, the packet header contains the source and destination port numbers to ensure that the response can be returned correctly.

[0067] In specific implementations, the basic principle of using an ECMP (Equal Cost Multi-Path Routing) hash strategy to determine the path traffic takes is to calculate a hash value of the packet's source IP address, destination IP address, and port number, and then map the result to an ECMP path. Since the IP address remains unchanged, establishing a network test connection can be achieved by adjusting the port numbers (including the source and destination port numbers). Specifically, a source port number and a destination port number are randomly selected, hashed, and mapped to the corresponding path to establish a network test connection between the first and second nodes.

[0068] In this embodiment, by randomly selecting the source port number and the destination port number, a network test connection is established between the first node and the second node based on the source port number and the destination port number, thereby achieving effective establishment of the network test connection and facilitating the replacement of the port number and / or the destination port number to establish a new network test connection when the network test connection load is unbalanced.

[0069] It will be understood that the first node and the second node are nodes in an enhanced Ethernet network, which is generally networked using network aggregation. Therefore, both the first node and the second node use network bonding technology to aggregate multiple physical network ports into a single virtual interface. The aggregated virtual interface in the first node is referred to as the first virtual interface, and the aggregated virtual interface in the second node is referred to as the second virtual interface. The load balancing method between the first and second nodes specifically applies to load balancing between the first virtual interface of the first node and the second virtual interface of the second node.

[0070] In an exemplary embodiment, in step S320, a balancing test is performed on the first node and the second node through a network test connection to obtain a test result, including: at the first node, a detection packet is periodically sent to the second node through the network test connection; if the traffic at each physical network port associated with the first virtual interface of the first node and the traffic at each physical network port associated with the second virtual interface of the second node increases periodically, it is determined that the load is balanced between the first node and the second node.

[0071] In a specific implementation, a flow counter can be set at each physical network port associated with the first virtual interface of the first node and each physical network port associated with the second virtual interface of the second node. When performing a balancing test, the first node periodically sends a detection packet from the first virtual interface to the second virtual interface of the second node through the network test connection. If the flow counters at each physical network port associated with the first virtual interface of the first node and each physical network port associated with the second virtual interface of the second node increase periodically, similar to Figure 1 The situation in (b) of the figure indicates that the load is balanced between the first node and the second node. On the contrary, if some of the physical network ports associated with the first virtual interface of the first node and the physical network ports associated with the second virtual interface of the second node have no traffic and some have large traffic, similar to Figure 1 In the cases of (b) and (c) in FIG, it is determined that the load is unbalanced between the first node and the second node.

[0072] For example, assume that both the first and second nodes are virtual interfaces formed by aggregating two physical network ports. Two network test connections are established between the first and second nodes. If the traffic counters on both network ports of each node periodically increase, the point-to-point traffic between the first and second nodes is balanced. Otherwise, the point-to-point traffic between the first and second nodes is unbalanced.

[0073] In this embodiment, detection packets are periodically sent from the first node to the second node through a network test connection, and whether the load is balanced between the first node and the second node is determined based on the traffic conditions at each physical network port associated with the first virtual interface of the first node and each physical network port associated with the second virtual interface of the second node. This implements a load balancing test between the first node and the second node, so as to determine whether the service network connection between the first node and the second node needs to be replaced based on the test results.

[0074] In an exemplary embodiment, determining the current pending balancing task of the first node in step S310 includes: selecting the current pending balancing task from a balancing task list corresponding to the first node; each balancing task in the balancing task list corresponds to a different second node.

[0075] Specifically, the first node can communicate with any node other than the first node, thereby establishing a balancing task with any node other than the first node, thereby obtaining a balancing task list corresponding to the first node. The first node can select the balancing task to be processed each time from the balancing task list. In some embodiments, when generating a balancing task between the first node and other nodes, the timestamp of the balancing task generation can be recorded simultaneously, and a mapping relationship can be established between the balancing task, the timestamp, and the node identifier of the corresponding second node, and the balancing task is stored in the balancing task list. When selecting a balancing task from the balancing task list, the balancing task can be selected according to the timestamp (for example, from early to late). The balancing task with the earlier generation time has a higher priority and is processed earlier.

[0076] In one embodiment, when the balancing task between the first node and the second node is completed, including the balancing test result between the first node and the second node is load balancing, or the service network connection between the first node and the second node has been replaced with the target network test connection, that is, when the load balancing between the first node and the second node has been determined, the balancing task between the first node and the second node can be deleted from the balancing task list of the first node.

[0077] In this embodiment, by establishing a balancing task list for the first node and selecting a balancing task to be processed from the balancing task list each time, it is possible to ensure that the balancing tasks of the first node are processed in an orderly manner.

[0078] In an exemplary embodiment, the method further includes: when the second node is busy or the service network connection between the first node and the second node has been replaced by a target network test connection, exiting the current pending balancing task and determining the traversal of other balancing tasks in the balancing task list; if there are balancing tasks that have not been traversed in the balancing task list, selecting the next balancing task as the new pending balancing task and returning to the step of determining the second node corresponding to the balancing task.

[0079] In a specific implementation, a second node being busy indicates that the second node is currently in a balancing task, i.e., performing a balancing test with other nodes and is unable to perform a balancing test with the first node. If the second node is busy, or if the balancing task between the first and second nodes has been completed, and the service network connection between the first and second nodes is already load-balanced (e.g., the service network connection between the first and second nodes has been replaced with a target network test connection, or the service network connection is already load-balanced), in either case, the first node can exit the current balancing task with the second node and select the next pending balancing task from the task balancing list. Specifically, the process can first determine the traversal status of other balancing tasks in the balancing task list. If there are any untraversed balancing tasks in the balancing task list, the next balancing task is selected from the untraversed balancing tasks as the new pending balancing task. The process then returns to step S310, determines the second node corresponding to the newly selected balancing task, detects the current status of the second node, and then performs a balancing test. This process repeats in this manner to achieve load balancing between the first node and the other nodes, ensuring that the first node and the other nodes are load-balanced.

[0080] In this embodiment, when the second node is busy or the service network connection between the first node and the second node has been replaced by the target network test connection, the current pending balancing task is exited and the next balancing task is selected from the balancing task list of the first node for processing to avoid waiting for the second node for too long, which may affect the balancing tasks of the first node and other nodes.

[0081] In an exemplary embodiment, the method further includes: if all balancing tasks in the balancing task list have been traversed, setting the state of the first node to an idle state; monitoring the length of time the first node is in the idle state, and if the length of time exceeds a threshold, entering the next round of balancing task traversal process.

[0082] In a specific implementation, if all balancing tasks in the balancing task list have been traversed, it indicates that the first node currently has no balancing tasks to process. At this time, the state of the first node can be set to idle, so that it can passively wait for balancing tests initiated by other nodes. At the same time, the length of time the first node is in the idle state can be monitored, and a threshold can be set. The length of time the first node is in the idle state can be compared with the threshold. When it is monitored that the length of time the first node is in the idle state exceeds the threshold, that is, the first node has been in the idle state for too long, a timeout event is triggered, and the next round of balancing task traversal is entered. Whether there are any balancing tasks that have not been traversed in the balancing task list of the first node, and then processing them.

[0083] In this embodiment, if all the balancing tasks in the balancing task list have been traversed, the state of the first node is set to idle state, and the length of time the first node is in the idle state is monitored. If the length of time exceeds the threshold, the next round of balancing task traversal process is entered, thereby avoiding the first node being in the idle state for too long.

[0084] refer to Figure 4 , is a schematic diagram of a specific flow chart of a point-to-point load balancing method in another embodiment, comprising the following steps:

[0085] S1, the first node selects the balancing task.

[0086] Specifically, each time the first node establishes a service network connection with another node, it simultaneously generates a balancing task and stores it in a balancing task list.

[0087] S2: Determine whether the second node corresponding to the balancing task is in an idle state.

[0088] Scenario 1: The second node is idle:

[0089] S3: Configure a network test connection between the first node and the second node, set the test priority to be lower than the priority of the service network connection, and perform a balancing test.

[0090] S4: If the test result is load balancing, the original business network connection is replaced with the current network test connection, or not replaced, and the process goes to step S6.

[0091] S5. If the test result is load imbalance, a new network test connection is established and the balancing test is performed again until a load-balanced network test connection is obtained. The original business network connection is replaced with the load-balanced network test connection, and step S6 is entered.

[0092] Scenario 2: The second node is busy:

[0093] S6, exit the current balancing task and determine whether the traversal of the balancing task list is complete.

[0094] S7: If the traversal is complete, the first node is set to an idle state, waiting for the passive balancing task. At the same time, the duration of the first node being in the idle state is monitored. When the duration exceeds a threshold, a timeout event is triggered, and the next round of traversal of the balancing task list begins.

[0095] S8: If the traversal is not completed and there are balancing tasks that have not been executed in this round, then go to step S1, select the next executable balancing task, and go to step S2.

[0096] This method provides a balancing process design between two nodes. One node acts as the initiator of balancing tasks and periodically attempts to execute them. This process design reduces implementation complexity and ensures that all balancing tasks are executed. Furthermore, in an enhanced Ethernet aggregation network, low-priority traffic balancing is used for testing, achieving point-to-point network traffic balancing without impacting service traffic.

[0097] To more clearly illustrate the point-to-point load balancing method proposed in the embodiment of this application, the following will be described with reference to the specific examples in the accompanying drawings. This embodiment is described using the first node as a client and the second node as a server as an example. The bonding aggregation of the client and the server is to aggregate two physical network ports into a virtual interface.

[0098] refer to Figure 5 , is a schematic diagram of an online point-to-point traffic balancing strategy according to an embodiment. The point-to-point balancing strategy in a single balancing process is described below. The process is as follows:

[0099] (1) When a business network connection is requested to be established between the client and the server, a dual-channel business network connection (such as a TCP connection) is created and a balancing task is established at the same time.

[0100] (2) If the server is busy, exit the balancing task.

[0101] (3) If the server is in idle state, the client randomly selects the source port number and destination port number to establish two network test connections.

[0102] The business network connection has a higher priority than the network test connection. The network test connection priority must be reserved for balancing strategies and not occupied by other applications on the server side.

[0103] (3) Perform a balancing test through two network test connections, specifically the client periodically sends a detection data packet (detection packet) to the server.

[0104] (4) If the corresponding traffic counters on the two network ports of the client and the server increase periodically, it means that the data is balanced in the entire end-to-end link. The information of this pair of network test connections can be used for business data connections. The information of the network test connection can be saved and the original business network connection can be replaced on the application side, or it can be not replaced.

[0105] (5) If the traffic counters on the two network ports of the client and the server do not increase periodically and there is an imbalance, two new network test connections are established and the balancing test is performed again until the traffic is balanced. The information of the balanced network test connection is saved and the original business network connection is replaced on the application side to complete the balancing task between the client and the server.

[0106] (6) The client node attempts to process the next balancing task. The server node returns to the idle state and waits for the next passive traffic balancing task.

[0107] This implementation is to achieve Bonding traffic balancing between nodes in an enhanced Ethernet environment without interfering with the original business traffic. This method enables the traffic of the Bonding network port to be fully utilized on the entire link. In order not to affect the business, this application uses idle and low-priority test channels for test traffic. The traffic counters of each network port are then checked on both the client and the server. When both network ports of the client and the server can detect periodic receiving and sending traffic, the corresponding test connection information is saved and the original data connection is replaced at the appropriate time to achieve point-to-point traffic balancing.

[0108] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0109] Based on the same inventive concept, embodiments of the present application also provide a point-to-point load balancing device for implementing the point-to-point load balancing method described above. The solution provided by this device is similar to the solution described in the method described above. Therefore, the specific limitations of the one or more point-to-point load balancing device embodiments provided below can be found in the limitations of the point-to-point load balancing method described above and will not be repeated here.

[0110] In an exemplary embodiment, Figure 6 As shown, a point-to-point load balancing device is provided, which is set at a first node in an enhanced Ethernet network, and the device includes:

[0111] A node determination module 610 is configured to determine a balancing task currently to be processed by a first node and a second node corresponding to the balancing task; a balancing task between the first node and the second node is generated when a service network connection between the first node and the second node is established;

[0112] A balancing test module 620 is configured to configure a network test connection between the first node and the second node when the second node is in an idle state, perform a balancing test on the first node and the second node through the network test connection, and obtain a test result; the service network connection has a higher priority than the network test connection;

[0113] A result processing module 630 is configured to establish a new network test connection between the first node and the second node if the test result indicates load imbalance, and perform a balancing test again until a target network test connection with a load-balanced test result is obtained;

[0114] The connection replacement module 640 is configured to replace the service network connection between the first node and the second node with a target network test connection.

[0115] In one embodiment, the balancing test module 620 is further configured to randomly select a source port number and a destination port number; and establish a network test connection between the first node and the second node according to the source port number and the destination port number.

[0116] In one embodiment, the first node and the second node both aggregate multiple physical network ports into a virtual interface through network aggregation technology, and the load balancing method is applied to the load balancing between the first virtual interface of the first node and the second virtual interface of the second node; the balancing test module 620 is also used to periodically send detection packets to the second node through the network test connection at the first node; if the traffic at each physical network port associated with the first virtual interface of the first node and the traffic at each physical network port associated with the second virtual interface of the second node both increase periodically, it is determined that the load is balanced between the first node and the second node.

[0117] In one embodiment, the node determination module 610 is further configured to select a currently pending balancing task from a balancing task list corresponding to the first node; each balancing task in the balancing task list corresponds to a different second node.

[0118] In one embodiment, the balancing test module 620 is further used to exit the current pending balancing task and determine the traversal status of other balancing tasks in the balancing task list when the second node is busy or the service network connection between the first node and the second node has been replaced by the target network test connection; if there are balancing tasks that have not been traversed in the balancing task list, the next balancing task is selected as the new pending balancing task, and the step of returning to determine the second node corresponding to the balancing task is returned.

[0119] In one embodiment, the balancing test module 620 is also used to set the state of the first node to an idle state if all the balancing tasks in the balancing task list have been traversed; monitor the length of time the first node is in the idle state, and if the length of time exceeds a threshold, enter the next round of balancing task traversal process.

[0120] Each module in the above-mentioned peer-to-peer load balancing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0121] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a point-to-point load balancing method is implemented.

[0122] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0123] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

[0124] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0125] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0126] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0127] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0128] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0129] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A point-to-point load balancing method, characterized in that: Applied to a first node in an enhanced Ethernet network, the method comprises: determining a balancing task currently to be processed by the first node and a second node corresponding to the balancing task; the balancing task between the first node and the second node is generated when a service network connection between the first node and the second node is established; When the second node is in an idle state, configuring a network test connection between the first node and the second node, performing a balancing test on the first node and the second node through the network test connection, and obtaining a test result; the service network connection has a higher priority than the network test connection; If the test result is load imbalance, a new network test connection is established between the first node and the second node, and a balancing test is performed again until a target network test connection with a load balanced test result is obtained; The service network connection between the first node and the second node is replaced with the target network test connection.

2. The method according to claim 1, characterized in that The configuring a network test connection between the first node and the second node includes: Randomly select the source port number and destination port number; A network test connection is established between the first node and the second node according to the source port number and the destination port number.

3. The method according to claim 1, characterized in that The first node and the second node both aggregate multiple physical network ports into a virtual interface through network aggregation technology, and the load balancing method is applied to load balancing between the first virtual interface of the first node and the second virtual interface of the second node; The performing a balancing test on the first node and the second node through the network test connection to obtain a test result includes: At the first node, periodically sending a probe packet to the second node through the network test connection; If traffic at each physical network port associated with the first virtual interface of the first node and traffic at each physical network port associated with the second virtual interface of the second node increases periodically, it is determined that the first node and the second node are load balanced.

4. The method according to claim 1, wherein The determining of the balancing task currently to be processed by the first node includes: A current balancing task to be processed is selected from a balancing task list corresponding to the first node; each balancing task in the balancing task list corresponds to a different second node.

5. The method according to claim 4, characterized in that The method further comprises: When the second node is busy or the service network connection between the first node and the second node has been replaced by the target network test connection, exit the current pending balancing task and determine the traversal status of other balancing tasks in the balancing task list; If there is an untraversed balancing task in the balancing task list, the next balancing task is selected as a new balancing task to be processed, and the process returns to the step of determining the second node corresponding to the balancing task.

6. The method according to claim 5, characterized in that The method further comprises: If all balancing tasks in the balancing task list have been traversed and completed, setting the state of the first node to an idle state; Monitor the duration of the idle state of the first node. If the duration exceeds a threshold, enter the next round of balancing task traversal process.

7. A point-to-point load balancing device, characterized in that: A first node is provided in an enhanced Ethernet network, the device comprising: a node determination module, configured to determine a balancing task currently to be processed by the first node and a second node corresponding to the balancing task; the balancing task between the first node and the second node is generated when a service network connection between the first node and the second node is established; a balancing test module, configured to, when the second node is in an idle state, configure a network test connection between the first node and the second node, perform a balancing test on the first node and the second node through the network test connection, and obtain a test result; the service network connection has a higher priority than the network test connection; A result processing module is configured to establish a new network test connection between the first node and the second node if the test result is load imbalance, and perform a balancing test again until a target network test connection with a load balanced test result is obtained; A connection replacement module is configured to replace the service network connection between the first node and the second node with the target network test connection.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Priority-based load balancing algorithm in hybrid network

    CN105049368A

  • Method and system for automatically testing load balance under UDP

    CN112134733A

  • Load balancing test method of switch, electronic equipment, medium and product

    CN118740771A

  • Network link testing

    US10181912B1

  • Detection of Load Balancing Across Network Paths in a Communication Network

    US20140258524A1