Methods, apparatus, media and equipment for generating polymer tree

By constructing a flow network and transforming it into a maximum flow problem, the high complexity of aggregate tree generation in existing technologies is solved, achieving more efficient aggregate tree generation and improving real-time performance and accuracy.

CN119544606BActive Publication Date: 2025-10-31NEW ZIGUANG GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411875782.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-10-31
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

Existing methods for generating aggregate trees have high computational complexity, making it difficult to meet the requirements of real-time dynamic deployment. They are also prone to getting trapped in local optima, resulting in insufficient real-time performance and accuracy of aggregate tree generation.

Method used

By constructing a flow network and generating an aggregation tree using the current remaining capacity of network device nodes, the problem is transformed into a maximum flow problem, reducing resource overhead and improving the real-time performance and accuracy of the generation.

Benefits of technology

It reduces the resource overhead of network device nodes maintaining bitmaps, and the generated aggregation tree can be reused as a multicast tree, reducing network bandwidth and latency, and improving the real-time performance and accuracy of aggregation tree generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544606B_ABST
    Figure CN119544606B_ABST
Patent Text Reader

Abstract

This disclosure relates to a method, apparatus, medium, and device for generating an aggregate tree. The method includes: acquiring network topology information; acquiring the current remaining capacity of each network device node; determining the root node; if a first network device node with a current remaining capacity greater than a first preset threshold is determined among N network device nodes, then constructing a flow network based on the network topology information, the root node, and the current remaining capacity of the first network device node; determining feasible augmenting paths from the source node to the sink node based on the flow network, and determining the maximum flow from the source node to the sink node based on the feasible augmenting paths; and generating an aggregate tree based on the feasible augmenting paths and the root node when the maximum flow is equal to a first value. Through the above technical solution, by constructing directed virtual edges from the first network device node to the sink node, the generation of the aggregate tree can be transformed into solving a maximum flow problem, making it easier to find the optimal solution and improving the real-time performance and accuracy of the aggregate tree generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, medium, and device for generating aggregate trees. Background Technology

[0002] In-Network Computing (INC) is a technology that reduces data transmission latency and improves system efficiency by offloading data aggregation tasks to network devices such as switches and routers. In-Network Computing reduces data transmission overhead between data nodes and is particularly suitable for accelerating distributed machine learning systems.

[0003] In network computing, an aggregation tree is a network topology used to summarize and process data. As the scale of distributed processing systems grows larger, a single network device often cannot support all aggregation tasks. Therefore, multiple network devices can be selected to form an aggregation tree. Data is aggregated layer by layer from the leaf nodes and finally passed to the root node. The tree structure makes the aggregation tasks more distributed and is suitable for large-scale distributed processing systems.

[0004] However, the methods for generating aggregation trees in related technologies are essentially about solving integer programming problems. The computational complexity of finding the global optimal solution is high, making it difficult to meet the requirements of real-time dynamic deployment of aggregation trees. On the other hand, finding the local optimal solution (e.g., through greedy algorithms) can easily lead to not finding a feasible solution. Summary of the Invention

[0005] The purpose of this disclosure is to provide a method, apparatus, medium, and device for generating aggregate trees, which can improve the real-time performance and accuracy of aggregate tree generation.

[0006] To achieve the above objectives, in a first aspect, this disclosure provides a method for generating an aggregation tree, the method comprising:

[0007] Obtain network topology information, wherein the network topology information is used to characterize the network topology of the M data nodes where the data packets to be aggregated are distributed and the N network device nodes used to perform the aggregation operation, where M≥1 and N≥1;

[0008] The current remaining capacity of each of the network device nodes is obtained, and the current remaining capacity is used to characterize the number of data packets that the network device node can currently aggregate;

[0009] Determine the root node, which is one of the N network device nodes;

[0010] If it is determined that there is a first network device node among the N network device nodes whose current remaining capacity is greater than a first preset threshold, then a flow network is constructed based on the network topology information, the root node, and the current remaining capacity of the first network device node. The vertices of the flow network include the source node, the sink node, and the N network device nodes, and the edges of the flow network include directed real edges and directed virtual edges from the first network device node to the sink node.

[0011] Based on the flow network, a feasible augmenting path from the source to the sink is determined, and the maximum flow from the source to the sink is determined according to the feasible augmenting path;

[0012] When the maximum traffic is equal to a first value, an aggregation tree is generated based on the feasible augmenting path and the root node, wherein the first value is the sum of the number of data packets to be aggregated that the M data nodes can send.

[0013] Secondly, this disclosure provides an aggregation number generation apparatus, the apparatus comprising:

[0014] The first acquisition module is used to acquire network topology information, wherein the network topology information is used to characterize the network topology of the M data nodes where the data packets to be aggregated are distributed and the N network device nodes used to perform the aggregation operation, where M≥1 and N≥1;

[0015] The second acquisition module is used to acquire the current remaining capacity of each of the network device nodes, wherein the current remaining capacity is used to characterize the number of data packets that the network device node can currently aggregate;

[0016] The first determining module is used to determine the root node, which is one of the N network device nodes;

[0017] A construction module is configured to construct a flow network based on the network topology information, the root node, and the current remaining capacity of the first network device node if it is determined that there is a first network device node among the N network device nodes whose current remaining capacity is greater than a first preset threshold. The vertices of the flow network include the source node, the sink node, and the N network device nodes, and the edges of the flow network include directed real edges and directed virtual edges from the first network device node to the sink node.

[0018] The second determining module is used to determine, based on the flow network, a feasible augmenting path from the source to the sink, and to determine the maximum flow from the source to the sink based on the feasible augmenting path;

[0019] The aggregation tree generation module is used to generate an aggregation tree based on the feasible augmenting path and the root node when the maximum traffic is equal to a first value, wherein the first value is the sum of the number of data packets to be aggregated that the M data nodes can send.

[0020] Thirdly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aggregation tree generation method provided in the first aspect of this disclosure.

[0021] Fourthly, this disclosure provides an electronic device, comprising:

[0022] A memory on which computer programs are stored;

[0023] A processor is configured to execute the computer program in the memory to implement the steps of the aggregation tree generation method provided in the first aspect of this disclosure.

[0024] Through the above technical solution, if it is determined that among the N network device nodes, there is a first network device node whose current remaining capacity is greater than a first preset threshold, then a flow network is constructed based on the network topology information, the root node, and the current remaining capacity of the first network device node. The vertices of the flow network include the source node, the sink node, and the N network device nodes. The edges of the flow network include directed real edges and directed virtual edges from the first network device node to the sink node. In this way, generating an aggregation tree at the network device node level reduces the resource overhead of maintaining bitmaps for network device nodes. The generated aggregation tree can be reused as a multicast tree, reducing network bandwidth and latency. Furthermore, for the first network device node whose current remaining capacity is greater than the first preset threshold, directed virtual edges can be constructed from the first network device node to the sink node. This allows traffic from the first network device node to flow out through virtual edges, ensuring that the inflow and outflow of traffic from the first network device node are equal. This satisfies the constraints of the maximum flow algorithm, transforming the generation of the aggregation tree into solving a maximum flow problem. This avoids solving complex integer programming problems, makes it easier to find the optimal solution, reduces complexity, and improves the real-time performance and accuracy of aggregation tree generation.

[0025] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0026] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:

[0027] Figure 1 A schematic diagram of a method for generating a composite tree in related technologies is shown.

[0028] Figure 2 This is a flowchart illustrating a method for generating a composite tree according to an exemplary embodiment.

[0029] Figure 3 This is a schematic diagram of a network topology according to an exemplary embodiment.

[0030] Figure 4 This is a flowchart illustrating a method for constructing a stream network according to an exemplary embodiment.

[0031] Figure 5 This is a schematic diagram of a streaming network according to an exemplary embodiment.

[0032] Figure 6 This is a schematic diagram illustrating a flow network and a first augmenting path according to an exemplary embodiment.

[0033] Figure 7 This is a flowchart illustrating a method for determining a feasible augmented path from a source to a sink based on a flow network, according to an exemplary embodiment.

[0034] Figure 8 This is a schematic diagram illustrating a first augmentation path according to an exemplary embodiment.

[0035] Figure 9 This is a schematic diagram illustrating a first augmentation path according to an exemplary embodiment.

[0036] Figure 10 This is a schematic diagram illustrating a first augmentation path according to an exemplary embodiment.

[0037] Figure 11 This is a schematic diagram illustrating a first augmentation path according to an exemplary embodiment.

[0038] Figure 12 This is a schematic diagram illustrating a first augmentation path according to an exemplary embodiment.

[0039] Figure 13 This is a schematic diagram illustrating a first augmentation path according to an exemplary embodiment.

[0040] Figure 14 This is a schematic diagram of a aggregation tree according to an exemplary embodiment.

[0041] Figure 15 This is a block diagram illustrating an exemplary apparatus for generating a composite tree.

[0042] Figure 16 This is a block diagram illustrating an electronic device according to an exemplary embodiment.

[0043] Figure 17This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0044] Figure 1 A schematic diagram of a method for generating a aggregation tree in related technologies is shown, such as... Figure 1 As shown, the left side illustrates the topology. w1, w2, w3, w4, w5, w6, w7, and w8 are data nodes, and s1, s2, s3, s4, s5, s6, and s7 are switch nodes. Data from data nodes w1 and w2 is aggregated at switch node s1, and data from data nodes w3 and w4 is aggregated at switch node s7. The aggregated data from switch node s1 and switch node s7 are finally aggregated at switch node s6, resulting in an aggregation tree as shown. Figure 1 As shown on the right. In related technologies, the method for generating an aggregation tree requires each transmitted data packet to carry a bitmap. The bitmap indicates the task corresponding to that data packet. For example, the bitmaps of the data packets sent by data nodes w1 and w2 in the initial state are [1000000] and [01000000], respectively. Then, the bitmap of the data packet aggregated by switch node s1 is [11000000]. Switch node s1 also stores this bitmap [11000000]. The bitmap is used by the switch to determine which data packets should be sent and to record the aggregation progress. Similarly, the bitmap of the data packet aggregated by switch node s7 is [00110000], and the bitmap of the data packet aggregated by switch node s6 is [11110000]. Therefore, the method for generating an aggregation tree in related technologies aggregates at the data node level. Each transmitted data packet needs to carry a sufficiently large bitmap to represent the aggregation state, resulting in poor scalability. Furthermore, this method in related technologies is essentially solving an integer programming problem, typically using a greedy algorithm to solve the aggregation tree, which cannot guarantee a feasible solution.

[0045] In view of this, the present disclosure provides a method, apparatus, medium and device for generating aggregate trees, which can improve the real-time performance and accuracy of aggregate tree generation.

[0046] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0047] Figure 2 This is a flowchart illustrating a method for generating an aggregate tree according to an exemplary embodiment. This method can be applied to electronic devices with processing capabilities, such as… Figure 2 As shown, the method may include steps 21 to 26.

[0048] In step 21, network topology information is obtained.

[0049] The network topology information characterizes the network topology of the M data nodes where the data packets to be aggregated are distributed and the N network device nodes used to perform the aggregation operation, where M ≥ 1 and N ≥ 1. Data nodes can be, for example, GPUs or CPUs used to perform distributed tasks, where the data packets to be aggregated in the distributed task are distributed across the M data nodes. Network device nodes can be, for example, data forwarding devices such as switch nodes or router nodes, and can be used to perform aggregation operations, such as aggregating multiple data packets into one packet.

[0050] For example, the distributed task can be an inference task based on a Large Language Model (LLM). In one embodiment, the data packet to be aggregated in this disclosure can be, for example, a data packet composed of attention vectors generated during the inference process of the Large Language Model. The Transformer model is currently the core structure of Large Language Models, and its core module is the attention mechanism. The attention vector is a vector generated during the inference process of the Large Language Model based on the attention mechanism. It should be noted that this disclosure does not limit the type of data packet to be aggregated; the data packet composed of attention vectors generated during the inference process of the Large Language Model is an exemplary implementation method.

[0051] Figure 3 This is a schematic diagram illustrating a network topology according to an exemplary embodiment, such as... Figure 3 As shown, Worker1, Worker2, Worker3, Worker4, Worker5, Worker6, Worker7, and Worker8 are data nodes. , , This refers to network device nodes, such as switch nodes. Among them, the network device node... The directly connected data nodes are Worker1, Worker2, and Worker3, and the network device nodes are also connected. The directly connected data nodes are Worker4, Worker5, Worker6, and Worker7, and the network device nodes... The directly connected data nodes are Worker8 and network device nodes. , , They can transfer data to each other. It should be noted that... Figure 3 The network topology shown is for illustrative purposes only. This disclosure does not impose any restrictions on the number of data nodes and network device nodes or the connection methods.

[0052] In step 22, the current remaining capacity of each network device node is obtained.

[0053] The current remaining capacity of a network device node represents the number of data packets that the network device node can currently aggregate, and it also represents the current aggregation capability of the network device node. For example, a network device node... The current remaining capacity is Capacity=4, which is the network device node capacity. Currently, it can aggregate 4 data packets, network device node The current remaining capacity is Capacity=3, which is the network device node capacity. Currently, it can aggregate 3 data packets, network device node The current remaining capacity is Capacity=3, which is the network device node capacity. Currently, it can aggregate 3 data packets.

[0054] In step 23, the root node is determined.

[0055] The root node is one of the N network device nodes. For example, the node with the best network performance among the N network device nodes can be chosen as the root node. Network performance can be measured by data transmission latency and bandwidth utilization; for example, the node with the lowest data transmission latency and the highest bandwidth utilization can be chosen as the node with the best network performance. Alternatively, the node with the strongest data processing capability among the N network device nodes can be chosen as the root node, or the N network device nodes can be chosen as the root node in a certain order. This disclosure does not limit the method of determining the root node. For example, the root node can be... Figure 3 Network device nodes As the root node.

[0056] In step 24, if it is determined that there is a first network device node among the N network device nodes whose current remaining capacity is greater than the first preset threshold, then a flow network is constructed based on the network topology information, the root node, and the current remaining capacity of the first network device node.

[0057] The vertices of the flow network include the source, the sink, and N network device nodes. The edges of the flow network include directed real edges and directed virtual edges from the first network device node to the sink.

[0058] In this disclosure, an aggregation tree is generated at the granularity of network device nodes, eliminating the need for each data node to carry a lengthy bitmap. Furthermore, from the perspective of data broadcasting, the generated aggregation tree can be reused as a multicast tree, and the root node can broadcast the aggregated data packets layer by layer to M data nodes, thereby reducing network bandwidth and latency.

[0059] Furthermore, considering that greedy algorithms in related technologies often fail to find feasible aggregation trees, this disclosure transforms the generation of aggregation trees into solving a maximum flow problem. The maximum flow algorithm model does not constrain the aggregation capability of nodes, but rather constrains that the inflow and outflow of traffic to a node must be equal, meaning there should be no traffic loss in between. For example, the first preset threshold can be determined based on the number of data packets aggregated after the network device performs the aggregation operation. For instance, if a network device can aggregate multiple data packets into one, the first preset threshold could be, for example, 1. (Network device node) , , All nodes whose current remaining capacity is greater than the first preset threshold can be used as the first network device node. For example, Currently, it can aggregate four data packets into one data packet, which is equivalent to a network device node. The inflow is 4, and the outflow is 1. Clearly, the inflow and outflow of a node are not equal. To satisfy the constraints of the maximum flow algorithm modeling, this disclosure constructs a directed virtual edge from the first network device node to the sink for the first network device node whose remaining capacity is greater than a first preset threshold. This allows the flow of the first network device node to flow out through the virtual edge, ensuring that the inflow and outflow of the first network device node are equal. Thus, the constraints of the maximum flow algorithm are satisfied, transforming the generation of the aggregation tree into solving a maximum flow problem. This avoids solving complex integer (or mixed integer) programming problems and is easier to find the optimal solution compared to a greedy algorithm, improving the real-time performance and accuracy of aggregation tree generation.

[0060] In step 25, based on the flow network, feasible augmenting paths from the source to the sink are determined, and the maximum flow from the source to the sink is determined based on the feasible augmenting paths.

[0061] An augmenting path is a path from the source to the sink, where each edge has remaining capacity for traffic to pass through. For example, multiple feasible augmenting paths can be determined based on a flow network, with the maximum traffic being the sum of the capacities of each feasible augmenting path.

[0062] In step 26, if the maximum flow is equal to the first value, an aggregate tree is generated based on the feasible augmenting path and the root node.

[0063] The first value represents the sum of the number of data packets to be aggregated that the M data nodes can send. The number of data packets to be aggregated that a data node can send can refer to the number of data packets to be aggregated that a data node can send to the network device node at one time. For example, each data node can send one data packet to the network device node at one time. Figure 3 The network topology shown has 8 data nodes, and the first value is 8. The maximum traffic is equal to the first value, which means that if an aggregation tree is generated according to the root node and feasible augmenting paths, the maximum traffic that the source node can send can be scheduled. Therefore, an aggregation tree can be generated based on augmenting paths and the root node.

[0064] Through the above technical solution, if it is determined that among the N network device nodes, there is a first network device node whose current remaining capacity is greater than a first preset threshold, then a flow network is constructed based on the network topology information, the root node, and the current remaining capacity of the first network device node. The vertices of the flow network include the source node, the sink node, and the N network device nodes. The edges of the flow network include directed real edges and directed virtual edges from the first network device node to the sink node. In this way, generating an aggregation tree at the network device node level reduces the resource overhead of maintaining bitmaps for network device nodes. The generated aggregation tree can be reused as a multicast tree, reducing network bandwidth and latency. Furthermore, for the first network device node whose current remaining capacity is greater than the first preset threshold, directed virtual edges can be constructed from the first network device node to the sink node. This allows traffic from the first network device node to flow out through virtual edges, ensuring that the inflow and outflow of traffic from the first network device node are equal. This satisfies the constraints of the maximum flow algorithm, transforming the generation of the aggregation tree into solving a maximum flow problem. This avoids solving complex integer programming problems, makes it easier to find the optimal solution, reduces complexity, and improves the real-time performance and accuracy of aggregation tree generation.

[0065] Figure 4 This is a flowchart illustrating a method for constructing a stream network according to an exemplary embodiment, such as... Figure 4 As shown, steps 41 to 47 are included.

[0066] In step 41, the source and sink nodes are constructed.

[0067] In step 42, the first directed real edge from the source node to each data node is constructed.

[0068] The initial capacity of the first directed real edge is the number of data packets to be aggregated that the data node can send, for example, 1.

[0069] In step 43, for each data node, based on the network topology information, the network device node directly connected to the data node is determined, and a second directed real edge from the data node to the network device node directly connected to that data node is constructed.

[0070] The initial capacity of the second directed real edge is the number of data packets to be aggregated that the data node can send, for example, 1. Figure 3 The network topology shown has network device nodes directly connected to data node Worker2 as follows: It can build from Worker2 to The second directed real edge. If data node Worker2 is not directly connected to network device nodes. It also relates to network device nodes. A direct connection allows for the construction of a network from Worker2 to... The second directed real edge and from Worker2 to The second directed real edge. Other data nodes are similar.

[0071] In step 44, for each network device node, a third directed real edge is constructed from the network device node to each of the other N-1 network device nodes.

[0072] The initial capacity of the third directed real edge is a second preset threshold. For example, this second preset threshold can be determined based on the number of data packets that can be transmitted between network device nodes at one time. For instance, if there is one port on the physical link of a network device node, the second preset threshold may be 1.

[0073] In step 45, a fourth directed real edge is constructed from the root node to the sink node. The initial capacity of the fourth directed real edge is a third preset threshold. This third preset threshold is, for example, 1.

[0074] In step 46, directed virtual edges are constructed from each first network device node to the sink.

[0075] The initial capacity of the directed virtual edge is the difference between the current remaining capacity of the first network device node and a first preset threshold. For example, the first preset threshold is 1, with the network device node... For example, from network device nodes The initial capacity of the directed virtual edge to the sink is 3.

[0076] In step 47, a flow network is constructed based on the source node, sink node, M data nodes, N network device nodes, the first directed real edge, the second directed real edge, the third directed real edge, the fourth directed real edge, and the directed virtual edge.

[0077] Through the above technical solution, the initial capacity of the constructed directed virtual edge is the difference between the current remaining capacity of the first network device node and the first preset threshold. In this way, the traffic of the difference between the current remaining capacity of the first network device node and the first preset threshold can flow out through the virtual edge, ensuring that the traffic flowing into the first network device node is equal to the traffic flowing out. Therefore, the flow network based on the constructed flow network can transform the generation of the aggregation tree into the solution of the maximum flow problem. Compared with the greedy algorithm, it has lower complexity, is easier to find the optimal solution, and improves the real-time performance and accuracy of the aggregation tree generation.

[0078] In one embodiment, step 47 can be implemented as follows: using the source node, sink node, M data nodes, and N network device nodes as vertices, and the first directed real edge, the second directed real edge, the third directed real edge, the fourth directed real edge, and the directed virtual edge as edges to form a flow network.

[0079] In another embodiment, in order to reduce the size of the flow network and increase the speed of generating the aggregation tree, another embodiment of step 47 is described below.

[0080] Based on the network topology information, the first data node is determined. The first data node is one of the M data nodes that is directly connected to multiple network device nodes.

[0081] For example, if data node Worker2 is not directly connected to network device nodes It also relates to network device nodes. If directly connected, then data node Worker2 is directly connected to multiple network device nodes, and this data node Worker2 can serve as the first data node.

[0082] For each network device node, identify at least one second data node that is directly connected to the network device node. Aggregate the target first directed real edge and the target second directed real edge into a fifth directed real edge from the source node to the network device node. Here, the target first directed real edge is the first directed real edge from the source node to the second data node, and the target second directed real edge is the second directed real edge from the second data node to the network device node.

[0083] The initial capacity of the fifth directed real edge can be determined in either (1) or (2) as follows:

[0084] (1) The sum of the initial capacities corresponding to the first directed real edges of each target is used as the initial capacity of the fifth directed real edge.

[0085] (2) The sum of the initial capacities corresponding to the second directed real edges of each objective is used as the initial capacity of the fifth directed real edge.

[0086] It should be noted that the initial capacity of the first directed real edge is equal to the initial capacity of the second directed real edge, which is the number of data packets to be aggregated that the data node can send. The number of the first target directed real edge is also equal to the number of the second target directed real edge, which is the number of second data nodes that are directly connected to the network device node. Therefore, the initial capacity of the fifth directed real edge determined by the above two methods is the same.

[0087] In the following embodiments of this disclosure, the first preset threshold, the second preset threshold, and the third preset threshold are all 1 as an example. However, this does not constitute a limitation on the embodiments of this disclosure. This disclosure does not limit the value of each threshold. Figure 5 This is a schematic diagram of a streaming network according to an exemplary embodiment. Figure 5 The flow network shown is based on Figure 3 The network topology shown is constructed as described. Figure 5 As shown, circles represent nodes, s is the source node, t is the sink node, solid lines with arrows represent solid edges, dashed lines with arrows represent dashed edges, and numbers represent the residual capacity on the edges.

[0088] This involves aggregating at least one second data node into a target data node. Figure 3 Taking the network topology shown as an example, such as Figure 5 As shown, it will only be with network device nodes. The directly connected second data nodes Worker1, Worker2, and Worker3 are aggregated into a single target data node. It will only be with network device nodes The directly connected second data nodes Worker4, Worker5, Worker6, and Worker7 are aggregated into a single target data node. It will only be with network device nodes The directly connected second data node, Worker8, is represented as the target data node. Network device nodes It is the root node.

[0089] Additionally, if data node Worker2 is not directly connected to network device nodes... It also relates to network device nodes. Direct connection, then for network device nodes Worker1 and Worker3 can be aggregated into a single target data node.

[0090] The first directed real edges of each target are aggregated into a sixth directed real edge from the source node to the target data node; the second directed real edges of each target are aggregated into a seventh directed real edge from the target data node to the network device node; the sixth and seventh directed real edges are aggregated into a fifth directed real edge from the source node to the network device node. The initial capacity of the sixth directed real edge is the sum of the initial capacities of the first directed real edges of each target, and the initial capacity of the seventh directed real edge is the sum of the initial capacities of the second directed real edges of each target.

[0091] by Figure 3 Taking the network topology shown as an example, such as Figure 5 As shown, the first directed real edges from the source node s to data nodes Worker1, Worker2, and Worker3 are aggregated into a single line from the source node s to the nodes. The sixth directed real edge has an initial capacity of 3. It will connect data nodes Worker1, Worker2, and Worker3 to the network device node respectively. The second directed real edge is aggregated from the node. To network device nodes The seventh directed real edge has an initial capacity of 3. For example... Figure 6 As shown, the sixth directed real edge and the seventh directed real edge can be aggregated into a line from the source node s to the network device node. The fifth directed real edge has an initial capacity of 3.

[0092] The first directed real edges from the source node s to data nodes Worker4, Worker5, Worker6, and Worker7 are aggregated into a single line from the source node s to the nodes. The sixth directed real edge has an initial capacity of 4. It will connect data nodes Worker4, Worker5, Worker6, and Worker7 to the network device node, respectively. The second directed real edge is aggregated from the node. To network device nodes The seventh directed real edge has an initial capacity of 4. For example... Figure 6 As shown, the sixth directed real edge and the seventh directed real edge can be aggregated into a line from the source node s to the network device node. The fifth directed real edge has an initial capacity of 4.

[0093] The first directed real edge from the source node s to the data node Worker8 will be used as the boundary between the source node s and the node. The sixth directed real edge has an initial capacity of 1. It will connect the data node Worker8 to the network device node. The second directed real edge, as a slave node To network device nodes The seventh directed real edge has an initial capacity of 1. For example... Figure 6 As shown, the sixth directed real edge and the seventh directed real edge can be aggregated into a line from the source node s to the network device node. The fifth directed real edge has an initial capacity of 1.

[0094] like Figure 5 and Figure 6 As shown, the constructed network device node To network device nodes The initial capacity of the third directed real edge is 1, starting from node To node The initial capacity of the third directed real edge is 1, starting from node To node The initial capacity of the third directed real edge is 1, starting from node To node The initial capacity of the third directed real edge is 1. Wherein, Figure 5 and Figure 6 The node is not shown in the text. To node The third directed real edge, and from node To node The third directed real edge. Constructed from the root node. The initial capacity of the fourth directed real edge to the sink node t is 1. The constructed slave nodes... The initial capacity of the directed virtual edge to the sink node t is 3. The initial capacity of the directed virtual edge to the sink node t is 2. The initial capacity of the directed virtual edge to the sink t is 2.

[0095] Using the source node, sink node, first data node, and N network device nodes as vertices, and the third directed real edge, fourth directed real edge, fifth directed real edge, directed virtual edge, first directed real edge from the source node to the first data node, and second directed real edge from the first data node to the network device node directly connected to the first data node as edges, a flow network is formed. Figure 6 This is a schematic diagram illustrating the formed flow network.

[0096] It should be noted that, Figure 3 The network topology shown does not include a first data node directly connected to multiple network device nodes. This network topology is for illustrative purposes only and does not constitute a limitation on the embodiments of this disclosure. For example, if data node Worker2 is not directly connected to network device nodes... It also relates to network device nodes. In a directly connected flow network, the data node Worker2 is one of the vertices, and there is also the first directed real edge from the source node s to the data node Worker2, and the edge from node Worker2 to node s. The second directed real edge, from node Worker2 to node The second directed real edge.

[0097] Figure 7 This is a flowchart illustrating a method for determining a feasible augmenting path from a source to a sink based on a flow network, according to an exemplary embodiment. Figure 7 As shown, steps 71 to 77 are included.

[0098] In step 71, the current residual network corresponding to the flow network is obtained.

[0099] The current residual network is used to indicate the current capacity of each directed real edge, the current capacity of the corresponding reverse real edge, the current capacity of each directed virtual edge, and the current capacity of the corresponding reverse virtual edge in the flow network. The initial capacity of the reverse real edges and reverse virtual edges is 0.

[0100] In step 72, based on the current residual network, it is determined whether a first augmenting path exists from the source to the sink. If it exists, proceed to step 73; otherwise, proceed to step 77.

[0101] The method for determining augmenting paths can refer to relevant technologies, where each edge in the first augmenting path has remaining capacity for flow.

[0102] In step 73, determine whether the first augmenting path needs to traverse a directed virtual edge. If yes, proceed to step 74; otherwise, proceed to step 75.

[0103] In step 74, determine whether the directed virtual edges that the first augmenting path needs to traverse can currently be scheduled. If yes, proceed to step 75; otherwise, return to step 72.

[0104] The implementation of step 74 can be as follows: Based on the first augmenting path and the obtained feasible augmenting path, determine whether there is traffic flowing out from the second network device node and passing through the directed real edge in the flow network, wherein the second network device node is the network device node that serves as the starting point of the directed virtual edge that the first augmenting path needs to pass through.

[0105] If it exists, then determine that the directed virtual edges that the first augmenting path needs to pass through can currently be scheduled;

[0106] If it does not exist, then the directed virtual edges that the first augmenting path needs to traverse cannot be scheduled at present.

[0107] In step 75, the first augmenting path is selected as the feasible augmenting path determined in this step.

[0108] In step 76, the current residual network is updated based on the capacity of the feasible augmenting path determined this time, and then the process returns to step 72 until there is no first augmenting path.

[0109] In step 77, the identified feasible augmentation paths are obtained.

[0110] With the above scheme, if the directed virtual edges that the first augmenting path needs to pass through can be scheduled, then the first augmenting path is considered a feasible augmenting path. In this case, the corresponding directed virtual edges can only be scheduled if there is traffic flowing out of the directed real edges at the second network device node. This can avoid the phenomenon that real edges are eliminated and there are separately scheduled virtual edges.

[0111] like Figure 6 As shown, for example, finding the first augmenting path P1 from the source to the sink. The first augmenting path P1 passes through the source node s to node s. The fifth directed real edge, node To node The third directed real edge, node To node The third directed real edge, node The fourth directed real edge to sink t, the first augmenting path P1, does not need to traverse directed virtual edges and can be used as a feasible augmenting path determined in this study. The capacity of a feasible augmenting path is the minimum of the current capacities corresponding to each edge traversed by the path; the capacity of feasible augmenting path P1 is 1. Based on the capacity of the feasible augmenting path determined in this study, the current residual network is updated by subtracting the capacity of the feasible augmenting path from the capacity of each edge on the determined feasible augmenting path, and adding the capacity of the feasible augmenting path to the capacity of the corresponding reverse edge. Additionally, due to the nodes... , , All nodes have outflow from the real edges, therefore the nodes , , The corresponding directed virtual edges can all be scheduled at present, such as Figure 6 As shown, the node , , All are filled in gray, indicating that the directed virtual edges corresponding to these three nodes can be scheduled at present.

[0112] like Figure 8 As shown, after updating the current residual network, from the source node s to the node... The fifth directed real edge has a capacity of 2, starting from node The capacity of the fifth reverse real edge to the source node s is 1, and the capacity of the edge from node s is 1. To node The capacity of the third directed real edge is 0 (not shown in the diagram), starting from node... To node The capacity of the third reverse real edge is 1, from node To node The capacity of the third directed real edge is 0 (not shown in the diagram), starting from node... To node The capacity of the third reverse real edge is 1, from node The capacity of the fourth directed real edge to the sink t is 0 (not shown in the diagram). The distance from the sink t to the node... The capacity of the fourth reverse real edge is 1.

[0113] like Figure 8 As shown, based on the current residual network, for example, the first augmenting path is determined. The first augmenting path P2 passes through the source node s to node s. The fifth directed real edge, node A directed virtual edge to the sink t, the starting point of which is node t. Among them, since the obtained feasible augmenting path P1 contains slave nodes... Outflowing, and passing through from The flow to the fourth directed real edge to the sink t, therefore the node The directed virtual edge to sink t can be scheduled. This first augmenting path P2 is the feasible augmenting path determined in this study, and its capacity is 1. Based on the capacity of the feasible augmenting path determined in this study, the current residual network is updated.

[0114] like Figure 9 As shown, after updating the current residual network, from node s to node... The capacity of the fifth directed real edge is 0 (not shown in the diagram), starting from node... The capacity of the fifth reverse solid edge to node s is 1, and the capacity of the edge from node s is 1. The capacity of the directed virtual edge to the sink t is 1. The distance from the sink t to the node... The capacity of the reverse virtual edge is 1.

[0115] like Figure 9 As shown, based on the current residual network, for example, the first augmenting path is determined. The first augmenting path P3 passes through the source node s to node s. The fifth directed real edge, node A directed virtual edge to the sink t, the starting point of which is node t. Among them, since the obtained feasible augmenting path P1 contains slave nodes... Outflowing, and passing through the node To node The flow of the third directed real edge, therefore the node The directed virtual edge to sink t can be scheduled. This first augmenting path P3 is identified as a feasible augmenting path, and its capacity is 2. Based on the capacity of the feasible augmenting path identified, the current residual network is updated.

[0116] like Figure 10 As shown, after updating the current residual network, from node s to node... The capacity of the fifth directed real edge is 0 (not shown in the diagram), starting from node... The capacity of the fifth reverse solid edge to node s is 3, and the capacity of the edge from node s is 3. The capacity of the directed virtual edge to the sink t is 1. The distance from the sink t to the node... The capacity of the reverse virtual edge is 2.

[0117] like Figure 10 As shown, based on the current residual network, for example, the first augmenting path is determined. The first augmenting path P' passes through the source node s to the node The fifth directed real edge, node To node The third reverse solid edge, node The directed virtual edge to sink t, due to the nodes in the first augmenting path P' To node The flow of the third reverse real edge will affect the nodes in the feasible augmenting path P1. To node The flow of the third directed real edge is canceled out, therefore the node There is currently no outflow from the real edge, i.e., from the node. The directed virtual edge to sink t cannot be scheduled at present, therefore the first augmenting path P' cannot be considered a feasible augmenting path.

[0118] like Figure 11 As shown, based on the current residual network, for example, the first augmenting path is determined. The first augmenting path P4 passes through the source node s to node s. The fifth directed real edge, node To node The third reverse solid edge, node To node The third directed real edge, node The directed virtual edge to sink t has a slave node in the feasible augmenting path P1. The flow to sink t, therefore the node The directed virtual edge to sink t can currently be scheduled. This first augmenting path P4 is identified as a feasible augmenting path, and its capacity is 1. Based on the capacity of the feasible augmenting path identified, the current residual network is updated.

[0119] like Figure 12 As shown, after updating the current residual network, from node s to node... The fifth directed real edge has a capacity of 3, starting from node 3. The capacity of the fifth reverse solid edge to node s is 1, and the capacity of the edge from node s is 1. To node The capacity of the third reverse real edge is 0, from node To node The capacity of the third directed real edge is 1, starting from node To node The capacity of the third directed real edge is 0 (not shown in the diagram), starting from node... To node The capacity of the third reverse real edge is 1, from node The capacity of the directed virtual edge to the sink t is 0 (not shown in the diagram). The distance from the sink t to the node... The capacity of the reverse virtual edge is 2.

[0120] like Figure 12 As shown, based on the current residual network, for example, the first augmenting path is determined. The first augmenting path P5 passes through the source node s to node s. The fifth directed real edge, node To node The third directed real edge, node The directed virtual edge to sink t, since there exists a path from P4 in the feasible augmenting path... Flow to node The traffic, therefore the node The directed virtual edge to sink t can be scheduled. This first augmenting path P5 is selected as the feasible augmenting path in this study, and its capacity is 1. Based on the capacity of the feasible augmenting path selected in this study, the current residual network is updated.

[0121] like Figure 13 As shown, after updating the current residual network, from node s to node... The fifth directed real edge has a capacity of 2, starting from node The capacity of the fifth reverse solid edge to node s is 2, and the capacity of the edge from node s is 2. To node The capacity of the third directed real edge is 0, starting from node To node The capacity of the third reverse real edge is 1, from node The capacity of the directed virtual edge to the sink t is 0 (not shown in the diagram). The distance from the sink t to the node... The capacity of the reverse virtual edge is 3.

[0122] like Figure 13 As shown, the last first augmenting path was found. The first augmenting path P6 passes from node s to node The fifth directed real edge, from node The directed virtual edge to sink t has a slave node in the feasible augmenting path P1. Outflow to node The traffic, therefore from the node The directed virtual edge to sink t can be scheduled. This first augmenting path P6 is selected as the feasible augmenting path in this study, and its capacity is 2. Based on the capacity of the feasible augmenting path selected in this study, the current residual network is updated.

[0123] like Figure 14 As shown, after updating the current residual network, from node s to node... The capacity of the fifth directed real edge is 0, starting from node The capacity of the fifth reverse solid edge to node s is 4. The capacity of the directed virtual edge to the sink t is 0. The capacity of the edge from the sink t to the node is... The capacity of the reverse virtual edge is 2.

[0124] At this point, there is no first augmenting path from the source to the sink. The feasible augmenting paths obtained include augmenting paths P1, P2, P3, P4, P5, and P6. The total capacity of the feasible augmenting paths is 8, which is equal to the first value. Therefore, based on the root node... Generate a cluster tree using feasible augmenting paths P1 to P6. Since P1 and P4 contain a path with the same capacity but opposite direction, the actual final path is... and .like Figure 14 As shown, in the generated aggregation tree, the source node s will... Send to node The source node s will send data packets Send to node The source node s will send data packets Send to node ,node data packet Send to node ,node data packet Aggregate into data packets And send it to the root node. ,node data packet Aggregate into data packets And send it to the root node. root node data packet and Aggregate into The example of sending data packets described above is only one implementation method, such as a node. Data packets can also be used Either of them sends to the node .

[0125] After generating the aggregation tree, a related aggregation table can be configured on each network device node. The table entries include the aggregation task ID, parent node port number, child node port number, aggregation status bitmap, and aggregation operation type. The aggregation task ID identifies the aggregation task. Since this disclosure uses the network device port as the aggregation granularity, the child node port number informs the network device which ports the data comes from. The aggregation status bitmap maintains the status of the aggregation task. For online aggregation, the aggregation operation is performed immediately upon receiving each piece of data. Once the status bitmap indicates that all child node data has been received, the data can be sent directly to the parent node port. For offline aggregation, the aggregation operation is performed only after all data has been collected. The data is sent to the parent node port only after the aggregation operation is complete. The aggregation operation type represents the specific operation, such as summation, averaging, or finding the maximum / minimum value.

[0126] The aggregation tree generation method provided in this disclosure may also include:

[0127] If the maximum flow is less than the first value, the root node is replaced, and the steps of constructing the flow network based on the network topology information, the root node, and the current remaining capacity of the first network device node are re-executed, up to the steps of determining feasible augmenting paths from the source to the sink based on the flow network, and determining the maximum flow from the source to the sink based on the feasible augmenting paths. In other words, after replacing the root node, a feasible aggregation tree is searched again.

[0128] The aggregation tree generation method provided in this disclosure may also include:

[0129] If all N network device nodes are already root nodes, and the maximum traffic determined each time is less than the first value, then delete at least one of the M data nodes, update M and N, and then re-execute the steps of obtaining network topology information to flow-based networks, determining feasible augmenting paths from the source to the sink, and determining the maximum traffic from the source to the sink based on the feasible augmenting paths.

[0130] If all N network device nodes are already root nodes and a feasible aggregation tree still cannot be found, it means the current network cannot aggregate that many data packets. At least one data node from the M data nodes can be deleted. There is no limit to the number of data nodes deleted; for example, one data node can be deleted. Furthermore, which data node to delete can be set as needed, such as deleting the worst-performing data node. Deleting at least one data node updates M and N, and the network topology information is also updated accordingly. Then, a new feasible aggregation method is searched.

[0131] If a feasible aggregation tree cannot be formed even after deleting data nodes, it can be determined whether there are network device nodes with free ports and remaining capacity. The data packets to be aggregated can be sent to these ports without the network devices along the way being aware of them. Alternatively, the data packets to be aggregated can be sent to the parameter server for final aggregation. Or, the scheduling of the aggregation task can be temporarily postponed until resources are sufficient before scheduling the task.

[0132] In summary, for a first network device node whose remaining capacity is greater than a first preset threshold, this disclosure allows the construction of directed virtual edges from the first network device node to the sink. This transforms the generation of the aggregation tree into solving a maximum flow problem. The directed virtual edges can only be scheduled when there is traffic flowing out of the network device node from its real edges, thus avoiding the phenomenon of real edges being eliminated and virtual edges being scheduled separately. Therefore, when generating the aggregation tree, solving complex integer (or mixed integer) programming problems can be avoided, and the optimal solution is found more easily than with greedy algorithms, improving the real-time performance and accuracy of aggregation tree generation.

[0133] Based on the same inventive concept, this disclosure also provides an apparatus for generating aggregate trees. Figure 15 This is a block diagram illustrating an exemplary aggregate tree generation apparatus, such as... Figure 15 As shown, the device 1500 may include:

[0134] The first acquisition module 1501 is used to acquire network topology information, wherein the network topology information is used to characterize the network topology of the M data nodes distributed in the data packets to be aggregated and the N network device nodes used to perform the aggregation operation, where M≥1 and N≥1.

[0135] The second acquisition module 1502 is used to acquire the current remaining capacity of each of the network device nodes, wherein the current remaining capacity is used to characterize the number of data packets that the network device node can currently aggregate;

[0136] The first determining module 1503 is used to determine the root node, wherein the root node is one of the N network device nodes;

[0137] The construction module 1504 is used to construct a flow network based on the network topology information, the root node, and the current remaining capacity of the first network device node if it is determined that there is a first network device node among the N network device nodes whose current remaining capacity is greater than a first preset threshold. The vertices of the flow network include the source node, the sink node, and the N network device nodes, and the edges of the flow network include directed real edges and directed virtual edges from the first network device node to the sink node.

[0138] The second determining module 1505 is used to determine, based on the flow network, a feasible augmenting path from the source to the sink, and to determine the maximum flow from the source to the sink based on the feasible augmenting path;

[0139] The aggregation tree generation module 1506 is used to generate an aggregation tree based on the feasible augmenting path and the root node when the maximum traffic is equal to a first value, wherein the first value is the sum of the number of data packets to be aggregated that the M data nodes can send.

[0140] Optionally, the building module 1504 includes:

[0141] The first construction submodule is used to construct the source point and the sink point;

[0142] The second construction submodule is used to construct a first directed real edge from the source point to each of the data nodes, wherein the initial capacity of the first directed real edge is the number of data packets to be aggregated that the data node can send;

[0143] The third construction submodule is used to determine, for each data node, the network device node directly connected to the data node according to the network topology information, and construct a second directed real edge from the data node to the network device node directly connected to the data node. The initial capacity of the second directed real edge is the number of data packets to be aggregated that the data node can send.

[0144] The fourth construction submodule is used to construct a third directed real edge from each of the network device nodes to the other N-1 network device nodes, wherein the initial capacity of the third directed real edge is a second preset threshold.

[0145] The fifth construction submodule is used to construct a fourth directed real edge from the root node to the sink node, wherein the initial capacity of the fourth directed real edge is a third preset threshold.

[0146] The sixth construction submodule is used to construct the directed virtual edge from each of the first network device nodes to the sink, wherein the initial capacity of the directed virtual edge is the difference between the current remaining capacity of the first network device node and the first preset threshold.

[0147] The seventh construction submodule is used to construct the flow network based on the source node, the sink node, the M data nodes, the N network device nodes, the first directed real edge, the second directed real edge, the third directed real edge, the fourth directed real edge, and the directed virtual edge.

[0148] Optionally, the seventh construction submodule includes:

[0149] The first determining submodule is used to determine a first data node based on the network topology information, wherein the first data node is the data node among the M data nodes that is directly connected to the plurality of network device nodes;

[0150] The first aggregation submodule is used to determine, for each network device node, at least one second data node that is directly connected to the network device node, and aggregate the target first directed real edge and the target second directed real edge into a fifth directed real edge from the source node to the network device node. The target first directed real edge is the first directed real edge from the source node to the second data node, and the target second directed real edge is the second directed real edge from the second data node to the network device node.

[0151] The second determining submodule is used to take the source node, the sink node, the first data node and the N network device nodes as vertices, and the third directed real edge, the fourth directed real edge, the fifth directed real edge, the directed virtual edge, the first directed real edge from the source node to the first data node, and the second directed real edge from the first data node to the network device node directly connected to the first data node as edges, to form the flow network.

[0152] Optionally, the initial capacity of the fifth directed real edge is determined by the following module:

[0153] The first capacity determination submodule is used to sum the initial capacities corresponding to each of the target first directed real edges as the initial capacity of the fifth directed real edge; or,

[0154] The second capacity determination submodule is used to sum the initial capacities corresponding to each of the target second directed real edges as the initial capacity of the fifth directed real edge.

[0155] Optionally, the first aggregation submodule is configured to:

[0156] Aggregate the at least one second data node into a target data node;

[0157] Each of the first directed real edges of the target is aggregated into a sixth directed real edge from the source point to the target data node;

[0158] Each of the target second directed real edges is aggregated into a seventh directed real edge from the target data node to the network device node;

[0159] The sixth and seventh directed real edges are aggregated into the fifth directed real edge from the source node to the network device node.

[0160] Optionally, the second determining module 1505 includes:

[0161] The first acquisition submodule is used to acquire the current residual network corresponding to the flow network;

[0162] The third determining submodule is used to determine, based on the current residual network, whether there exists a first augmenting path from the source to the sink.

[0163] The fourth determining submodule is used to determine whether the first augmenting path needs to pass through the directed virtual edge if the first augmenting path exists.

[0164] The fifth determining submodule is used to determine whether the directed virtual edge that the first augmenting path needs to pass through can be scheduled at present if the first augmenting path needs to pass through the directed virtual edge.

[0165] The sixth determining submodule is used to take the first augmenting path as the feasible augmenting path determined this time if the directed virtual edge that the first augmenting path needs to pass through can be scheduled. Then, it updates the current residual network according to the capacity of the feasible augmenting path determined this time, and then triggers the third determining submodule to determine whether there is a first augmenting path from the source to the sink based on the current residual network, until there is no first augmenting path.

[0166] Optionally, the second determining module 1505 is further configured to:

[0167] If the directed virtual edge that the first augmenting path needs to pass through cannot be scheduled at present, the third determining submodule is triggered to determine whether there is a first augmenting path from the source to the sink based on the current residual network, until there is no first augmenting path.

[0168] Optionally, the fifth determining submodule is used for:

[0169] Based on the first augmenting path and the obtained feasible augmenting path, determine whether there is traffic flowing out from the second network device node and passing through the directed real edge in the flow network, wherein the second network device node is the network device node that serves as the starting point of the directed virtual edge that the first augmenting path needs to pass through.

[0170] If it exists, then it is determined that the directed virtual edge that the first augmenting path needs to pass through can currently be scheduled;

[0171] If it does not exist, then it is determined that the directed virtual edge that the first augmenting path needs to pass through cannot be scheduled at present.

[0172] Optionally, the device 1500 further includes:

[0173] The replacement module is used to replace the root node when the maximum traffic is less than the first value, and to trigger the construction module to re-execute the process of constructing a flow network based on the network topology information, the root node and the current remaining capacity of the first network device node, and the second determination module to determine a feasible augmenting path from the source to the sink based on the flow network, and to determine the maximum traffic from the source to the sink based on the feasible augmenting path.

[0174] Optionally, the device 1500 further includes:

[0175] The deletion module is configured to delete at least one of the M data nodes if all N network device nodes are already root nodes and the maximum traffic determined each time is less than the first value, and update M and N. Then, the first acquisition module is triggered to reacquire network topology information to the second determination module, which determines a feasible augmenting path from the source to the sink based on the flow network, and determines the maximum traffic from the source to the sink based on the feasible augmenting path.

[0176] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0177] Figure 16 This is a block diagram illustrating an electronic device 700 according to an exemplary embodiment. Figure 16 As shown, the electronic device 700 may include a processor 701 and a memory 702. The electronic device 700 may also include one or more of a multimedia component 703, an input / output (I / O) interface 704, and a communication component 705.

[0178] The processor 701 controls the overall operation of the electronic device 700 to complete all or part of the steps in the above-described aggregation tree generation method. The memory 702 stores various types of data to support the operation of the electronic device 700. This data may include, for example, instructions for any application or method operating on the electronic device 700, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 702 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The multimedia component 703 may include a screen and audio components. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 702 or transmitted via communication component 705. The audio component also includes at least one speaker for outputting audio signals. I / O interface 704 provides an interface between processor 701 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof; therefore, the corresponding communication component 705 may include a Wi-Fi module, a Bluetooth module, or an NFC module.

[0179] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described aggregation tree generation method.

[0180] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the above-described aggregate tree generation method. For example, the computer-readable storage medium may be the memory 702 including the program instructions, which may be executed by the processor 701 of the electronic device 700 to complete the above-described aggregate tree generation method.

[0181] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, which, when executed by the processor, implements the steps of the above-described aggregation tree generation method.

[0182] Figure 17 This is a block diagram illustrating an electronic device 1900 according to an exemplary embodiment. For example, the electronic device 1900 may be provided as a server. (Refer to...) Figure 17 The electronic device 1900 includes a processor 1922, which may be one or more, and a memory 1932 for storing computer programs executable by the processor 1922. The computer program stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processor 1922 may be configured to execute the computer program to perform the above-described aggregation tree generation method.

[0183] Additionally, the electronic device 1900 may also include a power supply component 1926 and a communication component 1950. The power supply component 1926 can be configured to perform power management of the electronic device 1900, and the communication component 1950 can be configured to enable communication of the electronic device 1900, such as wired or wireless communication. Furthermore, the electronic device 1900 may also include an input / output (I / O) interface 1958. The electronic device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM Mac OS X TM Unix TM Linux TM etc.

[0184] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the above-described aggregate tree generation method. For example, the computer-readable storage medium may be the memory 1932 including the program instructions, which may be executed by the processor 1922 of the electronic device 1900 to complete the above-described aggregate tree generation method.

[0185] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, which, when executed by the processor, implements the steps of the above-described aggregation tree generation method.

[0186] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0187] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0188] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. A method for generating a aggregation tree, characterized in that, The method includes: Obtain network topology information, wherein the network topology information is used to characterize the network topology of the M data nodes where the data packets to be aggregated are distributed and the N network device nodes used to perform the aggregation operation, where M≥1 and N≥1; The current remaining capacity of each of the network device nodes is obtained, and the current remaining capacity is used to characterize the number of data packets that the network device node can currently aggregate; Determine the root node, which is one of the N network device nodes; If it is determined that there is a first network device node among the N network device nodes whose current remaining capacity is greater than a first preset threshold, then a flow network is constructed based on the network topology information, the root node, and the current remaining capacity of the first network device node. The vertices of the flow network include the source node, the sink node, and the N network device nodes, and the edges of the flow network include directed real edges and directed virtual edges from the first network device node to the sink node. Based on the flow network, a feasible augmenting path from the source to the sink is determined, and the maximum flow from the source to the sink is determined according to the feasible augmenting path; When the maximum traffic is equal to a first value, an aggregation tree is generated based on the feasible augmenting path and the root node, wherein the first value is the sum of the number of data packets to be aggregated that the M data nodes can send.

2. The method according to claim 1, characterized in that, The step of constructing a flow network based on the network topology information, the root node, and the current remaining capacity of the first network device node includes: Construct the source point and the sink point; Construct a first directed real edge from the source point to each of the data nodes, wherein the initial capacity of the first directed real edge is the number of data packets to be aggregated that the data node can send; For each data node, based on the network topology information, the network device node directly connected to the data node is determined, and a second directed real edge is constructed from the data node to the network device node directly connected to the data node. The initial capacity of the second directed real edge is the number of data packets to be aggregated that the data node can send. For each of the network device nodes, a third directed real edge is constructed from the network device node to the other N-1 network device nodes, wherein the initial capacity of the third directed real edge is a second preset threshold. Construct a fourth directed real edge from the root node to the sink node, wherein the initial capacity of the fourth directed real edge is a third preset threshold. Construct directed virtual edges from each of the first network device nodes to the sink, wherein the initial capacity of the directed virtual edges is the difference between the current remaining capacity of the first network device node and the first preset threshold. The flow network is constructed based on the source node, the sink node, the M data nodes, the N network device nodes, the first directed real edge, the second directed real edge, the third directed real edge, the fourth directed real edge, and the directed virtual edge.

3. The method according to claim 2, characterized in that, The construction of the flow network based on the source node, the sink node, the M data nodes, the N network device nodes, the first directed real edge, the second directed real edge, the third directed real edge, the fourth directed real edge, and the directed virtual edge includes: Based on the network topology information, a first data node is determined, wherein the first data node is the data node among the M data nodes that is directly connected to the plurality of network device nodes; For each of the network device nodes, at least one second data node is determined that is directly connected only to the network device node. The target first directed real edge and the target second directed real edge are aggregated into a fifth directed real edge from the source node to the network device node. The target first directed real edge is the first directed real edge from the source node to the second data node, and the target second directed real edge is the second directed real edge from the second data node to the network device node. The source node, the sink node, the first data node, and the N network device nodes are used as vertices, and the third directed real edge, the fourth directed real edge, the fifth directed real edge, the directed virtual edge, the first directed real edge from the source node to the first data node, and the second directed real edge from the first data node to the network device node directly connected to the first data node are used as edges to form the flow network.

4. The method according to claim 3, characterized in that, The initial capacity of the fifth directed real edge is determined as follows: The sum of the initial capacities corresponding to the first directed real edges of each target is used as the initial capacity of the fifth directed real edge; or, The sum of the initial capacities corresponding to each of the target second directed real edges is used as the initial capacity of the fifth directed real edge.

5. The method according to claim 3, characterized in that, The step of aggregating the first and second directed real edges of the target into a fifth directed real edge from the source node to the network device node includes: Aggregate the at least one second data node into a target data node; Each of the first directed real edges of the target is aggregated into a sixth directed real edge from the source point to the target data node; Each of the target second directed real edges is aggregated into a seventh directed real edge from the target data node to the network device node; The sixth and seventh directed real edges are aggregated into the fifth directed real edge from the source node to the network device node.

6. The method according to claim 1, characterized in that, Determining a feasible augmenting path from the source to the sink based on the flow network includes: Obtain the current residual network corresponding to the flow network; Based on the current residual network, determine whether there exists a first augmenting path from the source to the sink; If the first augmenting path exists, determine whether the first augmenting path needs to pass through the directed virtual edge; If the first augmenting path needs to pass through the directed virtual edge, then determine whether the directed virtual edge that the first augmenting path needs to pass through can be scheduled at present. If the directed virtual edges that the first augmenting path needs to traverse can be scheduled, then the first augmenting path is taken as the feasible augmenting path determined this time, and the current residual network is updated according to the capacity of the feasible augmenting path determined this time. Then, the process returns to the step of determining whether there is a first augmenting path from the source to the sink based on the current residual network, until there is no first augmenting path.

7. The method according to claim 6, characterized in that, The step of determining a feasible augmenting path from the source to the sink based on the flow network further includes: If the directed virtual edge that the first augmenting path needs to pass through cannot be scheduled at present, then return to the step of determining whether there is a first augmenting path from the source to the sink based on the current residual network, until there is no first augmenting path.

8. The method according to claim 6, characterized in that, Determining whether the directed virtual edges that the first augmenting path needs to traverse can currently be scheduled includes: Based on the first augmenting path and the obtained feasible augmenting path, determine whether there is traffic flowing out from the second network device node and passing through the directed real edge in the flow network, wherein the second network device node is the network device node that serves as the starting point of the directed virtual edge that the first augmenting path needs to pass through. If it exists, then it is determined that the directed virtual edge that the first augmenting path needs to pass through can currently be scheduled; If it does not exist, then it is determined that the directed virtual edge that the first augmenting path needs to pass through cannot be scheduled at present.

9. The method according to claim 1, characterized in that, The method further includes: If the maximum flow is less than the first value, the root node is replaced, and the steps of constructing a flow network based on the network topology information, the root node, and the current remaining capacity of the first network device node are re-executed up to the steps of determining a feasible augmenting path from the source to the sink based on the flow network, and determining the maximum flow from the source to the sink based on the feasible augmenting path.

10. The method according to claim 9, characterized in that, The method further includes: If all N network device nodes are already root nodes, and the maximum traffic determined each time is less than the first value, then delete at least one of the M data nodes, update M and N, and then re-execute the step of obtaining network topology information up to the step of determining a feasible augmenting path from the source to the sink based on the flow network, and determining the maximum traffic from the source to the sink based on the feasible augmenting path.

11. The method according to any one of claims 1-10, characterized in that, The data packets to be aggregated are data packets composed of attention vectors generated during the inference process of the large language model.

12. A polymer tree generation device, characterized in that, The device includes: The first acquisition module is used to acquire network topology information, wherein the network topology information is used to characterize the network topology of the M data nodes where the data packets to be aggregated are distributed and the N network device nodes used to perform the aggregation operation, where M≥1 and N≥1; The second acquisition module is used to acquire the current remaining capacity of each of the network device nodes, wherein the current remaining capacity is used to characterize the number of data packets that the network device node can currently aggregate; The first determining module is used to determine the root node, which is one of the N network device nodes; A construction module is configured to construct a flow network based on the network topology information, the root node, and the current remaining capacity of the first network device node if it is determined that there is a first network device node among the N network device nodes whose current remaining capacity is greater than a first preset threshold. The vertices of the flow network include the source node, the sink node, and the N network device nodes, and the edges of the flow network include directed real edges and directed virtual edges from the first network device node to the sink node. The second determining module is used to determine, based on the flow network, a feasible augmenting path from the source to the sink, and to determine the maximum flow from the source to the sink based on the feasible augmenting path; The aggregation tree generation module is used to generate an aggregation tree based on the feasible augmenting path and the root node when the maximum traffic is equal to a first value, wherein the first value is the sum of the number of data packets to be aggregated that the M data nodes can send.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method described in any one of claims 1-11.

14. An electronic device, characterized in that, include: A memory on which computer programs are stored; A processor for executing the computer program in the memory to implement the steps of the method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Internet of Things flow distribution method based on undirected graph maximum flow

    CN117176653A

  • Aggregation tree generation method for online computing, electronic equipment and computer storage medium

    CN118509370A