Aggregation tree generation method and device, medium and equipment
By building a streaming network and generating an aggregation tree, the problem that aggregation tree generation in the prior art is difficult to meet real-time and accuracy, achieving more efficient network resource utilization and reducing network bandwidth and delay.
Patent Information
- Application Number
- CN202411875782.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-12-18
AI Technical Summary
The method of generating aggregation trees in the prior art is difficult to meet the requirements of real-time dynamic deployment, and it is easy to fall into the problem of not finding a feasible solution when solving local optimal solutions.
By obtaining network topology information and the current remaining capacity of each network device node, a streaming network is built to determine feasible augmentation paths and generate an aggregation tree based on the maximum traffic, avoiding solving complex integer planning problems.
The real-time and accuracy of aggregation tree generation is improved, and the resource overhead of network device nodes maintaining bitmaps is reduced. The generated aggregation tree can be multiplexed into a multicast tree, reducing network bandwidth and delay.
Smart Images

Figure CN119544606A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to a method, device, medium and equipment for generating an aggregation tree. Background Art
[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 the data transmission overhead between data nodes and is particularly suitable for accelerating distributed machine learning systems.
[0003] The aggregation tree in network computing is a network topology used to aggregate and process data. As the scale of distributed processing systems grows, one network device usually cannot support all aggregation tasks. Therefore, multiple network devices can be selected in the network 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 can make the aggregation tasks more decentralized and is suitable for large-scale distributed processing systems.
[0004] However, the method of generating an aggregation tree in the related art essentially requires solving an integer programming problem. The computational complexity of solving the global optimal solution is high, and it is difficult to meet the requirements of real-time dynamic deployment of the aggregation tree. Solving the local optimal solution (for example, through a greedy algorithm) is prone to being unable to find a feasible solution. Summary of the invention
[0005] The purpose of the present disclosure is to provide a method, device, medium and equipment for generating an aggregation tree, which can improve the real-time performance and accuracy of the aggregation tree generation.
[0006] In order to achieve the above objectives, in a first aspect, the present disclosure provides a method for generating an aggregation tree, the method comprising: Acquire network topology information, wherein the network topology information is used to characterize the network topology of M data nodes where the data packets to be aggregated are distributed and N network device nodes used to perform the aggregation operation, M≥1, N≥1; Respectively obtaining the current remaining capacity of each of the network device nodes, where the current remaining capacity is used to represent the number of data packets that the network device node can currently aggregate; Determine a root node, where the root node is one of the N network device nodes; If it is determined that there is a first network device node whose current remaining capacity is greater than a first preset threshold value among the N network device nodes, a flow network is constructed according to the network topology information, the root node, and the current remaining capacity of the first network device node, wherein the vertices of the flow network include a source node, a sink node, and the N network device nodes, and the edges of the flow network include a directed real edge and a directed virtual edge from the first network device node to the sink node; Based on the flow network, determining a feasible augmenting path from the source point to the sink point, and determining a maximum flow from the source point to the sink point according to the feasible augmenting path; When the maximum flow is equal to a first value, an aggregation tree is generated according to the feasible augmenting path and the root node, wherein the first value is the sum of the numbers of the data packets to be aggregated that can be sent by the M data nodes.
[0007] In a second aspect, the present disclosure provides a device for generating an aggregate number, the device comprising: A first acquisition module is used to acquire network topology information, wherein the network topology information is used to characterize the network topology of M data nodes where the data packets to be aggregated are distributed and N network device nodes used to perform the aggregation operation, M≥1, N≥1; A second acquisition module, used to respectively acquire the current remaining capacity of each of the network device nodes, where the current remaining capacity is used to represent the number of data packets that the network device node can currently aggregate; A first determining module, configured to determine a root node, wherein the root node is one of the N network device nodes; A construction module, configured to construct a flow network according to 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 whose current remaining capacity is greater than a first preset threshold value among the N network device nodes, wherein the vertices of the flow network include a source node, a sink node, and the N network device nodes, and the edges of the flow network include a directed real edge and a directed virtual edge from the first network device node to the sink node; A second determination module is used to determine a feasible augmenting path from the source point to the sink point based on the flow network, and determine a maximum flow from the source point to the sink point according to the feasible augmenting path; An aggregation tree generation module is used to generate an aggregation tree according to the feasible augmented path and the root node when the maximum flow is equal to a first value, wherein the first value is the sum of the numbers of the data packets to be aggregated that can be sent by the M data nodes.
[0008] In a third aspect, the present 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 the present disclosure.
[0009] In a fourth aspect, the present disclosure provides an electronic device, including: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of the aggregation tree generation method provided in the first aspect of the present disclosure.
[0010] Through the above technical solution, if it is determined that there is a first network device node whose current remaining capacity is greater than the first preset threshold value among the N network device nodes, a flow network is constructed according to the network topology information, the root node and the current remaining capacity of the first network device node, wherein the vertices of the flow network include the source point, the sink point 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 point. In this way, the aggregation tree is generated with the network device node as the granularity, which reduces the resource overhead of the network device node maintenance bitmap, and the generated aggregation tree can be reused as a multicast tree to reduce network bandwidth and latency. Moreover, for the first network device node whose current remaining capacity is greater than the first preset threshold value, a directed virtual edge from the first network device node to the sink point can be constructed, so that the traffic of the first network device node can flow out through the virtual edge, which can ensure that the traffic flowing into the first network device node is equal to the traffic flowing out, so that the constraints of the maximum flow algorithm are met, and the generation of the aggregation tree can be converted into solving the maximum flow problem, which can avoid solving complex integer programming problems, and it is easier to find the optimal solution, with lower complexity, and improve the real-time and accuracy of the generation of the aggregation tree.
[0011] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings: Figure 1 A schematic diagram of a method for generating an aggregation tree in the related art is shown.
[0013] Figure 2 The figure is a flow chart of a method for generating an aggregation tree according to an exemplary embodiment.
[0014] Figure 3 The diagram is a schematic diagram showing a network topology structure according to an exemplary embodiment.
[0015] Figure 4The present invention is a flowchart of a method for constructing a flow network according to an exemplary embodiment.
[0016] Figure 5 is a schematic diagram of a flow network according to an exemplary embodiment.
[0017] Figure 6 is a schematic diagram showing a flow network and a first augmenting path according to an exemplary embodiment.
[0018] Figure 7 The present invention is a flowchart of a method for determining a feasible augmenting path from a source point to a sink point based on a flow network according to an exemplary embodiment.
[0019] Figure 8 is a schematic diagram of a first augmenting path according to an exemplary embodiment.
[0020] Fig. 9 is a schematic diagram of a first augmenting path according to an exemplary embodiment.
[0021] Fig.10 is a schematic diagram of a first augmenting path according to an exemplary embodiment.
[0022] Fig.11 is a schematic diagram of a first augmenting path according to an exemplary embodiment.
[0023] Fig.12 is a schematic diagram of a first augmenting path according to an exemplary embodiment.
[0024] Fig.13 is a schematic diagram of a first augmenting path according to an exemplary embodiment.
[0025] Fig.14 It is a schematic diagram of an aggregation tree according to an exemplary embodiment.
[0026] Fig.15 The figure is a block diagram showing an exemplary device for generating an aggregation tree.
[0027] Fig.16 It is a block diagram of an electronic device according to an exemplary embodiment.
[0028] Fig.17 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0029] Figure 1 A schematic diagram of a method for generating an aggregation tree in the related art is shown. Figure 1As shown, the left side is a schematic diagram of the topology structure, w1, w2, w3, w4, w5, w6, w7 and w8 are data nodes, s1, s2, s3, s4, s5, s6 and s7 are switch nodes, where the data of data nodes w1 and w2 are aggregated at switch node s1, the data in data nodes w3 and w4 are aggregated at switch node s7, and the aggregated data of switch node s1 and the aggregated data of switch node s7 are finally aggregated at switch node s6. The generated aggregation tree is shown in FIG. Figure 1 As shown on the right. Among them, the method of generating an aggregation tree in the related art requires that each transmitted data packet carries a bitmap, and the bitmap is used to indicate the task corresponding to the data packet. For example, the bitmaps in the data packets sent by the initial state data nodes w1 and w2 are [1000000] and [01000000] respectively, and then the bitmap of the data packet after aggregation at the switch node s1 is [11000000], and the switch node s1 will also store the bitmap [11000000]. The role of the bitmap is used by the switch to determine which data packets should be transmitted and record the aggregation progress. Similarly, the bitmap of the data packet after aggregation at the switch node s7 is [00110000], and the bitmap of the data packet after aggregation at the switch node s6 is [11110000]. Therefore, the method of generating an aggregation tree in the related art is to aggregate at the granularity of data nodes. Each transmitted data packet needs to carry a sufficiently large bitmap to indicate the aggregation state, and the scalability is poor. In addition, the method in the related art is essentially to solve integer programming problems. Usually, a greedy algorithm is used to solve the aggregation tree, and a feasible solution cannot be guaranteed.
[0030] In view of this, the present disclosure provides a method, apparatus, medium and device for generating an aggregation tree, which can improve the real-time performance and accuracy of the aggregation tree generation.
[0031] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0032] Figure 2 is a flow chart of a method for generating an aggregation tree according to an exemplary embodiment. The method can be applied to an electronic device with processing capabilities, such as Figure 2 As shown, the method may include steps 21 to 26.
[0033] In step 21, network topology information is obtained.
[0034] 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 data nodes may be, for example, GPUs or CPUs used to perform distributed tasks, and the data packets to be aggregated required to be aggregated in the distributed tasks are distributed on the M data nodes. The network device nodes may be, for example, data forwarding devices such as switch nodes or router nodes, and the network device nodes may be used to perform aggregation operations, such as aggregating multiple data packets to be aggregated into one data packet.
[0035] 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 the present disclosure can be, for example, a data packet consisting of an attention vector generated during the inference process of a large language model. Among them, the Transformer model is the core structure of the current large language model, and its core module is the attention mechanism (attention). 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 the present disclosure does not limit the type of data packet to be aggregated. The data packet to be aggregated is a data packet consisting of an attention vector generated during the inference process of a large language model, which is an exemplary implementation.
[0036] Figure 3 is a schematic diagram showing a network topology structure according to an exemplary embodiment. Figure 3 As shown, Worker1, Worker2, Worker3, Worker4, Worker5, Worker6, Worker7, and Worker8 are data nodes. , , is a network device node, such as a switch node. The directly connected data nodes are Worker1, Worker2, and Worker3, and the network device nodes 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. , , Data can be transmitted between them. It should be noted that Figure 3 The network topology shown is for illustration only, and the present disclosure does not limit the number and connection method of data nodes and network device nodes.
[0037] In step 22, the current remaining capacity of each network device node is obtained respectively.
[0038] The current remaining capacity of the network device node is used to represent the number of data packets that the network device node can currently aggregate, and the current remaining capacity also represents the current aggregation capability of the network device node. The current remaining capacity Capacity = 4, that is, the network device node Currently able to aggregate 4 data packets, network device nodes The current remaining capacity Capacity = 3, that is, the network device node Currently able to aggregate 3 data packets, network device nodes The current remaining capacity Capacity = 3, that is, the network device node Currently 3 packets can be aggregated.
[0039] In step 23, the root node is determined.
[0040] 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 used as the root node. The network performance can be measured by data transmission delay and bandwidth utilization. For example, the node with the smallest data transmission delay and the highest bandwidth utilization can be used as the node with the best network performance. For example, the node with the strongest data processing capability among the N network device nodes can be used as the root node, or the N network device nodes can take turns as the root node in a certain order. The present disclosure does not limit the method for determining the root node. For example, Figure 3 Network device nodes in as the root node.
[0041] In step 24, if it is determined that there is a first network device node whose current remaining capacity is greater than a first preset threshold among the N network device nodes, a flow network is constructed according to the network topology information, the root node and the current remaining capacity of the first network device node.
[0042] The vertices of the flow network include a source, a sink, and N network device nodes, and the edges of the flow network include a directed real edge and a directed virtual edge from the first network device node to the sink.
[0043] In the present disclosure, an aggregation tree is generated with network device nodes as the granularity, and each data node does not need to carry a lengthy bitmap. From the perspective of data broadcasting, the generated aggregation tree can be multiplexed into a multicast tree, and the root node can broadcast the aggregated data packets to M data nodes layer by layer, thereby reducing network bandwidth and latency.
[0044] In addition, considering that it is not easy to find a feasible aggregation tree using the greedy algorithm in the related art, in the present disclosure, the generation of the aggregation tree is transformed into solving the maximum flow problem. Among them, the modeling of the maximum flow algorithm has no constraints on the aggregation ability of the node, but constrains the flow rate flowing into the node and the flow rate flowing out of the node to be equal, that is, there must be no loss of traffic in the middle. For example, the first preset threshold can be determined according to the number of data packets aggregated after the network device performs the aggregation operation. For example, the network device can be used to aggregate multiple data packets into one data packet. The first preset threshold can be 1, for example. Network device node , , The current remaining capacity of each of the network device nodes is greater than the first preset threshold value, and can be used as the first network device node. For example, Currently, 4 packets to be aggregated can be aggregated into 1 packet, which is equivalent to a network device node The inflow flow is 4, and the outflow flow is 1. Obviously, the inflow flow and outflow flow of the node are not equal. In order to meet the constraints of the maximum flow algorithm modeling, in the present disclosure, for the first network device node whose current remaining capacity is greater than the first preset threshold, a directed virtual edge from the first network device node to the sink can be constructed, so that the flow of the first network device node can flow out through the virtual edge, which can ensure that the inflow flow and outflow flow of the first network device node are equal. In this way, the constraints of the maximum flow algorithm are met, and the generation of the aggregation tree can be converted into solving the maximum flow problem, which can avoid solving complex integer (or mixed integer) planning problems, and it is easier to find the optimal solution than the greedy algorithm, thereby improving the real-time and accuracy of the aggregation tree generation.
[0045] In step 25, a feasible augmenting path from the source point to the sink point is determined based on the flow network, and the maximum flow from the source point to the sink point is determined according to the feasible augmenting path.
[0046] Among them, the augmenting path is the path from the source to the sink, and each edge in the augmenting path has residual capacity for traffic to pass through. For example, multiple feasible augmenting paths can be determined based on the flow network, and the maximum flow is the sum of the capacities of each feasible augmenting path.
[0047] In step 26, when the maximum flow is equal to the first value, an aggregation tree is generated according to the feasible augmenting paths and the root node.
[0048] The first value is the sum of the number of data packets to be aggregated that can be sent by the M data nodes. The number of data packets to be aggregated that can be sent by the data node may refer to the number of data packets to be aggregated that the data node can send to the network device node at one time. For example, each data node can send 1 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 flow is equal to the first value, which means that if the aggregation tree is generated according to the root node and the feasible augmenting path, the maximum flow that can be sent by the source point can be scheduled, so the aggregation tree can be generated according to the augmenting path and the root node.
[0049] Through the above technical solution, if it is determined that there is a first network device node whose current remaining capacity is greater than the first preset threshold value among the N network device nodes, a flow network is constructed according to the network topology information, the root node and the current remaining capacity of the first network device node, wherein the vertices of the flow network include the source point, the sink point 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 point. In this way, the aggregation tree is generated with the network device node as the granularity, which reduces the resource overhead of the network device node maintenance bitmap, and the generated aggregation tree can be reused as a multicast tree to reduce network bandwidth and latency. Moreover, for the first network device node whose current remaining capacity is greater than the first preset threshold value, a directed virtual edge from the first network device node to the sink point can be constructed, so that the traffic of the first network device node can flow out through the virtual edge, which can ensure that the traffic flowing into the first network device node is equal to the traffic flowing out, so that the constraints of the maximum flow algorithm are met, and the generation of the aggregation tree can be converted into solving the maximum flow problem, which can avoid solving complex integer programming problems, and it is easier to find the optimal solution, with lower complexity, and improve the real-time and accuracy of the generation of the aggregation tree.
[0050] Figure 4 is a flowchart of a method for constructing a flow network according to an exemplary embodiment. Figure 4 As shown, it includes steps 41 to 47.
[0051] In step 41, source points and sink points are constructed.
[0052] In step 42, a first directed real edge is constructed from the source node to each data node.
[0053] The initial capacity of the first directed real edge is the number of data packets to be aggregated that can be sent by the data node, for example, 1.
[0054] In step 43, for each data node, a network device node directly connected to the data node is determined according to the network topology information, and a second directed real edge is constructed from the data node to the network device node directly connected to the data node.
[0055] 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 In the network topology shown, the network device node directly connected to the data node Worker2 is , you can build from Worker2 to The second directed real edge. If the data node Worker2 is not directly connected to the network device node , and also with the network device node Direct connection, then you can build from Worker2 to The second directed real edge from Worker2 to The other data nodes are similar.
[0056] In step 44, for each network device node, a third directed real edge is constructed from the network device node to the other N-1 network device nodes.
[0057] The initial capacity of the third directed real edge is a second preset threshold. For example, the second preset threshold can be determined according to the number of data packets that can be transmitted between network device nodes at one time. For example, if there is one port on the physical link of the network device node, the second preset threshold is 1, for example.
[0058] 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 value. The third preset threshold value is 1, for example.
[0059] In step 46, a directed virtual edge is constructed from each first network device node to the sink.
[0060] 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. For example, from the network device node The initial capacity of the directed virtual edge to the sink is 3.
[0061] In step 47, a 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.
[0062] 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 value. In this way, the part of the traffic that is the difference between the current remaining capacity of the first network device node and the first preset threshold value 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, based on the constructed flow network, the generation of the aggregation tree can be converted into the solution of the maximum flow problem. Compared with the greedy algorithm, it has lower complexity and is easier to find the optimal solution, thereby improving the real-time and accuracy of the aggregation tree generation.
[0063] In one implementation, step 47 may be implemented as follows: using the source point, the sink point, 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.
[0064] In another implementation, in order to reduce the scale of the flow network and increase the speed of generating the aggregation tree, another implementation of step 47 is introduced below.
[0065] A first data node is determined according to the network topology information, wherein the first data node is a data node directly connected to multiple network device nodes among the M data nodes.
[0066] For example, if data node Worker2 has a direct network device node , and also with the network device node Direct connection, then the data node Worker2 is directly connected to multiple network device nodes, and the data node Worker2 can serve as the first data node.
[0067] For each network device node, at least one second data node directly connected only to the network device node is determined, and the target first directed real edge and the target second directed real edge are aggregated into a fifth directed real edge from the source point to the network device node, wherein the target first directed real edge is the first directed real edge from the source point 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.
[0068] The initial capacity of the fifth directed real edge can be determined by the following method (1) or (2): (1) The sum of the initial capacities corresponding to the first directed real edges of each target is taken as the initial capacity of the fifth directed real edge.
[0069] (2) The sum of the initial capacities corresponding to the second directed real edges of each target is taken as the initial capacity of the fifth directed real edge.
[0070] 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, both of which are the number of data packets to be aggregated that the data node can send, and the number of target first directed real edges is also equal to the number of target second directed real edges, both of which are the number of second data nodes that are directly connected only to the network device node. Therefore, the initial capacity of the fifth directed real edge determined by the above two methods is the same.
[0071] In the following implementation manner of the present disclosure, the first preset threshold, the second preset threshold, and the third preset threshold are all 1 as an example for introduction, but this does not constitute a limitation on the implementation manner of the present disclosure, and the present disclosure does not limit the values of each threshold. Figure 5is a schematic diagram of a flow network according to an exemplary embodiment. Figure 5 The flow network shown is based on Figure 3 The network topology shown in Figure 1 is constructed. Figure 5 As shown in the figure, circles represent nodes, s is the source point, t is the sink point, solid lines with arrows represent real edges, dotted lines with arrows represent virtual edges, and numbers represent the residual capacity on the edges.
[0072] At least one second data node is aggregated as a target data node. Figure 3 Take the network topology shown as an example. Figure 5 As shown, it will only be connected to the network device node The directly connected second data nodes Worker1, Worker2, and Worker3 are aggregated into one target data node , will only be associated with network device nodes The directly connected second data nodes Worker4, Worker5, Worker6, and Worker7 are aggregated into one target data node , will only be associated with network device nodes The second directly connected data node Worker8 is represented as the target data node , network device node is the root node.
[0073] In addition, if the data node Worker2 is not directly connected to the network device node , and also with the network device node Direct connection, then for network device nodes , Worker1 and Worker3 can be aggregated into one target data node.
[0074] Aggregate the first directed real edges of each target into the sixth directed real edge from the source point to the target data node; aggregate the second directed real edges of each target into the seventh directed real edge from the target data node to the network device node; aggregate the sixth directed real edge and the seventh directed real edge into the fifth directed real edge from the source point to the network device node. The initial capacity of the sixth directed real edge is the sum of the initial capacities corresponding to 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 corresponding to the second directed real edges of each target.
[0075] by Figure 3 Take the network topology shown as an example. Figure 5 As shown in the figure, the first directed real edges from the source point s to the data nodes Worker1, Worker2 and Worker3 are aggregated into the first directed real edges from the source point s to the nodes The sixth directed real edge with an initial capacity of 3. Connect the data nodes Worker1, Worker2, and Worker3 to the network device nodes The second directed real edge of To Network Device Node The initial capacity of is 3 for the seventh directed real edge. Figure 6 As shown, the sixth directed real edge and the seventh directed real edge can be aggregated into a direction from the source point s to the network device node The fifth directed real edge has an initial capacity of 3.
[0076] Aggregate the first directed real edges from source point s to data nodes Worker4, Worker5, Worker6, and Worker7 into directed real edges from source point s to nodes The sixth directed real edge with an initial capacity of 4. Connect data nodes Worker4, Worker5, Worker6, and Worker7 to network device nodes The second directed real edge of To Network Device Node The initial capacity of is 4 for the seventh directed real edge. Figure 6 As shown, the sixth directed real edge and the seventh directed real edge can be aggregated into a direction from the source point s to the network device node The fifth directed real edge has an initial capacity of 4.
[0077] The first directed real edge from source point s to data node Worker8 is used as the first directed real edge from source point s to node The sixth directed real edge has an initial capacity of 1. The second directed real edge of To Network Device Node The initial capacity of the seventh directed real edge is 1. Figure 6 As shown, the sixth directed real edge and the seventh directed real edge can be aggregated into a direction from the source point s to the network device node The fifth directed real edge with an initial capacity of 1.
[0078] like Figure 5 and Figure 6 As shown, the constructed slave network device node To Network Device Node The initial capacity of the third directed real edge is 1, from node To Node The initial capacity of the third directed real edge is 1, from node To Node The initial capacity of the third directed real edge is 1, from node To Node The initial capacity of the third directed real edge of is 1. Figure 5 and Figure 6 The slave nodes are not shown. To Node The third directed real edge of To Node The third directed real edge of . Constructed from the root node The initial capacity of the fourth directed real edge to the sink t is 1. The initial capacity of the directed virtual edge to the sink t is 3, from the node The initial capacity of the directed virtual edge to the sink t is 2, from the node The initial capacity of the directed virtual edge to the sink t is 2.
[0079] The source point, the sink point, the first data node and N network device nodes are taken 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 point 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 taken as edges to form a flow network. Figure 6 is a schematic diagram showing an exemplary formed flow network.
[0080] It should be noted that Figure 3 In the network topology shown, there is no first data node directly connected to multiple network device nodes. This network topology is for illustration only and does not constitute a limitation on the embodiments of the present disclosure. , and also with the network device node Direct connection, then in the formed flow network, data node Worker2 is one of the vertices, and there is also a first directed real edge from source point s to data node Worker2, and from node Worker2 to node The second directed real edge from node Worker2 to node The second directed real edge of .
[0081] Figure 7 is a flowchart of a method for determining a feasible augmenting path from a source point to a sink point based on a flow network according to an exemplary embodiment. Figure 7 As shown, it includes steps 71 to 77.
[0082] In step 71, the current residual network corresponding to the flow network is obtained.
[0083] Among them, the current residual network is used to indicate the current capacity of each directed real edge in the flow network, the current capacity of the reverse real edge corresponding to each directed real edge, the current capacity of the directed virtual edge, and the current capacity of the reverse virtual edge corresponding to the directed virtual edge. The initial capacity of the reverse real edge and the reverse virtual edge are both 0.
[0084] In step 72, based on the current residual network, it is determined whether there is a first augmenting path from the source point to the sink point. If so, step 73 is executed; if not, step 77 is executed.
[0085] The method for determining the augmenting path may refer to the relevant technology, and each edge in the first augmenting path has remaining capacity for traffic to pass through.
[0086] In step 73, it is determined whether the first augmenting path needs to pass through a directed virtual edge. If yes, step 74 is executed; if no, step 75 is executed.
[0087] In step 74, it is determined whether the directed virtual edge that the first augmenting path needs to pass through can be scheduled currently. If yes, step 75 is executed; if not, the process returns to step 72.
[0088] The implementation of step 74 may be: based on the first augmenting path and the obtained feasible augmenting path, determining 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 a network device node that is the starting point of the directed virtual edge that the first augmenting path needs to pass through; If so, it is determined that the directed virtual edge that the first augmenting path needs to pass through can be currently scheduled; If not, it is determined that the directed virtual edge that the first augmenting path needs to pass through cannot be scheduled currently.
[0089] In step 75, the first augmenting path is used as the feasible augmenting path determined this time.
[0090] In step 76, the current residual network is updated according to the capacity of the feasible augmenting path determined this time, and then the process returns to step 72 until the first augmenting path does not exist.
[0091] In step 77, the determined feasible augmenting path is obtained.
[0092] Through the above scheme, if the directed virtual edge that the first augmenting path needs to pass through can be scheduled, then the first augmenting path is used as a feasible augmenting path, wherein the corresponding directed virtual edge can be scheduled only when there is traffic flowing out from the directed real edge at the second network device node, thereby avoiding the phenomenon that the real edge is eliminated and there is a separately scheduled virtual edge.
[0093] like Figure 6As shown, for example, find the first augmenting path P1 from the source point to the sink point, , the first augmenting path P1 passes through the source point s to the node The fifth directed real edge and node To Node The third directed real edge and node To Node The third directed real edge and node The fourth directed real edge to the sink t, the first augmenting path P1 does not need to pass through the directed virtual edge and can be used as the feasible augmenting path determined this time. The capacity of the feasible augmenting path is the minimum value of the current capacity corresponding to each edge passed by the path, and the capacity of the feasible augmenting path P1 is 1. According to the capacity of the feasible augmenting path determined this time, the current residual network is updated, that is, the capacity of each edge on the feasible augmenting path determined this time is subtracted from the capacity of the feasible augmenting path, and the capacity of the corresponding reverse edge is added to the capacity of the feasible augmenting path. In addition, since the node , , There is outflow from the real edge, so the node , , The corresponding directed virtual edges can currently be scheduled, such as Figure 6 As shown, the node , , They are all filled in gray, indicating that the directed virtual edges corresponding to these three nodes can currently be scheduled.
[0094] like Figure 8 As shown, after updating the current residual network, from the source point s to the node The capacity of the fifth directed real edge is 2, from node The capacity of the fifth reverse real edge to the source point s is 1, from the node To Node The capacity of the third directed real edge of is 0 (not shown in the figure), 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 of is 0 (not shown in the figure), 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 figure). The capacity of the fourth reverse real edge is 1.
[0095] like Figure 8As shown, based on the current residual network, for example, the first augmenting path is determined , the first augmenting path P2 passes through the source point s to the node The fifth directed real edge and node A directed virtual edge to the sink t, the starting point of the directed virtual edge is the node Among them, since the feasible augmenting path P1 obtained has a node Flowing out and passing through The flow of the fourth directed real edge to the sink t, so the node The directed virtual edge to the sink t can be scheduled, and the first augmenting path P2 is used as the feasible augmenting path determined this time, and the capacity of the feasible augmenting path is 1. The current residual network is updated according to the capacity of the feasible augmenting path determined this time.
[0096] like Fig. 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 figure), from node The capacity of the fifth reverse real edge to node s is 1, from node The capacity of the directed virtual edge to the sink t is 1, and the capacity of the directed virtual edge from the sink t to the node The capacity of the reverse virtual edge is 1.
[0097] like Fig. 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 point s to the node The fifth directed real edge and node A directed virtual edge to the sink t, the starting point of the directed virtual edge is the node Among them, since the feasible augmenting path P1 obtained has a node Outgoing and passing through the slave node To Node The flow of the third directed real edge of , so the node The directed virtual edge to the sink t can be scheduled, and the first augmenting path P3 is used as the feasible augmenting path determined this time, and the capacity of the feasible augmenting path is 2. According to the capacity of the feasible augmenting path determined this time, the current residual network is updated.
[0098] like Fig.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 figure), from node The capacity of the fifth reverse real edge to node s is 3, from node The capacity of the directed virtual edge to the sink t is 1, and the capacity of the directed virtual edge from the sink t to the node The capacity of the reverse virtual edge is 2.
[0099] like Fig.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 point s to the node The fifth directed real edge and node To Node The third reverse real edge and node Directed virtual edge to sink t, due to the node in the first augmenting path P' To Node The flow of the third reverse real edge will expand the nodes in the feasible augmenting path P1 To Node The flow of the third directed real edge of There is currently no outflow from the real edge, that is, from the node The directed virtual edge to the sink t cannot be scheduled currently, so the first augmenting path P' cannot be used as a feasible augmenting path.
[0100] like Fig.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 point s to the node The fifth directed real edge and node To Node The third reverse real edge and node To Node The third directed real edge and node Directed virtual edge to sink t, since there is a feasible augmenting path P1 from node The flow to the sink t, so the node The directed virtual edge to the sink t can be scheduled currently, and the first augmenting path P4 is used as the feasible augmenting path determined this time, and the capacity of the feasible augmenting path is 1. The current residual network is updated according to the capacity of the feasible augmenting path determined this time.
[0101] like Fig.12 As shown, after updating the current residual network, from node s to node The capacity of the fifth directed real edge is 3, from node The capacity of the fifth reverse real edge to node s is 1, from node 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, from node To Node The capacity of the third directed real edge of is 0 (not shown in the figure), 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 figure), and the capacity of the directed virtual edge from the sink t to the node The capacity of the reverse virtual edge is 2.
[0102] like Fig.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 point s to the node The fifth directed real edge and node To Node The third directed real edge and node Directed virtual edge to sink t, since there is a feasible augmenting path from P4 Outflow to Node traffic, so the node The directed virtual edge to the sink t can be scheduled, and the first augmenting path P5 is used as the feasible augmenting path determined this time, and the capacity of the feasible augmenting path is 1. The current residual network is updated according to the capacity of the feasible augmenting path determined this time.
[0103] like Fig.13 As shown, after updating the current residual network, from node s to node The capacity of the fifth directed real edge is 2, from node The capacity of the fifth reverse real edge to node s is 2, from node To Node The capacity of the third directed real edge is 0, 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 figure), and the capacity of the directed virtual edge from the sink t to the node The capacity of the reverse virtual edge is 3.
[0104] like Fig.13 As shown, find the last first augmenting path , the first augmenting path P6 passes from node s to node The fifth directed real edge, from node Directed virtual edge to sink t, since there is a feasible augmenting path P1 from node Outgoing to Node traffic, so from the node The directed virtual edge to the sink t can be scheduled, and the first augmenting path P6 is used as the feasible augmenting path determined this time, and the capacity of the feasible augmenting path is 2. According to the capacity of the feasible augmenting path determined this time, the current residual network is updated.
[0105] like Fig.14 As shown, after updating the current residual network, from node s to node The capacity of the fifth directed real edge is 0, from node The capacity of the fifth reverse real edge to node s is 4, from node The capacity of the directed virtual edge to the sink t is 0, and the capacity of the directed virtual edge from the sink t to the node The capacity of the reverse virtual edge is 2.
[0106] So far, 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. According to the root node And the feasible augmented paths P1 to P6 are used to generate the aggregation tree. Since P1 and P4 have a path with the same capacity and opposite direction, the actual final path is and .like Fig.14 As shown in the generated aggregation tree, the source point s sends the data packet Send to node , the source point s sends the data packet Send to node , the source point s sends the data packet Send to node ,node Packet Send to node ,node Packet Aggregate into packets And send it to the root node ,node Packet Aggregate into packets And send it to the root node , the root node Packet and Aggregate to The above example of sending a data packet is only one implementation method. You can also send data packets Any one of them is sent to the node .
[0107] After the aggregation tree is generated, the relevant aggregation table can be configured on each network device node. The table items of the aggregation table include the aggregation task ID, the parent node port number, the child node port number, the aggregation status bitmap, the aggregation operation type, etc. The aggregation task ID is used to identify the aggregation task. Since the present disclosure adopts the network device port as the aggregation granularity, the child node port number is used to inform the network device which ports to aggregate the data from, and the aggregation status bitmap is used to maintain the status of the aggregation task. For the online aggregation method, that is, each time a data comes, the aggregation operation is directly performed. When the status bitmap indicates that all the child node data has been received, the data can be sent directly to the parent node port. For the offline aggregation method, that is, after all the data are collected, an aggregation operation is performed, and it needs to be sent to the parent node port after the aggregation operation is completed. The aggregation operation type represents a specific operation, such as summation, average, maximum value, etc.
[0108] The aggregation tree generation method provided in the present disclosure may also include: When the maximum flow is less than the first value, the root node is replaced, and the steps of constructing the flow network according to the network topology information, the root node, and the current remaining capacity of the first network device node are re-executed to the steps of determining a feasible augmenting path from the source point to the sink point based on the flow network, and determining the maximum flow from the source point to the sink point according to the feasible augmenting path. That is, after replacing the root node, a feasible aggregation tree is searched again.
[0109] The aggregation tree generation method provided in the present disclosure may also include: If all N network device nodes have been used as root nodes, and the maximum flow determined each time is less than the first value, delete at least one of the M data nodes, and update M and N. Then, re-execute the step of obtaining network topology information to determine a feasible augmenting path from the source point to the sink point based on the flow network, and determine the maximum flow from the source point to the sink point based on the feasible augmenting path.
[0110] Among them, if N network device nodes have been used as root nodes, and still no feasible aggregation tree can be found, it means that the current network cannot aggregate so many data packets. At least one of the M data nodes can be deleted. The number of deleted data nodes is not limited. For example, one data node can be deleted. In addition, which data node to delete can be set as needed, such as deleting the data node with the worst performance. When deleting at least one data node, M and N can be updated, and the network topology information can also be updated accordingly, and then a feasible aggregation formula can be found again.
[0111] If a feasible aggregation tree cannot be formed after deleting the data nodes, it is possible to determine whether there are network device nodes with idle 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, or the data packets to be aggregated can be sent to the parameter server for final aggregation. Alternatively, the scheduling of the aggregation task can be temporarily postponed until sufficient resources are available before scheduling the task.
[0112] In summary, in the present disclosure, for the first network device node whose current remaining capacity is greater than the first preset threshold, a directed virtual edge from the first network device node to the sink can be constructed, and the generation of the aggregation tree can be converted into solving the maximum flow problem. Only when there is traffic flowing out of the real edge of the network device node can its directed virtual edge be scheduled, which can avoid the phenomenon that the real edge is eliminated and there are virtual edges that are scheduled separately. In this way, when generating the aggregation tree, it is possible to avoid solving complex integer (or mixed integer) planning problems, and it is easier to find the optimal solution than the greedy algorithm, thereby improving the real-time and accuracy of the aggregation tree generation.
[0113] Based on the same inventive concept, the present disclosure also provides a device for generating an aggregation tree. Fig.15 is a block diagram of an exemplary aggregation tree generation device. Fig.15 As shown, the device 1500 may include: 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 M data nodes where the data packets to be aggregated are distributed and N network device nodes used to perform the aggregation operation, M≥1, N≥1; The second acquisition module 1502 is used to respectively acquire the current remaining capacity of each of the network device nodes, where the current remaining capacity is used to represent the number of data packets that the network device node can currently aggregate; A first determining module 1503 is used to determine a root node, where the root node is one of the N network device nodes; A construction module 1504 is used to construct a flow network according to 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 whose current remaining capacity is greater than a first preset threshold value among the N network device nodes, wherein the vertices of the flow network include a source node, a sink node and the N network device nodes, and the edges of the flow network include a directed real edge and a directed virtual edge from the first network device node to the sink node; A second determination module 1505 is used to determine a feasible augmenting path from the source point to the sink point based on the flow network, and determine the maximum flow from the source point to the sink point according to the feasible augmenting path; The aggregation tree generation module 1506 is used to generate an aggregation tree according to the feasible augmented path and the root node when the maximum flow is equal to a first value, wherein the first value is the sum of the numbers of the data packets to be aggregated that can be sent by the M data nodes.
[0114] Optionally, the construction module 1504 includes: A first construction submodule, used for constructing the source point and the sink point; A 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 the data packets to be aggregated that can be sent by the data node; A third construction submodule is used to determine, for each of the data nodes, 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, wherein the initial capacity of the second directed real edge is the number of the data packets to be aggregated that can be sent by the data node; A fourth construction submodule is used to construct, for each of the network device nodes, a third directed real edge 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; a fifth construction submodule, configured to construct a fourth directed real edge from the root node to the sink, wherein an initial capacity of the fourth directed real edge is a third preset threshold; a sixth construction submodule, configured to respectively 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; The seventh construction submodule is used to construct the flow network based on the source point, the sink point, 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.
[0115] Optionally, the seventh building block includes: A first determination submodule, configured to determine a first data node according to 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; A first aggregation submodule is used to determine, for each of the network device nodes, at least one second data node that is directly connected only to the network device node, and aggregate a target first directed real edge and a target second directed real edge into a fifth directed real edge from the source point to the network device node, wherein the target first directed real edge is a first directed real edge from the source point to the second data node, and the target second directed real edge is a second directed real edge from the second data node to the network device node; The second determination submodule is used to take the source point, the sink point, the first data node and the N network device nodes as vertices, and take 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 point 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.
[0116] Optionally, the initial capacity of the fifth directed real edge is determined by the following module: A first capacity determination submodule is configured to use the sum of the initial capacities corresponding to the target first directed real edges as the initial capacity of the fifth directed real edge; or The second capacity determination submodule is configured to use the sum of the initial capacities corresponding to the target second directed real edges as the initial capacity of the fifth directed real edge.
[0117] Optionally, the first aggregation submodule is used to: Aggregating the at least one second data node into a target data node; Aggregate each of the target first directed real edges into a sixth directed real edge from the source point to the target data node; Aggregate each of the target second directed real edges into a seventh directed real edge from the target data node to the network device node; The sixth directed real edge and the seventh directed real edge are aggregated into the fifth directed real edge from the source point to the network device node.
[0118] Optionally, the second determining module 1505 includes: A first acquisition submodule is used to acquire a current residual network corresponding to the flow network; A third determination submodule is used to determine whether there is a first augmenting path from the source point to the sink point based on the current residual network; a fourth determining submodule, configured to determine, if the first augmenting path exists, whether the first augmenting path needs to pass through the directed virtual edge; a fifth determining submodule, configured to determine whether the directed virtual edge that the first augmenting path needs to pass through can be currently scheduled if the first augmenting path needs to pass through the directed virtual edge; The sixth determination submodule is used to, if the directed virtual edge that the first augmenting path needs to pass through can currently be scheduled, use the first augmenting path as the feasible augmenting path determined this time, and update the current residual network according to the capacity of the feasible augmenting path determined this time, and then trigger the third determination submodule to determine whether there is a first augmenting path from the source point to the sink point based on the current residual network, until the first augmenting path does not exist.
[0119] Optionally, the second determining module 1505 is further configured to: If the directed virtual edge that the first augmenting path needs to pass through cannot be currently scheduled, triggering a third determination submodule to determine whether there is a first augmenting path from the source point to the sink point based on the current residual network until the first augmenting path does not exist.
[0120] Optionally, the fifth determining submodule is used to: Based on the first augmenting path and the obtained feasible augmenting path, determining whether there is traffic flowing out from a second network device node and passing through a directed real edge in the flow network, wherein the second network device node is a network device node that is a starting point of the directed virtual edge that the first augmenting path needs to pass through; If so, determining that the directed virtual edge that the first augmenting path needs to pass through can be currently scheduled; If not, it is determined that the directed virtual edge that the first augmenting path needs to pass through cannot be scheduled currently.
[0121] Optionally, the device 1500 further includes: A replacement module is used to replace the root node when the maximum flow is less than the first value, and trigger the construction module to re-execute the construction of the 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 determines a feasible augmenting path from the source point to the sink point based on the flow network, and determines the maximum flow from the source point to the sink point based on the feasible augmenting path.
[0122] Optionally, the device 1500 further includes: A deletion module is used to delete at least one of the M data nodes and update M and N if the N network device nodes have all served as root nodes and the maximum flow determined each time is less than the first value, and then trigger the first acquisition module to re-acquire network topology information to the second determination module based on the flow network, determine a feasible augmenting path from the source point to the sink point, and determine the maximum flow from the source point to the sink point according to the feasible augmenting path.
[0123] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0124] Fig.16 FIG. 7 is a block diagram of an electronic device 700 according to an exemplary embodiment. Fig.16 As shown, the electronic device 700 may include: a processor 701 , 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 .
[0125] The processor 701 is used to control the overall operation of the electronic device 700 to complete all or part of the steps in the above-mentioned aggregation tree generation method. The memory 702 is used to store various types of data to support the operation of the electronic device 700. For example, these data may include instructions for any application or method used to operate 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 (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 703 may include a screen and an audio component. The screen may be, for example, a touch screen, 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 signal may be further stored in the memory 702 or sent through the communication component 705. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 704 provides an interface between the processor 701 and other interface modules, and the above-mentioned other interface modules may be a keyboard, a mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 705 is used for wired or wireless communication between the electronic device 700 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 705 may include: Wi-Fi module, Bluetooth module, NFC module.
[0126] In an exemplary embodiment, the electronic device 700 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned aggregation tree generation method.
[0127] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned aggregation tree generation method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 702 including program instructions, and the above-mentioned program instructions can be executed by the processor 701 of the electronic device 700 to complete the above-mentioned aggregation tree generation method.
[0128] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a processor. When the computer program is executed by the processor, the steps of the above-mentioned aggregation tree generation method are implemented.
[0129] Fig.17 1 is a block diagram of an electronic device 1900 according to an exemplary embodiment. For example, the electronic device 1900 may be provided as a server. Fig.17 The electronic device 1900 includes a processor 1922, which may be one or more, and a memory 1932 for storing a computer program 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. In addition, the processor 1922 may be configured to execute the computer program to perform the above-mentioned aggregation tree generation method.
[0130] In addition, the electronic device 1900 may further include a power supply component 1926 and a communication component 1950. The power supply component 1926 may be configured to perform power management of the electronic device 1900, and the communication component 1950 may be configured to implement communication of the electronic device 1900, for example, wired or wireless communication. In addition, the electronic device 1900 may further include an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2000. TM , Mac OS X TM , Unix TM , Linux TM etc.
[0131] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned aggregation tree generation method are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 1932 including program instructions, and the above-mentioned program instructions can be executed by the processor 1922 of the electronic device 1900 to complete the above-mentioned aggregation tree generation method.
[0132] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a processor. When the computer program is executed by the processor, the steps of the above-mentioned aggregation tree generation method are implemented.
[0133] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0134] 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, the present disclosure will not further describe various possible combinations.
[0135] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A method for generating an aggregation tree, characterized in that: The method comprises: Acquire network topology information, wherein the network topology information is used to characterize the network topology of M data nodes where the data packets to be aggregated are distributed and N network device nodes used to perform the aggregation operation, M≥1, N≥1; Respectively obtaining the current remaining capacity of each of the network device nodes, where the current remaining capacity is used to represent the number of data packets that the network device node can currently aggregate; Determine a root node, where the root node is one of the N network device nodes; If it is determined that there is a first network device node whose current remaining capacity is greater than a first preset threshold value among the N network device nodes, a flow network is constructed according to the network topology information, the root node, and the current remaining capacity of the first network device node, wherein the vertices of the flow network include a source node, a sink node, and the N network device nodes, and the edges of the flow network include a directed real edge and a directed virtual edge from the first network device node to the sink node; Based on the flow network, determining a feasible augmenting path from the source point to the sink point, and determining a maximum flow from the source point to the sink point according to the feasible augmenting path; When the maximum flow is equal to a first value, an aggregation tree is generated according to the feasible augmenting path and the root node, wherein the first value is the sum of the numbers of the data packets to be aggregated that can be sent by the M data nodes.
2. The method according to claim 1, characterized in that: The step of constructing a flow network according to the network topology information, the root node, and the current remaining capacity of the first network device node includes: constructing the source point and the sink point; Constructing 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 the data packets to be aggregated that can be sent by the data node; For each of the data nodes, determining the network device node directly connected to the data node according to the network topology information, and constructing a second directed real edge from the data node to the network device node directly connected to the data node, wherein the initial capacity of the second directed real edge is the number of the data packets to be aggregated that can be sent by the data node; For each of the network device nodes, construct a third directed real edge 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; Constructing a fourth directed real edge from the root node to the sink, wherein an initial capacity of the fourth directed real edge is a third preset threshold; respectively constructing 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; The flow network is constructed based on the source point, the sink point, 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 constructing the flow network based on the source point, the sink point, 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 comprises: Determine a first data node according to the network topology information, where the first data node is the data node among the M data nodes that is directly connected to a plurality of the network device nodes; For each of the network device nodes, determine at least one second data node that is directly connected only 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 point to the network device node, the target first directed real edge is the first directed real edge from the source point 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 point, the sink point, the first data node and the N network device nodes are taken 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 point 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 taken 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 by: The sum of the initial capacities corresponding to the first target real edges is used as the initial capacity of the fifth real directed edge; or, The sum of the initial capacities corresponding to 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: Aggregating the target first directed real edge and the target second directed real edge into a fifth directed real edge from the source point to the network device node includes: Aggregating the at least one second data node into a target data node; Aggregate each of the target first directed real edges into a sixth directed real edge from the source point to the target data node; Aggregate each of the target second directed real edges into a seventh directed real edge from the target data node to the network device node; The sixth directed real edge and the seventh directed real edge are aggregated into the fifth directed real edge from the source point to the network device node.
6. The method according to claim 1, characterized in that The determining, based on the flow network, a feasible augmenting path from the source point to the sink point comprises: Obtaining a current residual network corresponding to the flow network; Based on the current residual network, determining whether there is a first augmenting path from the source point to the sink point; If the first augmenting path exists, determining 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, determining whether the directed virtual edge that the first augmenting path needs to pass through can be currently scheduled; If the directed virtual edge that the first augmenting path needs to pass through can currently be scheduled, the first augmenting path is used 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, and then the step of determining whether there is a first augmenting path from the source point to the sink point based on the current residual network is returned until the first augmenting path does not exist.
7. The method according to claim 6, characterized in that The determining, based on the flow network, a feasible augmenting path from the source point to the sink point further includes: If the directed virtual edge that the first augmenting path needs to pass through cannot be scheduled currently, return to the step of determining whether there is a first augmenting path from the source point to the sink point based on the current residual network until the first augmenting path does not exist.
8. The method according to claim 6, characterized in that The determining whether the directed virtual edge that the first augmenting path needs to pass through can be currently scheduled includes: Based on the first augmenting path and the obtained feasible augmenting path, determining whether there is traffic flowing out from a second network device node and passing through a directed real edge in the flow network, wherein the second network device node is a network device node that is a starting point of the directed virtual edge that the first augmenting path needs to pass through; If so, determining that the directed virtual edge that the first augmenting path needs to pass through can be currently scheduled; If not, it is determined that the directed virtual edge that the first augmenting path needs to pass through cannot be scheduled currently.
9. The method according to claim 1, characterized in that: The method further comprises: When the maximum flow is less than the first value, the root node is replaced, and the step of constructing a flow network according to the network topology information, the root node and the current remaining capacity of the first network device node is re-executed, and the step of determining a feasible augmenting path from the source point to the sink point based on the flow network, and determining the maximum flow from the source point to the sink point according to the feasible augmenting path is re-executed.
10. The method according to claim 9, characterized in that The method further comprises: If the N network device nodes have all served as root nodes and the maximum flow determined each time is less than the first value, delete at least one of the M data nodes, and update M and N. Then, re-execute the step of obtaining the network topology information to the step of determining a feasible augmenting path from the source point to the sink point based on the flow network, and determining the maximum flow from the source point to the sink point based on the feasible augmenting path.
11. The method according to any one of claims 1 to 10, characterized in that The data packet to be aggregated is a data packet composed of attention vectors generated during the large language model inference process.
12. A device for generating a polymerization tree, characterized in that: The device comprises: A first acquisition module is used to acquire network topology information, wherein the network topology information is used to characterize the network topology of M data nodes where the data packets to be aggregated are distributed and N network device nodes used to perform the aggregation operation, M≥1, N≥1; A second acquisition module, used to respectively acquire the current remaining capacity of each of the network device nodes, where the current remaining capacity is used to represent the number of data packets that the network device node can currently aggregate; A first determining module, configured to determine a root node, wherein the root node is one of the N network device nodes; A construction module, configured to construct a flow network according to 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 whose current remaining capacity is greater than a first preset threshold value among the N network device nodes, wherein the vertices of the flow network include a source node, a sink node, and the N network device nodes, and the edges of the flow network include a directed real edge and a directed virtual edge from the first network device node to the sink node; A second determination module is used to determine a feasible augmenting path from the source point to the sink point based on the flow network, and determine a maximum flow from the source point to the sink point according to the feasible augmenting path; An aggregation tree generation module is used to generate an aggregation tree according to the feasible augmented path and the root node when the maximum flow is equal to a first value, wherein the first value is the sum of the numbers of the data packets to be aggregated that can be sent by the M data nodes.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 11 are implemented.
14. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 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
Multicast transmissions management
US20210067438A1