Method for dividing target node set, electronic device, and computer program product
By dividing the target node collection according to the number of the source network node and the reference route length in the large -scale MESH network, the target node collection is divided, and the problem of excessive routing paths and uneven target node collection. Route path.
Patent Information
- Application Number
- CN202411372932.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In large-scale mesh networks, the dual-path and multi-path routing methods have the problem of long routing paths, which increases network delay and uneven division of target node sets, resulting in long multicast paths and shorter multicast paths .
By dividing the target node set according to the number of the source network node, and dividing the to-be-divided node set according to the reference routing path length, multiple target node subsets are obtained. This method ensures that the longest routing path length from the source network node to the target node does not exceed the preset reference routing path length.
Effectively solve the problem of long route paths when the target node collection is divided into a road -shaped routing, which improves the network performance, reduces the network delay, and balances the length of the transmission route.
Smart Images

Figure CN118869575B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of data exchange, and more specifically, to a method for partitioning a target node set, an electronic device, and a computer program product. Background Art
[0002] Multicast communication is an important communication method for interconnected networks. Multicast communication can be roughly divided into two methods: path routing and tree routing. Many studies have shown that the performance of path routing is superior to that of tree routing. Path-based methods only replicate messages at the source node and do not replicate messages at other nodes in the network, so there is no increase in message contention. However, the path for path routing to access all target nodes may be very long.
[0003] At present, dual-path, multi-path and column-path routing methods are several commonly used path division methods for 2D-mesh networks, and each method has its advantages and disadvantages. Especially in large-scale mesh networks, dual-path routing methods and multi-path routing methods have the problem of long routing paths, which increases network delay. Multi-path routing methods also have the problem of uneven division of target node sets, which will cause some multicast paths to be long and some multicast paths to be short.
[0004] In the related art, after the target node set is divided, the routing path for accessing all nodes in the divided node subset using path-shaped routing may be long. Currently, no effective solution has been proposed. Summary of the invention
[0005] The embodiments of the present application provide a method for dividing a target node set, an electronic device, and a computer program product to at least solve the problem that after dividing the target node set using related technologies, the routing path of all nodes in the divided node subset may be long using path-like routing.
[0006] According to one embodiment of the present application, a method for dividing a target node set is provided, comprising: dividing the target node set according to the number of the source network node to obtain a first node set and a second node set, wherein the number of the network node in the first node set is greater than the number of the source network node, and the number of the network node in the second node set is less than the number of the source network node, and the target node set has multiple target nodes, and the target node is a node in the specified grid network to receive a message sent by the source network node; dividing the node set to be divided according to a reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is a preset longest routing path length from the source network node to the target node, and the node set to be divided includes: the first node set and the second node set.
[0007] In an exemplary embodiment, when the specified mesh network is an M*N mesh network, before partitioning the set of nodes to be partitioned according to the reference routing path length to obtain multiple target node subsets, the method further includes: using the following function Number the network nodes in the specified mesh network: ;in, is the coordinate of the network node in the specified grid network, x is an integer greater than or equal to 0 and less than or equal to M-1, and y is an integer greater than or equal to 0 and less than or equal to N-1.
[0008] In an exemplary embodiment, the node set to be divided is divided according to the reference routing path length to obtain multiple target node subsets, including: initially dividing the node set to be divided to obtain k node subsets, wherein the horizontal coordinates of the network nodes in each node subset of the k node subsets are the same, the horizontal coordinates of the network nodes in the i-1th node subset are smaller than the horizontal coordinates of the network nodes in the i-th node subset, and i is an integer greater than or equal to 2 and less than or equal to k; and secondary dividing the k node subsets according to the reference routing path length to obtain multiple target node subsets.
[0009] In an exemplary embodiment, the k node subsets are divided twice according to the reference routing path length to obtain multiple target node subsets, including: storing the k node subsets in a storage set, and repeatedly performing the following steps until the storage set is empty to obtain multiple target node subsets: determining whether the first node subset in the storage set needs to supplement nodes according to the reference routing path length; if the first node subset needs to supplement nodes and there is a second node subset in the storage set, moving some or all of the nodes in the second node subset to the first node subset, wherein, in the case where all the nodes in the second node subset are moved to the first node subset, the second node subset is deleted from the storage set; if the first node subset needs to supplement nodes and there is no second node subset in the storage set, determining the first node subset as a target node subset and deleting the first node subset from the storage set; if the first node subset does not need to supplement nodes, determining the first node subset as a target node subset and deleting the first node subset from the storage set.
[0010] In an exemplary embodiment, the k node subsets are divided twice according to the reference routing path length to obtain multiple target node subsets, including: looping the following steps, wherein, when the following steps are performed for the first time, i is equal to 1 and j is equal to 1: step 1: determine the i-th node subset in the k node subsets as the j-th target node subset, and if there is an i+1-th node subset, execute step 2; if there is no i+1-th node subset, exit the loop; step 2: determine the shortest routing path length between the last network node in the i-th node subset and the source network node, and if the shortest routing path length is greater than or equal to the reference routing path length, execute step 3; if the shortest routing path length is less than the reference routing path length, execute step 4, wherein, if the node set to be divided is the first node set, the network node numbers in each node subset are sorted from small to large, and if the node set to be divided is the second node set, the network node numbers in each node subset are sorted from large to small row sorting; step 3: update the value of i to i+1, update the value of j to j+1, and jump to the step 1; step 4: determine the number of nodes to be supplemented, and jump to step 5, wherein the number of nodes to be supplemented is the number of network nodes to be added to the j-th target node subset; step 5: if the number of nodes to be supplemented is less than the number of network nodes in the i+1-th node subset, execute step 6; if the number of nodes to be supplemented is greater than or equal to the number of network nodes in the i+1-th node subset, execute step 7; step 6: add the i+1-th The first Q network nodes in the node subset are moved to the j-th target node subset, and the value of i is updated to i+1, the value of j is updated to j+1, and the process is skipped to step one, where Q is equal to the number of nodes to be supplemented; step seven: all network nodes in the i+1-th node subset are moved to the j-th target node subset, and if the i+2-th node subset exists, the number of nodes to be supplemented is recalculated, the value of i is updated to i+1, and the process is skipped to step five; if the i+2-th node subset does not exist, the process is skipped to exit the loop.
[0011] In an exemplary embodiment, determining the number of nodes to be supplemented includes: calculating the number of nodes to be supplemented using the following formula: ;in, is the number of nodes to be supplemented, is the difference between the reference routing path length and the shortest routing path length, is the horizontal coordinate of the target node in the i-th node subset, is the horizontal coordinate of the target node in the i+1th node subset.
[0012] In an exemplary embodiment, the recalculating the number of nodes to be supplemented includes: recalculating the number of nodes to be supplemented using the following formula: ;in, , is the number of network nodes in the i+1th node subset, is the horizontal coordinate of the target node in the i+1th node subset, is the horizontal coordinate of the target node in the i+2th node subset, is the number of nodes to be added after recalculation.
[0013] In an exemplary embodiment, determining the shortest routing path length between the last network node in the i-th node subset and the source network node includes: the coordinates of the last network node in the i-th node subset are , the coordinates of the source network node are In the case of , the shortest routing path length between the last network node in the i-th node subset and the source network node is equal to .
[0014] In an exemplary embodiment, after dividing the target node set into C target node subsets according to the C networks, the method further includes: determining C target node lists corresponding to the C target node subsets, wherein the i-th target node list has the number of the network node in the i-th target node subset, and i is a positive integer greater than or equal to 1 and less than or equal to C; obtaining C target messages according to the C target node lists through the source network node, wherein the header of the i-th target message carries the i-th target node list, and the i-th target message is a message to be received by the network node in the i-th target node subset.
[0015] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the first node set, the numbers of the network nodes in the i-th target node list are sorted from small to large.
[0016] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the second node set, the numbers of the network nodes in the i-th target node list are sorted from large to small.
[0017] In an exemplary embodiment, the method also includes: an intermediate network node in the designated grid network receives a target message, and determines through the intermediate network node whether the intermediate network node is the node corresponding to the first network node number in the target node list in the header of the target message; when the intermediate network node is the node corresponding to the first network node number in the target node list in the header of the target message, copying the payload part of the target message through the intermediate network node, deleting the first network node number in the target node list in the header of the target message, and forwarding the target message according to the first network node number in the target node list in the header of the target message when the updated target node list is not empty.
[0018] In an exemplary embodiment, the method further includes: when an intermediate network node in the designated grid network receives a target message, determining through the intermediate network node whether the intermediate network node is a node corresponding to the first network node number in the target node list in the header of the target message; when the intermediate network node is not a node corresponding to the first network node number in the target node list in the header of the target message, forwarding the target message through the intermediate network node according to the first network node number in the target node list in the header of the target message.
[0019] In an exemplary embodiment, forwarding the target message according to the first network node number in the target node list in the header of the target message includes: when the number of the intermediate network node is less than the first network node number, determining the network node with the largest number among all network nodes in the designated mesh network whose numbers are less than or equal to the first network node number and have a direct connection relationship with the intermediate network node as the network node to be forwarded, and forwarding the target message to the network node to be forwarded; when the number of the intermediate network node is greater than the first network node number, determining the network node with the smallest number among all network nodes in the designated mesh network whose numbers are greater than or equal to the first network node number and have a direct connection relationship with the intermediate network node as the network node to be forwarded, and forwarding the target message to the network node to be forwarded.
[0020] According to another embodiment of the present application, a device for dividing a target node set is also provided, including: a first dividing module, used to divide the target node set according to the number of the source network node to obtain a first node set and a second node set, wherein the number of the network node in the first node set is greater than the number of the source network node, and the number of the network node in the second node set is less than the number of the source network node, and the target node set has multiple target nodes, and the target node is a node in the specified grid network to receive the message sent by the source network node; a second dividing module, used to divide the node set to be divided according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is a preset longest routing path length from the source network node to the target node, and the node set to be divided includes: the first node set and the second node set.
[0021] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0022] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0023] According to another embodiment of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0024] Through the present application, the target node set is divided according to the number of the source network node to obtain the first node set and the second node set, and the first node set and the second node set are divided according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is the preset longest routing path length from the source network node to the target node. The above technical solution can be used to reasonably divide the target node set, solving the problem that after dividing the target node set, the routing path of all nodes in the divided node subset may be long when using path-shaped routing to access them. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0026] Figure 1 It is a hardware structure block diagram of a server device according to a method for dividing a target node set in an embodiment of the present application;
[0027] Figure 2 is a flowchart of a method for dividing a target node set according to an embodiment of the present application;
[0028] Figure 3 is a schematic diagram of a specified grid network according to an embodiment of the present application;
[0029] Figure 4 is a schematic diagram of dividing a set of nodes to be divided according to an embodiment of the present application;
[0030] Figure 5 is a schematic diagram of a network routing path according to an embodiment of the present application;
[0031] Figure 6 is a structural block diagram of a device for dividing a target node set according to an embodiment of the present application;
[0032] Figure 7 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0035] The target node set partitioning method embodiment provided in the embodiment of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a server device of a method for dividing a target node set in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0036] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for dividing the target node set in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0037] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0038] For a better understanding, the following briefly describes unicast communication and multicast communication:
[0039] Unicast communication is sending a message from a source node to a single destination node, while multicast communication is sending a message from one source node to any number of destination nodes.
[0040] Assume that a source multicast message is replicated at the source node to obtain multiple source multicast messages, and each source multicast message is sent to a specific destination node (this is called unicast-based multicast). In this way, multicast can be easily implemented without hardware overhead. However, this method is inefficient because sending multiple copies of the same message into the network not only generates a lot of traffic, but also introduces large serialization delays at the injection point. Multicast communication has a significant impact on the performance of on-chip multiprocessor systems.
[0041] At present, hardware-based multicast methods can be roughly divided into two methods: path-based routing and tree-based routing. In the tree-based routing method, a spanning tree is built at the source node and multicast messages are sent along the tree. The source node is regarded as the root, and the target node is the leaf of the tree. During the routing process, the message is copied at the branch node and forwarded along multiple output channels to reach each target node in the target node set. In the path-based routing method, the node prepares and sends the source message to the target node through the target node list in the message header. The message is routed along the path and first reaches the first target node in the target node list in the message header. At this time, the source message is absorbed by the current node and is also passed to the corresponding output channel to continue the path to the next target node in the list. In this way, the message is eventually delivered to all specified target nodes. Many studies have shown that path-based methods exhibit superior performance characteristics than tree-based methods. Path-based methods only copy messages at the source node and do not copy messages at other nodes in the network, so they do not increase message contention. However, the path for path-based routing to visit all target nodes may be very long. In order to reduce the length of the multicast path, the target node can be divided into several disjoint subsets at the network interface of the source node, each subset corresponds to an independent multicast path and routes a copy of the message.
[0042] Path partitioning methods reduce latency and improve network performance by effectively partitioning target nodes into disjoint subsets. Several commonly used path partitioning methods for 2D-mesh and n-cube networks are dual-path, multi-path, and column-path routing methods, each of which has its own advantages and disadvantages. The dual-path routing algorithm performs well when the network is small, however, as the network expands, a multicast message may require a long path to be routed to all target nodes, which increases latency. Compared with the dual-path routing algorithm, the multi-path routing algorithm is better. This method increases the number of independent multicast paths and reduces the path length to a certain extent. However, this method has the problem of uneven partitioning of the target node set, which will result in some multicast paths being longer and some multicast paths being shorter. These two routing algorithms are deadlock-free. The column path routing algorithm divides the network into more areas according to the columns of the target nodes. This method reduces the length of the longest path in multicast communication and improves the parallelism of the network. However, since the network is divided into more subsets of target nodes, more copies of the source message are required, which increases the delay in the message preparation phase. This method requires the use of virtual channels to avoid network deadlock.
[0043] When the source node is not in the central area of the network but in the edge area of the network, the three multicast routing algorithms all have the problem of uneven network area division, the dual-path routing algorithm is the most serious, the multi-path routing algorithm is second, and the column path routing algorithm is further alleviated. Based on this, it is urgent to propose a multicast routing algorithm that reduces network latency, improves network parallelism, and further alleviates the problem of uneven network area division.
[0044] In this regard, a method for dividing a target node set is provided in this embodiment. Figure 2 is a flow chart of a method for dividing a target node set according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps S202-S206:
[0045] Step S202: Divide the target node set according to the number of the source network node to obtain a first node set and a second node set, wherein the number of the network node in the first node set is greater than the number of the source network node, and the number of the network node in the second node set is less than the number of the source network node, and the target node set has multiple target nodes, and the target node is a node in the specified mesh network to receive the message sent by the source network node;
[0046] Optionally, specify mesh networks including: 2D-mesh and n-cube networks.
[0047] In an exemplary embodiment, when the specified mesh network is an M*N mesh network, before the above step S202, the method further includes: using the following function Number the network nodes in the specified mesh network: ;
[0048] in, is the coordinate of the network node in the specified grid network, x is an integer greater than or equal to 0 and less than or equal to M-1, and y is an integer greater than or equal to 0 and less than or equal to N-1.
[0049] For example, when the designated mesh network is a 4*7 mesh network, after numbering the network nodes in the designated mesh network, the number of each mesh node is as follows: Figure 3 shown.
[0050] Step S204: Divide the node set to be divided according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is a preset longest routing path length from the source network node to the target node, and the node set to be divided includes: the first node set and the second node set.
[0051] It should be noted that the node set to be divided is the first node set or the second node set, that is, in this embodiment, it is necessary to divide the first node set and the second node set at the same time according to the reference routing path length, so that after multiple target node subsets are obtained by division, the longest routing path length from the source network node to all target nodes in the specified node set does not exceed the reference routing length.
[0052] In an exemplary embodiment, dividing the node set to be divided according to the reference routing path length includes: dividing the node set to be divided when the number of nodes in the node set to be divided is greater than a preset threshold. It should be noted that in this embodiment, unnecessary division operations can be avoided in this way.
[0053] It should be noted that the designated node set includes all nodes in the target node set except the specific node set, wherein the longest routing path length from the source network node to each target node in the specific node set exceeds the reference routing length. It should be noted that this is due to the nature of the topological structure of the designated mesh network itself, that is, no matter how the target node set is divided, the longest routing path length from the source network node to each target node in the specific node set will exceed the reference routing length.
[0054] In the above steps, the target node set is divided according to the number of the source network node to obtain the first node set and the second node set, and the first node set and the second node set are divided according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is the preset longest routing path length from the source network node to the target node. The above technical solution can be used to reasonably divide the target node set, solving the problem that after dividing the target node set, the routing path of all nodes in the divided node subset may be long when using path-shaped routing to access them.
[0055] In an exemplary embodiment, the above step S204 includes the following steps S11-S12:
[0056] Step S11: Initially partition the node set to be partitioned to obtain k node subsets, wherein the horizontal coordinates of the network nodes in each of the k node subsets are the same, the horizontal coordinates of the network nodes in the i-1th node subset are smaller than the horizontal coordinates of the network nodes in the i-th node subset, i is an integer greater than or equal to 2 and less than or equal to k. K is a positive integer greater than or equal to 2;
[0057] Step S12: performing secondary division on the k node subsets according to the reference routing path length to obtain multiple target node subsets.
[0058] In an exemplary embodiment, the above step S12 includes: storing k node subsets into a storage set, and repeatedly performing the following steps S21-S24 until the storage set is empty, thereby obtaining multiple target node subsets:
[0059] Step S21: determining whether the first node subset in the storage set needs to be supplemented with nodes according to the reference routing path length;
[0060] Step S22: when the first node subset needs to supplement nodes and there is a second node subset in the storage set, move some or all nodes in the second node subset to the first node subset, wherein when all nodes in the second node subset are moved to the first node subset, the second node subset is deleted from the storage set;
[0061] Step S23: when the first node subset needs to supplement nodes and the second node subset does not exist in the storage set, determine the first node subset as a target node subset, and delete the first node subset from the storage set;
[0062] Step S24: when the first node subset does not need to supplement nodes, the first node subset is determined as a target node subset, and the first node subset is deleted from the storage set.
[0063] In an exemplary embodiment, the above step S204 includes: looping through the following steps 1 to 7, wherein when the following steps are performed for the first time, i is equal to 1 and j is equal to 1:
[0064] Step 1: determine the i-th node subset among the k node subsets as the j-th target node subset, and if the i+1-th node subset exists, execute step 2; if the i+1-th node subset does not exist, exit the loop;
[0065] Optionally, after the ith node subset among the k node subsets is determined as the jth target node subset, the longest path length from the ith node subset to the source node may be determined as a specified value corresponding to the jth target node subset.
[0066] Step 2: Determine the shortest routing path length between the last network node in the i-th node subset and the source network node, and when the shortest routing path length is greater than or equal to the reference routing path length, execute step 3; when the shortest routing path length is less than the reference routing path length, execute step 4, wherein, when the node set to be divided is the first node set, the network node numbers in each node subset are sorted from small to large, and when the node set to be divided is the second node set, the network node numbers in each node subset are sorted from large to small;
[0067] In an exemplary embodiment, determining the shortest routing path length between the last network node in the i-th node subset and the source network node includes: the coordinates of the last network node in the i-th node subset are , the coordinates of the source network node are In the case of , the shortest routing path length between the last network node in the i-th node subset and the source network node is equal to .
[0068] Step 3: Update the value of i to i+1, update the value of j to j+1, and jump to step 1;
[0069] Step 4: Determine the number of nodes to be supplemented, and jump to step 5, wherein the number of nodes to be supplemented is the number of network nodes to be added to the j-th target node subset;
[0070] In an exemplary embodiment, determining the number of nodes to be supplemented includes: calculating the number of nodes to be supplemented using the following formula: ;
[0071] in, is the number of nodes to be supplemented, is the difference between the reference routing path length and the shortest routing path length, is the horizontal coordinate of the target node in the i-th node subset, is the horizontal coordinate of the target node in the i+1th node subset.
[0072] Step 5: When the number of nodes to be supplemented is less than the number of network nodes in the i+1th node subset, execute step 6; when the number of nodes to be supplemented is greater than or equal to the number of network nodes in the i+1th node subset, execute step 7;
[0073] Step 6: Move the first Q network nodes in the i+1th node subset to the jth target node subset, update the value of i to i+1, update the value of j to j+1, and jump to the step 1, where Q is equal to the number of nodes to be supplemented;
[0074] Step 7: Move all network nodes in the i+1th node subset to the jth target node subset, and if the i+2th node subset exists, recalculate the number of nodes to be supplemented, update the value of i to i+1, and jump to the step 5; if the i+2th node subset does not exist, exit the loop.
[0075] In an exemplary embodiment, recalculating the number of nodes to be supplemented includes:
[0076] Use the following formula to recalculate the number of nodes to be supplemented: ;
[0077] in, , is the number of network nodes in the i+1th node subset, is the horizontal coordinate of the target node in the i+1th node subset, is the horizontal coordinate of the target node in the i+2th node subset, is the number of nodes to be supplemented after recalculation. It should be noted that Z is used to indicate the number of step 7 since the last execution of step 3. For example, after executing step 3, if step 7 is executed for the first time, then Z=1.
[0078] For better understanding, the following is a detailed description:
[0079] for 2D-mesh network, the specific implementation process of dividing the target node set is as follows:
[0080] 1. According to the source node , divide the target node set D into and Two sets, where The number of the target node in is greater than the number of the source node S, The number of the target node in is less than the number of the source node S.
[0081] 2. Divide the sets H and L according to the horizontal coordinates of the target nodes.
[0082] Divide the set H into multiple subsets , where i can be , is the set of all target nodes with abscissa i in set H;
[0083] Divide the set L into multiple subsets , where i can be , It is the set of all target nodes with horizontal coordinate i in the set L.
[0084] After the division is completed, Arrange the nodes in ascending order according to the node number. The nodes in are arranged in descending order according to the node number.
[0085] 3. Get the route collection.
[0086] In order of i from small to large, and The target nodes in are included in the routing set.
[0087] Route Collection The subset is obtained as follows:
[0088] Assume that the reference routing path length is , There are nodes, H has k subsets, namely , , , ,in .
[0089] (1) Set the route set ,Pick The last node in , calculate the shortest path length from the source node to this node , . Continue with (2).
[0090] (2) Judgment Is it greater than 0?
[0091] if , indicating that the shortest path length is greater than the reference routing path length, let the routing set ,Pick The last node in , same as step (1).
[0092] if , calculate the number of nodes to be supplemented , round down. Continue with (3).
[0093] (3) Compare the number of nodes in the next subset with the number of supplementary nodes:
[0094] if The number of nodes , then take Before Nodes are added to the collection In, at this time Remaining nodes. ,Pick The last node in , same as step 3(1).
[0095] if The number of nodes , then All nodes are put into the collection In . , calculate the number of nodes to be supplemented ,Compare The number of nodes and The size of is the same as step 3(3).
[0096] This process repeats until Included in the routing collection Finally, we get t1 The routing subset (i.e., the target node subset) of , , , , and then sort the target nodes in these routing subsets in ascending order.
[0097] Similarly, we get t2 The routing subset of , , , , and then sort the target nodes in these routing subsets in descending order.
[0098] In an exemplary embodiment, after the above step S204, the method further includes:
[0099] Step S31: when the target node set is divided into C target node subsets, C target node lists corresponding to the C target node subsets are determined, wherein the i-th target node list has the number of the network node in the i-th target node subset, i is a positive integer greater than or equal to 1 and less than or equal to C; C is a positive integer greater than or equal to 2;
[0100] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the first node set, the numbers of the network nodes in the i-th target node list are sorted from small to large. When the network nodes in the i-th target node subset are network nodes in the second node set, the numbers of the network nodes in the i-th target node list are sorted from large to small.
[0101] Step S32: Obtain C target messages through the source network node according to the C target node lists, wherein the header of the i-th target message carries the i-th target node list, and the i-th target message is a message to be received by the network node in the i-th target node subset.
[0102] That is to say, after dividing the target node set, the source message can be copied to the source node, and a total of Source packets. Each packet carries a routing subset. , .
[0103] In an exemplary embodiment, the method further comprises the following steps S41-S43:
[0104] Step S41: an intermediate network node in the designated mesh network receives a target message, and determines through the intermediate network node whether the intermediate network node is a node corresponding to the first network node number in the target node list in the header of the target message;
[0105] Optionally, the intermediate network node also includes the source network node.
[0106] Step S42: When the intermediate network node is the node corresponding to the first network node number in the target node list in the header of the target message, the payload part of the target message is copied through the intermediate network node, and the first network node number in the target node list in the header of the target message is deleted, and when the updated target node list is not empty, the target message is forwarded according to the first network node number in the target node list in the header of the target message.
[0107] Step S43: When the intermediate network node is not the node corresponding to the first network node number in the target node list in the header of the target message, the target message is forwarded through the intermediate network node according to the first network node number in the target node list in the header of the target message.
[0108] In an exemplary embodiment, forwarding the target message according to the first network node number in the target node list in the header of the target message includes: when the number of the intermediate network node is less than the first network node number, determining the network node with the largest number among all network nodes in the designated mesh network whose numbers are less than or equal to the first network node number and have a direct connection relationship with the intermediate network node as the network node to be forwarded, and forwarding the target message to the network node to be forwarded; when the number of the intermediate network node is greater than the first network node number, determining the network node with the smallest number among all network nodes in the designated mesh network whose numbers are greater than or equal to the first network node number and have a direct connection relationship with the intermediate network node as the network node to be forwarded, and forwarding the target message to the network node to be forwarded.
[0109] That is to say, the network node to be forwarded can be determined by the routing function Q below, that is, the network node to be forwarded=Q (intermediate network node, first network node).
[0110] It should be noted that currently, the commonly used path-based routing methods are all based on Hamiltonian paths, such as dual-path routing methods and multi-path routing methods. Hamiltonian paths ensure that there is no deadlock in network multicast paths. Nodes are numbered starting from 0 according to their order in the Hamiltonian path, such as Figure 3 As shown, the coordinates of the node in the lower left corner of the mesh network are , each node is recorded as , such as the node with sequence number 18 is represented as node or node 18.
[0111] exist Figure 3 middle," " indicates a node, " " indicates a bidirectional link, and the number in the upper left corner of the node indicates the node number. According to the routing direction, the two routing directions of the bidirectional link are defined as uplink and downlink respectively. The uplink is a unidirectional link from a node with a smaller number to a node with a larger number, and the downlink is a unidirectional link from a node with a larger number to a node with a smaller number.
[0112] First, consider the case of unicast communication. If the sequence number of the target node is greater than the sequence number of the source node, it is routed through the uplink; otherwise, it is routed through the downlink. Given a source node and a target node, Figure 3 It can be easily observed that there is always a shortest path to deliver a message. Obviously, the performance of the routing scheme depends on the choice of Hamilton path.
[0113] Let N be the set of 2D-mesh nodes. Define the routing function Q, , expressed as , node w is adjacent to node a and satisfies , where node g is adjacent to node a.
[0114] For any two nodes a and b, a path from a to b can be selected using the P function. ,in , , , In channel network 1 , ; In channel network 2 , .
[0115] That is to say, this embodiment can use the routing function Q for routing, from the source node To get started, use the routing function , transmit the message to the node adjacent to the source node , when the message arrives at the node, determine whether the node is a node in the routing subset. If so, ( ), the message is copied and absorbed at the node, and the node is removed from the routing subset, and the routing function continues to be used , transmit the message to the node ;if not ( ), then use the routing function , transmit the message to the node This process is repeated until there is no target node in the target node subset, that is, the target node subset is an empty set, and the routing ends.
[0116] It should be noted that the final length of all routing paths is ,satisfy ,in, , , , . The specified value corresponding to the j-th target node subset.
[0117] That is, the minimum length of the routing path is the minimum of all shortest paths, and the maximum length is the sum of all shortest path lengths and the reference routing path length. Since all shortest paths (the shortest routing path length from the source node to the network target node) are determined by the nature of the topological structure of the network itself and are not within the scope of discussion of this application, the solution proposed in this application can control the routing path length within a certain range in terms of the multicast routing algorithm, balance the load of each routing path, improve network performance, and further reduce the multicast routing algorithm with large differences in routing path lengths.
[0118] For a better understanding, the following is an explanation with specific examples:
[0119] For one mesh topology network, the source node is . Set the reference routing path length to . Assume that the target node set is:
[0120]
[0121] Using the path-based multicast routing algorithm proposed in this application, the specific process is as follows:
[0122] 1. According to the source node , divide the target node set D into and Two collections.
[0123]
[0124]
[0125] 2. Divide the sets H and L according to the horizontal coordinates of the target nodes.
[0126] Divide H by the horizontal coordinate of the target node and Arrange the nodes in ascending order according to the node number, and get:
[0127] ;
[0128] ;
[0129] ;
[0130] ;
[0131] ;
[0132] ;
[0133] Divide L by the horizontal coordinate of the target node, and Arrange the nodes in descending order according to the node number, and get:
[0134] ;
[0135] ;
[0136] ;
[0137] ;
[0138] ;
[0139] ;
[0140] ;
[0141] 3. Get the route collection.
[0142] Route Collection (that is, the target node set mentioned above) is obtained as follows:
[0143] First, , The last node in is , calculate the shortest path length from the source node to this node , ,because , calculate the number of nodes to be supplemented:
[0144] ;
[0145] because The number of nodes ,Pick The first 3 nodes are put into the collection middle, ,at this time There is one node left in .
[0146] make ,Pick The last node in , calculate the shortest path length from the source node to this node , , calculate the number of nodes to be supplemented:
[0147] ;
[0148] because The number of nodes , then All nodes are put into the collection In . , calculate the number of nodes to be supplemented:
[0149] ;
[0150] because The number of nodes ,Pick The first node is put into the collection middle, ,at this time There are 2 nodes left in .
[0151] make ,Pick The last node in , calculate the shortest path length from the source node to this node , The number of nodes to be added is calculated as:
[0152] ;
[0153] because The number of nodes ,Pick The first 3 nodes are put into the collection middle, ,at this time There are 2 nodes left in .
[0154] make ,Pick The last node in , calculate the shortest path length from the source node to this node , , calculate the number of nodes to be supplemented:
[0155] ;
[0156] because The number of nodes ,Will All nodes are put into the collection middle, , The routing node subsets are divided. The target nodes in these routing subsets are arranged in ascending order, and finally the following is obtained:
[0157] ;
[0158] ;
[0159] ;
[0160] ;
[0161] Similarly, if Figure 4 As shown, we get The routing subset is:
[0162] ;
[0163] ;
[0164] ;
[0165] 4. Prepare the message.
[0166] The source message is copied at the source node, and a total of 7 source messages are obtained. Each message carries a list of target nodes.
[0167] 5. Use routing function Q for routing.
[0168] by Take the source node as an example. To get started, use the routing function , the message is transmitted to the node 30 adjacent to the source node. Since the node is in the target node list, the message is copied and absorbed at the node 30, and the node is removed from the target node list. , continue to use the routing function , transmit the message to node 29; since node 29 is not a routing subset The target node in, so use the routing function , the message is transmitted to node 28. This process is repeated until there is no target node in the target node list, that is, the target node list is an empty set, and the routing is terminated.
[0169] The routing paths of the above 7 routing subsets are as follows: Figure 5 As shown, the path lengths are , , , , , , .
[0170] ;
[0171] ;
[0172] ;
[0173] .
[0174] That is, the length of all routing paths is Between, among them, Figure 5 middle," " indicates the target node, " " indicates a node, " " indicates an unused link, " " indicates the link and routing direction used to complete the routing.
[0175] It should be noted that this application proposes a path-based multicast routing algorithm, which sets the reference path length , divide the target node subset into different routing subsets, and then complete the routing through the Hamiltonian path. The algorithm is deadlock-free and reduces cost overhead. The value is often set according to the requirements and experience for network performance. In addition, the maximum value of the routing path length of the method proposed in this application is the shortest routing path length from the source node to the network destination node or the set reference path length, while the shortest routing path length from the source node to the network destination node is determined by the nature of the topological structure of the network itself, which is not within the scope of discussion of this application. Therefore, the scheme proposed in this application can control the routing path length within a certain range in terms of the multicast routing algorithm, balance the load of each routing path, improve network performance, and further alleviate the problem of large differences in routing path lengths in the multicast routing algorithm.
[0176] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0177] In this embodiment, a device for dividing a target node set is also provided to implement the above-mentioned embodiments and preferred implementation modes, which have been described and will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the modules described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0178] Figure 6 is a structural block diagram of a device for dividing a target node set according to an embodiment of the present application, such as Figure 6 As shown, the device comprises:
[0179] A first partitioning module 62 is used to partition the target node set according to the number of the source network node to obtain a first node set and a second node set, wherein the number of the network node in the first node set is greater than the number of the source network node, and the number of the network node in the second node set is less than the number of the source network node, and the target node set has multiple target nodes, and the target node is a node in the specified mesh network to receive the message sent by the source network node;
[0180] The second partitioning module 64 is used to partition the node set to be partitioned according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is the preset longest routing path length from the source network node to the target node, and the node set to be partitioned includes: the first node set and the second node set.
[0181] The above device divides the target node set according to the number of the source network node to obtain the first node set and the second node set, and divides the first node set and the second node set according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is the preset longest routing path length from the source network node to the target node. The above technical solution can reasonably divide the target node set, solving the problem that after dividing the target node set, the routing path of all nodes in the divided node subset may be long when using path-shaped routing to access them.
[0182] In an exemplary embodiment, the apparatus further comprises: a numbering module, configured to use the following function when the specified mesh network is an M*N mesh network: Number the network nodes in the specified mesh network: ;in, is the coordinate of the network node in the specified grid network, x is an integer greater than or equal to 0 and less than or equal to M-1, and y is an integer greater than or equal to 0 and less than or equal to N-1.
[0183] In an exemplary embodiment, the second partitioning module 64 is further used to perform an initial partitioning on the node set to be partitioned to obtain k node subsets, wherein the horizontal coordinates of the network nodes in each of the k node subsets are the same, the horizontal coordinates of the network nodes in the i-1th node subset are smaller than the horizontal coordinates of the network nodes in the i-th node subset, and i is an integer greater than or equal to 2 and less than or equal to k; the k node subsets are secondary partitioned according to the reference routing path length to obtain multiple target node subsets.
[0184] In an exemplary embodiment, the second partitioning module 64 is further used to store k node subsets into a storage set, and repeatedly perform the following steps until the storage set is empty to obtain multiple target node subsets: determine whether the first node subset in the storage set needs to supplement nodes based on the reference routing path length; if the first node subset needs to supplement nodes and there is a second node subset in the storage set, move some or all of the nodes in the second node subset to the first node subset, wherein, in the case where all the nodes in the second node subset are moved to the first node subset, the second node subset is deleted from the storage set; if the first node subset needs to supplement nodes and there is no second node subset in the storage set, determine the first node subset as a target node subset and delete the first node subset from the storage set; if the first node subset does not need to supplement nodes, determine the first node subset as a target node subset and delete the first node subset from the storage set.
[0185] In an exemplary embodiment, the second partitioning module 64 is further used to loop through the following steps, wherein, when the following steps are first executed, i is equal to 1 and j is equal to 1: Step 1: Determine the i-th node subset among the k node subsets as the j-th target node subset, and if the i+1-th node subset exists, execute step 2; if the i+1-th node subset does not exist, exit the loop; Step 2: Determine the shortest routing path length between the last network node in the i-th node subset and the source network node, and if the shortest routing path length is greater than or equal to the reference routing path length, execute step 3; if the shortest routing path length is less than the reference routing path length, execute step 4, wherein, if the node set to be partitioned is the first node set, the network node numbers in each node subset are sorted from small to large, and if the node set to be partitioned is the second node set, the network node numbers in each node subset are sorted from large to small; Step 3: Update the value of i to i+1, update the value of j to j+1, and jump to step 1; step 4: determine the number of nodes to be supplemented, and jump to step 5, wherein the number of nodes to be supplemented is the number of network nodes to be added to the j-th target node subset; step 5: if the number of nodes to be supplemented is less than the number of network nodes in the i+1-th node subset, execute step 6; if the number of nodes to be supplemented is greater than or equal to the number of network nodes in the i+1-th node subset, execute step 7; step 6: add the first nodes in the i+1-th node subset to the first node subset; Q network nodes are moved to the j-th target node subset, and the value of i is updated to i+1, the value of j is updated to j+1, and the process is skipped to step one, wherein Q is equal to the number of nodes to be supplemented; step seven: all network nodes in the i+1-th node subset are moved to the j-th target node subset, and if the i+2-th node subset exists, the number of nodes to be supplemented is recalculated, the value of i is updated to i+1, and the process is skipped to step five; if the i+2-th node subset does not exist, the process is skipped to exit the loop.
[0186] In an exemplary embodiment, the second partitioning module 64 is further configured to calculate the number of nodes to be supplemented using the following formula: ;in, is the number of nodes to be supplemented, is the difference between the reference routing path length and the shortest routing path length, is the horizontal coordinate of the target node in the i-th node subset, is the horizontal coordinate of the target node in the i+1th node subset.
[0187] In an exemplary embodiment, the second partitioning module 64 is further configured to recalculate the number of nodes to be supplemented using the following formula: ;in, , is the number of network nodes in the i+1th node subset, is the horizontal coordinate of the target node in the i+1th node subset, is the horizontal coordinate of the target node in the i+2th node subset, is the number of nodes to be added after recalculation.
[0188] In an exemplary embodiment, the second partitioning module 64 is further configured to: , the coordinates of the source network node are In the case of , the shortest routing path length between the last network node in the i-th node subset and the source network node is equal to .
[0189] In an exemplary embodiment, the device also includes: a processing module, which is used to divide the node set to be divided according to the reference routing path length to obtain multiple target node subsets, and then determine C target node lists corresponding to the C target node subsets when the target node set is divided into C target node subsets, wherein the i-th target node list has the number of the network node in the i-th target node subset, and i is a positive integer greater than or equal to 1 and less than or equal to C; obtain C target messages through the source network node according to the C target node list, wherein the header of the i-th target message carries the i-th target node list, and the i-th target message is the message to be received by the network node in the i-th target node subset.
[0190] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the first node set, the numbers of the network nodes in the i-th target node list are sorted from small to large.
[0191] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the second node set, the numbers of the network nodes in the i-th target node list are sorted from large to small.
[0192] In an exemplary embodiment, the processing module is also used to receive a target message at an intermediate network node in the designated grid network, and determine through the intermediate network node whether the intermediate network node is the node corresponding to the first network node number in the target node list in the header of the target message; when the intermediate network node is the node corresponding to the first network node number in the target node list in the header of the target message, copy the payload part of the target message through the intermediate network node, delete the first network node number in the target node list in the header of the target message, and forward the target message according to the first network node number in the target node list in the header of the target message when the updated target node list is not empty.
[0193] In an exemplary embodiment, the processing module is also used to, when an intermediate network node in the designated grid network receives a target message, determine through the intermediate network node whether the intermediate network node is the node corresponding to the first network node number in the target node list in the header of the target message; when the intermediate network node is not the node corresponding to the first network node number in the target node list in the header of the target message, forward the target message through the intermediate network node according to the first network node number in the target node list in the header of the target message.
[0194] In an exemplary embodiment, the processing module is also used to, when the number of the intermediate network node is smaller than the number of the first network node, determine the network node with the largest number among all the network nodes in the designated mesh network whose numbers are smaller than or equal to the first network node number and have a direct connection relationship with the intermediate network node as the network node to be forwarded, and forward the target message to the network node to be forwarded; when the number of the intermediate network node is greater than the number of the first network node, determine the network node with the smallest number among all the network nodes in the designated mesh network whose numbers are greater than or equal to the first network node number and have a direct connection relationship with the intermediate network node as the network node to be forwarded, and forward the target message to the network node to be forwarded.
[0195] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0196] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0197] Optionally, in this embodiment, the computer program may be configured to perform the following steps by means of the computer program:
[0198] S1, dividing the target node set according to the number of the source network node to obtain a first node set and a second node set, wherein the number of the network node in the first node set is greater than the number of the source network node, and the number of the network node in the second node set is less than the number of the source network node, and the target node set has multiple target nodes, and the target node is a node in the specified mesh network to receive the message sent by the source network node;
[0199] S2. Divide the node set to be divided according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is a preset longest routing path length from the source network node to the target node, and the node set to be divided includes: the first node set and the second node set.
[0200] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0201] The embodiment of the present application also provides an electronic device, such as Figure 7 As shown, the electronic device includes a memory 702 and a processor 704. The memory 702 stores a computer program, and the processor 704 is configured to execute the steps in any of the above method embodiments through the computer program.
[0202] Optionally, in this embodiment, the processor 704 may be configured to perform the following steps through a computer program:
[0203] S1, dividing the target node set according to the number of the source network node to obtain a first node set and a second node set, wherein the number of the network node in the first node set is greater than the number of the source network node, and the number of the network node in the second node set is less than the number of the source network node, and the target node set has multiple target nodes, and the target node is a node in the specified mesh network to receive the message sent by the source network node;
[0204] S2. Divide the node set to be divided according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is a preset longest routing path length from the source network node to the target node, and the node set to be divided includes: the first node set and the second node set.
[0205] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0206] Alternatively, a person skilled in the art may understand that: Figure 7 The structure shown is for illustration only. Figure 7 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 7 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 7 Different configurations shown.
[0207] Among them, the memory 702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for dividing the target node set in the embodiment of the present application. The processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, realizing the above-mentioned method for dividing the target node set. The memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 702 may further include a memory remotely arranged relative to the processor 704, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 702 can be specifically, but not limited to, used to store information such as system configuration files. As an example, such as Figure 7 As shown, the memory 702 may include but is not limited to the first partitioning module 62 and the second partitioning module 64 in the target node set partitioning device. In addition, other module units in the target node set partitioning device may also be included but are not limited to, which will not be described in detail in this example.
[0208] Optionally, the transmission device 706 is used to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one example, the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0209] In addition, the electronic device further includes: a display 708; and a connection bus 710, which is used to connect various module components in the electronic device.
[0210] In other embodiments, the electronic device may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. The nodes may form a peer-to-peer network, and any form of computing device, such as a server, terminal, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0211] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0212] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0213] The embodiments of the present application also provide a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any one of the above method embodiments.
[0214] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0215] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for partitioning a target node set, characterized in that: include: Dividing the target node set according to the number of the source network node to obtain a first node set and a second node set, wherein the number of the network node in the first node set is greater than the number of the source network node, and the number of the network node in the second node set is less than the number of the source network node, and the target node set has multiple target nodes, and the target node is a node in the specified mesh network to receive the message sent by the source network node; The node set to be divided is divided according to the reference routing path length to obtain multiple target node subsets, wherein the reference routing path length is a preset longest routing path length from the source network node to the target node, and the node set to be divided includes: the first node set and the second node set; Wherein, in the case where the designated mesh network is an M*N mesh network, before dividing the set of nodes to be divided according to the reference routing path length to obtain a plurality of target node subsets, the method further includes: Use the following function Number the network nodes in the specified mesh network: ; in, is the coordinate of the network node in the specified grid network, x is an integer greater than or equal to 0 and less than or equal to M-1, y is an integer greater than or equal to 0 and less than or equal to N-1, and n is equal to N; The step of dividing the node set to be divided according to the reference routing path length to obtain multiple target node subsets includes: Performing an initial division on the node set to be divided to obtain k node subsets, wherein the abscissas of the network nodes in each of the k node subsets are the same, the abscissas of the network nodes in the i-1th node subset are smaller than the abscissas of the network nodes in the i-th node subset, i is an integer greater than or equal to 2 and less than or equal to k, and k is a positive integer greater than or equal to 2; Divide the k node subsets twice according to the reference routing path length to obtain multiple target node subsets; The k node subsets are divided twice according to the reference routing path length to obtain multiple target node subsets, including: The following steps are executed in a loop, wherein i is equal to 1 and j is equal to 1 when the following steps are executed for the first time: Step 1: determine the i-th node subset among the k node subsets as the j-th target node subset, and if the i+1-th node subset exists, execute step 2; if the i+1-th node subset does not exist, exit the loop; Step 2: Determine the shortest routing path length between the last network node in the i-th node subset and the source network node, and execute step 3 when the shortest routing path length is greater than or equal to the reference routing path length; execute step 4 when the shortest routing path length is less than the reference routing path length, wherein, when the node set to be divided is the first node set, the network node numbers in each node subset are sorted from small to large, and when the node set to be divided is the second node set, the network node numbers in each node subset are sorted from large to small; Step 3: Update the value of i to i+1, update the value of j to j+1, and jump to step 1; Step 4: Determine the number of nodes to be supplemented, and jump to step 5, wherein the number of nodes to be supplemented is the number of network nodes to be added to the j-th target node subset; Step 5: When the number of nodes to be supplemented is less than the number of network nodes in the i+1th node subset, execute step 6; when the number of nodes to be supplemented is greater than or equal to the number of network nodes in the i+1th node subset, execute step 7; Step 6: Move the first Q network nodes in the i+1th node subset to the jth target node subset, update the value of i to i+1, update the value of j to j+1, and jump to the step 1, where Q is equal to the number of nodes to be supplemented; Step 7: Move all network nodes in the i+1th node subset to the jth target node subset, and if the i+2th node subset exists, recalculate the number of nodes to be supplemented, update the value of i to i+1, and jump to the step 5; if the i+2th node subset does not exist, exit the loop; The step of determining the number of nodes to be supplemented includes: The number of nodes to be supplemented is calculated using the following formula: ; in, is the number of nodes to be supplemented, is the difference between the reference routing path length and the shortest routing path length, is the horizontal coordinate of the target node in the i-th node subset, is the horizontal coordinate of the target node in the i+1th node subset; The recalculating the number of nodes to be supplemented includes: Use the following formula to recalculate the number of nodes to be supplemented: ; in, , is the number of network nodes in the i+1th node subset, is the horizontal coordinate of the target node in the i+1th node subset, is the horizontal coordinate of the target node in the i+2th node subset, is the number of nodes to be supplemented after recalculation, and Z is used to indicate the number of step seven since the last execution of step three.
2. The method according to claim 1, characterized in that The determining the shortest routing path length between the last network node in the i-th node subset and the source network node comprises: The coordinates of the last network node in the i-th node subset are , the coordinates of the source network node are In the case of , the shortest routing path length between the last network node in the i-th node subset and the source network node is equal to .
3. The method according to claim 1, characterized in that After dividing the node set to be divided according to the reference routing path length to obtain multiple target node subsets, the method further includes: In the case where the target node set is divided into C target node subsets, C target node lists corresponding to the C target node subsets are determined, wherein the i-th target node list has the number of the network node in the i-th target node subset, i is a positive integer greater than or equal to 1 and less than or equal to C, and C is a positive integer greater than or equal to 2; C target messages are obtained through the source network node according to the C target node lists, wherein the header of the i-th target message carries the i-th target node list, and the i-th target message is a message to be received by the network node in the i-th target node subset.
4. The method according to claim 3, characterized in that In the case where the network nodes in the i-th target node subset are network nodes in the first node set, the numbers of the network nodes in the i-th target node list are sorted from small to large.
5. The method according to claim 3, characterized in that: In the case that the network nodes in the i-th target node subset are network nodes in the second node set, the numbers of the network nodes in the i-th target node list are sorted from large to small.
6. The method according to claim 3, characterized in that The method further comprises: An intermediate network node in the designated mesh network receives a target message, and determines through the intermediate network node whether the intermediate network node is a node corresponding to the first network node number in the target node list in the header of the target message; In the case where the intermediate network node is the node corresponding to the first network node number in the target node list in the header of the target message, the payload part of the target message is copied through the intermediate network node, and the first network node number in the target node list in the header of the target message is deleted, and in the case where the updated target node list is not empty, the target message is forwarded according to the first network node number in the target node list in the header of the target message.
7. The method according to claim 6, characterized in that The method further comprises: In the case where the intermediate network node in the designated mesh network receives the target message, determining, by the intermediate network node, whether the intermediate network node is the node corresponding to the first network node number in the target node list in the header of the target message; In the case that the intermediate network node is not the node corresponding to the first network node number in the target node list in the header of the target message, the target message is forwarded through the intermediate network node according to the first network node number in the target node list in the header of the target message.
8. The method according to claim 7, characterized in that The forwarding of the target message according to the first network node number in the target node list in the header of the target message includes: In the case where the number of the intermediate network node is less than the number of the first network node, determining the network node with the largest number among all network nodes in the designated mesh network whose numbers are less than or equal to the number of the first network node and which have a direct connection relationship with the intermediate network node as the network node to be forwarded, and forwarding the target message to the network node to be forwarded; In the case that the number of the intermediate network node is greater than the number of the first network node, the network node with the smallest number among all network nodes in the designated mesh network whose numbers are greater than or equal to the first network node number and which have a direct connection relationship with the intermediate network node is determined as the network node to be forwarded, and the target message is forwarded to the network node to be forwarded.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 8 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Method and device for transmitting data
CN107342939A
Route planning method and device, computer equipment and storage medium
CN115866455A