A network load balancing method, device, apparatus and storage medium

CN119030928BActive Publication Date: 2026-10-20TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310596994.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-24
Publication Date
2026-10-20
Estimated Expiration
2043-05-24

AI Technical Summary

Technical Problem

如此,基于ECMP哈希算法的随机性,网络设备可以实现各数据流在多个路径中的负载均衡,有效提高业务吞吐量、网络可用性,以及数据传输效率,但这种方式在数据流较少的情况下,极易出现数据流在多路径中分配不均的现象,且这种方式存在哈希极化问题,也会出现负载不均衡的现象

Benefits of technology

[0042]本申请实施例提供的一种网络负载均衡方法、装置、计算机设备和存储介质,适用于负载均衡系统,本申请中适用于负载均衡系统的网络拓扑结构中包含多个节点,节点之间进行数据传输时,一般会根据五元组进行路由,五元组中包含源IP、目的IP、源端口、目的端口和使用的数据传输协议标识,在一次数据传输过程中,选中用于进行数据传输的传输路径可以称为目标传输路径。目标传输路径,涉及网络拓扑结构中源节点、至少一个中间节点,以及接收并处理数据包的目标节点,其中的两个节点之间的路径为目标子路径(如,两个中间节点之间、源节点与中间节点之间、中间节点与目标节点之间),至少一个目标子路径串联,形成目标传输路径。数据传输过程中,源节点生成数据包中的五元组后,可以根据五元组选择数据包的目标传输路径,其中,源节点在根据五元组选择目标传输路径时,一般会进行初步负载均衡,使得源节点中各传输路径的资源利用情况相当。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119030928B_ABST
    Figure CN119030928B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a network load balancing method, device, equipment and storage medium, relates to the network technical field, is suitable for a load balancing system, and comprises the following steps: determining a target transmission path and a target path identifier based on five tuples in a source node data packet, the target transmission path is connected with the source node and the target node respectively, contains at least one intermediate node, and is formed by a plurality of target sub-paths in series; data packets are sent to the target node through at least one intermediate node based on the target transmission path; wherein each intermediate node performs the following operations: based on the target data conversion result of the target path identifier, in combination with the first mapping record preset for the corresponding one intermediate node, the target sub-path index is determined, each sub-path is the path between one intermediate node and the corresponding next hop node; based on the target sub-path, data packets are sent to the next hop node, so as to perform network load balancing and improve network resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network technology, and in particular to a network load balancing method, apparatus, device and storage medium. Background Technology

[0002] Load balancing refers to the process by which network devices distribute the workload (tasks) across multiple operating units. These operating units can be lower-level network devices such as servers supporting the File Transfer Protocol (FTP), web servers, switches, core enterprise application servers, and other primary task servers, thereby collaboratively completing the tasks.

[0003] In related technologies, load balancing for Virtual Private Cloud (VPN) networks involves configuring an Equal Cost Multi-path (ECMP) hash algorithm with randomization in the VPN network's network devices. The network devices use ECMP hashing to randomly and evenly distribute data flows across multiple paths to send them to lower-layer network devices. Here, a path is the data transmission route between the network device and the lower-layer network device. Based on the randomness of the ECMP hashing algorithm, the network devices can achieve load balancing across multiple paths for data flows, effectively improving service throughput, network availability, and data transmission efficiency. However, this method is prone to uneven distribution of data flows across multiple paths when data flows are few, and it also suffers from hash polarization, which can lead to load imbalance.

[0004] For example, when data flow is low, if a network device has four paths (paths 1, 2, 3, and 4), the network device might allocate all data flow to path 1, causing path 1 to be overloaded, while the transmission resources in paths 2, 3, and 4 remain idle. This leads to a decrease in service quality and low resource utilization. Another example is... Figure 1As shown, in hash polarization, if the first-level network device uses the ECMP hash algorithm to determine the path for data streams 1-6, sending data streams 1, 2, and 3 to the second-level network device 1, and sending data streams 4, 5, and 6 to the second-level network device 2, and the second-level network device 1 uses the same ECMP hash algorithm to determine the path for data streams 1-3, sending data streams 1, 2, and 3 to the third-level network device 1, and the second-level network device 2 uses the same ECMP hash algorithm to determine the path for data streams 4-6, sending data streams 4, 5, and 6 to the third-level network device 2, it can be seen that the load balancing method based on the ECMP hash algorithm has failed in the lower-level network devices. The links from the second-level network device 1 to the third-level network device 2, and from the second-level network device 2 to the third-level network device 1, are idle, which will also lead to a decrease in service quality and low resource utilization.

[0005] Therefore, there is an urgent need to redesign a network load balancing method and overcome the above-mentioned shortcomings. Summary of the Invention

[0006] This application provides a network load balancing method, apparatus, device, and storage medium for performing network load balancing, improving service quality, and increasing network resource utilization.

[0007] In a first aspect, embodiments of this application provide a network load balancing method, applicable to load balancing systems, the method comprising:

[0008] Based on the 5-tuple in the data packet generated by the source node, the target transmission path and its target path identifier of the data packet are determined. The target transmission path connects the source node and the target node respectively, contains at least one intermediate node, and is formed by concatenating multiple target sub-paths.

[0009] Based on the target transmission path, the data packet is sent to the target node through at least one intermediate node; wherein, during the transmission process, each intermediate node performs the following operations:

[0010] Based on the target data transformation result of the target path identifier, and combined with the first mapping record corresponding to an intermediate node, the target sub-path index associated with the target data transformation result is determined. The first mapping record includes: at least one data transformation result associated with each sub-path index, and each sub-path is the path between the intermediate node and the corresponding next-hop node.

[0011] Based on the target subpath corresponding to the target subpath index, the data packet is sent to the next hop node.

[0012] Secondly, embodiments of this application provide a network load balancing device, applicable to load balancing systems, the device comprising:

[0013] The first processing unit is used to determine the target transmission path and its target path identifier of the data packet based on the five-tuple in the data packet generated by the source node. The target transmission path connects the source node and the target node respectively, contains at least one intermediate node, and is formed by multiple target sub-paths concatenated.

[0014] The second processing unit is configured to send the data packet to the target node through the at least one intermediate node based on the target transmission path; wherein, during the transmission process, each intermediate node performs the following operations:

[0015] The path selection unit is used to determine the target sub-path index associated with the target data conversion result based on the target data conversion result of the target path identifier and in combination with the first mapping record corresponding to an intermediate node. The first mapping record includes: at least one data conversion result associated with each sub-path index, and each sub-path is the path between the intermediate node and the corresponding next-hop node.

[0016] The transceiver unit is used to send the data packet to the next-hop node based on the target sub-path corresponding to the target sub-path index.

[0017] Optionally, the network topology includes the one intermediate node and other nodes, wherein the other nodes are nodes that are at the same network distance from the one intermediate node to the source node, and the one intermediate node and the other nodes are provided with a preset conversion method;

[0018] The path selection unit is also used for,

[0019] Based on the preset conversion method, each path identifier in the source node is converted into data to obtain the data conversion result of each path identifier.

[0020] The data transformation results are evenly distributed to each sub-path index and each other sub-path index, where the other sub-paths are the paths between other nodes and their corresponding next-hop nodes;

[0021] The association between each sub-path index and at least one assigned data transformation result, as well as the association between each other sub-path index and at least one assigned data transformation result, are stored in the first mapping record;

[0022] Set the first mapping record to the intermediate node and the other nodes.

[0023] Optional, also includes:

[0024] The third processing unit is used to determine the target data operation result of the five-tuple in the data packet based on the target node using a thread selection unit, and to determine the target thread index associated with the target data operation result by combining the preset second mapping record in the target node. The second mapping record includes at least one data operation result associated with each thread index.

[0025] The transceiver unit is further configured to send the data packet to the target processing thread corresponding to the target thread index, so that the target processing thread processes the data packet.

[0026] Optionally, the network topology includes the target node and the receiving node, wherein the receiving node is a node whose network distance from the target node to the source node is the same as that from the source node, and the target node and the receiving node are configured with a preset calculation method;

[0027] The third processing unit is also used for,

[0028] Based on the preset calculation method, each quintuple in the network topology is transformed to obtain the data calculation result of each quintuple.

[0029] The results of the data operations are evenly distributed to each thread index and each receiving thread index, where the receiving thread is the processing thread in the receiving node;

[0030] The association between each thread index and the result of at least one allocated data operation, and the association between each receiving thread index and the result of at least one allocated data operation, are stored in the second mapping record.

[0031] The second mapping record is set in the target node and the receiving node.

[0032] Optionally, the first processing unit is specifically used for,

[0033] Based on the quintuple in the data packet generated by the source node, a preset transformation method is used to obtain the target data transformation result corresponding to the quintuple. Based on the target transmission path index corresponding to the target data transformation result, the target path identifier associated with the target transmission path is determined. There are multiple transmission paths between the source node and the target node, and the transmission path index of each of the multiple transmission paths is associated with at least one path identifier.

[0034] Optionally, the first processing unit is specifically used for,

[0035] Based on the routing record, the target transmission path index corresponding to the target data transformation result is obtained. Each transmission path index in the routing record is repeated multiple times in a preset order, and each transmission path index with a new sort has its own sort number, which is the data transformation result.

[0036] Optionally, the first processing unit is further configured to, if a node in a transmission path fails, determine the fault transmission path index of the faulty node's faulty transmission path, and replace the faulty transmission path index in the routing record with another transmission path index.

[0037] Optionally, the preset conversion method is an XOR hash function, and the XOR hash function and hash seed of the intermediate node are the same as those of the other nodes.

[0038] Thirdly, an embodiment of this application provides a computer device including a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs any of the network load balancing methods described in the first aspect above.

[0039] Fourthly, embodiments of this application provide a computer-readable storage medium comprising a computer program, wherein when the computer program is run on a computer device, the computer program is used to cause the computer device to perform any of the network load balancing methods described in the first aspect above.

[0040] Fifthly, an embodiment of this application provides a computer program product, the computer program product including a computer program stored in a computer-readable storage medium; when a processor of a computer device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the computer device to execute any of the network load balancing methods in the first aspect described above.

[0041] The beneficial effects of this application are as follows:

[0042] This application provides a network load balancing method, apparatus, computer equipment, and storage medium applicable to load balancing systems. The network topology of the load balancing system in this application includes multiple nodes. When data transmission occurs between nodes, routing is generally performed based on a 5-tuple. The 5-tuple includes the source IP, destination IP, source port, destination port, and the data transmission protocol identifier used. During a data transmission process, the selected transmission path for data transmission can be called the target transmission path. The target transmission path involves the source node, at least one intermediate node, and the target node that receives and processes the data packet in the network topology. The path between two nodes is a target sub-path (e.g., between two intermediate nodes, between the source node and an intermediate node, or between an intermediate node and the target node). At least one target sub-path is concatenated to form the target transmission path. During data transmission, after the source node generates the 5-tuple in the data packet, it can select the target transmission path based on the 5-tuple. When selecting the target transmission path based on the 5-tuple, the source node generally performs preliminary load balancing to ensure that the resource utilization of each transmission path within the source node is relatively equal.

[0043] Subsequently, each intermediate node involved in the target transmission path, upon receiving the data packet, performs data transformation based on the target path identifier of the target transmission path to obtain the target data transformation result. Based on this result, it determines the target sub-path index associated with the target data transformation result from the first mapping record. Then, based on the target sub-path corresponding to the target sub-path index, it sends the data packet to the next-hop node until the data packet is transmitted to the target node. In this way, each intermediate node corresponding to the target sub-path obtains the target sub-path under the determined target path identifier, ensuring that the data packet accurately and sequentially passes through each target sub-path of the target transmission path. This guarantees routing consistency and effectively prevents the uneven distribution of data flow across multiple paths caused by the ECMP hash algorithm used in related technologies, especially when data flow is limited, as well as the load imbalance caused by hash polarization.

[0044] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0046] Figure 1 A schematic diagram of a data flow routing method in the related technology provided in the embodiments of this application;

[0047] Figure 2 A simplified schematic diagram of a network topology provided in this application embodiment;

[0048] Figure 3 A simplified schematic diagram of a data center network topology with a three-layer network design provided for embodiments of this application;

[0049] Figure 4 An optional schematic diagram illustrating an application scenario provided in this application embodiment;

[0050] Figure 5 An optional schematic diagram illustrating an application scenario provided in this application embodiment;

[0051] Figure 6 An optional schematic diagram illustrating an application scenario provided in this application embodiment;

[0052] Figure 7 An optional schematic diagram illustrating another application scenario provided by an embodiment of this application;

[0053] Figure 8 A flowchart illustrating a network load balancing method provided in an embodiment of this application;

[0054] Figure 9 This application provides a schematic diagram of the structure of a data packet according to an embodiment of the present application.

[0055] Figure 10 This application provides a schematic diagram of the structure of a data packet according to an embodiment of the present application.

[0056] Figure 11 This is a schematic diagram of the structure of another data packet provided in an embodiment of this application;

[0057] Figure 12 A schematic diagram of the packet header structure of data packets in each transmission path of the same data transmission tunnel provided in an embodiment of this application;

[0058] Figure 13 A flowchart illustrating a data transmission method provided in an embodiment of this application;

[0059] Figure 14 A flowchart illustrating a network load balancing method provided in an embodiment of this application;

[0060] Figure 15 A schematic diagram illustrating a transmission path planning method provided in an embodiment of this application;

[0061] Figure 16 A schematic diagram of a transmission path provided in an embodiment of this application;

[0062] Figure 17 This is a schematic diagram of a data flow routing method provided in an embodiment of this application;

[0063] Figure 18 This application provides a schematic diagram of a data flow routing method when a sending node fails.

[0064] Figure 19 A schematic diagram of data flow transmission in a current faulty transmission path provided for an embodiment of this application;

[0065] Figure 20 A schematic diagram of data flow transmission for a fault transmission path provided in an embodiment of this application;

[0066] Figure 21 A schematic diagram illustrating the relationship between sub-paths and transmission paths in an intermediate node, provided as an embodiment of this application;

[0067] Figure 22 This application provides a schematic diagram illustrating the configuration of an intermediate node and other nodes in an embodiment.

[0068] Figure 23 A flowchart illustrating a data packet processing method provided in an embodiment of this application;

[0069] Figure 24 A schematic diagram of network traffic allocation to a target node provided in an embodiment of this application;

[0070] Figure 25 A schematic diagram of network traffic allocation to a target node provided in an embodiment of this application;

[0071] Figure 26 This is a schematic diagram of the configuration in a receiving node provided in an embodiment of this application;

[0072] Figure 27 This application provides a schematic diagram of source port number allocation in an embodiment.

[0073] Figure 28 This is a schematic diagram of a network load balancing method provided in an embodiment of this application;

[0074] Figure 29This application provides a schematic diagram of a network load balancing application in a server.

[0075] Figure 30 A schematic diagram of a network load balancing device provided in an embodiment of this application;

[0076] Figure 31 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application;

[0077] Figure 32 This is a schematic diagram of the hardware structure of another computer device that applies an embodiment of this application. Detailed Implementation

[0078] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0079] It is understood that the following specific embodiments of this application involve data packets, quintuples, and other related data. When the various embodiments of this application are applied to specific products or technologies, relevant licenses or consents are required, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, when relevant data is needed, relevant volunteers can be recruited and agreements authorizing their data can be signed, thereby enabling the use of this volunteer data for implementation; alternatively, implementation can be carried out within an authorized organization, using data from internal members to implement the following implementation methods for making relevant recommendations to internal members; or, the relevant data used in the specific implementation may be simulated data, such as simulated data generated in a virtual scene.

[0080] To facilitate understanding of the technical solutions provided in the embodiments of this application, some key terms used in the embodiments of this application will be explained below:

[0081] Network topology refers to the physical layout of various devices interconnected using transmission media. It refers to the specific physical (real) or logical (virtual) arrangement of the members constituting the network. It describes the physical layout of computers and other devices connected by transmission media, representing the geometric shape formed during the interconnection process. It shows the network configuration of network servers and workstations and their connections. Network topologies can be classified by shape, including star, ring, bus, tree, bus / star, and mesh topologies. For example, a star topology connects each node to a central node, presenting a radial arrangement, with the central node controlling the communication of the entire network. A bus-type computer network topology primarily connects surrounding nodes through a high-speed backbone cable. Two networks can be said to have the same network topology if their connection structures are identical, even though their internal physical wiring and distances between nodes may differ. Figure 2 The diagram shown is a simplified schematic of a network topology provided in an embodiment of this application.

[0082] Source and Destination Nodes: Based on network topology, in a transport network, service transmission also has a starting point and an ending point, simply termed "Source" and "Sink" in standard language, corresponding to source nodes and destination nodes. In one example, such as... Figure 2 As shown, if host A sends a data packet to host B, then host A is the source node and host B is the destination node.

[0083] Intermediate node: Based on network topology, in a transport network, an "intermediate station" between the starting and ending points of a service transmission. Based on the above example, such as... Figure 2 As shown, if host A sends a data packet to host B through nodes 3 and 2, then switches 3 and 2 are intermediate nodes.

[0084] Next-hop node: Based on the network topology, in a transport network, it is the node following the service delivery route. If a router is not directly connected to the destination network, it will have a neighboring router (next-hop node) that provides the next-hop route to forward the data to the destination (target node). Based on the above example, as... Figure 2 As shown, the next-hop node of host A is switch 3, the next-hop node of switch 3 is switch 2, and the next-hop node of switch 2 is host B.

[0085] Network distance: Based on the network topology, the minimum number of edges required to connect two nodes in an interconnected network. Based on the example above, such as... Figure 2 As shown, the network distance between host A and host B is 3, the network distance between switch 3 and host B is 2, and the network distance between switch 1 and host C is 2.

[0086] OSI Model: Open Systems Interconnection Reference Model (OSI), or simply OSI model, is a conceptual model proposed by the International Organization for Standardization (ISO). It is a standard framework that attempts to enable various computers to interconnect as a network worldwide. It includes the physical layer, data link layer, transport layer, session layer, presentation layer, and application layer.

[0087] Transport protocol: refers to the protocol used when sending data packets, such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).

[0088] Transmission Control Protocol (TCP): A connection-oriented, reliable, byte-stream-based transport layer communication protocol defined by IETF RFC 793[1]. It is designed to adapt to a layered protocol hierarchy that supports multiple network applications. Pairs of processes in a host computer connected to different but interconnected computer communication networks rely on TCP for reliable communication services. TCP assumes that it can obtain simple, potentially unreliable datagram services from lower-level protocols. In principle, TCP should be able to operate over a variety of communication systems, from hardwired connections to packet-switched or circuit-switched networks.

[0089] User Datagram Protocol (UDP): A connectionless transport protocol supported by the Internet Protocol version of the Internet. UDP provides applications with a way to send encapsulated IP packets without establishing a connection. RFC 768 describes UDP. The Internet's transport layer has two main protocols that complement each other. UDP is connectionless, giving applications the ability to send data packets and allowing them to architect their own protocols at the layers they need. TCP is connection-oriented, and this protocol does almost everything.

[0090] A 5-tuple is a telecommunications term that typically refers to a set of five values: source IP address, source port, destination IP address, destination port, and transport layer protocol. For example, 192.168.1.1, 10000, TCP, 121.14.88.76, and 80 constitute a 5-tuple. This means that a terminal with IP address 192.168.1.1 connects to a terminal with IP address 121.14.88.76 on port 80 via port 10000 using the TCP protocol. The 5-tuple distinguishes different sessions, and each corresponding session is unique.

[0091] Source Port: This field occupies the first 16 bits of the UDP header and typically contains the UDP port used by the program in the source node sending the datagram. The program in the destination node receiving the datagram uses the value of this field as the target address for sending the response. This field is optional; the program in the source node sending the datagram is not required to include its port number in this field. If the program in the source node sending the datagram does not include its port number, this field should be set to all bits of 0. If this field does not contain a valid port address, the program in the destination node receiving the datagram cannot send a response.

[0092] Source IP address: refers to the IP address of the source node that sent the data packet, used to identify the source of the data packet.

[0093] Destination IP address: refers to the IP address of the target node receiving the data packet, used to determine the destination of the data packet.

[0094] Destination port: The UDP port used by the program in the target node to receive data packets.

[0095] Source port number: refers to the port number used by the source node that sends the data packet, which is used to identify which application in the source node sent the data packet from.

[0096] Destination port number: refers to the port number used by the target node receiving the data packet, which is used to identify which application in the target node should handle the data packet.

[0097] Target transmission path: The path used to transmit data packets between the source node and the target node. Based on the example above, such as... Figure 2 As shown, the target transmission path is host A → switch 3 → switch 2 → host B.

[0098] Data transmission tunnel: A data transmission tunnel is determined by the source IP of the source node and the destination IP of the destination node. A data transmission tunnel can contain multiple transmission paths. Based on the above example, such as... Figure 2As shown, the data transmission tunnel determined by the source IP of host A and the destination IP of host B contains multiple transmission paths, such as: Host A → Switch 3 → Switch 2 → Host B; Host A → Switch 3 → Switch 4 → Host B; Host A → Switch 1 → Switch 4 → Host B; Host A → Switch 1 → Switch 2 → Host B.

[0099] Virtual eXtensible Local Area Network (VXLAN) is a network virtualization technology that improves scalability during large-scale cloud deployments and is an extension of VLANs. VXLAN is a tunneling technology that establishes Layer 2 Ethernet tunnels on top of Layer 3 networks, enabling cross-regional Layer 2 interconnection and extending Layer 2 networks through Layer 3. It overcomes the portability limitations of VMS (Virtual Memory System) by encapsulating traffic and extending it to a Layer 3 gateway, allowing it to access servers on external IP subnets. The main principle is to introduce a UDP-formatted outer tunnel as the data link layer, encapsulating the original Ethernet packets within UDP packets. The original Layer 2 data frames are encapsulated with a VXLAN header into a single UDP packet, while the original datagram content is transmitted as the tunnel payload. Because the outer layer uses UDP as the transmission medium, the payload data can be easily transmitted between Layer 2 and Layer 3 networks.

[0100] Layer 2 tunneling (Generic Routing Encapsulation, GRE) is an IP encapsulation protocol that allows one protocol within a network to be encapsulated within another protocol. It's a network tunneling technology used to establish network tunnels where one end sends data and the other end receives and encapsulates it in a different protocol. It can establish tunnels between different types of networks, allowing data packets to be sent from one network to another without using application-layer protocols. This enables data from one network to be sent to another through a network tunnel. GRE Layer 2 tunneling specifically refers to using the GRE protocol to establish a Layer 2 tunnel between two independent networks, allowing them to exchange data. The GRE Layer 2 tunneling protocol can be used to establish tunnels between different networks or within the same network. It can also be used to implement Virtual Private Networks (VPNs), multi-layer routing, and other network applications.

[0101] A three-layer network design includes: core layer switches, aggregation layer switches, and access layer switches, plus a layer of servers. The access layer switches and their connected servers together form a rack. The access layer switches, all their upstream aggregation layer switches, and all their downstream servers together form a pod. For example... Figure 3 The diagram shown is a simplified illustration of a three-layer network topology for a data center provided in this application. It assumes that in this three-layer network design, the core layer has 8 core switches (C0-C7), the aggregation layer has 16 switches (S0-S15), the access layer has 16 switches (L0-L15), and L0-L15 are connected to 16 servers (H0-H15). Access switches L0 and L1, along with their connected servers H0 and H1, form a rack (Rack0). All devices within the first large dashed box form a network module (Pod0). It should be noted that this diagram is only for clearly illustrating the architecture of the three-layer network design. In a real three-layer network data center, there can be more core layer switches, aggregation layer switches, access layer switches, and servers. A Pod can contain more servers and access layer switches, and a Rack can contain more servers, access layer switches, and aggregation layer switches. To increase communication bandwidth and connection reliability between servers, servers typically use two links to connect to two access layer switches (a server's network interface card has two ports, each connected to one of the two switches).

[0102] Core Layer: The core layer is the high-speed switching backbone of the network, playing a crucial role in the connectivity of the entire network. The core layer should possess the following characteristics: reliability, efficiency, redundancy, fault tolerance, manageability, adaptability, and low latency. High-bandwidth gigabit or higher switches should be used in the core layer because its importance is paramount as the network's central hub. Dual-machine redundancy with hot backup is essential for core layer devices; load balancing can also be used to improve network performance.

[0103] Aggregation Layer: The aggregation layer acts as an intermediary between the network access layer and the core layer. It aggregates workstations before they connect to the core layer, reducing the load on core layer devices. The aggregation layer has various functions, including policy enforcement, security, workgroup access, routing between Virtual LANs (VLANs), and source or destination address filtering. Switches supporting Layer 3 switching technology and VLANs should be selected for the aggregation layer to achieve network isolation and segmentation.

[0104] Access Layer: The access layer provides workstation access to the local network segment. Reducing the number of workstations on the same network segment within the access layer enables the provision of high-speed bandwidth to workgroups. The access layer can utilize standard switches that do not support VLANs and Layer 3 switching technologies.

[0105] A network interface card (NIC) is a piece of computer hardware designed to allow computers to communicate on a computer network. Because it has a MAC address, it falls between Layer 1 and Layer 2 of the OSI model. It allows users to connect to each other via cable or wirelessly. Each NIC has a unique 48-bit serial number called a MAC address, which is written into a ROM on the card. Every computer on the network must have a unique MAC address. No two NICs manufactured have the same address. This is because the Institute of Electrical and Electronics Engineers (IEEE) is responsible for assigning unique MAC addresses to NIC vendors.

[0106] Index: In relational databases, an index is a separate, physical storage structure that sorts the values ​​of one or more columns in a database table. It's a collection of values ​​from one or more columns in a table and a list of logical pointers to the physical identifiers of the data pages containing these values. It functions similarly to a book's index, allowing you to quickly find the desired content by referring to page numbers. An index provides pointers to data values ​​stored in specified columns of a table, and these pointers are then sorted according to a specified sort order. The database uses the index to find a specific value and then follows the pointers to find the row containing that value. This allows SQL statements corresponding to the table to execute faster, enabling quick access to specific information within the database table.

[0107] A pointer is essentially a memory address. A pointer variable is a variable used to store a memory address. Under the same CPU architecture, different types of pointer variables occupy the same amount of storage space, while variables storing data occupy different amounts of storage space depending on the data type. With pointers, you can manipulate not only the data itself but also the address of the variable storing the data. A pointer describes the location of data in memory, indicating the relative distance of an entity occupying storage space from the beginning of that space. In C / C++, pointers are generally considered pointer variables. The content of a pointer variable stores the starting address of the object it points to. The object it points to can be a variable (pointer variables are also variables), an array, a function, or other entity occupying storage space.

[0108] The technical solutions in this application relate to cloud technology. Cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, transmission, and sharing. Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology applied to cloud computing business models. It can form resource pools, providing flexibility and convenience for on-demand use. The backend services of technical network systems require substantial computing and storage resources, such as those found on video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may eventually possess its own identification mark, requiring transmission to a backend system for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing. Cloud computing technology will become a crucial support for cloud technology.

[0109] Cloud computing refers to the delivery and usage model of IT infrastructure, specifically obtaining necessary resources through a network in an on-demand and easily scalable manner. In a broader sense, cloud computing also refers to the delivery and usage model of services, meaning obtaining necessary services through a network in an on-demand and easily scalable manner. These services can be IT and software-related, internet-related, or other services. Cloud computing is a product of the convergence and development of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. Driven by the development of the internet, real-time data streams, the diversification of connected devices, and the demands of search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. For example, in data stream transmission, cloud computing load balancing technology is applied. Based on load balancing technology, multiple data streams are evenly distributed across various transmission paths, ensuring similar load conditions on each path, improving network resource utilization, and enhancing the quality of service provided.

[0110] The design concept of the embodiments of this application is briefly introduced below:

[0111] Data center network topology is mainly divided into three layers: the core switching layer that interconnects the data center with external operators, the user layer or access layer of the data center network topology, and the aggregation layer that connects the two to achieve data aggregation.

[0112] Currently, data center networks generally use routing methods based on the ECMP hash algorithm for packet routing. Access layer switches and aggregation layer switches in a data center network are equipped with the ECMP hash algorithm, and typically each switch contains multiple outgoing ports, each corresponding to multiple equally long network paths to the same destination IP. When a packet destined for that IP arrives at the switch, the switch uses the ECMP hash algorithm to select one of the multiple outgoing ports to send the packet out. In this way, based on the randomness of the ECMP hash algorithm, the switch can evenly distribute data flows across the outgoing ports, using the respective paths of each outgoing port to distribute the data flows to the appropriate next-hop nodes, effectively improving service throughput and network availability. However, this method is prone to uneven data flow distribution when there are few data flows or few paths, and it also suffers from hash polarization, which can lead to load imbalance.

[0113] For example, when there is little data flow or few paths, if a switch has four outgoing ports numbered 1, 2, 3, and 4, the switch might allocate all data flow to outgoing port 1, causing excessive load on the path corresponding to outgoing port 1, while the resources on the paths corresponding to outgoing ports 2, 3, and 4 remain idle. This leads to a decrease in service quality and low resource utilization. Another example is in hash polarization, such as... Figure 1 As shown above, a data packet transmission path has been exemplified and will not be repeated here. Based on the data packet transmission path in the example above, it can be seen that the load balancing method based on the ECMP hash algorithm has failed in the next hop node (lower-layer network device), resulting in idle link resources, which will also lead to a decrease in service quality and low resource utilization.

[0114] Therefore, embodiments of this application provide a network load balancing method, apparatus, computer equipment, and storage medium, applicable to load balancing systems. The network topology of the load balancing system in this application includes multiple nodes. During a data transmission process, the selected transmission path for data transmission can be called the target transmission path. The target transmission path involves a source node, at least one intermediate node, and a target node that receives and processes data packets in the network topology. The path between two nodes is a target sub-path, and at least one target sub-path is concatenated to form the target transmission path. During data transmission, after the source node generates the 5-tuple in the data packet, it can select the target transmission path based on the 5-tuple. When selecting the target transmission path based on the 5-tuple, the source node generally performs preliminary load balancing to ensure that the resource utilization of each transmission path within the source node is relatively equal.

[0115] Subsequently, each intermediate node involved in the target transmission path, upon receiving the data packet, performs data transformation based on the target path identifier of the target transmission path to obtain the target data transformation result. Based on this result, it determines the target sub-path index associated with the target data transformation result from the first mapping record. Then, based on the target sub-path corresponding to the target sub-path index, it sends the data packet to the next-hop node until the data packet is transmitted to the target node. In this way, each intermediate node corresponding to the target sub-path obtains the target sub-path under the determined target path identifier, ensuring that the data packet accurately and sequentially passes through each target sub-path of the target transmission path. This guarantees routing consistency and effectively prevents the uneven distribution of data flow across multiple paths caused by the ECMP hash algorithm used in related technologies, especially when data flow is limited, as well as the load imbalance caused by hash polarization.

[0116] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.

[0117] like Figure 4 The diagram shown is an application scenario illustration of an embodiment of this application, applicable to a load balancing system. The application scenario diagram includes multiple servers 410, access layer switches 420, aggregation layer switches 430, and core layer switches 440.

[0118] It should be noted that the specific number of servers 410, access layer switches 420, aggregation layer switches 430, and core layer switches 440 in this application scenario is not limited and can be configured as needed. The transmission paths between upper-layer network devices and lower-layer network devices (e.g., servers and access layer switches, access layer switches and aggregation layer switches, aggregation layer switches and core layer switches) can also be configured as needed. Figure 5 As shown, one path from the server to the access layer switch in the left dashed box is closed, indicated by "×". Similarly, one path from the access layer switch to the aggregation layer switch in the left dashed box is closed, also indicated by "×". Additionally, Figure 4 The network topology hierarchy (multiple servers, access layer switches, aggregation layer switches, and core layer switches) shown in the application scenario is only one embodiment of this application and does not limit the implementation of the solution in this application. For example, a user access switch may also be included between the multiple servers 410 and the access layer switch 420. Figure 6As shown in the diagram, the application scenario includes multiple servers 610, access layer switches 620, aggregation layer switches 630, core layer switches 640, and user access switches 650.

[0119] Among them, the above Figure 4 , Figure 5 , Figure 6 The source node can be a server running relevant business systems, capable of autonomously generating and sending data packets. For example, if the server cluster where the source node resides is a server cluster providing account management services, then the server cluster where the target node resides can be a server cluster providing relevant payment services. In this case, the source node can generate a ledger reconciliation request at a set time and send it to the target node, enabling the target node to perform ledger reconciliation processing. Similarly, if the server cluster where the source node resides is a server cluster providing intelligent transportation services, then the server cluster where the target node resides can be a server cluster providing traffic management services. In this case, the source node can generate a map update request at a set time and send it to the target node, enabling the target node to obtain the map of the corresponding location and return it to the source node. It should be noted that there are no specific restrictions on the relevant business systems running in the source and target nodes; these can be configured as needed. The above examples are only for clearly illustrating this solution.

[0120] The process of the source node sending data packets can also be triggered by the terminal device to generate and send data packets. Figure 4 Taking the application scenario in the example, this application embodiment also provides an application scenario, such as Figure 7 As shown, the application scenario includes multiple servers 710, access layer switches 720, aggregation layer switches 730, core layer switches 740, and terminal devices 750. For example, if the server cluster where the source node resides can be a server cluster providing account management services, then the server cluster where the target node resides can be a server cluster providing related payment services. After receiving a bill retrieval request from terminal device 750, the source node can generate a bill retrieval request and send it to the target node, so that the target node returns the account bill of terminal device 750 to the source node. Similarly, if the server cluster where the source node resides can be a server cluster providing intelligent transportation services, then the server cluster where the target node resides can be a server cluster providing traffic management services. After receiving a map retrieval request from terminal device 750, the source node can generate a map retrieval request and send it to the target node, so that the target node retrieves the map of the corresponding location and returns it to the source node. It should be noted that there are no specific restrictions on the relevant business systems running on the source and target nodes; they can be configured as needed. The above examples are only for clearly illustrating this solution.

[0121] In this application embodiment, the terminal device 750 includes, but is not limited to, mobile phones, tablets, laptops, desktop computers, e-book readers, smart voice interaction devices, smart home appliances, and in-vehicle terminals. The terminal device 750 may have a client installed on it that is related to the business in the source nodes of the multiple servers 710. This client can be software (such as a browser, communication software, etc.), or a webpage, mini-program, etc. The source node is the backend server corresponding to the software, webpage, mini-program, etc., or a backend server specifically used to recommend multimedia information to the client; this application does not impose specific limitations. The source nodes in the multiple servers 710 can be a server cluster or distributed system composed of multiple physical servers. The source nodes in the multiple servers 710 can also be independent physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0122] It should be noted that the network load balancing method in this embodiment can be executed by a computer device. For clarity, this method is described in conjunction with... Figure 4 The application scenario is described below. The computer device can be a source node and a target node in multiple servers 410, or an intermediate node in an access layer switch 420, or an intermediate node in an aggregation layer switch 430, or an intermediate node in a core layer switch 440. That is, the method can be jointly executed by multiple source nodes and target nodes in servers 410, intermediate nodes in access layer switches 420, intermediate nodes in aggregation layer switches 430, and intermediate nodes in core layer switches 440. Therefore, the network load balancing method includes:

[0123] The source node generates a data packet containing a 5-tuple. Based on the 5-tuple, the target transmission path and its identifier are determined. Assuming... Figure 4 The bold lines in the diagram represent different target sub-paths. Multiple target sub-paths are concatenated to form a target transmission path, which connects the source node and the target node, and contains at least one intermediate node.

[0124] After receiving the data packet, the intermediate node in the access layer switch 420 performs data conversion on the target path identifier, obtains the target data conversion result, and determines the target sub-path index associated with the target data conversion result by combining the first mapping record in the corresponding intermediate node. Based on the target sub-path corresponding to the target sub-path index, the data packet is sent to the next hop node (the intermediate node in the aggregation layer switch 430).

[0125] After receiving the data packet, the intermediate node in the aggregation layer switch 430 performs data conversion on the target path identifier, obtains the target data conversion result, and determines the target sub-path index associated with the target data conversion result by combining the first mapping record in the corresponding intermediate node. Based on the target sub-path corresponding to the target sub-path index, the data packet is sent to the next hop node (the intermediate node in the core layer switch 440).

[0126] After receiving the data packet, the intermediate node in the core layer switch 440 performs data conversion on the target path identifier, obtains the target data conversion result, and determines the target sub-path index associated with the target data conversion result by combining the first mapping record in the corresponding intermediate node. Based on the target sub-path corresponding to the target sub-path index, the data packet is sent to the next hop node (target node).

[0127] After receiving a data packet, the target node determines the processing thread for the data packet and processes the data packet based on the processing thread.

[0128] It should be noted that, Figure 4 The examples shown are merely illustrative. In reality, the number of servers, switches, intermediate nodes, and their communication methods are not limited and are not specifically restricted in this embodiment. For instance, generally speaking, the core layer switch 440 has a strong load capacity, and the intermediate nodes of the core layer switch 440 may not use the network load balancing method described in this application. Furthermore, it can be combined with... Figure 5 In application scenarios where network load balancing methods are implemented, the computer device can be a source node and a target node among multiple servers 510, or an intermediate node among access layer switches 520, or an intermediate node among aggregation layer switches 530, or an intermediate node among core layer switches 540. That is, the method can be jointly executed by multiple source and target nodes among servers 510, intermediate nodes among access layer switches 520, intermediate nodes among aggregation layer switches 530, and intermediate nodes among core layer switches 540. It can also be combined with... Figure 6 In the application scenario of executing the network load balancing method, the computer device can be a source node and a target node in multiple servers 610, or an intermediate node in an access layer switch 620, or an intermediate node in an aggregation layer switch 630, or an intermediate node in a core layer switch 640, or an intermediate node in a user access switch 650. That is, the method can be jointly executed by multiple source nodes and target nodes in servers 610, intermediate nodes in access layer switches 620, intermediate nodes in aggregation layer switches 630, intermediate nodes in core layer switches 640, and intermediate nodes in user access switches 650. Figure 7 Application scenarios and Figure 4 and Figure 5 The application scenarios are similar to those in the text. Figure 7 The source node, target node, and intermediate nodes in the diagram are already shown and will not be repeated here. Figure 5 , Figure 6 and Figure 7 The application scenarios in which the network load balancing method in this application is executed are the same as those described above. Figure 4 The similarities are also not elaborated here.

[0129] Furthermore, the network load balancing embodiments of this application can be applied to various scenarios, such as payment services, smart transportation services, related mini-program services in chat software, advertising recommendation services, and online shopping services, which involve data transmission between servers, between terminal devices, or between servers and terminal devices.

[0130] The network load balancing method provided by the exemplary embodiments of this application will be described below with reference to the accompanying drawings and the application scenarios described above. It should be noted that the application scenarios described above are only shown to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way in this respect.

[0131] See Figure 8 The diagram shown is a flowchart of a network load balancing method provided in an embodiment of this application. The example uses a load balancing system as the execution entity. The specific implementation flow of this method is as follows:

[0132] Step 801: Based on the 5-tuple in the data packet generated by the source node, determine the target transmission path of the data packet and its target path identifier. The target transmission path connects the source node and the target node respectively, contains at least one intermediate node, and is formed by multiple target sub-paths concatenated.

[0133] In one embodiment, the source node may carry a destination path identifier when sending a data packet containing a 5-tuple.

[0134] In one embodiment, the source node can employ the OSI model. The application layer, presentation layer, and session layer of the OSI model can generate the original data. Specifically, the application layer generates request-related information according to a set transport protocol (format); the presentation layer encrypts and compresses the request-related information according to specific encryption and compression methods to obtain the encrypted and compressed request as the original data; the session layer establishes, maintains, and releases user-facing connections, and manages and controls the session to ensure reliable transmission of session data; further, the transport layer is used to determine the source port number, destination port number, and data transmission protocol identifier of the original data, and then... The original data packet header information includes a data transmission protocol identifier; the network layer determines the source IP and destination IP of the source node corresponding to the original data, and generates an inner header based on the source port number, destination port number, source IP, destination IP, and data transmission protocol identifier; the data link layer calculates the target path and its target path identifier based on a hash function on the inner five-tuple of the data packet, and generates an outer header based on the target path identifier, destination port number, source IP, destination IP, and data transmission protocol identifier, encapsulates the data packet, and obtains the final data packet, which can be sent to the next-hop node through the data link layer and physical layer. Here, an embodiment of this application provides a schematic diagram of the data packet structure, as shown below. Figure 9 The image shows a data packet that includes an inner header and an outer header.

[0135] In one embodiment, the data packet may also include network service information, such as... Figure 10 The diagram shown is a schematic representation of a data packet structure provided in an embodiment of this application, which includes network service information.

[0136] In one embodiment, this application may use Transmission Control Protocol (TCP) and User Datagram Protocol (UDP) to carry service traffic.

[0137] In one embodiment, this application employs the VxLAN-GPE tunneling protocol. Therefore, this application provides another schematic diagram of a data packet structure, as shown below. Figure 11As shown, the Outer header is used for tunnel encapsulation, the Inner header is included in the original data payload, Outer-Eth represents the outer Ethernet header, Outer-IP represents the outer IP header, Outer UDP represents the outer UDP header, VxLAN-GPE indicates that the tunnel protocol used is VxLAN-GPE, NSH is the tunnel's network service header, Inner-Eth represents the inner Ethernet header (inner header), which is included in the original data, and Inner-IP represents the inner IP header (inner header), which is also included in the original data.

[0138] In one embodiment, the source node contains multiple outgoing ports, each of which can connect to a next-hop node. The next-hop node can also contain multiple outgoing ports, each of which can connect to a next-next-hop node. Therefore, each outgoing port in the source node can correspond to multiple transmission paths, and each of these multiple transmission paths has its own path identifier, such as... Figure 4 As shown in the diagram, assuming there are only two switches in the access layer switch 420, only two switches in the aggregation layer switch 430, and only two switches in the core layer switch 440, there are 8 transmission paths between the source node and the target node. The network card of the source node has two outgoing ports, which are connected to the two switches in the access layer switch 420 respectively. Then, one outgoing port of the source node has 4 transmission paths to the target node. The source node determines the outgoing port in the source node to send the data packet based on the 5-tuple, selects one of the 4 transmission paths in the outgoing port as the target transmission path, and determines the target path identifier of the target transmission path.

[0139] In one embodiment, based on the above embodiments, this application uses a data transmission tunnel with multiple transmission paths to carry all traffic between an IP pair (source IP and destination IP). This application may be part of a Highly Available and Reliable Protocol (HARP). Multiple paths within the same data transmission tunnel have the same four-tuple (source / destination IP, destination port number, and protocol number), but have different source port numbers (path identifiers of the transmission paths), such as... Figure 12 The diagram shown is a schematic representation of the packet header structure of data packets in each transmission path within the same data transmission tunnel, as provided in an embodiment of this application.

[0140] In one embodiment, for the purpose of clearly illustrating this solution, such as Figure 13 The diagram shown is a flowchart illustrating a data transmission method provided in an embodiment of this application, including:

[0141] Step 1301: When the source node sends a data packet, it checks whether there is a data transmission tunnel to the destination IP.

[0142] Step 1302: If it does not exist, create a data transmission tunnel to the destination IP. After creation, configure the path identification information of each transmission path in the data transmission tunnel.

[0143] Step 1303: If it exists, it can be used directly. Based on the five-tuple in the inner header of the data packet, the target path index of the target transmission path is obtained by using a hash algorithm, and then the target path identifier is obtained. Based on the target path identifier and related information such as the destination port, source IP, and destination IP, the outer header of the data packet is obtained, and the data packet is encapsulated.

[0144] Step 1304: Transmit the encapsulated data packet containing the target path identifier to the target node through the target transmission path.

[0145] Step 1305: When the target node receives a data packet, it will first check whether there is a data transmission tunnel to the source IP.

[0146] Step 1306: If it does not exist, create a data transmission tunnel to the source IP. After creation, configure the path identification information of each transmission path in the data transmission tunnel.

[0147] Step 1307: If it exists, it can be used directly to decapsulate the data packet.

[0148] based on Figure 8 The method flow in this application provides a network load balancing method, such as... Figure 14 As shown, in step 801, determining the target transmission path and its target path identifier of the data packet based on the five-tuple generated by the source node includes:

[0149] Step 1401: Based on the quintuple in the data packet generated by the source node, a preset transformation method is used to obtain the target data transformation result corresponding to the quintuple;

[0150] Step 1402: Based on the target transmission path index corresponding to the target data transformation result, determine the target path identifier associated with the target transmission path. There are multiple transmission paths between the source node and the target node, and the transmission path index of each of the multiple transmission paths is associated with at least one path identifier.

[0151] In one embodiment, the preset transformation method is a hash algorithm or a mapping function, etc. There is no restriction on the specific method used for the preset transformation method, and it can be set as needed.

[0152] In one embodiment, the target data transformation result can be associated with a one-to-one correspondence with the target transmission path index. Each 5-tuple has its own corresponding transmission path index. For example, if two 5-tuples differ only in their source IP address and have the same remaining 4-tuples, these two 5-tuples can be associated with different transmission path indices. Alternatively, if any tuple in two 5-tuples differs but the remaining 4-tuples are the same, these two 5-tuples can also be associated with different transmission path indices. That is, different 5-tuples are associated with different transmission paths. In other words, if there are enough transmission paths to ensure that each 5-tuple can be allocated its own dedicated transmission path, then each 5-tuple can have its own dedicated transmission path. If there are insufficient transmission paths, multiple 5-tuples can share a single transmission path. For example, two data packets with the same source IP address, destination IP address, source port, and destination port can each use two transmission paths within the same data transmission tunnel.

[0153] In one embodiment, the source node can use the ECMP hash algorithm to transform the quintuples to obtain the target data transformation result, thus obtaining the target transmission path index and the target transmission path identifier. The ECMP hash algorithm can then randomly transform each quintuple to obtain the target data transformation result and the target path identifier. In this way, each quintuple has a roughly equal probability of being assigned to each transmission path, as described above. Figure 4 In the example, there are a total of 8 transmission paths from the source node to the target node. Based on the ECMP hash algorithm in the source node, each quintuple has an equal probability of being assigned to one of the 8 transmission paths, thus ensuring network load balancing.

[0154] In one embodiment, this application provides a schematic diagram of a transmission path planning method, such as... Figure 15As shown, assuming there are 64 source port numbers, the application scenario of the network load balancing method includes 1 source node, 2 access layer switches (intermediate nodes), and 8 aggregation layer switches (intermediate nodes). Assuming the core layer switches do not use the network load balancing method described in this application, a fully interconnected mode (a network connection form where all nodes are directly connected without traffic relaying through third-party nodes) is adopted. Therefore, there are 16 physical transmission paths from the source node to the access layer switches to the aggregation layer switches. Assuming the source node has 64 logical path identifiers (which can be 64 source port numbers, which will be used to describe path identifiers later), the 16 physical transmission paths are treated as 16 network packets. The 64 source port numbers are allocated to these 16 network packets, resulting in each packet containing 4 source port numbers. This gives each access layer switch 32 source port numbers (logical path identifiers for logical transmission paths) and each aggregation layer switch 4 source port numbers (logical path identifiers for logical transmission paths). The reason why the network load balancing method described in this application is not applied to the core layer switches is that the number of core layer switches is very large, and they have sufficient resources to handle traffic load. Therefore, we can only consider the path from the source node to the access layer switch to the aggregation layer switch. The aforementioned 16 physical transmission paths correspond to 64 logical path identifiers, that is, each physical transmission path corresponds to 4 logical transmission paths - 4 source port numbers. This allows data packets to travel along one physical transmission path from the source node to the access layer switch to the aggregation layer switch, but they can be distributed at the aggregation layer switch to the core switch based on 4 different source port numbers, further balancing the load. This simpler approach improves the network load balancing capability. Figure 16 As shown in the bolded transmission path, when data packets sent from the source node reach the aggregation layer switch, because this transmission path has four different source port numbers, the outer header of the data packets can carry different source port numbers, allowing different core layer switches to be used for transmission to the target node. It should be noted that in this embodiment, the transmission path from the aggregation layer switch to the core layer switch is a divergent process, while the downlink from the core layer switch to the aggregation layer switch to the target node is a convergent process. However, this embodiment does not limit the downlink process from the core layer switch to the aggregation layer switch to the target node; the process from the core layer switch to the aggregation layer switch to the target node can also be a divergent process, meaning the choice can be... Figure 16 Other transmission paths besides the bolded transmission path on the right. Ideally, there are 65535 source port numbers, so each access layer switch can be allocated 32767.5 (source port numbers that cannot be integers can be randomly allocated to one of the two access layer switches), and each access layer switch can be allocated 8191 (the remaining 7 source port numbers can be randomly allocated to any 7 of the 8 aggregation layer switches).

[0155] In one embodiment, based on the above embodiment, the source node uses the ECMP hash algorithm to transform the quintuples to obtain the target data transformation result, and obtains the target transmission path index of the target data transformation result, thereby obtaining the target transmission path and the target path identifier (one of 64 source port numbers). The ECMP hash algorithm can randomly transform each quintuple to obtain the target data transformation result and the target path identifier. In this way, the probability of each quintuple being assigned to one of the 64 source port numbers is basically equal, making the probability of each quintuple being assigned to one of the 64 logical transmission paths equal, thus ensuring network load balancing.

[0156] In one embodiment, based on the above embodiments, the source port number can be used as the target path identifier, and the destination port number, source IP, destination IP, and transport protocol identifier can be used as the outer header of the data packet. Accordingly, different source port numbers identify different transport paths and serve as path identifiers for the transport paths.

[0157] Based on the above Figure 14 The method flow in this application provides a method for obtaining a target transmission path index. In step 1402, the step of obtaining the target transmission path index corresponding to the target data transformation result includes:

[0158] Based on the routing record, the target transmission path index corresponding to the target data transformation result is obtained. Each transmission path index in the routing record is repeated multiple times in a preset order, and each transmission path index with a new sort has its own sort number, which is the data transformation result.

[0159] In one embodiment, such as Figure 17 As shown, assuming there are 4 transmission paths from the source node to the target node, the process is repeated multiple times (4 times) according to the preset order of each transmission path index, resulting in a new sorting of the transmission path indices after multiple repetitions (1-16). The source node performs data transformation on the 5-tuple in the inner header of the data packet using a hash function to obtain the target data transformation result (the new sorting of each transmission path index (1-16)). Based on the routing record, the target transmission path index corresponding to the target data transformation result is obtained. Figure 17 The dashed lines in the diagram represent the correspondence between data streams and transmission path indices, as well as the corresponding transmission paths. Here, by repeatedly recording each transmission path index in a preset order in the routing record and obtaining a new sorting of the repeatedly recorded transmission path indices, and assigning the sorting number as the data transformation result, the randomness of the hash function can be enhanced, further improving load balancing capabilities.

[0160] Based on the above-described method for obtaining the target transmission path index, this application embodiment also provides a method for processing the transmission path index when a node fails, including: if a node in a transmission path fails, determining the fault transmission path index of the faulty node's faulty transmission path, and replacing the faulty transmission path index in the routing record with another transmission path index.

[0161] In one embodiment, based on Figure 17 If a node in transmission path 1 fails, transmission path index 1 in the path record will be replaced with another transmission path index, such as... Figure 18 As shown, replacing transmission path index 1 with transmission path index 2 can solve the current problem caused by the faulty node. The faulty node randomly selects transmission paths for its data stream, resulting in data packets from the same data stream arriving at the target node out of order, thus preventing the data stream from being processed normally. Figure 19 The diagram shown is a schematic representation of the data flow transmission in a current faulty transmission path, as provided in an embodiment of this application. Figure 20 The diagram shown illustrates the data flow transmission of a fault transmission path according to an embodiment of this application. Figure 19 As shown in the current transmission diagram of the faulty transmission path, transmission paths 2, 3, and 4 each send a portion of the data packets from data stream 1. Due to inconsistent performance of different transmission paths, or performance jitter, the target node receives data packets in the disordered order from data stream 1, making it impossible to obtain information from data stream 1. Figure 20 As can be seen from the data stream transmission diagram of the fault transmission path in this application embodiment, this application retains the order information of each data packet in data stream 1, so that the order of each data packet in data stream 1 received by the target node remains unchanged, and the information in data stream 1 can be obtained.

[0162] Step 802: Based on the target transmission path, send the data packet to the target node through the at least one intermediate node; wherein, during the transmission process, each intermediate node performs the following operations:

[0163] Step 8021: Based on the target data conversion result of the target path identifier, and combined with the first mapping record corresponding to an intermediate node, determine the target sub-path index associated with the target data conversion result. The first mapping record includes: at least one data conversion result associated with each sub-path index, and each sub-path is the path between the intermediate node and the corresponding next-hop node.

[0164] In one embodiment, the 5-tuple of the data packet determines the data transmission tunnel, which contains multiple transmission paths that, when the source node sends the data packet, pass through at least one intermediate node to the target node, for example... Figure 4 The bolded lines in the target transmission path show intermediate nodes—access layer switches and aggregation layer switches. When a source node transmits a data packet to an intermediate node via at least one target sub-path, it selects the target sub-path from the intermediate node's sub-paths based on the target path identifier of the data packet. Each sub-path identifier of an intermediate node can correspond to multiple path identifiers, such as... Figure 21 The diagram illustrates the relationship between sub-paths and transmission paths in an intermediate node according to an embodiment of this application. If there are 64 transmission paths from the source node to the target node, and the source node has 2 next-hop nodes (access layer switches), and each access layer switch has 8 next-hop nodes (aggregation layer switches), then the intermediate node is an access layer switch, corresponding to 8 next-hop nodes (aggregation layer switches). Therefore, the intermediate node-access switch has 8 sub-paths in the data transmission tunnel between the source and target nodes, and each sub-path corresponds to 4 path identifiers. Sub-path 1 - path identifier (4, 8, 7, 9), Sub-path 2 - path identifier (20, 64, 42, 50), Sub-path 3 - path identifier (13, 45, 21, 46), Sub-path 4 - path identifier (15, 17, 23, 56), Sub-path 5 - path identifier (31, 35, 48, 58), Sub-path 6 - path identifier (29, 27, 60, 14), Sub-path 7 - path identifier (39, 38, 37, 34), Sub-path 8 - path identifier (11, 12, 14, 16). Assuming the target path identifier is 15, the target sub-path from the intermediate node (access layer switch) to the next-hop node is sub-path 4. Therefore, the first mapping record can contain at least one data transformation result associated with each sub-path index of the intermediate node.

[0165] In one embodiment, the intermediate node contains a first mapping record. This first mapping record may contain data transmission tunnels corresponding to multiple receiving nodes for each sending node, sub-paths of each transmission path within the corresponding data transmission tunnel in the intermediate node, and path identifiers corresponding to the sub-paths. For example, assuming there are 5 sending nodes and 5 receiving nodes, there are 25 data transmission tunnels. Assuming each data transmission tunnel has 64 transmission paths, there are a total of 25 * 64 transmission paths. If 1000 transmission paths pass through the intermediate node, the first mapping record of the intermediate node may contain 1000 data conversion results. These 1000 data conversion results are distributed in the corresponding sub-paths from the intermediate node to each next-hop node, and the association between the sub-path index and the multiple data conversion results of the sub-path is recorded in the first mapping record.

[0166] Step 8022: Based on the target sub-path corresponding to the target sub-path index, send the data packet to the next hop node.

[0167] In one embodiment, the next-hop node can be the target node or the next-hop intermediate node of the current intermediate node. It should be noted that the number of intermediate nodes included in the target transmission path of this application is not specifically limited.

[0168] In one embodiment, an intermediate node may contain multiple outgoing ports, each with a corresponding sub-path leading to the next-hop node, and the target sub-path index may also be the target outgoing port index of the intermediate node.

[0169] In the above method, the network topology of the load balancing system contains multiple nodes. During a data transmission process, the selected transmission path for data transmission can be called the target transmission path. The target transmission path involves the source node, at least one intermediate node, and the target node that receives and processes the data packets in the network topology. The path between two nodes is the target sub-path, and at least one target sub-path is concatenated to form the target transmission path.

[0170] During data transmission, after the source node generates the 5-tuple in the data packet, it can select the target transmission path of the data packet based on the 5-tuple. The source node can pre-obtain the transmission path between the source IP and the destination IP, and further assign a path identifier to each transmission path. Then, based on the data packet 5-tuple, the corresponding target path identifier is obtained, and the data packet header is generated based on the target path identifier. The first mapping record of the intermediate node already contains the association between the target path identifier and the target sub-path index. The intermediate node selects the corresponding target sub-path in the target transmission path based on the target path identifier in the data packet header, so as to control the transmission path of the data packet to follow the target transmission path determined by the source node. The load balancing system enables the source node, intermediate node and target node to cooperate to ensure the consistency of routing and balance the network traffic load. It effectively prevents the uneven distribution of data flow in multiple paths caused by the ECMP hash algorithm used by network devices in related technologies, when the data flow is small, as well as the load imbalance caused by hash polarization.

[0171] Based on the above Figure 8 , Figure 13 and Figure 14 The present application provides a first mapping record generation method, wherein the network topology includes an intermediate node and other nodes, the other nodes being nodes whose network distance from the source node is the same as that from the intermediate node, and the intermediate node and the other nodes are provided with a preset conversion method;

[0172] In step 8021, before determining the target sub-path index associated with the target data transformation result, the method further includes:

[0173] Step 1: Based on the preset conversion method, perform data conversion on each path identifier in the source node to obtain the data conversion result of each path identifier;

[0174] Step 2: Distribute the data transformation results evenly to each sub-path index and each other sub-path index. The other sub-paths are the paths between other nodes and their corresponding next-hop nodes.

[0175] Step 3: Store the association between each sub-path index and at least one assigned data transformation result, and the association between each other sub-path index and at least one assigned data transformation result, into the first mapping record;

[0176] Step 4: Set the first mapping record to the intermediate node and the other nodes.

[0177] In one embodiment, the preset conversion method can be a mapping function or a hash algorithm, and there is no limitation on the specific settings of the preset conversion method.

[0178] In one embodiment, the network topology includes an intermediate node and other nodes, where the other nodes are nodes that are equidistant from the source node from the intermediate node, such as... Figure 4 In the context of access layer switches, the intermediate access layer switches and other access layer switches are examples. Figure 4 The aggregation layer switches in the middle are the aggregation layer switches and other aggregation layer switches.

[0179] In one embodiment, based on a preset conversion method, the source node's path identifiers are input into the preset conversion method to obtain the data conversion results for each path identifier. The association between the path identifiers and the data conversion results is then established. The data conversion results are evenly distributed to the sub-path indices of the intermediate nodes. This is equivalent to evenly distributing the path identifiers in the source node to the sub-paths, and consequently, evenly distributing the data packets of each 5-tuple in the source node to the sub-paths. Thus, the data packets received by the intermediate nodes can be evenly distributed across the sub-paths for transmission, achieving load balancing at the intermediate nodes. In other words, after initial load balancing is performed at the source node when determining the target transmission path based on the 5-tuple, further load balancing is performed at the intermediate nodes after setting the first mapping record (evenly distributing path identifiers to each sub-path). This ensures load balancing across all interconnected intermediate nodes in the target transmission path, maximizing network traffic load balancing, effectively improving resource utilization, and enhancing service quality.

[0180] In one embodiment, the data transformation results are evenly distributed to the sub-path indices of the intermediate nodes, that is, the path identifiers are evenly distributed to the sub-paths of the intermediate nodes, that is, the quintuples are evenly distributed to the sub-paths of the intermediate nodes, which can further balance the network traffic load.

[0181] Based on the above methods, this application provides a preset conversion method, wherein the preset conversion method is an XOR hash function, and the XOR hash function and hash seed of the intermediate node are the same as those of the other nodes.

[0182] In one embodiment, a first mapping record is uniformly set in intermediate nodes and other nodes that are equidistant from the source node. Therefore, the first mapping record only needs to be generated once. That is, based on a preset conversion method (the same in intermediate nodes and other nodes), the data conversion results of each path identifier can be obtained. These data conversion results are then assigned to the sub-paths of the intermediate nodes and to the other sub-path indices of the other nodes. A first mapping record is obtained that records the association between each sub-path index and at least one assigned data conversion result, as well as the association between each other sub-path index and at least one assigned data conversion result. This eliminates the need to generate separate first mapping records for intermediate nodes and other nodes, improving the efficiency of mapping record generation.

[0183] In one embodiment, such as Figure 22As shown, in this application, intermediate nodes and other nodes at the same network distance from the source node all use a routing hash method based on XOR and use the same hash seed (hash key). In addition, the conversion method set in nodes at different network distances from the source node can be the same as or different from the preset conversion method of the intermediate node. No specific restrictions are imposed here.

[0184] Based on the above Figure 8 The method flow in this application provides a data packet processing method, such as... Figure 23 As shown, in step 8022, after sending the data packet to the target node through the at least one intermediate node, the method further includes:

[0185] Step 2301: Based on the target node, determine the target data operation result of the five-tuple in the data packet, and combine it with the preset second mapping record in the target node to determine the target thread index associated with the target data operation result. The second mapping record includes: at least one data operation result associated with each thread index.

[0186] Step 2302: Send the data packet to the target processing thread corresponding to the target thread index, so that the target processing thread can process the data packet.

[0187] In one embodiment, the target node contains multiple processing threads, such as Figure 24 The diagram illustrates a target node network traffic allocation method according to an embodiment of this application. The network interface card (NIC) in the target node receives data packets, calculates the target data result based on the five-tuple in the data packet, and combines this with a second mapping record to determine the target thread index associated with the target data calculation result. The NIC then sends the data packet to the corresponding target processing thread for processing by the application's virtual machine. In other words, the NIC in the target node distributes the received network traffic across multiple CPU threads for load balancing (ReceiverSide Scaling, RSS). Therefore, after receiving a data packet, the NIC of the target node needs to determine which processing thread's queue to allocate the data packet to, so that the processing thread can process the data packet.

[0188] In one embodiment, the 5-tuple of the data packet obtained by the target node is the 5-tuple in the inner header of the data packet. A preset calculation method, such as a hash algorithm or mapping method, can be used to obtain the target data calculation result of the 5-tuple, such as... Figure 25 The diagram shown is a schematic diagram of network traffic allocation for a target node according to an embodiment of this application.

[0189] In one embodiment, the 5-tuple of the data packet obtained by the target node can also be the 5-tuple in the outer header of the data packet. A preset calculation method, such as an XOR hash algorithm or a mapping method, can be used to obtain the target data calculation result of the 5-tuple, such as... Figure 26 The diagram shown is a configuration diagram of a receiving node provided in an embodiment of this application.

[0190] Based on the above Figure 23 The method flow in this application provides a second mapping record generation method. The network topology includes the target node and the receiving node. The receiving node is a node with the same network distance from the target node to the source node. The target node and the receiving node are equipped with preset calculation methods.

[0191] In step 2301, before determining the target data operation result of the quintuple in the data packet, the method further includes:

[0192] Step 1: Based on the preset calculation method, perform data transformation on each quintuple existing in the network topology to obtain the data calculation result of each quintuple;

[0193] Step 2: Distribute the results of the data operations evenly to each thread index and each receiving thread index, where the receiving thread is the processing thread in the receiving node;

[0194] Step 3: Store the association between each thread index and the result of at least one allocated data operation, and the association between each receiving thread index and the result of at least one allocated data operation, into the second mapping record;

[0195] Step 4: Set the second mapping record in the target node and the receiving node.

[0196] In one embodiment, the preset operation method can be a mapping function or a hash algorithm, and there is no limitation on the specific settings of the preset conversion method.

[0197] In one embodiment, the network topology includes a target node and a receiving node, where the receiving node is a node whose network distance from the source node is the same as that from the target node, such as... Figure 4 The target node and other servers (receiving nodes) among multiple servers.

[0198] In one embodiment, based on a preset calculation method, the source node and path identifiers are input into the preset calculation method to obtain the data calculation results for each path identifier. The association between the path identifier and the data calculation results is then obtained. The data calculation results are evenly distributed to the thread indices of the target node. This is equivalent to evenly distributing the path identifiers in the source node to each processing thread, and consequently, evenly distributing the data packets of each five-tuple in the source node to each processing thread. Thus, the data packets received by the target node can be evenly distributed to each processing thread for processing, achieving load balancing among the processing threads of the target node. In other words, after initial load balancing is performed at the source node when determining the target transmission path based on the five-tuple, further load balancing is performed after setting the first mapping record (evenly distributing path identifiers to each sub-path) at the intermediate nodes. Load balancing is performed at each interconnected intermediate node in the target transmission path, and finally, load balancing is performed again among the processing threads of the target node. This even distribution of thread resources maximizes network traffic load balancing, effectively improving resource utilization and service quality.

[0199] Based on the above embodiments, in one embodiment, the preset operation method is an XOR hash function, and the XOR hash function and hash seed are the same in the target node and the receiving node.

[0200] In one embodiment, a second mapping record is uniformly set in both the target node and the receiving node, which are at the same network distance from the source node. Therefore, the second mapping record only needs to be generated once. That is, based on a preset calculation method (the same in both the target node and the receiving node), the data calculation results for each path identifier can be obtained. These results are then distributed to the processing threads of the target node and the receiving processing threads of the receiving node. This results in a second mapping record that records the association between each thread index and at least one assigned data calculation result, as well as the association between each receiving thread index and at least one assigned data transformation result. This eliminates the need to generate separate second mapping records for the target node and the receiving node, improving the efficiency of mapping record generation.

[0201] In one embodiment, similar to the hash algorithm in the source node, the target transmission path of the data packet can be obtained based on the 5-tuple in the packet header. Macroscopically, the data streams of the source node can be evenly distributed to each transmission path. Similarly, the hash algorithm in the target node can obtain the target thread index of the data packet based on the 5-tuple in the packet header (the target data operation result of the packet 5-tuple is associated with the target thread index). Macroscopically, the data streams of the target node can be evenly distributed to each processing thread. Thus, in the source node, after initial load balancing is performed when determining the target transmission path based on the 5-tuple, further load balancing is performed after setting the first mapping record (evenly distributing path identifiers to each sub-path) in the intermediate nodes. Load balancing is performed in each interconnected intermediate node in the target transmission path. Finally, load balancing is performed in each processing thread of the target node, achieving maximum network traffic load balancing, effectively improving resource utilization and service quality. In other words, this application performs load balancing at each node of the data packet, maximizing load balancing.

[0202] In one embodiment, such as Figure 27 As shown, if the source node contains 64 source port numbers (path identifiers for the transmission path), based on Figure 4 In the application scenario described, there are 8 aggregation layer switches, 2 access layer switches, and 32 processing threads in the target node. A greedy algorithm can be used to allocate path identifiers to each switch and processing thread, ensuring that each network packet contains 4 source port numbers, distributed across different RSS packets (processing threads), and each RSS packet contains 2 port numbers.

[0203] include:

[0204] Step 1: Obtain 16 network packets based on the aggregation layer switch and the access layer switch.

[0205] Step 2: Traverse the network groups and denote the current network group as N, where N≤16 and is an integer.

[0206] Step 3: Traverse the source port number of network packet N, and denote the current source port number as P. Then traverse the RSS packets and denote the current RSS packet as R.

[0207] If the following conditions are met, then select P and mark R as used by N;

[0208] (a) The current port number P is in R;

[0209] (b) R is not used by N (the four source ports selected by N must be distributed in different RSS packets);

[0210] (c) The number of port numbers selected in N is no greater than 4 (64 / 16).

[0211] (d) The number of port numbers selected in R is no greater than 2 (64 / 32).

[0212] If the number of source port numbers obtained in the above embodiments is less than 64, the conditions b, c, or d above can be relaxed appropriately to perform incremental selection until 64 source port numbers are selected.

[0213] Additionally, for a typical data center network configuration, each pod has 8 aggregation layer switches, each rack has 2 access layer switches, and the number of RSS packet processing threads is 32, 16, 8, 4, etc. For 65,535 source port numbers, each access layer switch has 8,192 source port numbers, each access layer switch has 32,768 source port numbers, and each RSS packet has 2,048 source port numbers. In practice, the selection of source port numbers (path identifiers) is more than sufficient; the above embodiment can basically complete the selection of source port numbers.

[0214] Based on the above methods and their embodiments, this application provides a network load balancing method that only requires load balancing control for the uplink direction (load balancing for each aggregation layer switch) and the downlink direction (load balancing for each access layer switch) of the access layer switches. This is because the route from the aggregation layer switch (uplink) to the peer aggregation layer switch (downlink) is highly deterministic, i.e., as... Figure 3 As shown, a certain aggregation layer switch within the same pod will only reach the same aggregation layer switch in other pods through a set of access layer switches. For example, traffic from S0 to Pod 1 will only reach S4, regardless of which core layer switch it passes through. Meanwhile, load balancing of the aggregation layer switches can be disregarded because there are many core layer switches, and the bottleneck for cross-pod traffic often lies on the aggregation layer switches. Figure 28 As shown, the sending node assigns path identifiers to each transmission path. Based on the five-tuple in the inner header of the data packet, it uses a hash algorithm and routing records to determine the target transmission path index, thus balancing network traffic load across each transmission path. After receiving the data packet, the intermediate node, based on the target path identifier carried in the outer header of the data packet, uses a preset conversion method and a first mapping record to determine the target sub-path index, balancing network traffic load across each sub-path. After receiving the data packet, the target node, based on the five-tuple in the inner header of the data packet, uses a preset calculation method and a second mapping record to balance network traffic load across each processing thread. This network load balancing method can be applied at the data link layer in a server, such as... Figure 29 As shown.

[0215] Based on the same concept, this application provides a network load balancing device 3000, suitable for load balancing systems, such as... Figure 30 As shown, it includes:

[0216] The first processing unit 3010 is used to determine the target transmission path and its target path identifier of the data packet based on the five-tuple in the data packet generated by the source node. The target transmission path connects the source node and the target node respectively, contains at least one intermediate node, and is formed by multiple target sub-paths connected in series.

[0217] The second processing unit 3020 is configured to send the data packet to the target node through the at least one intermediate node based on the target transmission path; wherein, during the transmission process, each intermediate node performs the following operations:

[0218] The path selection unit 3021 is used to determine the target sub-path index associated with the target data conversion result based on the target data conversion result of the target path identifier and in combination with the first mapping record preset for a corresponding intermediate node. The first mapping record includes: at least one data conversion result associated with each sub-path index, and each sub-path is the path between the intermediate node and the corresponding next-hop node.

[0219] The transceiver unit 3022 is used to send the data packet to the next-hop node based on the target sub-path corresponding to the target sub-path index.

[0220] Optionally, the network topology includes the one intermediate node and other nodes, wherein the other nodes are nodes that are at the same network distance from the one intermediate node to the source node, and the one intermediate node and the other nodes are provided with a preset conversion method;

[0221] The path selection unit 3021 is also used for,

[0222] Based on the preset conversion method, each path identifier in the source node is converted into data to obtain the data conversion result of each path identifier.

[0223] The data transformation results are evenly distributed to each sub-path index and each other sub-path index, where the other sub-paths are the paths between other nodes and their corresponding next-hop nodes;

[0224] The association between each sub-path index and at least one assigned data transformation result, as well as the association between each other sub-path index and at least one assigned data transformation result, are stored in the first mapping record;

[0225] Set the first mapping record to the intermediate node and the other nodes.

[0226] Optional, also includes:

[0227] The third processing unit 3030 is used to determine the target data operation result of the five-tuple in the data packet based on the target node, and to determine the target thread index associated with the target data operation result by combining the preset second mapping record in the target node. The second mapping record includes at least one data operation result associated with each thread index.

[0228] The transceiver unit 3022 is further configured to send the data packet to the target processing thread corresponding to the target thread index, so that the target processing thread processes the data packet.

[0229] Optionally, the network topology includes the target node and the receiving node, wherein the receiving node is a node whose network distance from the target node to the source node is the same as that from the source node, and the target node and the receiving node are configured with a preset calculation method;

[0230] The third processing unit 3030 is also used for,

[0231] Based on the preset calculation method, each quintuple in the network topology is transformed to obtain the data calculation result of each quintuple.

[0232] The results of the data operations are evenly distributed to each thread index and each receiving thread index, where the receiving thread is the processing thread in the receiving node;

[0233] The association between each thread index and the result of at least one allocated data operation, and the association between each receiving thread index and the result of at least one allocated data operation, are stored in the second mapping record.

[0234] The second mapping record is set in the target node and the receiving node.

[0235] Optionally, the first processing unit 3010 is specifically used for,

[0236] Based on the quintuple in the data packet generated by the source node, a preset transformation method is used to obtain the target data transformation result corresponding to the quintuple. Based on the target transmission path index corresponding to the target data transformation result, the target path identifier associated with the target transmission path is determined. There are multiple transmission paths between the source node and the target node, and the transmission path index of each of the multiple transmission paths is associated with at least one path identifier.

[0237] Optionally, the first processing unit 3010 is specifically used for,

[0238] Based on the routing record, the target transmission path index corresponding to the target data transformation result is obtained. Each transmission path index in the routing record is repeated multiple times in a preset order, and each transmission path index with a new sort has its own sort number, which is the data transformation result.

[0239] Optionally, the first processing unit 3010 is further configured to, if a node in a transmission path fails, determine the fault transmission path index of the faulty node's faulty transmission path, and replace the faulty transmission path index in the routing record with another transmission path index.

[0240] Optionally, the preset conversion method is an XOR hash function, and the XOR hash function and hash seed of the intermediate node are the same as those of the other nodes.

[0241] Based on the same inventive concept as the above-described method embodiments, this application also provides a computer device. In one embodiment, the computer device may be a server, such as... Figure 4 , Figure 5 , Figure 6 and Figure 7 Servers 410, 510, 610, and 710 are shown. In this embodiment, the structure of the computer device can be as follows: Figure 31 As shown, it includes a memory 3101, a communication module 3103, and one or more processors 3102.

[0242] The memory 3101 is used to store computer programs executed by the processor 3102. The memory 3101 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and programs required to run instant messaging functions, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0243] Memory 3101 may be volatile memory, such as random-access memory (RAM); memory 3101 may also be non-volatile memory, such as read-only memory, flash memory, hard disk drive (HDD), or solid-state drive (SSD); or memory 3101 may be any other medium capable of carrying or storing a desired computer program having the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 3101 may be a combination of the above-described memories.

[0244] Processor 3102 may include one or more central processing units (CPUs) or digital processing units, etc. Processor 3102 is used to implement the above-described network load balancing method when calling computer programs stored in memory 3101.

[0245] The communication module 3103 is used to communicate with terminal devices and other servers.

[0246] This application embodiment does not limit the specific connection medium between the memory 3101, communication module 3103, and processor 3102 described above. This application embodiment... Figure 31 The memory 3101 and the processor 3102 are connected via a bus 3104, and the bus 3104 is in Figure 31 The diagram uses thick lines to describe the connections between other components; these are for illustrative purposes only and should not be considered limiting. The bus 3104 can be divided into address bus, data bus, control bus, etc. For ease of description, Figure 31 It is described using only a thick line, but does not indicate that there is only one bus or one type of bus.

[0247] The memory 3101 stores a computer storage medium, which stores computer-executable instructions for implementing the network load balancing method of this application embodiment. The processor 3102 is used to execute the above-described network load balancing method, such as... Figure 8 or Figure 13 or Figure 14 or Figure 23 As shown.

[0248] In another embodiment, the computer device can also be other computer devices, such as... Figure 7 The terminal device 750 is shown. In this embodiment, the structure of the computer device can be as follows: Figure 32As shown, it includes components such as: communication component 3210, memory 3220, display unit 3230, camera 3240, sensor 3250, audio circuit 3260, Bluetooth module 3270, processor 3280, etc.

[0249] The communication component 3210 is used to communicate with the server. In some embodiments, it may include a Circuit-Based Wireless Fidelity (WiFi) module. WiFi is a short-range wireless transmission technology, and computer devices can use WiFi modules to help users send and receive information.

[0250] The memory 3220 can be used to store software programs and data. The processor 3280 executes various functions of the terminal device 750 and performs data processing by running the software programs or data stored in the memory 3220. The memory 3220 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The memory 3220 stores an operating system that enables the terminal device 750 to run. In this application, the memory 3220 may store the operating system and various application programs, and may also store a computer program that executes the network load balancing method in the embodiments of this application.

[0251] The display unit 3230 can also be used to display information input by the user or information provided to the user, as well as various menus of the terminal device 750, forming a graphical user interface (GUI). Specifically, the display unit 3230 may include a display screen 3232 disposed on the front of the terminal device 750. The display screen 3232 may be configured as a liquid crystal display, a light-emitting diode, or the like. The display unit 3230 can be used to display the network load balancing user interface, etc., as described in this application embodiment.

[0252] The display unit 3230 can also be used to receive input digital or character information and generate signal inputs related to user settings and function control of the terminal device 750. Specifically, the display unit 3230 may include a touch screen 3231 disposed on the front of the terminal device 750, which can collect touch operations of the user on or near it, such as clicking buttons, dragging scroll boxes, etc.

[0253] The touchscreen 3231 can be placed on top of the display screen 3232, or the touchscreen 3231 and the display screen 3232 can be integrated to realize the input and output functions of the terminal device 750. After integration, it can be referred to as a touch display screen. In this application, the display unit 3230 can display the application and the corresponding operation steps.

[0254] Camera 3240 can be used to capture still images, which users can then post comments on via an application. There can be one or multiple cameras 3240. An object is projected onto a photosensitive element through a lens, generating an optical image. This photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to a processor 3280 to be converted into a digital image signal.

[0255] The terminal device may also include at least one sensor 3250, such as an accelerometer 3251, a proximity sensor 3252, a fingerprint sensor 3253, and a temperature sensor 3254. The terminal device may also be equipped with other sensors such as a gyroscope, barometer, hygrometer, thermometer, infrared sensor, light sensor, and motion sensor.

[0256] Audio circuitry 3260, speaker 3261, and microphone 3262 provide an audio interface between the user and terminal device 750. Audio circuitry 3260 converts received audio data into electrical signals, which are then transmitted to speaker 3261, where they are converted into sound signals for output. Terminal device 750 may also be equipped with volume buttons for adjusting the volume of the sound signal. Conversely, microphone 3262 converts collected sound signals into electrical signals, which are then received by audio circuitry 3260, converted back into audio data, and output to communication component 3210 for transmission to, for example, another terminal device 750, or to memory 3220 for further processing.

[0257] The Bluetooth module 3270 is used to interact with other Bluetooth devices that also have a Bluetooth module via the Bluetooth protocol. For example, a terminal device can establish a Bluetooth connection with a wearable computer device (such as a smartwatch) that also has a Bluetooth module through the Bluetooth module 3270, thereby exchanging data.

[0258] The processor 3280 is the control center of the terminal device, connecting various parts of the terminal through various interfaces and lines. It executes software programs stored in the memory 3220 and calls data stored in the memory 3220 to perform various functions and process data of the terminal device. In some embodiments, the processor 3280 may include one or more processing units; the processor 3280 may also integrate an application processor and a baseband processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the baseband processor mainly handles wireless communication. It is understood that the baseband processor may not be integrated into the processor 3280. In this application, the processor 3280 can run the operating system, applications, user interface display and touch response, and the network load balancing method of this embodiment. Furthermore, the processor 3280 is coupled to the display unit 3230.

[0259] In some possible implementations, various aspects of the network load balancing method provided in this application can also be implemented as a program product, comprising a computer program. When the program product is run on a computer device, the computer program causes the computer device to perform the steps of the network load balancing method according to the various exemplary embodiments of this application described above. For example, the computer device can perform actions such as... Figure 8 or Figure 13 or Figure 14 or Figure 23 The steps are shown in the figure.

[0260] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0261] The program product of the embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include a computer program, and may run on a computer device. However, the program product of this application is not limited thereto. In this document, the readable storage medium may be any tangible medium that contains or stores a program that may be used by or in conjunction with a command execution system, apparatus, or device.

[0262] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a readable computer program. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with a command execution system, apparatus, or device.

[0263] Computer programs contained on readable media may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0264] Computer programs for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The computer program can execute entirely on the user's computer device, partially on the user's device, as a standalone software package, partially on the user's computer device and partially on a remote computer device, or entirely on a remote computer device or server. In cases involving remote computer devices, the remote computer device can be connected to the user's computer device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer device (e.g., via the Internet using an Internet service provider).

[0265] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0266] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0267] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.

[0268] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0269] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0270] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0271] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A network load balancing method, characterized in that, Applicable to load balancing systems, the method includes: Based on the 5-tuple in the data packet generated by the source node, the target transmission path and its target path identifier of the data packet are determined. The target transmission path connects the source node and the target node respectively, contains at least one intermediate node, and is formed by concatenating multiple target sub-paths. Based on the target transmission path, the data packet is sent to the target node through at least one intermediate node; wherein, during the transmission process, each intermediate node performs the following operations: Based on the target data transformation result of the target path identifier, and combined with the first mapping record corresponding to an intermediate node, the target sub-path index associated with the target data transformation result is determined. The first mapping record includes: at least one data transformation result associated with each sub-path index, and each sub-path is the path between the intermediate node and the corresponding next-hop node. Based on the target subpath corresponding to the target subpath index, the data packet is sent to the next hop node.

2. The method as described in claim 1, characterized in that, The network topology includes an intermediate node and other nodes, wherein the other nodes are nodes that are equidistant from the source node from the intermediate node, and the intermediate node and the other nodes are equipped with a preset conversion method. Before determining the target sub-path index associated with the target data transformation result, the method further includes: Based on the preset conversion method, each path identifier in the source node is converted into data to obtain the data conversion result of each path identifier. The data transformation results are evenly distributed to each sub-path index and each other sub-path index, where the other sub-paths are the paths between other nodes and their corresponding next-hop nodes; The association between each sub-path index and at least one assigned data transformation result, and the association between each other sub-path index and at least one assigned data transformation result, are stored in the first mapping record; Set the first mapping record to the intermediate node and the other nodes.

3. The method as described in claim 1, characterized in that, After sending the data packet to the target node through the at least one intermediate node, the method further includes: Based on the target node, the target data operation result of the five-tuple in the data packet is determined. Combined with the preset second mapping record in the target node, the target thread index associated with the target data operation result is determined. The second mapping record includes: at least one data operation result associated with each thread index. The data packet is sent to the target processing thread corresponding to the target thread index, so that the target processing thread processes the data packet.

4. The method as described in claim 3, characterized in that, The network topology includes the target node and the receiving node. The receiving node is a node whose network distance from the source node is the same as that from the target node. The target node and the receiving node are equipped with a preset calculation method. Before determining the target data operation result of the five-tuple in the data packet, the method further includes: Based on the preset calculation method, each quintuple in the network topology is transformed to obtain the data calculation result of each quintuple. The results of the data operations are evenly distributed to each thread index and each receiving thread index, where the receiving thread is the processing thread in the receiving node; The association between each thread index and the result of at least one allocated data operation, and the association between each receiving thread index and the result of at least one allocated data operation, are stored in the second mapping record. The second mapping record is set in the target node and the receiving node.

5. The method as described in claim 1, characterized in that, The five-tuple in the data packet generated based on the source node determines the target transmission path and its target path identifier for the data packet, including: Based on the quintuple in the data packet generated by the source node, a preset transformation method is used to obtain the target data transformation result corresponding to the quintuple. Based on the target transmission path index corresponding to the target data transformation result, the target path identifier associated with the target transmission path is determined. There are multiple transmission paths between the source node and the target node, and the transmission path index of each of the multiple transmission paths is associated with at least one path identifier.

6. The method as described in claim 5, characterized in that, The target transmission path index corresponding to the target data transformation result includes: Based on the routing record, the target transmission path index corresponding to the target data transformation result is obtained. Each transmission path index in the routing record is repeated multiple times in a preset order, and each transmission path index with a new sort has its own sort number, which is the data transformation result.

7. The method as described in claim 6, characterized in that, If a node in the transmission path fails, the fault transmission path index of the faulty node is determined, and the fault transmission path index in the routing record is replaced with another transmission path index.

8. The method as described in claim 2, characterized in that, The preset conversion method is an XOR hash function, and the XOR hash function and hash seed of the intermediate node are the same as those of the other nodes.

9. A network load balancing device, characterized in that, Suitable for load balancing systems, the device includes: The first processing unit is used to determine the target transmission path and its target path identifier of the data packet based on the five-tuple in the data packet generated by the source node. The target transmission path connects the source node and the target node respectively, contains at least one intermediate node, and is formed by multiple target sub-paths concatenated. The second processing unit is configured to send the data packet to the target node through the at least one intermediate node based on the target transmission path; wherein, during the transmission process, each intermediate node performs the following operations: The path selection unit is used to determine the target sub-path index associated with the target data conversion result based on the target data conversion result identified by the target path identifier, combined with a first mapping record preset for a corresponding intermediate node. The first mapping record includes: at least one data conversion result associated with each sub-path index, and each sub-path is the path between the intermediate node and the corresponding next-hop node. The transceiver unit is used to send the data packet to the next-hop node based on the target sub-path corresponding to the target sub-path index.

10. The apparatus as claimed in claim 9, characterized in that, The network topology includes an intermediate node and other nodes, wherein the other nodes are nodes that are equidistant from the source node from the intermediate node, and the intermediate node and the other nodes are equipped with a preset conversion method. The path selection unit is also used for, Based on the preset conversion method, each path identifier in the source node is converted into data to obtain the data conversion result of each path identifier. The data transformation results are evenly distributed to each sub-path index and each other sub-path index, where the other sub-paths are the paths between other nodes and their corresponding next-hop nodes; The association between each sub-path index and at least one assigned data transformation result, and the association between each other sub-path index and at least one assigned data transformation result, are stored in the first mapping record; Set the first mapping record to the intermediate node and the other nodes.

11. The apparatus as claimed in claim 9, characterized in that, Also includes: The third processing unit is used to determine the target data operation result of the five-tuple in the data packet based on the target node, and to determine the target thread index associated with the target data operation result by combining the preset second mapping record in the target node. The second mapping record includes at least one data operation result associated with each thread index. The transceiver unit is further configured to send the data packet to the target processing thread corresponding to the target thread index, so that the target processing thread processes the data packet.

12. The apparatus as claimed in claim 11, characterized in that, The network topology includes the target node and the receiving node. The receiving node is a node whose network distance from the source node is the same as that from the target node. The target node and the receiving node are equipped with a preset calculation method. The third processing unit is also used for, Based on the preset calculation method, each quintuple in the network topology is transformed to obtain the data calculation result of each quintuple. The results of the data operations are evenly distributed to each thread index and each receiving thread index, where the receiving thread is the processing thread in the receiving node; The association between each thread index and the result of at least one allocated data operation, and the association between each receiving thread index and the result of at least one allocated data operation, are stored in the second mapping record. The second mapping record is set in the target node and the receiving node.

13. A computer-readable non-volatile storage medium, characterized in that, The computer-readable non-volatile storage medium stores a program that, when run on a computer, causes the computer to perform the method described in any one of claims 1 to 8.

14. A computer device, characterized in that, include: Memory, used to store computer programs; A processor is configured to invoke a computer program stored in the memory and execute the method as described in any one of claims 1 to 8 according to the obtained program.

15. A computer program product, characterized in that, The method includes a computer program stored in a computer-readable storage medium; when a processor of a computer device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the computer device to perform the method as claimed in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Flow equalization method and device

    CN111147381A

  • Load balancing method, device and system

    CN114024969A