Method and device for dividing target node set, electronic device, and computer program product
By dividing the grid network according to the number of the source network node in the multi -nuclear system, and the target network according to the reference value, the target network area division in the traditional multi -broadcasting algorithm is solved. Lower network latency and higher network performance.
Patent Information
- Application Number
- CN202411372976.1
- 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 the interconnection structure of multi-core system, traditional multicast routing algorithms have unreasonable division of target node sets due to uneven network area division, which in turn has a large network delay, especially when the network scale is expanded.
By dividing the specified grid network according to the number of the source network node, the first and second network are obtained, and the target network is divided according to the reference value. Uniform network division.
This method can more reasonably divide the target node set, reduce network delay, and improve network performance, especially when the network scale expands.
Smart Images

Figure CN118890277B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of data exchange, and more specifically, to a method and device for partitioning a target node set, an electronic device, and a computer program product. Background Art
[0002] In the interconnect structure of multi-core systems, the multicast communication performance of the on-chip network is crucial to the efficiency of the entire system. Although traditional multicast routing algorithms, such as dual-path, multi-path, and column-path routing methods, have solved the problem of multicast communication to varying degrees, there are still problems such as uneven network area division, which leads to unreasonable division of the target node set, and thus makes the network delay of the path-based multicast routing algorithm larger. These problems become more prominent, especially when the network scale is expanded.
[0003] In view of the problem in the related art that the target node set is not divided reasonably due to the uneven division of the network area, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a method and device for dividing a target node set, an electronic device, and a computer program product, so as to at least solve the problem of unreasonable division of the target node set due to uneven division of network areas.
[0005] According to one embodiment of the present application, a method for dividing a target node set is provided, comprising: dividing a specified grid network according to the number of source network nodes to obtain a first network and a second network, wherein the number of network nodes in the first network is greater than the number of the source network nodes, and the number of network nodes in the second network is less than the number of the source network nodes; when the number of network nodes in the target network is greater than a reference value, dividing the target network according to the reference value so that the B networks obtained after the division meet a first preset condition or a second preset condition, wherein the first preset condition includes: the evaluation value corresponding to the B networks is the smallest, the evaluation value is equal to the average of the sum of the squares of the B values, and the i-th value among the B values is equal to the i-th value among the B networks. The difference between the number of network nodes of i networks and the reference value; the second preset condition includes: the number of network nodes of each network in the B networks is less than or equal to the reference value, or the number of columns of the network is equal to 1; the target network is the first network or the second network, and B is a positive integer greater than or equal to 2; when the designated grid network is divided into Z networks, the target node set is divided into Z target node subsets according to the Z networks, wherein the target node set has multiple target nodes, and the target node is a node in the designated grid network to receive the message sent by the source network node, and the network node in the i-th target node subset of the Z target node subsets is located in the i-th network among the Z networks, and Z is a positive integer greater than or equal to 2.
[0006] In an exemplary embodiment, when the designated mesh network is an M*N mesh network, before dividing the designated mesh network according to the numbers of the source network nodes to obtain the first network and the second network, 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.
[0007] In an exemplary embodiment, the target network is divided according to the reference value so that the B networks obtained after the division meet a first preset condition, including: determining the number of network columns according to the number of columns of the specified grid network, the reference value and the number of network nodes of the target network; determining the target number of networks with the number of network columns according to the number of network columns; and dividing the target network according to the number of network columns and the target number.
[0008] In an exemplary embodiment, determining the number of network columns according to the number of columns of the specified grid network, the reference value, and the number of network nodes of the target network includes: calculating the number of network columns by the following formula: ; Wherein, p is the number of columns of the network, n is the number of columns of the specified grid network, k is the reference value, and f is the number of network nodes of the target network, wherein, when calculating p=0, the value of p is set to 1.
[0009] In an exemplary embodiment, determining the target number of networks having the number of network columns according to the number of network columns includes: calculating the target number by the following formula: , where s is the target number, n is the number of columns of the specified grid network, and p is the number of columns of the network.
[0010] In an exemplary embodiment, the dividing the target network according to the number of network columns and the number of targets includes: when the coordinates of the source network node are ,and In the case of , the B networks after division are determined as:
[0011] , ,
[0012] in, , is the set of network nodes corresponding to the target network, is the set of network nodes corresponding to the ith network among B networks, is the network node set corresponding to the s+1th network among B networks, B is equal to s+1, and p is the number of network columns.
[0013] In an exemplary embodiment, the dividing the target network according to the number of network columns and the number of targets includes: when the coordinates of the source network node are ,and In the case of , the B networks after division are determined as:
[0014] ,
[0015] ,
[0016] in, , is the set of network nodes corresponding to the target network, is the set of network nodes corresponding to the first network among B networks, is the set of network nodes corresponding to the ith network among B networks, B is equal to s+1, , p is the number of columns of the network, n is the number of columns of the specified grid network, and s is the target number.
[0017] In an exemplary embodiment, the target network is divided according to the reference value so that the B networks obtained after the division meet the second preset condition, including: adding the target network to the set of networks to be divided, and repeatedly performing the following steps to divide the networks in the set of networks to be divided until the set of networks to be divided is empty: selecting a network to be divided from the set of networks to be divided, and deleting the network to be divided from the set of networks to be divided; dividing the network to be divided into a first sub-network and a second sub-network based on the middle column of the network to be divided in the area where the specified grid network is located, wherein the network nodes in the first sub-network and the second sub-network are not repeated; if the first sub-network does not meet the preset condition, adding the first sub-network to the set of networks to be divided; if the second sub-network does not meet the preset condition, adding the second sub-network to the set of networks to be divided.
[0018] In an exemplary embodiment, when the network to be divided is the first network or a network divided from the first network, dividing the network to be divided into the first sub-network and the second sub-network based on the middle column of the network to be divided in the area where the specified mesh network is located includes: the coordinates of the lower left boundary node of the network to be divided in the area where the specified mesh network is located are , the coordinates of the lower right boundary node are , the coordinates of the source network node are In the case of, determining that the area corresponding to the first sub-network in the specified grid network is , determine that the area corresponding to the second sub-network in the specified grid network is ; Among them, In the case of , , The network to be divided is located in the middle column of the area where the specified grid network is located. ;exist In the case of , , .
[0019] In an exemplary embodiment, after dividing the network to be divided into the first sub-network and the second sub-network based on the middle column of the area where the specified grid network is located, the method further includes: determining the coordinates of the lower left boundary node of the area where the first sub-network is located as , the coordinates of the lower right boundary node are ; Determine the coordinates of the lower left boundary node of the area where the second sub-network is located as , the coordinates of the lower right boundary node are ; Among them, In the case of , i is equal to 1 and 2; ,and In the case of ;exist ,and In the case of ;exist ,and , .
[0020] In an exemplary embodiment, when the network to be divided is the second network or a network divided from the second network, dividing the network to be divided into the first sub-network and the second sub-network based on the middle column of the network to be divided in the area where the specified mesh network is located includes: the coordinates of the upper left boundary node of the network to be divided in the area where the specified mesh network is located are , the coordinates of the upper right boundary node are , the coordinates of the source network node are In the case of, determining that the area corresponding to the first sub-network in the specified grid network is , determine that the area corresponding to the second sub-network in the specified grid network is ; Among them, In the case of , , The network to be divided is located in the middle column of the area where the specified grid network is located. ;exist In the case of , , .
[0021] In an exemplary embodiment, after dividing the network to be divided into the first sub-network and the second sub-network based on the middle column of the area where the specified grid network is located, the method further includes: determining the coordinates of the upper left boundary node of the area where the first sub-network is located as , the coordinates of the upper right boundary node are ; Determine the coordinates of the upper left boundary node of the area where the second sub-network is located as , the coordinates of the upper right boundary node are ; Among them, In the case of , i is equal to 1 and 2; ,and In the case of ;exist ,and In the case of ;exist ,and , .
[0022] In an exemplary embodiment, when the network to be divided is the first network or a network divided from the first network, the method further includes: when the coordinates of the lower left boundary node of the first sub-network or the second sub-network in the area where the specified grid network is located are , the coordinates of the lower right boundary node are , the coordinates of the source network node are In the case of, the number f of network nodes in the first sub-network or the second sub-network is determined by: In the case of ;exist In the case of .
[0023] In an exemplary embodiment, when the network to be divided is the second network or a network divided from the second network, the method further includes: when the coordinates of the upper left boundary node of the first sub-network or the second sub-network in the area where the specified grid network is located are , the coordinates of the upper right boundary node are , the coordinates of the source network node are In the case of, the number f of network nodes in the first sub-network or the second sub-network is determined by: In the case of ;exist In the case of .
[0024] In an exemplary embodiment, after dividing the target node set into Z target node subsets according to the Z networks, the method further includes: determining Z target node lists corresponding to the Z 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 Z; obtaining Z target messages according to the Z 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.
[0025] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the first network, the numbers of the network nodes in the i-th target node list are sorted from small to large.
[0026] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the second network, the numbers of the network nodes in the i-th target node list are sorted from large to small.
[0027] In an exemplary embodiment, the header of the i-th target message among the Z target messages carries an i-th flag bit, wherein the i-th flag bit is used to guide the i-th target message to be forwarded to a network node in the i-th target node subset.
[0028] In an exemplary embodiment, when the network node in the ith target node subset is a network node in the first network, the ith flag bit is the number of the network node with the smallest number in the ith network.
[0029] In an exemplary embodiment, when the network node in the i-th target node subset is a network node in the second network, the i-th flag bit is the number of the network node with the largest number in the i-th network.
[0030] In an exemplary embodiment, the method also includes: when an intermediate network node in the designated grid network receives a target message and the header of the target message has a flag bit, determining through the intermediate network node whether the intermediate network node is the network node corresponding to the flag bit; when the intermediate network node is the network node corresponding to the flag bit, deleting the flag bit in the header of the target message through the intermediate network node, 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 intermediate network node is not the network node corresponding to the flag bit, forwarding the target message according to the flag bit through the intermediate network node.
[0031] In an exemplary embodiment, forwarding the target message according to the flag bit includes: when the number of the intermediate network node is less than the flag bit, 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 flag bit 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 flag bit, 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 flag bit 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.
[0032] In an exemplary embodiment, the method also includes: when an intermediate network node in the designated grid network receives a target message and there is no flag bit in the header of the target message, determining 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.
[0033] In an exemplary embodiment, the method also includes: when an intermediate network node in the designated grid network receives a target message and there is no flag bit in the header of the target message, determining 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, 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.
[0034] 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.
[0035] According to another embodiment of the present application, a device for dividing a target node set is also provided, including: a first division module, used to divide a specified grid network according to the number of the source network node to obtain a first network and a second network, wherein the number of the network nodes in the first network is greater than the number of the source network node, and the number of the network nodes in the second network is less than the number of the source network node; a second division module, used to divide the target network according to the reference value when the number of network nodes in the target network is greater than the reference value, so that the B networks obtained after the division meet the first preset condition or the second preset condition, wherein the first preset condition includes: the evaluation value corresponding to the B networks is the smallest, the evaluation value is equal to the average of the sum of the squares of the B values, and the i-th value among the B values is equal to the B The difference between the number of network nodes of the i-th network in the B networks and the reference value; the second preset condition includes: the number of network nodes of each network in the B networks is less than or equal to the reference value, or the number of columns of the network is equal to 1; the target network is the first network or the second network, and B is a positive integer greater than or equal to 2; a third partitioning module is used to divide the target node set into Z target node subsets according to the Z networks when the designated grid network is divided into Z networks, wherein the target node set has multiple target nodes, and the target node is a node in the designated grid network to receive the message sent by the source network node, and the network node in the i-th target node subset of the Z target node subsets is located in the i-th network in the Z networks, and Z is a positive integer greater than or equal to 2.
[0036] 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 running.
[0037] 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.
[0038] 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.
[0039] Through the present application, the designated grid network is divided into the first network and the second network according to the number of the source network node, and then the network in which the number of network nodes in the first network and the second network is greater than the reference value is divided, so that the number of network nodes in each of the B networks obtained after the division is less than or equal to the reference value, or the evaluation value corresponding to the B networks obtained after the division is the smallest, and then when the designated grid network is divided into Z networks, the target node set is divided into Z target node subsets according to the Z networks. By adopting the above technical solution, the grid network can be divided more evenly, so that the division of the target node set is more reasonable, which solves the problem of unreasonable division of the target node set due to uneven network area division in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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:
[0041] 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;
[0042] Figure 2 is a flowchart of a method for dividing a target node set according to an embodiment of the present application;
[0043] Figure 3 is a schematic diagram of a specified grid network according to an embodiment of the present application;
[0044] Figure 4 is a schematic diagram of an uplink channel subnetwork and a downlink channel subnetwork according to an embodiment of the present application;
[0045] Figure 5 is a schematic diagram of a network routing path based on average partitioning according to an embodiment of the present application (I);
[0046] Figure 6is a schematic diagram of a network routing path based on average partitioning according to an embodiment of the present application (II);
[0047] Figure 7 is a schematic diagram of a network routing path based on average partitioning according to an embodiment of the present application (III);
[0048] Figure 8 is a schematic diagram of a network routing path based on recursive partitioning according to an embodiment of the present application (I);
[0049] Fig. 9 is a schematic diagram of a network routing path based on recursive partitioning according to an embodiment of the present application (II);
[0050] Fig.10 is a structural block diagram of a device for dividing a target node set according to an embodiment of the present application;
[0051] Fig.11 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0052] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0053] 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.
[0054] 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 are shown.
[0055] 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 instances, 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.
[0056] 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.
[0057] For a better understanding, the following briefly describes unicast communication and multicast communication:
[0058] 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.
[0059] 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.
[0060] 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.
[0061] 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.
[0062] 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, followed by the multi-path routing algorithm, and the column path routing algorithm further alleviates the problem. 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.
[0063] 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:
[0064] Step S202: Divide the specified mesh network according to the numbers of the source network nodes to obtain a first network and a second network, wherein the numbers of the network nodes in the first network are greater than the numbers of the source network nodes, and the numbers of the network nodes in the second network are less than the numbers of the source network nodes;
[0065] Optionally, specify mesh networks including: 2D-mesh and n-cube networks.
[0066] 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: ;
[0067] 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.
[0068] For example, when the designated mesh network is a 4*3 mesh network, after numbering the network nodes in the designated mesh network, the number of each mesh node is as follows: Figure 3 shown.
[0069] Step S204: when the number of network nodes in the target network is greater than a reference value, the target network is divided according to the reference value so that the B networks obtained after the division meet the first preset condition or the second preset condition, wherein the first preset condition includes: the evaluation value corresponding to the B networks is the smallest, the evaluation value is equal to the average value of the sum of squares of the B values, and the i-th value among the B values is equal to the difference between the number of network nodes of the i-th network among the B networks and the reference value; the second preset condition includes: the number of network nodes of each network among the B networks is less than or equal to the reference value, or the number of columns of the network is equal to 1; the target network is the first network or the second network, and B is a positive integer greater than or equal to 2;
[0070] For a better understanding, the evaluation values corresponding to B networks are calculated using the following formula:
[0071] ,in, is the number of network nodes of the Bth network in the Bth network, and k is the reference value.
[0072] Step S206: In the case where the designated grid network is divided into Z networks, the target node set is divided into Z target node subsets according to the Z networks, wherein the target node set has multiple target nodes, and the target node is a node in the designated grid network to receive the message sent by the source network node, and the network node in the i-th target node subset among the Z target node subsets is located in the i-th network among the Z networks, and Z is a positive integer greater than or equal to 2.
[0073] In the above steps, the designated grid network is divided into the first network and the second network according to the number of the source network node, and then the networks in which the number of network nodes in the first network and the second network is greater than the reference value are divided, so that the number of network nodes in each of the B networks obtained after the division is less than or equal to the reference value, or the evaluation value corresponding to the B networks obtained after the division is the smallest, and then when the designated grid network is divided into Z networks, the target node set is divided into Z target node subsets according to the Z networks. By adopting the above technical solution, the grid network can be divided more evenly, and then the division of the target node set is more reasonable, which solves the problem of unreasonable division of the target node set due to uneven network area division in the related art.
[0074] In an exemplary embodiment, in the above step S204, dividing the target network according to the reference value so that the B networks obtained after the division meet the first preset condition can be achieved by the following steps S11-S13:
[0075] Step S11: determining the number of network columns according to the number of columns of the specified grid network, the reference value and the number of network nodes of the target network;
[0076] In an exemplary embodiment, the above step S11 includes: calculating the number of network columns by the following formula: ;
[0077] Wherein, p is the number of columns of the network, n is the number of columns of the specified grid network, k is the reference value, and f is the number of network nodes of the target network. When p=0 is calculated, the value of p is set to 1.
[0078] Step S12: determining a target number of networks having the number of network columns according to the number of network columns;
[0079] In an exemplary embodiment, the above step S12 includes: calculating the target quantity by the following formula: , where s is the target number, n is the number of columns of the specified grid network, and p is the number of columns of the network.
[0080] Step S13: Divide the target network according to the number of network columns and the target quantity.
[0081] In an exemplary embodiment, the above step S13 includes: when the coordinates of the source network node are ,and In the case of , the B networks after division are determined as: , ,
[0082] in, , is the set of network nodes corresponding to the target network, is the set of network nodes corresponding to the ith network among B networks, is the network node set corresponding to the s+1th network among B networks, B is equal to s+1, and p is the number of network columns.
[0083] In an exemplary embodiment, the above step S13 further includes: when the coordinates of the source network node are ,and In the case of , the B networks after division are determined as: , ,
[0084] in, , is the set of network nodes corresponding to the target network, is the set of network nodes corresponding to the first network among B networks, is the set of network nodes corresponding to the ith network among B networks, B is equal to s+1, , p is the number of columns of the network, n is the number of columns of the specified grid network, and s is the target number.
[0085] It should be noted that the above-mentioned division of the target network according to the reference value so that the B networks obtained after the division meet the first preset condition is to divide the target network using an average partitioning strategy. For better understanding, the following is a detailed description in combination with steps one to three:
[0086] Step 1: Based on the source node , divide the target node set D into and Two collections.
[0087] area The corresponding target node set is Contains numbers greater than All target nodes, regions The number of nodes in ;area The corresponding target node set is , including numbers less than All target nodes, regions The number of nodes in .
[0088] Step 2: Judgement The relationship with k (k is the reference value of the number of nodes in each region, is the number of nodes in a region, ).
[0089] If the number of regional nodes Less than , then the area will not be divided;
[0090] If the number of regional nodes Greater than , representing the region as , the target node set corresponding to the region is represented as , go to step three.
[0091] Step 3: Divide the area The target node in ).
[0092] Count the number of columns in each region: ,(in means round down), when the calculation is When ,therefore Must meet .
[0093] Calculate the number of regions: , remainder: .
[0094] 1) When When , the number of columns in each region is: .
[0095] gather Divided into:
[0096] , ;
[0097] ;
[0098] 2) When When , the number of columns in each region is: .
[0099] gather Divided into:
[0100] ;
[0101] , ;
[0102] It should be noted that the relevant examples of using the average partitioning strategy to divide the network will be described in detail below and will not be repeated here.
[0103] In an exemplary embodiment, in the above step S204, the target network is divided according to the reference value so that the B networks obtained after the division meet the second preset condition, including: adding the target network to the set of networks to be divided, and looping the following steps S21-S23 to divide the networks in the set of networks to be divided until the set of networks to be divided is empty, wherein after the target network is added to the set of networks to be divided, there is only one network in the set of networks to be divided, namely, the target network:
[0104] Step S21: selecting a network to be divided from the set of networks to be divided, and deleting the network to be divided from the set of networks to be divided;
[0105] Step S22: dividing the network to be divided into a first sub-network and a second sub-network based on the middle column of the network to be divided in the area where the designated grid network is located, wherein the network nodes in the first sub-network and the second sub-network are not repeated;
[0106] Step S23: if the first sub-network does not meet the preset condition, add the first sub-network to the set of networks to be divided; if the second sub-network does not meet the preset condition, add the second sub-network to the set of networks to be divided.
[0107] In an exemplary embodiment, when the network to be divided is the first network or a network divided from the first network, the step S22 includes: the coordinates of the lower left boundary node of the network to be divided in the area where the specified grid network is located are , the coordinates of the lower right boundary node are , the coordinates of the source network node are In the case of, determining that the area corresponding to the first sub-network in the specified grid network is , determine that the area corresponding to the second sub-network in the specified grid network is ; Among them, In the case of , , The network to be divided is located in the middle column of the area where the specified grid network is located. ;exist In the case of , , .
[0108] For better understanding, Figure 7 The source network node is the node numbered 29, the first network is a network including the network nodes corresponding to the numbers 30-41, and the second network is a network including the network nodes corresponding to the numbers 0-28. The coordinates of the lower left boundary node of the first network in the area where the specified grid network is located are , the coordinates of the lower right boundary node are .
[0109] In an exemplary embodiment, when the network to be divided is the first network or a network divided from the first network, after the above step S22, the method further includes: determining the coordinates of the lower left boundary node of the area where the first sub-network is located as , the coordinates of the lower right boundary node are ; Determine the coordinates of the lower left boundary node of the area where the second sub-network is located as , the coordinates of the lower right boundary node are ; Among them, In the case of , i is equal to 1 and 2; ,and In the case of ;exist ,and In the case of ;exist ,and , .
[0110] In an exemplary embodiment, when the network to be divided is the second network or a network divided from the second network, the step S22 includes:
[0111] The coordinates of the upper left boundary node of the network to be divided in the area where the specified grid network is located are: , the coordinates of the upper right boundary node are , the coordinates of the source network node are In the case of, determining that the area corresponding to the first sub-network in the specified grid network is , determine that the area corresponding to the second sub-network in the specified grid network is ;
[0112] Among them, In the case of , , The network to be divided is located in the middle column of the area where the specified grid network is located. ;exist In the case of , , .
[0113] For better understanding, Figure 7 The source network node is the node numbered 29, then the first network is a network including network nodes corresponding to numbers 30-41, and the second network is a network including network nodes corresponding to numbers 0-28. The coordinates of the upper left boundary node of the second network in the area where the specified grid network is located are , the coordinates of the lower right boundary node are .
[0114] In an exemplary embodiment, when the network to be divided is the second network or a network divided from the second network, after the above step S22, the method further includes: determining the coordinates of the upper left boundary node of the area where the first sub-network is located as , the coordinates of the upper right boundary node are ; Determine the coordinates of the upper left boundary node of the area where the second sub-network is located as , the coordinates of the upper right boundary node are ;
[0115] Among them, In the case of , i is equal to 1 and 2; ,and In the case of ;exist ,and In the case of ;exist ,and , .
[0116] In an exemplary embodiment, when the network to be divided is the first network or a network divided from the first network, the method further includes: when the coordinates of the lower left boundary node of the first sub-network or the second sub-network in the area where the specified grid network is located are , the coordinates of the lower right boundary node are , the coordinates of the source network node are In the case of, the number f of network nodes in the first sub-network or the second sub-network is determined by: In the case of ;exist In the case of .
[0117] In an exemplary embodiment, when the network to be divided is the second network or a network divided from the second network, the method further includes: when the coordinates of the upper left boundary node of the first sub-network or the second sub-network in the area where the specified grid network is located are , the coordinates of the upper right boundary node are , the coordinates of the source network node are In the case of, the number f of network nodes in the first sub-network or the second sub-network is determined by: In the case of ;exist In the case of .
[0118] It should be noted that the above-mentioned dividing the target network according to the reference value so that the B networks obtained after the division meet the second preset condition is to divide the target network using a recursive partitioning strategy. For better understanding, the following is a detailed description in combination with the following steps 1 to 5:
[0119] Step 1: Divide the target node set D.
[0120] According to the source node , divide D into and Two sets. Area The corresponding target node set is , including numbers greater than All target nodes, regions The number of nodes in ;area The corresponding target node set is , including numbers less than All target nodes, regions The number of nodes in .
[0121] Step 2: Judgement The relationship with the size of k ( is the number of nodes in a region).
[0122] (1) If The corresponding area belongs to the area ,but:
[0123] If the number of regional nodes Less than , then put the target node set corresponding to the area into the set middle;
[0124] If the number of regional nodes Greater than , representing the region as , go to step three.
[0125] (2) If The corresponding area belongs to the area ,but:
[0126] If the number of regional nodes Less than , then put the target node set corresponding to the area into the set middle;
[0127] If the number of regional nodes Greater than , representing the region as , go to step 4.
[0128] Step 3: Divide the area The target node in ).
[0129] Indicates area The coordinates of the lower left corner, Indicates area The coordinate value of the lower right corner, so the area can be expressed as . Represents the boundary node coordinate value of the network after division, .
[0130] Divide by column, region The middle column is .
[0131] if ,Pick ,but , ;if ,Pick ,but , .symbol Indicates rounding up, the symbol means round down. Sub-areas:
[0132] ;
[0133] ;
[0134] if ,but ;
[0135] if , then we discuss it in the following three cases: 1) ,but ; 2) ,but ; 3) ,but .
[0136] For Region , the corresponding target node set is .if , then the target node subset corresponding to this area Add to collection If ,make , , , , go to step five (1).
[0137] For Region , the corresponding target node set is ,if , then the target node subset corresponding to this area Add to collection If ,make , , , , go to step five (1).
[0138] Step 4: Divide into regions The target node in ).
[0139] Indicates area The coordinates of the upper left corner, Indicates area The coordinate value of the upper right corner, so the area can be expressed as .
[0140] Divide by column, region The middle column is .
[0141] if ,Pick ,but , ;if ,Pick ,but , .symbol Indicates rounding up, the symbol means round down. Sub-areas:
[0142] ;
[0143] ;
[0144] if ,but ;
[0145] if , the following three cases are discussed: 1) ,but ; 2) ,but ; 3) ,but .
[0146] For Region , the corresponding target node set is .if , then the target node subset corresponding to this area Add to collection If ,make , , , , go to step five (2).
[0147] For Region , the corresponding target node set is ,if , then the target node subset corresponding to this area Add to collection If ,make , , , , go to step five (2).
[0148] Step 5: Calculate the area The number of midpoints.
[0149] (1) If the area belong :
[0150] if ,area The number of nodes is: .
[0151] if ,area The number of nodes is:
[0152] .
[0153] Go to step 2 (1).
[0154] (2) If the region belong :
[0155] if ,area The number of nodes is: .
[0156] if ,area The number of nodes is:
[0157] .
[0158] Go to step 2 (2).
[0159] When the number of target nodes in all sub-areas When it is less than k or there is only one column, the target node subset is divided and the above loop ends.
[0160] It should be noted that the relevant examples of using the recursive partitioning strategy to divide the network will be described in detail below and will not be repeated here.
[0161] In an exemplary embodiment, after the above step S206, the method further includes steps S31-S32:
[0162] Step S31: Determine Z target node lists corresponding to the Z 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 Z;
[0163] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the first network, 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 network, the numbers of the network nodes in the i-th target node list are sorted from large to small.
[0164] Step S32: Obtain Z target messages through the source network node according to the Z 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.
[0165] In an exemplary embodiment, the header of the i-th target message among the Z target messages also carries an i-th flag bit, wherein the i-th flag bit is used to guide the i-th target message to be forwarded to a network node in the i-th target node subset.
[0166] In an exemplary embodiment, when the network node in the i-th target node subset is a network node in the first network, the i-th flag bit is the number of the network node with the smallest number in the i-th network. When the network node in the i-th target node subset is a network node in the second network, the i-th flag bit is the number of the network node with the largest number in the i-th network.
[0167] That is to say, in this embodiment, after the target node set is divided into Z target node subsets, the source network node will obtain Z target messages based on the Z target node lists and Z flag bits corresponding to the Z target node subsets, and then the source network node will send the i-th target message according to the i-th flag bit.
[0168] In an exemplary embodiment, the method further comprises the following steps S41-S43:
[0169] Step S41: when an intermediate network node in the designated mesh network receives a target message and the header of the target message has a flag bit, determining through the intermediate network node whether the intermediate network node is a network node corresponding to the flag bit;
[0170] Step S42: when the intermediate network node is the network node corresponding to the flag bit, the flag bit of the header of the target message is deleted through the intermediate network node, and the target message is forwarded according to the first network node number in the target node list in the header of the target message;
[0171] It should be noted that the method of forwarding the target message according to the first network node number in the target node list in the header of the target message is the same as the method of forwarding the target message according to the flag bit in the following step S43, which will not be repeated here.
[0172] Step S43: when the intermediate network node is not the network node corresponding to the flag bit, forwarding the target message through the intermediate network node according to the flag bit.
[0173] In an exemplary embodiment, forwarding the target message according to the flag bit includes: when the number of the intermediate network node is less than the flag bit, 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 flag bit 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 flag bit, 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 flag bit 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.
[0174] It should be noted that the intermediate network node can use the routing function R below to determine the network node to be forwarded, that is, the network node to be forwarded .
[0175] In an exemplary embodiment, the method further comprises the following steps S51-S52:
[0176] Step S51: when an intermediate network node in the designated mesh network receives a target message and the header of the target message does not have a flag bit, 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;
[0177] Step S52: 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.
[0178] In an exemplary embodiment, after the above step S51, the method further includes: 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, 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.
[0179] 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.
[0180] It should be noted that the routing function R described below can be used to determine the network node to be forwarded, that is, the network node to be forwarded .
[0181] For better understanding, the following is a detailed description:
[0182] It should be noted that the Hamiltonian path strategy ensures that the network unicast and multicast paths are deadlock-free. A Hamiltonian path can access all nodes, and each node can only be accessed once. In a mesh topology, you can consider setting up several Hamiltonian paths. For each node in the network, such as node i, it is denoted as l(i). The nodes are numbered according to the order of the nodes in the Hamilton path. If there are s nodes in the network, the first node in the path is node 0 and the last node is node s-1. In the following example, Figure 3 As shown, using the node number function right After the nodes of the mesh network are numbered, the network can be divided into two channel sub-networks: the uplink channel sub-network and the downlink channel sub-network. The uplink channel sub-network consists of all channels from nodes with smaller numbers pointing to nodes with larger numbers. The downlink channel sub-network consists of all channels from nodes with larger numbers pointing to nodes with smaller numbers. The corresponding uplink channel and downlink channel sub-networks are as follows: Figure 4 As shown in (a) and (b).
[0183] First, consider the case of unicast communication. If the destination node number is greater than the source node number, routing is always done in the up-channel network; otherwise, it is done in the down-channel network. Given a source node and a destination 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. The above numbering formula will provide the shortest routing path for any given source node and destination node pair.
[0184] Let N be the set of nodes in a 2D-mesh or n-cube. Define the routing function R, , expressed as , node w is adjacent to node u and satisfies ; Among them, node p is adjacent to node u.
[0185] For any two nodes u and v, we can use the R function to select a path from u to v. ,in , , , The routing path is a partially ordered set of node numbers l in the uplink channel network. , ; In the downlink channel network , .
[0186] After dividing the target node set into Z target node subsets, assuming that the local node address , sorted list of target nodes , yes or A subset of ; then at the node After receiving the message (which carries the flag bit and the target node list), the following process is performed:
[0187] First: If the message has a flag bit, the node Determine whether it is a marker node. If the node If node v determines that it is not a flag node, it will not modify the message and forward the message to the flag node. If it is not adjacent to the flag node, the routing function R is used to determine the network node to be forwarded, that is, the network node to be forwarded If the node If it is determined that it is a flag node, the flag node information in the message is deleted, and the modified message is forwarded according to the target node list in the message. Specifically, the above routing function R can be used to determine the node to receive the modified message. , and forward the message.
[0188] Secondly: If the message does not have a flag bit, the node Determine whether it is a node in the target node list; if so, copy the message in the buffer and the local node Absorb, and delete the first node recorded in the target node list in the message to obtain the modified message. If the target node list in the modified message is not empty, the node to receive the modified message is determined based on the use of the routing function R. , and forward the message; if the target node list in the modified message is empty, terminate the message transmission; if the node If it is not a node in the target node list, it is necessary to determine the node to receive the message based on the routing function R. , and forward the message.
[0189] It should be noted that the multicast routing algorithm based on average partitioning proposed above can divide the network into 2~2n areas according to the value of the reference value. Therefore, the multicast routing algorithm based on average partitioning proposed in this application has high flexibility and adaptability, and can set a suitable k value according to different network performance requirements. The k value is often set according to the requirements and experience for network performance. The multicast routing algorithm based on average partitioning is deadlock-free, so the network does not need additional overhead to avoid deadlock, reduce cost overhead, improve the utilization rate of buffer resources, and reduce the cost of deadlock resolution.
[0190] For a better understanding, the above-mentioned multicast routing algorithm based on average partitioning is explained below with a specific example:
[0191] like Figure 5 For one Mesh topology network, source nodes are 23. Set k=8. Assume that the target node set D={0,3, 5, 9, 12, 15, 19, 21, 26, 27, 30, 33, 34, 37, 38, 41}. Use the average partition-based multicast routing algorithm. The specific process is as follows:
[0192] Message preparation stage:
[0193] Input: multicast set D (i.e., target node set), source node address , node number function l(x,y), reference value of the number of nodes contained in each area The specific process is as follows:
[0194] Step 1: Based on the source node , divide D into and Two collections.
[0195] ,area The number of nodes in ; ,area The number of nodes in .
[0196] Step 2-1: Judgment Relationship with the size of k.
[0197] when hour, , the area Expressed as ,make , go to step three.
[0198] Step 3-1: Divide into areas The target node in ).
[0199] Count the number of columns in each region: ;
[0200] Calculate the number of regions: , remainder: ;
[0201] because , the number of columns in each region is: ;
[0202] gather Divided into:
[0203] , , .
[0204] Step 2-2: Judgment Relationship with the size of k.
[0205] when hour, , the area Expressed as ,make , go to step three.
[0206] Step 3-2: Divide into areas The target node in ).
[0207] Count the number of columns in each region: ; Calculate the number of regions: , remainder: ;
[0208] because , the number of columns in each region is: ;
[0209] gather Divided into:
[0210] , , , .
[0211] Step 4: and Sort the target nodes in the subset.
[0212] for Subset of: (The corresponding flag bit is 27); (The corresponding flag bit is 24), (The corresponding flag bit is 32); for Subset of: (The corresponding flag bit is 14), (The corresponding flag bit is 16), (The corresponding flag bit is 18), (The corresponding flag bit is 22).
[0213] because and The sum of the number of subsets , copy the source message at the source node, and get a total of 7 source messages. Each message carries a subset of the target nodes .
[0214] Output: List of all source messages and the destination nodes they carry And the corresponding flag bit, , , , , , , , .
[0215] Multicast routing phase:
[0216] In this case, the message has flag bit 27 and Take this as an example to illustrate.
[0217] When the local node address hour, , the message carries a flag bit, then , , send the message to the address Node.
[0218] When the local node address hour, , is a landmark node, and The node in the buffer will copy the message and the local node absorb, .because ,but , , will carry the target node information The message is sent to the address Node.
[0219] When the local node address hour, , the copy message is copied in the buffer and sent by the local node absorb, , terminate the message transmission.
[0220] The six routing paths corresponding to the above six target node sets are: , , , , , , .
[0221] Figure 6 For the general Figure 5 The example k value is set to 10, resulting in 5 areas and routing paths.
[0222] like Figure 7 For one Mesh topology network, source nodes are 29. Set k=8. Using the average partition-based multicast routing algorithm, the network is divided into six areas, and the corresponding target node set is also divided into six subsets. The routing path is as follows Figure 7 shown.
[0223] From the above two examples, it can be seen that the average partition-based path multicast routing algorithm proposed in this application is superior to the multipath routing algorithm and the column path routing algorithm. In short, the routing method based on average partitioning has similar performance to the column path method in avoiding the formation of long paths, and can divide the network into 2n regions at most. Therefore, this method has better parallelism. For the routing algorithm based on average partitioning, whether the number of nodes contained in the created partition is uniform has little dependence on the location of the source node, so it avoids the formation of long paths in the network, alleviates the problem of uneven number of nodes in the network area, and increases the parallelism of the network while maintaining a relatively low number of startup messages.
[0224] It should be noted that the multicast routing algorithm based on recursive partitioning proposed in the present application can divide the network into 2~2n areas according to the value of the reference value. Therefore, the recursive multicast routing algorithm proposed in the present application has high flexibility and adaptability, and can set a suitable k value according to different network performance requirements. The k value is often set according to the requirements and experience for network performance. The recursive multicast routing algorithm is deadlock-free, so the network does not need additional overhead to avoid deadlock, reduce cost overhead, improve the utilization of buffer resources, and reduce the cost of deadlock resolution.
[0225] For better understanding, the above multicast routing algorithm based on recursive partitioning is explained below with specific examples:
[0226] Figure 8 For one Mesh topology network, source nodes are 14. Set k=10. Assume that the target nodes are D={1, 2,3, 5, 8, 10, 12, 15, 17, 21, 23, 25, 27, 28, 30, 31, 35}. Using the recursive partitioned multicast routing algorithm, the network is divided into five areas, and the corresponding target node set is also divided into five subsets. (The corresponding flag bit is 21), (The corresponding flag bit is 15), (The corresponding flag bit is 17), (The corresponding flag bit is 13), (The corresponding flag bit is 8); the five corresponding routing paths are , , , , .
[0227] Fig. 9 For one Mesh topology network, the number of source nodes is 10. Set k=10. Assume that the target nodes are D={0, 3,7, 9, 12, 15, 17, 21, 25, 27, 28, 30, 33, 35}. Using the recursive partition-based multicast routing algorithm, the network is divided into five areas, and the corresponding target node set is also divided into five subsets. (The corresponding flag bit is 11), (The corresponding flag bit is 13), (The corresponding flag bit is 15), (The corresponding flag bit is 17), (The corresponding flag bit is 9), and the corresponding five routing paths are , , , , .
[0228] From the above two examples, it can be seen that the path-based recursive multicast routing algorithm proposed in this application is superior to the multipath routing algorithm and the column path routing algorithm. In short, the recursive routing method has similar performance to the column path method in avoiding the formation of long paths. At the same time, when the number of columns in the sub-area is greater than 1 column, the number of nodes in the sub-area cannot exceed the reference value k. Therefore, this method has better parallelism. For the recursive routing algorithm, whether the number of nodes contained in the created partition is uniform has less dependence on the location of the source node, so it avoids the formation of long paths in the network, alleviates the problem of uneven number of nodes in the network area, and increases the parallelism of the network while maintaining a relatively low number of startup messages.
[0229] 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.
[0230] 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.
[0231] Fig.10 is a structural block diagram of a device for dividing a target node set according to an embodiment of the present application, such as Fig.10 As shown, the device comprises:
[0232] A first division module 1002 is used to divide the specified mesh network according to the number of the source network node to obtain a first network and a second network, wherein the number of the network node in the first network is greater than the number of the source network node, and the number of the network node in the second network is less than the number of the source network node;
[0233] The second division module 1004 is used to divide the target network according to the reference value when the number of network nodes in the target network is greater than the reference value, so that the B networks obtained after the division meet the first preset condition or the second preset condition, wherein the first preset condition includes: the evaluation value corresponding to the B networks is the smallest, the evaluation value is equal to the average value of the sum of squares of the B values, and the i-th value among the B values is equal to the difference between the number of network nodes of the i-th network among the B networks and the reference value; the second preset condition includes: the number of network nodes of each network among the B networks is less than or equal to the reference value, or the number of columns of the network is equal to 1; the target network is the first network or the second network, and B is a positive integer greater than or equal to 2;
[0234] The third division module 1006 is used to divide the target node set into Z target node subsets according to the Z networks when the designated mesh network is divided into Z networks, wherein the target node set has multiple target nodes, and the target node is a node in the designated mesh network to receive the message sent by the source network node, and the network node in the i-th target node subset among the Z target node subsets is located in the i-th network among the Z networks, and Z is a positive integer greater than or equal to 2.
[0235] The above device divides the designated mesh network into the first network and the second network according to the number of the source network node, and then divides the network whose number of network nodes in the first network and the second network is greater than the reference value, so that the number of network nodes in each of the B networks obtained after the division is less than or equal to the reference value, or the evaluation value corresponding to the B networks obtained after the division is the smallest, and then when the designated mesh network is divided into Z networks, the target node set is divided into Z target node subsets according to the Z networks. The above technical solution can be used to divide the mesh network more evenly, so that the division of the target node set is more reasonable, which solves the problem of unreasonable division of the target node set due to uneven network area division in the related art.
[0236] In an exemplary embodiment, the apparatus further comprises: a numbering module for dividing the specified mesh network according to the numbers of the source network nodes when the specified mesh network is an M*N mesh network, and before obtaining the first network and the second network, 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.
[0237] In an exemplary embodiment, the second division module 1004 is further used to determine the number of network columns based on the number of columns of the specified grid network, the reference value and the number of network nodes of the target network; determine the target number of networks with the number of network columns based on the number of network columns; and divide the target network based on the number of network columns and the target number.
[0238] In an exemplary embodiment, the second partitioning module 1004 is further configured to calculate the number of network columns by using the following formula: ; Wherein, p is the number of columns of the network, n is the number of columns of the specified grid network, k is the reference value, and f is the number of network nodes of the target network, wherein, when calculating p=0, the value of p is set to 1.
[0239] In an exemplary embodiment, the second division module 1004 is further configured to calculate the target quantity by the following formula: , where s is the target number, n is the number of columns of the specified grid network, and p is the number of columns of the network.
[0240] In an exemplary embodiment, the second partitioning module 1004 is further configured to: ,and In the case of , the B networks after division are determined as:
[0241] , ,
[0242] in, , is the set of network nodes corresponding to the target network, is the set of network nodes corresponding to the ith network among B networks, is the network node set corresponding to the s+1th network among B networks, B is equal to s+1, and p is the number of network columns.
[0243] In an exemplary embodiment, the second partitioning module 1004 is further configured to: ,and In the case of , the B networks after division are determined as:
[0244] ,
[0245] ,
[0246] in, , is the set of network nodes corresponding to the target network, is the set of network nodes corresponding to the first network among B networks, is the set of network nodes corresponding to the ith network among B networks, B is equal to s+1, , p is the number of columns of the network, n is the number of columns of the specified grid network, and s is the target number.
[0247] In an exemplary embodiment, the second division module 1004 is also used to add the target network to the set of networks to be divided, and loop the following steps to divide the networks in the set of networks to be divided until the set of networks to be divided is empty: select a network to be divided from the set of networks to be divided, and delete the network to be divided from the set of networks to be divided; divide the network to be divided into a first sub-network and a second sub-network based on the middle column of the network to be divided in the area where the specified grid network is located, wherein the network nodes in the first sub-network and the second sub-network are not repeated; if the first sub-network does not meet the preset condition, add the first sub-network to the set of networks to be divided; if the second sub-network does not meet the preset condition, add the second sub-network to the set of networks to be divided.
[0248] In an exemplary embodiment, the second division module 1004 is further configured to: when the network to be divided is the first network or a network divided from the first network, and the coordinates of the lower left boundary node of the network to be divided in the area where the specified grid network is located are , the coordinates of the lower right boundary node are , the coordinates of the source network node are In the case of, determining that the area corresponding to the first sub-network in the specified grid network is , determine that the area corresponding to the second sub-network in the specified grid network is ;
[0249] Among them, In the case of , , The network to be divided is located in the middle column of the area where the specified grid network is located. ;exist In the case , , .
[0250] In an exemplary embodiment, the second division module 1004 is further configured to, after dividing the network to be divided into the first sub-network and the second sub-network based on the middle column of the network to be divided in the area where the specified grid network is located, determine the coordinates of the lower left boundary node of the area where the first sub-network is located as , the coordinates of the lower right boundary node are ; Determine the coordinates of the lower left boundary node of the area where the second sub-network is located as , the coordinates of the lower right boundary node are ; Among them, In the case of , i is equal to 1 and 2; ,and In the case of ;exist ,and In the case of ;exist ,and , .
[0251] In an exemplary embodiment, the second division module 1004 is further configured to: when the network to be divided is the second network or a network divided from the second network, and the coordinates of the upper left boundary node of the network to be divided in the area where the specified grid network is located are , the coordinates of the upper right boundary node are , the coordinates of the source network node are In the case of, determining that the area corresponding to the first sub-network in the specified grid network is , determine that the area corresponding to the second sub-network in the specified grid network is ;
[0252] Among them, In the case of , , The network to be divided is located in the middle column of the area where the specified grid network is located. ;exist In the case of , , .
[0253] In an exemplary embodiment, the second division module 1004 is further configured to divide the network to be divided into the first sub-network and the second sub-network based on the middle column of the area where the specified grid network is located, and determine the coordinates of the upper left boundary node of the area where the first sub-network is located as , the coordinates of the upper right boundary node are ; Determine the coordinates of the upper left boundary node of the area where the second sub-network is located as , the coordinates of the upper right boundary node are ; Among them, In the case of , i is equal to 1 and 2; ,and In the case of ;exist ,and In the case of ;exist ,and , .
[0254] In an exemplary embodiment, the second division module 1004 is further configured to: when the network to be divided is the first network or a network divided from the first network, and the coordinates of the lower left boundary node of the first sub-network or the second sub-network in the area where the specified grid network is located are , the coordinates of the lower right boundary node are , the coordinates of the source network node are In the case of, the number f of network nodes in the first sub-network or the second sub-network is determined by: In the case of ;exist In the case of .
[0255] In an exemplary embodiment, the second division module 1004 is further configured to: when the network to be divided is the second network or a network divided from the second network, and the coordinates of the upper left boundary node of the first sub-network or the second sub-network in the area where the specified grid network is located are , the coordinates of the upper right boundary node are , the coordinates of the source network node are In the case of, the number f of network nodes in the first sub-network or the second sub-network is determined by: In the case of ;exist In the case of .
[0256] In an exemplary embodiment, the device also includes: a processing module, used to determine Z target node lists corresponding to the Z target node subsets after dividing the target node set into Z target node subsets according to the Z networks, 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 Z; obtain Z target messages through the source network node according to the Z 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.
[0257] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the first network, the numbers of the network nodes in the i-th target node list are sorted from small to large.
[0258] In an exemplary embodiment, when the network nodes in the i-th target node subset are network nodes in the second network, the numbers of the network nodes in the i-th target node list are sorted from large to small.
[0259] In an exemplary embodiment, the header of the i-th target message among the Z target messages carries an i-th flag bit, wherein the i-th flag bit is used to guide the i-th target message to be forwarded to a network node in the i-th target node subset.
[0260] In an exemplary embodiment, when the network node in the ith target node subset is a network node in the first network, the ith flag bit is the number of the network node with the smallest number in the ith network.
[0261] In an exemplary embodiment, when the network node in the i-th target node subset is a network node in the second network, the i-th flag bit is the number of the network node with the largest number in the i-th network.
[0262] 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 and the header of the target message has a flag bit, determine through the intermediate network node whether the intermediate network node is the network node corresponding to the flag bit; when the intermediate network node is the network node corresponding to the flag bit, delete the flag bit in the header of the target message through the intermediate network node, 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 intermediate network node is not the network node corresponding to the flag bit, forward the target message according to the flag bit through the intermediate network node.
[0263] In an exemplary embodiment, the processing module is also used to, when the number of the intermediate network node is less than the flag bit, determine the network node with the largest number among all the network nodes in the designated mesh network whose numbers are less than or equal to the flag bit 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 flag bit, 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 flag bit 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.
[0264] 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 and there is no flag bit in the header of the 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 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.
[0265] 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 and there is no flag bit in the header of the 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.
[0266] In an exemplary embodiment, the processing module is also used to, when the number of the intermediate network node is less 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 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 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.
[0267] 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.
[0268] 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.
[0269] Optionally, in this embodiment, the computer program may be configured to perform the following steps by means of the computer program:
[0270] S1, dividing a specified mesh network according to the numbers of source network nodes to obtain a first network and a second network, wherein the numbers of network nodes in the first network are greater than the numbers of the source network nodes, and the numbers of network nodes in the second network are less than the numbers of the source network nodes;
[0271] S2, when the number of network nodes in the target network is greater than a reference value, the target network is divided according to the reference value so that the B networks obtained after the division meet the first preset condition or the second preset condition, wherein the first preset condition includes: the evaluation value corresponding to the B networks is the smallest, the evaluation value is equal to the average value of the sum of the squares of the B values, and the i-th value among the B values is equal to the difference between the number of network nodes of the i-th network among the B networks and the reference value; the second preset condition includes: the number of network nodes of each network among the B networks is less than or equal to the reference value, or the number of columns of the network is equal to 1; the target network is the first network or the second network, and B is a positive integer greater than or equal to 2;
[0272] S3, when the designated mesh network is divided into Z networks, the target node set is divided into Z target node subsets according to the Z networks, wherein the target node set has multiple target nodes, the target node is a node in the designated mesh network to receive a message sent by the source network node, the network node in the i-th target node subset among the Z target node subsets is located in the i-th network among the Z networks, and Z is a positive integer greater than or equal to 2.
[0273] 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.
[0274] The embodiment of the present application also provides an electronic device, such as Fig.11 As shown, the electronic device includes a memory 1102 and a processor 1104. The memory 1102 stores a computer program, and the processor 1104 is configured to execute the steps in any of the above method embodiments through the computer program.
[0275] Optionally, in this embodiment, the processor 1104 may be configured to perform the following steps through a computer program:
[0276] S1, dividing a specified mesh network according to the numbers of source network nodes to obtain a first network and a second network, wherein the numbers of network nodes in the first network are greater than the numbers of the source network nodes, and the numbers of network nodes in the second network are less than the numbers of the source network nodes;
[0277] S2, when the number of network nodes in the target network is greater than a reference value, the target network is divided according to the reference value so that the B networks obtained after the division meet the first preset condition or the second preset condition, wherein the first preset condition includes: the evaluation value corresponding to the B networks is the smallest, the evaluation value is equal to the average value of the sum of the squares of the B values, and the i-th value among the B values is equal to the difference between the number of network nodes of the i-th network among the B networks and the reference value; the second preset condition includes: the number of network nodes of each network among the B networks is less than or equal to the reference value, or the number of columns of the network is equal to 1; the target network is the first network or the second network, and B is a positive integer greater than or equal to 2;
[0278] S3, when the designated mesh network is divided into Z networks, the target node set is divided into Z target node subsets according to the Z networks, wherein the target node set has multiple target nodes, the target node is a node in the designated mesh network to receive a message sent by the source network node, the network node in the i-th target node subset among the Z target node subsets is located in the i-th network among the Z networks, and Z is a positive integer greater than or equal to 2.
[0279] 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.
[0280] Alternatively, a person skilled in the art may understand that: Fig.11 The structure shown is for illustration only. Fig.11 The structure of the electronic device is not limited. For example, the electronic device may also include Fig.11 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig.11 Different configurations are shown.
[0281] Among them, the memory 1102 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 1104 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102, that is, realizing the above-mentioned method for dividing the target node set. The memory 1102 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 1102 may further include a memory remotely arranged relative to the processor 1104, 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 1102 can be specifically, but not limited to, used to store information such as system configuration files. As an example, such as Fig.11 As shown, the memory 1102 may include, but is not limited to, the first partitioning module 1002, the second partitioning module 1004, and the third partitioning module 1006 in the above-mentioned device for partitioning the target node set. In addition, other module units in the above-mentioned device for partitioning the target node set may also be included but are not limited to, which will not be repeated in this example.
[0282] Optionally, the transmission device 1106 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 1106 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 1106 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0283] In addition, the electronic device further includes: a display 1108; and a connection bus 1110, which is used to connect various module components in the electronic device.
[0284] 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 (P2P) 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.
[0285] 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.
[0286] 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.
[0287] 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.
[0288] 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.
[0289] 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: Divide the specified mesh network according to the number of the source network node to obtain a first network and a second network, wherein the number of the network node in the first network is greater than the number of the source network node, and the number of the network node in the second network is less than the number of the source network node; In the case where the number of network nodes in the target network is greater than a reference value, the target network is divided according to the reference value so that the B networks obtained after the division meet the first preset condition or the second preset condition, wherein the first preset condition includes: the evaluation value corresponding to the B networks is the smallest, the evaluation value is equal to the average value of the sum of squares of the B values, and the i-th value among the B values is equal to the difference between the number of network nodes of the i-th network among the B networks and the reference value; the second preset condition includes: the number of network nodes of each network among the B networks is less than or equal to the reference value, or the number of columns of the network is equal to 1; the target network is the first network or the second network, and B is a positive integer greater than or equal to 2; In the case where the designated mesh network is divided into Z networks, the target node set is divided into Z target node subsets according to the Z networks, wherein the target node set has multiple target nodes, the target node is a node in the designated mesh network to receive a message sent by the source network node, the network node in the i-th target node subset among the Z target node subsets is located in the i-th network among the Z networks, and Z is a positive integer greater than or equal to 2.
2. The method according to claim 1, characterized in that: In the case where the designated mesh network is an M*N mesh network, Before dividing the designated mesh network according to the numbers of the source network nodes to obtain the first network and the second network, 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 the number of columns of the specified grid network.
3. The method according to claim 2, characterized in that The dividing the target network according to the reference value so that the B networks obtained after the division meet a first preset condition includes: Determine the number of network columns according to the number of columns of the specified grid network, the reference value and the number of network nodes of the target network; Determining a target number of networks having the number of network columns according to the number of network columns; The target network is divided according to the number of network columns and the number of targets.
4. The method according to claim 3, characterized in that: The determining the number of network columns according to the number of columns of the specified grid network, the reference value and the number of network nodes of the target network comprises: The network column number is calculated by the following formula: ; Wherein, p is the number of network columns, k is the reference value, and f is the number of network nodes of the target network. When p=0 is calculated, the value of p is set to 1.
5. The method according to claim 3, characterized in that: The determining, according to the number of network columns, a target number of networks having the number of network columns, comprises: The target quantity is calculated by the following formula: , where s is the target number, n is the number of columns of the specified grid network, and p is the number of columns of the network.
6. The method according to claim 3, characterized in that The dividing the target network according to the number of network columns and the number of targets includes: The coordinates of the source network nodes are ,and In the case of , the B networks after division are determined as: , , in, , is the set of network nodes corresponding to the target network, is the set of network nodes corresponding to the ith network among B networks, is the network node set corresponding to the s+1th network among B networks, B is equal to s+1, and p is the number of network columns.
7. The method according to claim 3, characterized in that The dividing the target network according to the number of network columns and the number of targets includes: The coordinates of the source network nodes are ,and In the case of , the B networks after division are determined as: , , in, , is the set of network nodes corresponding to the target network, is the set of network nodes corresponding to the first network among B networks, is the set of network nodes corresponding to the ith network among B networks, B is equal to s+1, , p is the number of columns of the network, n is the number of columns of the specified grid network, and s is the target number.
8. The method according to claim 2, characterized in that: The dividing the target network according to the reference value so that the B networks obtained after the division meet the second preset condition includes: Add the target network to the set of networks to be divided, and loop through the following steps to divide the networks in the set of networks to be divided until the set of networks to be divided is empty: Select a network to be divided from the set of networks to be divided, and delete the network to be divided from the set of networks to be divided; Dividing the network to be divided into a first sub-network and a second sub-network based on the middle column of the network to be divided in the area where the designated grid network is located, wherein the network nodes in the first sub-network and the second sub-network are not repeated; If the first sub-network does not meet the preset condition, the first sub-network is added to the set of networks to be divided; if the second sub-network does not meet the preset condition, the second sub-network is added to the set of networks to be divided.
9. The method according to claim 8, characterized in that In the case where the network to be divided is the first network or a network divided from the first network, The step of dividing the network to be divided into a first sub-network and a second sub-network based on the network to be divided being in the middle column of the area where the designated grid network is located comprises: The coordinates of the lower left boundary node of the network to be divided in the area where the specified grid network is located are: , the coordinates of the lower right boundary node are , the coordinates of the source network node are In the case of, determining that the area corresponding to the first sub-network in the specified grid network is , determine that the area corresponding to the second sub-network in the specified grid network is , where m is the number of rows of the specified grid network; Among them, In the case of , , The network to be divided is located in the middle column of the area where the specified grid network is located. ;exist In the case of , , .
10. The method according to claim 9, characterized in that After dividing the network to be divided into the first sub-network and the second sub-network based on the middle column of the area where the designated grid network is located, the method further includes: Determine the coordinates of the lower left boundary node of the area where the first sub-network is located as , the coordinates of the lower right boundary node are ; Determine the coordinates of the lower left boundary node of the area where the second sub-network is located as , the coordinates of the lower right boundary node are ; Among them, In the case of , i is equal to 1 and 2; exist ,and In the case of ; exist ,and In the case of ; exist ,and In the case of .
11. The method according to claim 8, characterized in that In the case where the network to be divided is the second network or a network divided from the second network, The step of dividing the network to be divided into a first sub-network and a second sub-network based on the network to be divided being in the middle column of the area where the designated grid network is located comprises: The coordinates of the upper left boundary node of the network to be divided in the area where the specified grid network is located are: , the coordinates of the upper right boundary node are , the coordinates of the source network node are In the case of, determining that the area corresponding to the first sub-network in the specified grid network is , determine that the area corresponding to the second sub-network in the specified grid network is ; Among them, In the case of , , The network to be divided is located in the middle column of the area where the specified grid network is located. ;exist In the case of , , .
12. The method according to claim 11, characterized in that After dividing the network to be divided into the first sub-network and the second sub-network based on the middle column of the area where the designated grid network is located, the method further includes: Determine the coordinates of the upper left boundary node of the area where the first sub-network is located as , the coordinates of the upper right boundary node are ; Determine the coordinates of the upper left boundary node of the area where the second sub-network is located as , the coordinates of the upper right boundary node are ; Among them, In the case of , i is equal to 1 and 2; exist ,and In the case of ; exist ,and In the case of ; exist ,and In the case of .
13. The method according to claim 8, characterized in that In the case where the network to be divided is the first network or a network divided from the first network, The method further comprises: The coordinates of the lower left boundary node of the first sub-network or the second sub-network in the area where the specified grid network is located are: , the coordinates of the lower right boundary node are , the coordinates of the source network node are In the case of, the number f of network nodes in the first sub-network or the second sub-network is determined by: exist In the case of , where m is the number of rows of the specified grid network; exist In the case of .
14. The method according to claim 8, characterized in that In the case where the network to be divided is the second network or a network divided from the second network, The method further comprises: The coordinates of the upper left boundary node of the first sub-network or the second sub-network in the area where the specified grid network is located are: , the coordinates of the upper right boundary node are , the coordinates of the source network node are In the case of, the number f of network nodes in the first sub-network or the second sub-network is determined by: exist In the case of ; exist In the case of .
15. The method according to claim 1, characterized in that After dividing the target node set into Z target node subsets according to the Z networks, the method further includes: Determine Z target node lists corresponding to the Z 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 Z; Z target messages are obtained through the source network node according to the Z 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.
16. The method according to claim 15, characterized in that In the case where the network nodes in the i-th target node subset are network nodes in the first network, the numbers of the network nodes in the i-th target node list are sorted from small to large.
17. The method according to claim 15, characterized in that In the case where the network nodes in the i-th target node subset are network nodes in the second network, the numbers of the network nodes in the i-th target node list are sorted from large to small.
18. The method according to claim 15, characterized in that The header of the i-th target message among the Z target messages carries the i-th flag bit, wherein the i-th flag bit is used to guide the i-th target message to be forwarded to the network node in the i-th target node subset.
19. The method according to claim 18, characterized in that In the case where the network node in the i-th target node subset is a network node in the first network, the i-th flag bit is the number of the network node with the smallest number in the i-th network.
20. The method according to claim 18, characterized in that In the case that the network node in the i-th target node subset is a network node in the second network, the i-th flag bit is the number of the network node with the largest number in the i-th network.
21. The method according to claim 18, characterized in that The method further comprises: When an intermediate network node in the designated mesh network receives a target message and a header of the target message has a flag bit, determining, through the intermediate network node, whether the intermediate network node is a network node corresponding to the flag bit; In the case where the intermediate network node is the network node corresponding to the flag bit, the flag bit of the header of the target message is deleted through the intermediate network node, and the target message is forwarded according to the first network node number in the target node list in the header of the target message; In a case where the intermediate network node is not a network node corresponding to the flag bit, the target message is forwarded through the intermediate network node according to the flag bit.
22. The method according to claim 21, characterized in that The forwarding of the target message according to the flag bit includes: In the case where the number of the intermediate network node is less than the flag bit, 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 flag bit 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; In the case that the number of the intermediate network node is greater than the flag bit, 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 flag bit and 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.
23. The method according to claim 18, characterized in that The method further comprises: When an intermediate network node in the designated mesh network receives a target message and the header of the target message does not have a flag bit, determining, by 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 that 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 that 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.
24. The method according to claim 18, characterized in that The method further comprises: When an intermediate network node in the designated mesh network receives a target message and the header of the target message does not have a flag bit, determining, by 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 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.
25. The method according to claim 24, 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.
26. A device for partitioning a target node set, characterized in that: include: A first division module, configured to divide a specified mesh network according to the numbers of the source network nodes to obtain a first network and a second network, wherein the numbers of the network nodes in the first network are greater than the numbers of the source network nodes, and the numbers of the network nodes in the second network are less than the numbers of the source network nodes; A second partitioning module is used for partitioning the target network according to the reference value when the number of network nodes in the target network is greater than a reference value, so that the B networks obtained after the partitioning meet the first preset condition or the second preset condition, wherein the first preset condition includes: the evaluation value corresponding to the B networks is the smallest, the evaluation value is equal to the average value of the sum of squares of the B values, and the i-th value among the B values is equal to the difference between the number of network nodes of the i-th network among the B networks and the reference value; the second preset condition includes: the number of network nodes of each network among the B networks is less than or equal to the reference value, or the number of columns of the network is equal to 1; the target network is the first network or the second network, and B is a positive integer greater than or equal to 2; A third partitioning module is used for partitioning a target node set into Z target node subsets according to the Z networks when the designated mesh network is divided into Z networks, wherein the target node set has multiple target nodes, and the target node is a node in the designated mesh network to receive a message sent by the source network node, and a network node in the i-th target node subset among the Z target node subsets is located in the i-th network among the Z networks, and Z is a positive integer greater than or equal to 2.
27. 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 25 are implemented.
28. 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 25 are implemented.
Citation Information
Patent Citations
Virtualized grid division method for improving source grid load storage multi-element collaboration
CN115758644A
Low congestion routing method of Optical Network-on-Chip and related device
US12081923B1