Data distribution method, device, electronic device and storage medium
By building a virtual coordinate system in the 2D Torus network, the loop deadlock problem caused by infinite loop loops of multicast packets is solved, and the rapid and accurate distribution of data is achieved.
Patent Information
- Application Number
- CN202510888958.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-27
AI Technical Summary
In 2D Torus networks, multicast packets may loop infinitely, resulting in loop loop deadlock failure and data cannot be distributed in a timely and accurate manner.
By building a virtual coordinate system, map nodes into the virtual coordinate system, use the target area identification and the target coordinate axis bitmap to determine the initial distribution node, avoid boundary winding, reduce redundant paths, and quickly complete data distribution.
It effectively avoids deadlocks in data distribution, reduces redundant paths, and ensures timely and accurate data distribution.
Smart Images

Figure CN120416133B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data distribution technology, and in particular to a data distribution method, device, electronic device and storage medium. Background Art
[0002] As multi-core chips become mainstream and core connections proliferate, NoCs (Network-on-Chip) (NoCs) introduce the concept of network communication into systems-on-chip (SoCs). They treat components like processor cores and storage as network nodes, allowing data to be transmitted over the NoC. Among the various NoC networking methods, 2D toruses are widely used. While the 2D torus architecture employs edge-loop links, this can lead to infinite multicast packet loops, resulting in loop deadlocks and inaccurate data distribution. Summary of the Invention
[0003] The present application provides a data distribution method, device, electronic device and storage medium to at least solve the current problem that multicast data packets may loop infinitely, resulting in a loop deadlock failure and the inability to distribute data in a timely and accurate manner.
[0004] The present application provides a data distribution method, comprising: obtaining information to be distributed, the information to be distributed including at least: data to be distributed, a first physical coordinate of a target node, and at least one multicast code corresponding to the target node;
[0005] Determining at least one to-be-distributed node corresponding to the target node according to at least one multicast code;
[0006] Mapping the at least one node to be distributed into a virtual coordinate system based on the first physical coordinates of the target node and the second physical coordinates of the at least one node to be distributed to obtain a target region identifier and a target coordinate axis bitmap, wherein the target region identifier is used to indicate the quadrant of the at least one node to be distributed in the virtual coordinate system, and the target coordinate axis bitmap is used to indicate the coordinate position of the at least one node to be distributed in the virtual coordinate system, where the virtual coordinate system is a coordinate system created with the target node as the origin;
[0007] Determining at least one initial distribution node based on the target node according to the target area identifier;
[0008] The information to be distributed and the target coordinate axis bitmap are distributed to at least one initial distribution node through the target node.
[0009] The present application also provides a data distribution device, comprising: an acquisition module, configured to acquire information to be distributed, the information to be distributed comprising at least: data to be distributed, a first physical coordinate of a target node, and at least one multicast code corresponding to the target node;
[0010] A processing module, configured to determine at least one to-be-distributed node corresponding to a target node according to at least one multicast code;
[0011] The processing module is further configured to map the at least one node to be distributed into a virtual coordinate system based on the first physical coordinates of the target node and the second physical coordinates of the at least one node to be distributed, to obtain a target region identifier and a target coordinate axis bitmap, wherein the target region identifier is used to indicate the quadrant of the at least one node to be distributed in the virtual coordinate system, and the target coordinate axis bitmap is used to indicate the coordinate position of the at least one node to be distributed in the virtual coordinate system, where the virtual coordinate system is a coordinate system created with the target node as the origin;
[0012] The processing module is further configured to determine at least one initial distribution node based on the target node according to the target area identifier;
[0013] The transceiver module is used to distribute the information to be distributed and the target coordinate axis bitmap to at least one initial distribution node through the target node.
[0014] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned data distribution methods when executing the computer program.
[0015] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data distribution methods are implemented.
[0016] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned data distribution methods when executed by a processor.
[0017] Through the present application, information to be distributed is obtained, and the information to be distributed includes at least: data to be distributed, the first physical coordinates of the target node, and at least one multicast code corresponding to the target node; based on the at least one multicast code, at least one node to be distributed corresponding to the target node is determined; based on the first physical coordinates of the target node and the second physical coordinates of at least one node to be distributed, at least one node to be distributed is mapped to a virtual coordinate system to obtain a target area identifier and a target coordinate axis bitmap, the target area identifier is used to indicate the quadrant of at least one node to be distributed in the virtual coordinate system, and the target coordinate axis bitmap is used to indicate the coordinate position of at least one node to be distributed in the virtual coordinate system, and the virtual coordinate system is a coordinate system created with the target node as the origin; based on the target area identifier, at least one initial distribution node based on the target node is determined; and the information to be distributed and the target coordinate axis bitmap are distributed to the at least one initial distribution node through the target node. In this solution, by constructing a virtual coordinate system and transferring the data distribution between nodes to the virtual coordinate system, the problem of boundary wrapping can be effectively avoided and the deadlock of the data distribution track can be avoided. In addition, the position of each node to be distributed compared to the target node can be intuitively represented through the target area identification and the target coordinate axis bitmap, which can reduce redundant paths and quickly complete the data distribution between nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 A data distribution method according to an embodiment of the present invention Figure 1 ;
[0020] Figure 2 A data distribution method according to an embodiment of the present invention Figure 2 ;
[0021] Figure 3 A schematic diagram of area identification provided in an embodiment of the present application;
[0022] Figure 4 Schematic diagram of the virtual coordinate system provided in the embodiment of this application Figure 1 ;
[0023] Figure 5 A schematic diagram of distribution rules provided in an embodiment of the present application;
[0024] Figure 6 Schematic diagram of the virtual coordinate system provided in the embodiment of this application Figure 2 ;
[0025] Figure 7 A structural diagram of a data distribution device provided in an embodiment of the present application;
[0026] Figure 8 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0028] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0029] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being more preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0030] In the post-Moore era, Moore's Law is gradually slowing due to the constraints of physics, making it impossible to simply increase chip integration and frequency to improve performance. Multi-core chips have become the mainstream development, but traditional bus architectures face serious bottlenecks in scalability, power consumption, and real-time performance when dealing with large numbers of core connections. Network-on-chip (NOC) introduces the concept of network communication into systems-on-chip (SoCs), treating components such as processor cores and storage as network nodes and transmitting data through an on-chip network, significantly improving the on-chip communication architecture.
[0031] Among them, NOC is a distributed communication architecture integrated into a single chip (such as a multi-core processor or system-on-chip). It is used to connect multiple processing units (CPU, GPU, DSP), storage units (cache, memory controller) and peripheral interfaces (USB, PCIe) within the chip. Drawing on the packet switching concept of computer networks, it achieves efficient data transmission between components through routers, communication links and network interfaces, solving the problems of poor scalability, insufficient parallelism and high latency of traditional bus architecture in multi-core / heterogeneous scenarios.
[0032] Multicast, which transmits data simultaneously from a single source node to multiple destination nodes, rather than sending it to each node individually, is crucial in parallel and high-performance computing, effectively reducing network traffic and latency. Hardware-level multicast significantly optimizes the performance of cache coherence protocols through precise invalidation and updates, enabling efficient implementation of directory protocols and achieving significant results in large-scale multi-core systems.
[0033] To achieve data multicast, multiple nodes can be organized into a mesh. NOCs have various networking methods, such as Mesh, Fat Tree, Butterfly, Star, Ring, and 2D Torus. 2D Torus is a variant of Mesh and an efficient, regularized interconnection solution in NOCs. With its advantages of good scalability, high fault tolerance, low latency, load balancing, simple routing algorithms, and low power consumption, it has been widely used in large-scale arrays, all-to-all global communications, and highly reliable NOC scenarios. It is particularly suitable for multi-core / heterogeneous chip designs with high requirements for communication latency, throughput, and reliability.
[0034] It's important to note that a 2D mesh is a network topology that arranges nodes in a two-dimensional matrix of rows and columns. Each node is connected to adjacent nodes via links, forming a grid-like layout. 2D meshes evolve into 2D toruses, with non-surrounding (2D mesh) and surrounding (2D torus) being key factors in determining their topological properties.
[0035] Comparing 2D Mesh and 2D Torus, we can get the following Table 1:
[0036] Table 1 Comparison of characteristics of "2D Mesh" and "2D Torus"
[0037]
[0038] Deadlock refers to a state in which multiple processes or data packets are stuck in an infinite waiting state due to competition for resources. This may occur in a 2D Torus. Due to the looping links at the boundary, data may circle back to the starting node after reaching the boundary node. Assume that four nodes A, B, C, and D form a loop A→B→C→D→A in a 2D Torus. A waits for B to release the receive buffer, B waits for C, C waits for D, and D waits for A. The loop may be blocked, leading to deadlock.
[0039] In addition, the current 2D Torus solution not only faces the risk of multicast packets looping infinitely and triggering broadcast storms due to looping links at the boundaries, but also faces the risk of redundant paths occupying additional bandwidth when sending data to multiple nodes, multicast traffic congestion due to the concentration of traffic on a few paths, and the risk of deadlock due to the dependencies of circular paths. Furthermore, the XY routing algorithm based on dimension-ordered routing suffers from load imbalance, the computational complexity of the shortest path multicast based on the Steiner tree leads to high overhead, the backbone link bottleneck and local optimality of individually segmented multicast are encountered, and the risk of deadlock in adaptive routing multicast algorithms is also present.
[0040] In summary, the current architectural problem with 2D Torus is its use of a boundary loop link approach. However, this can cause multicast packets to loop infinitely, leading to loop deadlock failures and the inability to distribute data in a timely and accurate manner.
[0041] In order to solve the above technical problems and enable technicians in this technical field to better understand the solution of this application, the application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0042] like Figure 1 As shown, Figure 1 This is a flowchart of a data distribution method provided in an embodiment of the present application. The method may include the following steps:
[0043] 101. Obtain information to be distributed.
[0044] In an embodiment of the present application, the information to be distributed may at least include: data to be distributed, a first physical coordinate of the target node, and at least one multicast code corresponding to the target node.
[0045] Among them, the data to be distributed is the data that needs to be sent to each node; the target node can be understood as the node that distributes data, that is, the target node needs to distribute the data to be distributed to other nodes. The first physical coordinate of the target node is the source physical coordinate of the target node, that is, the absolute coordinate of the target node in the 2D Torus; the multicast code can be understood as the multicast ID, that is, the ID code of the node. Each node will be pre-marked with an ID code, and the at least one multicast code corresponding to the target node can be understood as the ID code of at least one node to which the target node needs to distribute data. Through this at least one multicast code, the target node can know which nodes it needs to distribute data to.
[0046] In some embodiments, the method for obtaining the information to be distributed can be information input and uploaded by the user himself; it can also be information obtained by parsing the project file, for example: a task is currently received, and the above-mentioned information to be distributed is obtained after parsing the task file; it can also be information sent by a cloud network platform or other electronic devices, and the embodiments of this application do not make specific limitations.
[0047] 102. Determine at least one to-be-distributed node corresponding to the target node according to at least one multicast code.
[0048] In the embodiment of the present application, since each node corresponds to a multicast code, and the multicast code of each node is different, after determining at least one multicast code, the node corresponding to each multicast code can be determined, thereby obtaining at least one node to be distributed. It can be understood that the target node needs to distribute the data to be distributed to the at least one node to be distributed.
[0049] 103. Map the at least one to-be-distributed node into a virtual coordinate system according to the first physical coordinate of the target node and the second physical coordinate of the at least one to-be-distributed node, and obtain a target area identifier and a target coordinate axis bitmap.
[0050] In an embodiment of the present application, since the 2D Torus has a wraparound property, edge loops may occur during data multicasting. For this reason, the present application constructs a virtual coordinate system and converts the target node and at least one node to be distributed into the virtual coordinate system for data distribution. Since the target node is the node that distributes data, that is, the starting node of the data distribution link, a virtual coordinate system can be constructed with the target node as the origin, and then at least one node to be distributed is mapped to the virtual coordinate system. Since the coordinates of the target node in the virtual coordinate system are the origin (0, 0), the coordinates of at least one node to be distributed in the virtual coordinate system can be understood as the relative coordinates of the node to be distributed relative to the target node. Therefore, based on the absolute coordinates of the target node in the 2D Torus and the absolute coordinates of at least one node to be distributed in the 2D Torus, the relative position of each node to be distributed and the target node can be calculated and mapped to the virtual coordinate system.
[0051] In some embodiments, since the data distribution process is achieved by forwarding data one node at a time, that is, most nodes will forward the data after receiving it, and when forwarding, the node can be considered as the target node. That is to say, when a node needs to send data, it can establish a virtual coordinate system with itself as the origin, and map the nodes to be distributed to its newly created virtual coordinate system for distribution.
[0052] It should be noted that the target area identifier is used to indicate the quadrant of at least one node to be distributed in the virtual coordinate system, and the target coordinate axis bitmap is used to indicate the coordinate position of at least one node to be distributed in the virtual coordinate system.
[0053] In some embodiments, after a virtual coordinate system is created with the target node as the origin, the virtual coordinate system may include four quadrants, each of which may correspond to an area identifier. Since at least one node to be distributed may be located at any relative position of the target node in a 2D Torus, when at least one node to be distributed is mapped to the virtual coordinate system, the at least one node to be distributed may be located in any of the four quadrants. In other words, there may be nodes to be distributed in each quadrant. Of course, there may also be a quadrant in which there is no node to be distributed. Therefore, a target area identifier may be generated based on the quadrant in which at least one node to be distributed is located in the virtual coordinate system. In this way, after obtaining the target area identifier, the target node can directly know in which quadrant the nodes to be distributed are located based on the target area identifier.
[0054] In some embodiments, when distributing data, the target node ultimately aims to ensure that each node to be distributed receives the data. Therefore, in addition to knowing the quadrant in which each node to be distributed is located, the specific coordinate position also needs to be known. In a 2D Torus, when the target node distributes data to the node to be distributed, it does not directly construct a link between the target node and the node to be distributed for distribution, but rather distributes data sequentially along the direction of the coordinate axis. Therefore, it is necessary to determine the mapping of at least one node to be distributed on the coordinate axis. Since a 2D Torus can be understood as a grid structure, each node to be distributed can be mapped to a coordinate point on the X-axis and Y-axis respectively. By distinguishing whether a node to be distributed is mapped to a coordinate point, it can be determined whether there is a node to be distributed in the row or column corresponding to the coordinate point. In this way, when distributing data, the target node can distribute to the rows or columns where the nodes to be distributed exist, and ignore the rows or columns where no nodes to be distributed exist, thereby avoiding resource waste.
[0055] 104. Determine at least one initial distribution node based on the target node according to the target area identifier.
[0056] In an embodiment of the present application, in a 2D Torus, when the target node performs data multicasting, it is performed through an XY routing method, that is, the target node sends data to the nodes on the X-axis and Y-axis in sequence in the direction of the X-axis and Y-axis, and then the receiving node forwards the data to the next node. In other words, the target node distributes data to at least one node to be distributed by forwarding the data through at least one node located on the coordinate axis, and finally forwarding it to the node to be distributed. Therefore, the target node will first send the data to the initial distribution node, and then the initial distribution node will continue to forward it.
[0057] It should be noted that the virtual coordinate system includes four quadrants. To quickly distribute data, data can be distributed to the initial distribution nodes in each quadrant simultaneously, and the distribution rules within each quadrant are the same. Since there are nodes to be distributed in at least one quadrant, at least one quadrant containing nodes to be distributed can be identified based on the target area identifier. Then, the initial distribution node can be determined for each quadrant, resulting in at least one initial distribution node. In other words, it is possible that all nodes to be distributed are located in one quadrant, in which case there is only one initial distribution node; it is possible that at least one initial distribution node to be distributed is located in two quadrants, in which case there are two initial distribution nodes; it is possible that at least one initial distribution node to be distributed is located in three quadrants, in which case there are three initial distribution nodes; it is possible that at least one initial distribution node to be distributed is located in four quadrants, in which case there are four initial distribution nodes. Since there are only four quadrants, the maximum number of initial distribution nodes is 4.
[0058] 105. Distribute the information to be distributed and the target coordinate axis bitmap to at least one initial distribution node through the target node.
[0059] In the embodiment of the present application, the ultimate goal of the target node's data distribution to the nodes to be distributed is to enable each node to be distributed to receive the data to be distributed. Therefore, the target node needs to distribute the data to be distributed to at least one initial distribution node.
[0060] In addition, after the initial distribution node receives the data to be distributed, if there are still nodes to be distributed in the quadrant, then the initial distribution node needs to continue distributing data. Whether there are still nodes to be distributed in the quadrant is determined by the target multicast code, so the target node needs to distribute the target multicast code to at least one initial distribution node.
[0061] In addition, after the target node constructs a virtual coordinate system with itself as the origin, the target node maps each node to be distributed to the virtual coordinate system, while the node to be distributed and other nodes do not know their own positions in the virtual coordinate system with the target node as the origin. In order for the node to be distributed and other nodes to calculate their own positions in the virtual coordinate system with the target node as the origin, they need to perform relative calculations based on their own absolute coordinates and the absolute coordinates of the target node. Therefore, the target node needs to distribute the first physical coordinates of the target node to at least one initial distribution node, so that after other nodes receive the first physical coordinates of the target node, they can calculate the coordinates in the virtual coordinate system with the target node as the origin based on their own second physical coordinates.
[0062] In addition, after the initial distribution node receives the data to be distributed, if it needs to continue distributing data, then there are two directions, X-axis and Y-axis, for the initial distribution node. The initial distribution node needs to know whether there are nodes to be distributed in the X-axis direction and the Y-axis direction respectively. Whether there are nodes to be distributed in the X-axis direction and the Y-axis direction can be determined based on the target coordinate axis bitmap. Therefore, the target node needs to distribute the target coordinate axis bitmap to at least one initial distribution node.
[0063] In an embodiment of the present application, information to be distributed is obtained, and the information to be distributed includes at least: data to be distributed, a first physical coordinate of a target node, and at least one multicast code corresponding to the target node; based on the at least one multicast code, at least one node to be distributed corresponding to the target node is determined; based on the first physical coordinate of the target node and the second physical coordinate of at least one node to be distributed, at least one node to be distributed is mapped to a virtual coordinate system to obtain a target area identifier and a target coordinate axis bitmap, the target area identifier is used to indicate the quadrant of at least one node to be distributed in the virtual coordinate system, and the target coordinate axis bitmap is used to indicate the coordinate position of at least one node to be distributed in the virtual coordinate system, and the virtual coordinate system is a coordinate system created with the target node as the origin; based on the target area identifier, at least one initial distribution node based on the target node is determined; and the information to be distributed and the target coordinate axis bitmap are distributed to the at least one initial distribution node through the target node. In this solution, by constructing a virtual coordinate system and transferring the data distribution between nodes to the virtual coordinate system, the problem of boundary wrapping can be effectively avoided and the deadlock of the data distribution track can be avoided. In addition, the position of each node to be distributed compared to the target node can be intuitively represented through the target area identification and the target coordinate axis bitmap, which can reduce redundant paths and quickly complete the data distribution between nodes.
[0064] like Figure 2 As shown, Figure 2 Another flow chart of a data distribution method provided in an embodiment of the present application, the method may include the following steps:
[0065] 201. Obtain information to be distributed.
[0066] 202. Determine at least one to-be-distributed node corresponding to the target node according to at least one multicast code.
[0067] In the embodiment of the present application, for the description of steps 201-202, please refer to the detailed description of steps 101-102 in the above embodiment, which will not be repeated in the embodiment of the present application.
[0068] 203. Establish a virtual coordinate system of preset network dimensions with the target node as the origin.
[0069] In the embodiment of the present application, when a virtual coordinate system is established with the target node as the origin, it is not established without restrictions. Since the virtual coordinate system needs to have boundaries to prevent data packets from being forwarded indefinitely, the virtual coordinate system can have a preset network dimension. The preset network dimension can refer to the number of coordinate points on the X-axis and Y-axis in the virtual coordinate system, that is, the virtual coordinate system is M*N, then M and N refer to the preset network dimension. Generally, for the convenience of calculation, a virtual coordinate system with the same number of coordinate points on the X-axis and Y-axis can be established, that is, an N*N coordinate system. The preset network dimension can be set by itself or determined based on the distribution of at least one node to be distributed. The embodiment of the present application does not make specific restrictions.
[0070] In some embodiments, the target node can be any node that needs to distribute data. That is to say, any node in 2DTorus will establish its own virtual coordinate system when it needs to distribute data, and its own virtual coordinate system takes itself as the origin. That is to say, any node may create a virtual coordinate system with itself as the origin.
[0071] 204. Determine virtual coordinates of the at least one to-be-distributed node in the virtual coordinate system according to the first physical coordinates of the target node and the second physical coordinates of the at least one to-be-distributed node.
[0072] In an embodiment of the present application, when mapping at least one node to be distributed to a virtual coordinate system, it is necessary to first determine the virtual coordinates of the at least one node to be distributed in the virtual coordinate system, and then mapping can be performed based on the virtual coordinates. Since the origin of the virtual coordinate system is the target node, the virtual coordinates of the at least one node to be distributed can be considered as the relative position of the at least one node to be distributed and the target node. Then, based on the physical coordinates of the at least one node to be distributed and the target node in the 2D Torus, that is, the absolute coordinates, the virtual coordinates of the at least one node to be distributed in the virtual coordinate system can be obtained by calculation.
[0073] In some embodiments, after creating a virtual coordinate system of a preset network dimension, when calculating the virtual coordinates, it is also necessary to refer to the preset network dimension. Specifically, it may include: determining the virtual coordinates of at least one node to be distributed in the virtual coordinate system based on the first physical coordinates of the target node, the second physical coordinates of at least one node to be distributed, and the preset network dimension.
[0074] It should be noted that the center position can be calculated first. Specifically, for the N*N virtual coordinate system, for the horizontal coordinate, when the node to be distributed is on the left side of the target node (i.e., in the negative direction), = , when the node to be distributed is on the right side of the target node (i.e. in the positive direction), = , round down the calculated result to an integer (for example, if the calculated result is 3.5, then round it down to 3); then perform virtual coordinate transformation, is the abscissa value of the first physical coordinate of the target node, and x is the abscissa value of the second physical coordinate of the node to be distributed. is the horizontal coordinate value of the virtual coordinate of the node to be distributed. hour, ;when hour, ;when hour, ; In other cases, .
[0075] For the vertical coordinate, when the node to be distributed is below the target node (i.e., in the negative direction), = , when the node to be distributed is on the upper side of the target node (i.e. in the positive direction), = , round down the calculated result to an integer (for example, if the calculated result is 3.5, then round it down to 3); then perform virtual coordinate transformation, is the ordinate value of the first physical coordinate of the target node, y is the ordinate value of the second physical coordinate of the node to be distributed, is the vertical coordinate value of the virtual coordinate of the node to be distributed. hour, ;when hour, ;when hour, ; In other cases, .
[0076] 205. Determine the target area identifier and the target coordinate axis bitmap based on the virtual coordinates.
[0077] In some embodiments, determining the target area identifier based on the virtual coordinates may specifically include: determining the target quadrant of each node to be distributed in the virtual coordinate system based on the virtual coordinates; and determining the target area identifier corresponding to the target quadrant based on the target quadrant corresponding to each node to be distributed.
[0078] It should be noted that since the target area identifier is used to indicate the quadrant of at least one node to be distributed in the virtual coordinate system, after determining the virtual coordinates of at least one node to be distributed, the target quadrant of each node to be distributed can be determined, thereby determining the target area identifier corresponding to each target quadrant.
[0079] For example, Figure 3The figure shows a schematic diagram of the area identification. In the virtual coordinate system, four quadrants are divided by the X-axis and the Y-axis. Each quadrant corresponds to a different area identification. Figure 3 In the example, the region ID of the first quadrant in the upper right corner can be 00, the region ID of the second quadrant in the upper left corner can be 01, the region ID of the third quadrant in the lower left corner can be 10, and the region ID of the fourth quadrant in the lower right corner can be 11. If the three nodes to be distributed are located in the first, second, and fourth quadrants respectively, the target region IDs can be: 00, 01, and 11.
[0080] If x>0 and y≥0 in the virtual coordinates, the node to be distributed is considered to be in the first quadrant, and the target area identifier of the node to be distributed is 00; if x≤0 and y>0 in the virtual coordinates, the node to be distributed is considered to be in the second quadrant, and the target area identifier of the node to be distributed is 01; if x<0 and y≤0 in the virtual coordinates, the node to be distributed is considered to be in the third quadrant, and the target area identifier of the node to be distributed is 10; if x≥0 and y<0 in the virtual coordinates, the node to be distributed is considered to be in the fourth quadrant, and the target area identifier of the node to be distributed is 11.
[0081] Furthermore, based on the virtual coordinates, the target area identifier and the target coordinate axis bitmap are determined, which may specifically include: determining the initial distribution coordinate axis corresponding to the target quadrant based on the target area identifier; mapping at least one virtual coordinate located in the target quadrant to the initial distribution coordinate axis to obtain a mapping result; and determining the target coordinate axis bitmap based on the mapping result.
[0082] It should be noted that, since data is distributed to nodes in sequence according to the direction of the coordinate axis, and the same rules are followed in each quadrant, an initial distribution coordinate axis can be set for each quadrant. That is to say, for the nodes to be distributed in the quadrant, the target node will first distribute to the nodes on the initial distribution coordinate axis, and then the node will continue to distribute. At this time, in order to determine the distribution path of the nodes on the initial distribution coordinate axis, it is necessary to determine whether there are nodes to be distributed in the row or column corresponding to the node. Therefore, each node to be distributed can be mapped to the initial distribution coordinate axis in advance to obtain a mapping result. The mapping result can clearly indicate whether there are nodes to be distributed in the rows or columns where each coordinate point on the initial distribution coordinate axis is located. The target coordinate axis bitmap can be obtained by summarizing the mapping results.
[0083] Furthermore, the mapping result may include two situations, namely, there are nodes to be distributed on the row or column corresponding to the coordinate point on the initial distribution coordinate axis, or there are no nodes to be distributed on the row or column corresponding to the coordinate point on the initial distribution coordinate axis. Therefore, based on the mapping result, the target coordinate axis bitmap is determined, which may specifically include: when the mapping result indicates that there are virtual coordinates in the target row or target column perpendicular to the initial distribution coordinate axis, the value of the coordinate point corresponding to the target row or target column on the initial distribution coordinate axis is set to a first value; when the mapping result indicates that there are no virtual coordinates in the target row or target column perpendicular to the initial distribution coordinate axis, the value of the coordinate point corresponding to the target row or target column on the initial distribution coordinate axis is set to a second value; the values of each coordinate point on the initial distribution coordinate axis in the virtual coordinate system are summarized to obtain the target coordinate axis bitmap.
[0084] It should be noted that since the nodes in the virtual coordinate system are arranged in a grid format, after the target node distributes to the nodes on the initial distribution coordinate axis, the node can continue to distribute to other nodes in the direction of the initial distribution coordinate axis, or it can turn and distribute to nodes in the perpendicular direction of the initial distribution coordinate axis. Therefore, whether to turn depends on whether there is a node to be distributed in the perpendicular direction of the initial distribution coordinate axis, which is determined by the target coordinate axis bitmap. Since the virtual coordinate system includes the X-axis and the Y-axis, the target coordinate axis bitmap can also specifically include a target coordinate row bitmap and a target coordinate column bitmap. The mapping result mapped to the X-axis constitutes the target coordinate row bitmap, and the mapping result mapped to the Y-axis constitutes the target coordinate column bitmap.
[0085] Among them, the target coordinate axis bitmap can include the values of each coordinate point on the initial distribution coordinate axis, and the value of the coordinate point represents whether there is a node to be distributed in the row or column. For example: it can be stipulated that if there is a node to be distributed on the row or column, then the value of the coordinate point is 1, that is, the first value is 1; if there is no node to be distributed on the row or column, then the value of the coordinate point is 0, that is, the second value is 0.
[0086] For example, in Figure 4 In the virtual coordinate system shown, it can be seen that the target node is s27. The virtual coordinate system is created with s27 as the origin. In addition, the gray nodes are nodes to be distributed, and the other white nodes are just ordinary nodes that do not need to receive data to be distributed.
[0087] Among them, there are two nodes to be distributed in the first quadrant, namely s38 and s53. Assuming that the initial distribution coordinate axis of the first quadrant is the X-axis, both s38 and s53 can be mapped to the X-axis, and it can be obtained that s38 is mapped to the coordinate point (3, 0) and s53 is mapped to the coordinate point (2, 0).
[0088] Among them, there are two nodes to be distributed in the second quadrant, namely s40 and s49. Assuming that the initial distribution coordinate axis of the second quadrant is the Y axis, both s40 and s49 can be mapped to the Y axis, and it can be obtained that s40 is mapped to the coordinate point (0, 2) and s49 is mapped to the coordinate point (0, 3).
[0089] Among them, there are three nodes to be distributed in the third quadrant, namely s2, s9 and s16. Assuming that the initial distribution coordinate axis of the third quadrant is the X-axis, s2, s9 and s16 can all be mapped to the X-axis. It can be obtained that s2 is mapped to the coordinate point (-1, 0), s9 is mapped to the coordinate point (-2, 0), and s16 is mapped to the coordinate point (-3, 0).
[0090] Among them, there are two nodes to be distributed in the fourth quadrant, namely s14 and s22. Assuming that the initial distribution coordinate axis of the fourth quadrant is the Y axis, both s14 and s22 can be mapped to the Y axis, and it can be obtained that s14 is mapped to the coordinate point (0, -2) and s22 is mapped to the coordinate point (0, -1).
[0091] Summarizing all the above mapping results, we can see that on the X-axis, the coordinate points (-3, 0), (-2, 0), (-1, 0), (2, 0), and (3, 0) have mapped nodes to be distributed. Therefore, the values of these five coordinate points can be determined as 1, and the values of the other coordinate points can be 0. On the Y-axis, the coordinate points (0, 3), (0, 2), (0, -1), and (0, -2) have mapped nodes to be distributed. Therefore, the values of these four coordinate points can be determined as 1, and the values of the other coordinate points can be 0. After summarizing, we can obtain the target coordinate row bitmap of the X-axis as 11100110, and the target coordinate column bitmap of the Y-axis as 01100110.
[0092] 206. Determine, based on the target area identifier, a set of regional nodes to be distributed corresponding to at least one node to be distributed, to obtain at least one set of regional nodes to be distributed.
[0093] In an embodiment of the present application, when distributing data, the target node distributes it according to the quadrant, that is, the data to be distributed in the same quadrant can be considered as a set, and is distributed sequentially starting from the same initial distribution coordinate axis, and the target node can determine the quadrant in which each node to be distributed is located according to the target area identifier. Therefore, according to the target area identifier, at least one node to be distributed can be divided, that is, the set of regional nodes to be distributed corresponding to at least one node to be distributed is determined, and the nodes to be distributed with the same target area identifier correspond to the same set of regional nodes to be distributed, thereby obtaining at least one set of regional nodes to be distributed.
[0094] For example, in Figure 4In the virtual coordinate system shown, s38 and s53 are in the first quadrant, so the target area identifier of s38 and s53 is 00; s40 and s49 are in the second quadrant, so the target area identifier of s38 and s53 is 01; s2, s9 and s16 are in the third quadrant, so the target area identifier of s38 and s53 is 10; s14 and s22 are in the fourth quadrant, so the target area identifier of s38 and s53 is 11; Therefore, according to the target area identifier, Figure 4 All nodes to be distributed are divided into four sets of regional nodes to be distributed, as shown in Table 2 below.
[0095] Table 2 Region identification and corresponding node set
[0096]
[0097] 207. Determine at least one initial distribution node corresponding to at least one set of regional nodes to be distributed according to a preset distribution rule.
[0098] In the embodiment of the present application, the target node may distribute data to a set of regional nodes to be distributed, so each set of regional nodes to be distributed may correspond to an initial distribution node.
[0099] It should be noted that the preset distribution rule can be a pre-set rule for distributing data to the nodes in each quadrant in sequence, that is, first sending data to the initial distribution node on the initial distribution coordinate axis, and then continuing to send data through the initial distribution node, and the initial distribution node can decide the coordinate axis direction for continuing to distribute data according to the preset distribution rule. The preset distribution rule can also be commonly referred to as a turning rule.
[0100] In some embodiments, as Figure 5 The diagram shows the preset distribution rules. Figure 5 It can be seen that the rules in the four quadrants can be centrally symmetrical. Of course, it is also possible to set rules in other directions, which is not limited. In this application, Figure 5 The rules are explained as an example.
[0101] It can be seen that in the first quadrant, data is first distributed along the positive direction of the X-axis. After distributing to the node in the positive direction of the X-axis, the node can continue to distribute data in the positive direction of the X-axis or in the positive direction of the Y-axis. That is to say, the node in the positive direction of the X-axis can distribute data to the nodes in the positive direction of the X-axis and the positive direction of the Y-axis, while the node in the first quadrant can only distribute data to the node in the positive direction of the Y-axis.
[0102] Similarly, in the first quadrant, data is first distributed along the positive direction of the Y axis. After distributing to the node in the positive direction of the Y axis, the node can continue to distribute data in the positive direction of the Y axis or in the negative direction of the X axis. In other words, the node in the positive direction of the Y axis can distribute data to the nodes in the positive direction of the Y axis and the negative direction of the X axis, while the node in the second quadrant can only distribute data to the node in the negative direction of the X axis.
[0103] Similarly, in the third quadrant, data is first distributed along the negative direction of the X-axis. After distributing to the node in the negative direction of the X-axis, the node can continue to distribute data in the negative direction of the X-axis or in the negative direction of the Y-axis. In other words, the node in the negative direction of the X-axis can distribute data to the nodes in the negative direction of the X-axis and the negative direction of the Y-axis, while the nodes in the third quadrant can only distribute data to the nodes in the negative direction of the Y-axis.
[0104] Similarly, in the fourth quadrant, data is first distributed along the negative direction of the Y axis. After distributing to the node in the negative direction of the Y axis, the node can continue to distribute data in the negative direction of the Y axis or distribute data in the positive direction of the X axis. That is to say, the node in the negative direction of the Y axis can distribute data to the nodes in the negative direction of the Y axis and the positive direction of the X axis, while the node in the fourth quadrant can only distribute data to the node in the positive direction of the X axis.
[0105] In summary, reference Figure 4 and Figure 5 The initial distribution node corresponding to the set of regional nodes to be distributed in the first quadrant [s38, s53] is the first node s28 in the positive direction of the X-axis. The initial distribution node corresponding to the set of regional nodes to be distributed in the second quadrant [s40, s49] is the first node s35 in the positive direction of the Y-axis. The initial distribution node corresponding to the set of regional nodes to be distributed in the third quadrant [s2, s9, s16] is the first node s26 in the negative direction of the X-axis. The initial distribution node corresponding to the set of regional nodes to be distributed in the fourth quadrant [s14, s22] is the first node s19 in the negative direction of the Y-axis.
[0106] 208. Distribute the information to be distributed and the target coordinate axis bitmap to at least one initial distribution node through the target node.
[0107] In some embodiments, when the target node distributes data, some data may be more important and need to be sent quickly to each node to be distributed, while some data is just ordinary daily data. Therefore, the information to be distributed may also include: the priority of the data to be distributed. Therefore, the information to be distributed and the target coordinate axis bitmap are distributed to at least one initial distribution node through the target node. Specifically, it may include: when it is detected that the priority of the data to be distributed is greater than the preset priority, the information to be distributed and the target coordinate axis bitmap are distributed to at least one initial distribution node from the priority channel through the target node.
[0108] In addition to the ordinary channel, the data transmission channel between the target node and the initial distribution node can also set a priority channel. The data transmission speed of the priority channel can be greater than other channels and has a high priority. That is to say, if the priority of the data to be transmitted is greater than the better priority, it means that the data is very important, so the priority channel can be called for data transmission. Of course, priority channels will also be set between the initial distribution node and other nodes. This can ensure that each node passing between the target node and the node to be distributed can distribute data through the priority channel, so that the data to be distributed can quickly receive high-priority data, avoiding the situation where the channel is blocked when a large amount of data is transmitted, resulting in slow transmission of high-priority data.
[0109] 209. When the first initial distribution node is determined as the node to be distributed according to at least one multicast code in the information to be distributed, the first initial distribution node is used to process the data to be distributed.
[0110] In an embodiment of the present application, in a virtual coordinate system with the target node as the origin, the node to be distributed can be located on the coordinate axis or in the quadrant, so at least one initial distribution node located on the coordinate axis may also be the node to be distributed. Specifically, whether it is the node to be distributed can be determined by multicast coding. If the code of the first initial distribution node is located in at least one multicast code, then the first initial distribution node is the node to be distributed. That is to say, the first initial distribution node is the node to which the target node needs to distribute data, so the first initial distribution node can process the data to be distributed, and the first initial distribution node can be any one of the at least one initial distribution node.
[0111] 210. Determine the value of the coordinate point corresponding to the first initial distribution node and the values of the coordinate points corresponding to other nodes in the direction of the first coordinate axis according to the target coordinate axis bitmap.
[0112] In an embodiment of the present application, after receiving the information to be distributed and the target coordinate axis bitmap, the first initial distribution node may need to continue forwarding data, or may no longer need to continue forwarding, and the basis is whether there are other nodes to be distributed in its subsequent direction. Therefore, it can be judged based on the pre-obtained target coordinate axis bitmap if the first initial distribution node and / or other nodes in the first coordinate axis direction correspond to the first numerical value, indicating that there are still nodes to be distributed; if the corresponding second data indicates that there are no nodes to be distributed.
[0113] The direction of the first coordinate axis may be the direction in which the target node is connected to the first initial distribution node. Figure 4 As shown, for the first initial distribution node s28 in the first quadrant, in the target coordinate axis bitmap, the value corresponding to s28 is 0 (the second value), indicating that there is no node to be distributed in the column corresponding to s28, while the values corresponding to nodes s29 and s30 in the positive direction of the X-axis (the direction of the first coordinate axis) are 1 (the first value), indicating that there are nodes to be distributed in the columns corresponding to s29 and s30, so data needs to be distributed again.
[0114] 211. When the value of the coordinate point corresponding to the first initial distribution node is the first value, and the value of the coordinate point corresponding to other nodes in the direction of the first coordinate axis is the first value, the information to be distributed and the target coordinate axis bitmap are continued to be distributed to the next node in the direction of the first coordinate axis and the next node in the direction of the second coordinate axis through the first initial distribution node.
[0115] In an embodiment of the present application, the value of the coordinate point corresponding to the first initial distribution node is the first numerical value, indicating that there is a node to be distributed in the second coordinate axis direction corresponding to the first initial distribution node; the value of the coordinate point corresponding to other nodes in the first coordinate axis direction is the first numerical value, indicating that there are nodes to be distributed in the second coordinate axis direction corresponding to other nodes after the first initial distribution node in the first coordinate axis direction, so the first initial distribution node needs to distribute the information to be distributed and the target coordinate axis bitmap to the next node in the first coordinate axis direction and the next node in the second coordinate axis direction.
[0116] The first coordinate axis direction and the second coordinate axis direction are perpendicular to each other.
[0117] For example, Figure 4As shown, for the first initial distribution node s26 in the third quadrant, the first coordinate axis direction is the negative X-axis direction. According to the preset distribution rule, the third quadrant distributes data in the negative X-axis direction first, followed by the negative Y-axis direction. Therefore, the second coordinate axis direction is the negative Y-axis direction. In the target coordinate axis bitmap, the value corresponding to s26 is 1 (the first numerical value), indicating that there is a node to be distributed in the negative Y-axis direction corresponding to s26. Furthermore, the values corresponding to the subsequent nodes s25 and s24 in the negative X-axis direction are also 1 (the first numerical value), indicating that there are nodes to be distributed in the negative Y-axis direction corresponding to s25 and s24. Therefore, s26 needs to continue distributing data to s18 and s25. Similarly, after receiving data, s25 detects that the value corresponding to s25 in the target coordinate axis bitmap is 1 (the first numerical value), indicating that there is a node to be distributed in the negative Y-axis direction corresponding to s25. Furthermore, the value corresponding to the subsequent node s24 in the negative X-axis direction is 1 (the first numerical value), indicating that there is a node to be distributed in the negative Y-axis direction corresponding to s24. Therefore, s25 needs to distribute data to both s17 and s24.
[0118] For the first initial distribution node s19 in the fourth quadrant, the first coordinate axis direction is the negative Y-axis direction. According to the preset distribution rule, the fourth quadrant distributes data in the negative Y-axis direction first, followed by the positive X-axis direction. Therefore, the second coordinate axis direction is the positive X-axis direction. In the target coordinate axis bitmap, the value corresponding to s19 is 1 (the first value), indicating that there is a node to be distributed in the positive X-axis direction corresponding to s19. The value corresponding to the subsequent node s11 in the negative Y-axis direction is also 1 (the first value), indicating that there is a node to be distributed in the positive X-axis direction corresponding to s11. Therefore, s19 needs to continue distributing data to s11 and s20. Similarly, after receiving data, s11 detects that the value corresponding to s11 in the target coordinate axis bitmap is 1 (the first value), indicating that there is a node to be distributed in the positive X-axis direction corresponding to s11. The value corresponding to the subsequent node in the negative Y-axis direction is 0 (the second value), indicating that there is no node to be distributed in the negative Y-axis direction. Therefore, s11 needs to distribute data to s12.
[0119] 212. If it is detected that there are nodes to be distributed in other nodes except the next node in the direction of the second coordinate axis, continue to distribute the information to be distributed and the target coordinate axis bitmap to the nodes in the direction of the second coordinate axis through the next node in the direction of the second coordinate axis.
[0120] In an embodiment of the present application, after the first initial distribution node sends the information to be distributed and the target coordinate axis bitmap to the next node in the direction of the second coordinate axis, the next node in the direction of the second coordinate axis may be the node to be distributed or may not be the node to be distributed, and there may be other nodes to be distributed among the subsequent nodes in the direction of the second coordinate axis. Therefore, if it is detected that there are nodes to be distributed among other nodes in the direction of the second coordinate axis except the next node, then the next node in the direction of the second coordinate axis needs to continue to distribute the information to be distributed and the target coordinate axis bitmap to the subsequent nodes in the direction of the second coordinate axis after receiving the data sent by the first initial distribution node.
[0121] In some embodiments, at least one multicast code may be used to determine whether there are any nodes to be distributed in other nodes except the next node in the direction of the second coordinate axis.
[0122] For example, Figure 6 As shown, it can be seen Figure 6 This is a partial diagram of the second quadrant in the virtual coordinate system with s27 as the origin, where s32, s33, s49, and s57 are nodes to be distributed. According to the preset distribution rule, in the second quadrant, the positive direction of the Y axis is first, and then the negative direction of the X axis. Therefore, the direction of the first coordinate axis is the positive direction of the Y axis, and the direction of the second coordinate axis is the negative direction of the X axis. After s27 distributes data to s35, s35 will continue to distribute data to s34 and s43 according to the target coordinate axis bitmap. At this time, after s34 receives the data, it detects that s34 is not the node to be distributed according to the multicast coding. However, there are nodes to be distributed among other nodes in the negative direction of the X-axis of s34, namely s33 and s32. Therefore, s34 needs to continue to distribute the information to be distributed and the target coordinate axis bitmap to s33; further, after s33 receives the information to be distributed and the target coordinate axis bitmap, it detects that s33 is the node to be distributed, so it can process the data to be distributed, and also detects that there are nodes to be distributed among other nodes in the negative direction of the X-axis of s33, namely s32. Therefore, s33 needs to continue to distribute the information to be distributed and the target coordinate axis bitmap to s32.
[0123] 213. Stop distributing the information to be distributed and the target coordinate axis bitmap until it is detected that there is no node to be distributed in the direction of the second coordinate axis.
[0124] In the embodiments of this application, Figure 6As shown, after s49 receives the information to be distributed and the target coordinate axis bitmap sent by s50, it detects that there is no node to be distributed among other nodes in the negative direction of the X-axis of s49, that is, s48 is not a node to be distributed, then s49 can stop distributing the information to be distributed and the target coordinate axis bitmap; similarly, after s57 receives the information to be distributed and the target coordinate axis bitmap sent by s58, it detects that there is no node to be distributed among other nodes in the negative direction of the X-axis of s57, that is, s56 is not a node to be distributed, then s57 can stop distributing the information to be distributed and the target coordinate axis bitmap.
[0125] 214. When the value of the coordinate point corresponding to the first initial distribution node is the second value, continue to distribute the to-be-distributed information and the target coordinate axis bitmap to the next node in the direction of the first coordinate axis through the first initial distribution node.
[0126] In the embodiments of this application, Figure 4 As shown, for the first initial distribution node s28 in the first quadrant, the first coordinate axis direction is the positive X-axis direction. According to the preset distribution rule, the first quadrant distributes data in the positive X-axis direction first, followed by the positive Y-axis direction. Therefore, the second coordinate axis direction is the positive Y-axis direction. In the target coordinate axis bitmap, the value corresponding to s28 is 0 (the second value), indicating that there are no nodes to be distributed in the positive Y-axis direction corresponding to s28. However, the values corresponding to subsequent nodes s29 and s30 in the positive X-axis direction are 1 (the first value), indicating that there are nodes to be distributed in the positive Y-axis direction corresponding to s29 and s30. Therefore, s28 needs to continue distributing data to s29. Similarly, after receiving data, s29 detects that the value corresponding to s29 in the target coordinate axis bitmap is 1 (the first value), indicating that there is a node to be distributed in the positive Y-axis direction corresponding to s29. Furthermore, the value corresponding to subsequent node s30 in the positive X-axis direction is 1 (the first value), indicating that there is a node to be distributed in the positive Y-axis direction corresponding to s30. Therefore, s29 needs to distribute data to both s30 and s37.
[0127] For the first initial distribution node s35 in the second quadrant, the first coordinate axis direction is the positive Y-axis direction. According to the preset distribution rule, the second quadrant distributes data in the positive Y-axis direction first, followed by the negative X-axis direction. Therefore, the second coordinate axis direction is the negative X-axis direction. In the target coordinate axis bitmap, the value corresponding to s35 is 0 (the second value), indicating that there are no nodes to be distributed in the negative X-axis direction corresponding to s35. However, the values corresponding to subsequent nodes s43 and s51 in the positive Y-axis direction are 1 (the first value), indicating that there are nodes to be distributed in the negative X-axis direction corresponding to s43 and s51. Therefore, s35 needs to continue distributing data to s43. Similarly, after receiving data, s43 detects that the value corresponding to s43 in the target coordinate axis bitmap is 1 (the first value), indicating that there is a node to be distributed in the negative X-axis direction corresponding to s43. Furthermore, the value corresponding to subsequent node s51 in the positive Y-axis direction is 1 (the first value), indicating that there is a node to be distributed in the negative X-axis direction corresponding to s51. Therefore, s43 needs to distribute data to both s42 and s51.
[0128] 215. Determine a virtual boundary of the virtual coordinate system according to a preset network dimension of the virtual coordinate system.
[0129] In an embodiment of the present application, when a virtual coordinate system is constructed with the target node as the origin, the virtual coordinate system has a preset network dimension, that is, the virtual coordinate system is M*N or N*N, that is, the virtual coordinate system has boundaries.
[0130] For example, Figure 4 In the virtual coordinate system shown, the nodes s00, s01, s02, s03, s04, s05, s06, s07, s15, s23, s31, s39, s47, s55, s63, s62, s61, s60, s59, s58, s57, s56, s48, s40, s32, s24, s16, and s08 constitute the virtual boundary of the virtual coordinate system.
[0131] 216. When it is detected that the next node in the direction of the first coordinate axis or the next node in the direction of the second coordinate axis has reached the virtual boundary, stop distributing the to-be-distributed information and the target coordinate axis bitmap.
[0132] In an embodiment of the present application, if during the data distribution process, a node detects that it has reached the virtual boundary when receiving the information to be distributed and the target coordinate axis bitmap, that is, the node itself is a node on the boundary, then the node will not continue to send data to other nodes in the direction of receiving data.
[0133] For example, Figure 4As shown, after s40 receives the information to be distributed and the target coordinate axis bitmap sent by s41, it detects that s40 is a node on the virtual boundary, then s40 will not continue to send the information to be distributed and the target coordinate axis bitmap to the node in the negative direction of the X-axis; similarly, after s24 receives the information to be distributed and the target coordinate axis bitmap sent by s25, it detects that s24 is a node on the virtual boundary, then after s24 sends the information to be distributed and the target coordinate axis bitmap to s16, it will no longer send the information to be distributed and the target coordinate axis bitmap to the node in the negative direction of the X-axis.
[0134] In an embodiment of the present application, by setting a virtual coordinate system with a preset network dimension, the virtual coordinate system has a boundary, that is, there will be no boundary wraparound phenomenon during data distribution, and data distribution will stop after reaching the boundary. This can avoid the deadlock caused by boundary wraparound and improve the security of data distribution.
[0135] In some embodiments, when the target node distributes data to the node to be distributed, the data can be sent in the form of a protocol. In addition to the information to be distributed (including the data to be distributed, multicast coding, physical coordinates of the target node), target coordinate axis bitmap, and priority mentioned in the above embodiments, the protocol can also include: target area identification, frame identification, CRC-8, frame length, check code, etc., among which the frame identification, CRC-8 and check code frame identification can all be maintained by the node itself and used cyclically, and can be used for data identification and verification.
[0136] 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 the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0137] like Figure 7 As shown, an embodiment of the present application further provides a data distribution device, which may include:
[0138] An acquisition module 701 is configured to acquire information to be distributed, where the information to be distributed includes at least: data to be distributed, a first physical coordinate of a target node, and at least one multicast code corresponding to the target node;
[0139] A processing module 702 is configured to determine, based on at least one multicast code, at least one to-be-distributed node corresponding to a target node;
[0140] The processing module 702 is further configured to map the at least one node to be distributed into a virtual coordinate system based on the first physical coordinate of the target node and the second physical coordinate of the at least one node to be distributed, thereby obtaining a target region identifier and a target coordinate axis bitmap, wherein the target region identifier is used to indicate the quadrant of the at least one node to be distributed in the virtual coordinate system, and the target coordinate axis bitmap is used to indicate the coordinate position of the at least one node to be distributed in the virtual coordinate system, where the virtual coordinate system is a coordinate system created with the target node as the origin.
[0141] The processing module 702 is further configured to determine at least one initial distribution node based on the target node according to the target area identifier;
[0142] The transceiver module 703 is configured to distribute the information to be distributed and the target coordinate axis bitmap to at least one initial distribution node via the target node.
[0143] In some embodiments, the processing module 702 is specifically configured to determine virtual coordinates of at least one to-be-distributed node in a virtual coordinate system according to the first physical coordinates of the target node and the second physical coordinates of at least one to-be-distributed node;
[0144] The processing module 702 is specifically configured to determine a target region identifier and a target coordinate axis bitmap according to the virtual coordinates.
[0145] In some embodiments, the processing module 702 is further configured to establish a virtual coordinate system of a preset network dimension with the target node as the origin;
[0146] The processing module 702 is further configured to determine virtual coordinates of at least one to-be-distributed node in the virtual coordinate system according to the first physical coordinates of the target node, the second physical coordinates of at least one to-be-distributed node, and a preset network dimension.
[0147] In some embodiments, the processing module 702 is specifically configured to determine a target quadrant of each to-be-distributed node in the virtual coordinate system based on the virtual coordinates;
[0148] The processing module 702 is specifically configured to determine a target area identifier corresponding to the target quadrant according to the target quadrant corresponding to each to-be-distributed node.
[0149] In some embodiments, the processing module 702 is specifically configured to determine an initial distribution coordinate axis corresponding to the target quadrant according to the target area identifier;
[0150] The processing module 702 is specifically configured to map at least one virtual coordinate located in the target quadrant to the initial distribution coordinate axis to obtain a mapping result;
[0151] The processing module 702 is specifically configured to determine a target coordinate axis bitmap according to the mapping result.
[0152] In some embodiments, the processing module 702 is specifically configured to set the value of the coordinate point corresponding to the target row or target column located on the initial distribution coordinate axis to a first value when the mapping result indicates that a virtual coordinate exists in the target row or target column perpendicular to the initial distribution coordinate axis;
[0153] The processing module 702 is specifically configured to set the value of the coordinate point corresponding to the target row or target column on the initial distribution coordinate axis to a second value when the mapping result indicates that no virtual coordinate exists in the target row or target column perpendicular to the initial distribution coordinate axis;
[0154] The processing module 702 is specifically configured to aggregate the values of the coordinate points on the initial distribution coordinate axis in the virtual coordinate system to obtain a target coordinate axis bitmap.
[0155] In some embodiments, the processing module 702 is specifically configured to determine, based on the target area identifier, a set of regional nodes to be distributed corresponding to each of the at least one node to be distributed, to obtain at least one set of regional nodes to be distributed, wherein nodes to be distributed with the same target area identifier correspond to the same set of regional nodes to be distributed;
[0156] The processing module 702 is specifically configured to determine, according to a preset distribution rule, at least one initial distribution node corresponding to at least one set of regional nodes to be distributed, where each set of regional nodes to be distributed corresponds to one initial distribution node.
[0157] In some embodiments, the processing module 702 is further configured to process the data to be distributed through the first initial distribution node when the first initial distribution node is determined to be the node to be distributed according to at least one multicast code in the information to be distributed.
[0158] In some embodiments, the processing module 702 is further configured to determine, based on the target coordinate axis bitmap, a value of a coordinate point corresponding to the first initial distribution node and values of coordinate points corresponding to other nodes in the direction of the first coordinate axis;
[0159] The transceiver module 703 is further configured to, when the value of the coordinate point corresponding to the first initial distribution node is the first value and the coordinate point corresponding to another node in the first coordinate axis direction has the first value, continue to distribute the information to be distributed and the target coordinate axis bitmap to the next node in the first coordinate axis direction and the next node in the second coordinate axis direction through the first initial distribution node.
[0160] The transceiver module 703 is further configured to continue distributing the information to be distributed and the target coordinate axis bitmap to the next node in the direction of the first coordinate axis through the first initial distribution node when the value of the coordinate point corresponding to the first initial distribution node is the second value;
[0161] The first coordinate axis direction and the second coordinate axis direction are perpendicular to each other, and the first coordinate axis direction is the direction in which the target node connects to the first initial distribution node.
[0162] In some embodiments, the transceiver module 703 is further configured to, if it is detected that there are nodes to be distributed in other nodes except the next node in the direction of the second coordinate axis, continue to distribute the information to be distributed and the target coordinate axis bitmap to the nodes in the direction of the second coordinate axis through the next node in the direction of the second coordinate axis;
[0163] The transceiver module 703 is further configured to stop distributing the information to be distributed and the target coordinate axis bitmap until it is detected that there is no node to be distributed in the direction of the second coordinate axis.
[0164] In some embodiments, the processing module 702 is further configured to determine a virtual boundary of the virtual coordinate system based on a preset network dimension of the virtual coordinate system;
[0165] The transceiver module 703 is further configured to stop distributing the to-be-distributed information and the target coordinate axis bitmap when detecting that the next node in the direction of the first coordinate axis or the next node in the direction of the second coordinate axis has reached the virtual boundary.
[0166] In some embodiments, the information to be distributed also includes: the priority of the data to be distributed, and the transceiver module 703, which is specifically used to distribute the information to be distributed and the target coordinate axis bitmap from the priority channel to at least one initial distribution node through the target node when it is detected that the priority of the data to be distributed is greater than the preset priority.
[0167] In the embodiments of the present application, the description of the features in the embodiments corresponding to the data distribution device can refer to the relevant description of the embodiments corresponding to the data distribution method, and will not be repeated here.
[0168] like Figure 8 As shown, an embodiment of the present application further provides an electronic device, including a memory 801 and a processor 802, wherein the memory 801 stores a computer program, and the processor 802 is configured to run the computer program to execute the steps in any of the above-mentioned data distribution method embodiments.
[0169] 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-mentioned data distribution method embodiments when running.
[0170] 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.
[0171] 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 of the above-mentioned data distribution method embodiments are implemented.
[0172] An embodiment of the present application also 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-mentioned data distribution method embodiments are implemented.
[0173] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0174] The above is a detailed introduction to the process monitoring of a storage system provided by this application. Specific examples are used herein to illustrate the principles and implementation methods of this application. The description of the above embodiments is only intended to help understand the method and core ideas of this application. It should be pointed out that, for those skilled in the art, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
Claims
1. A data distribution method, characterized in that: The method comprises: Acquire information to be distributed, where the information to be distributed includes at least: data to be distributed, a first physical coordinate of a target node, and at least one multicast code corresponding to the target node; Determining, according to the at least one multicast code, at least one to-be-distributed node corresponding to the target node; Mapping the at least one node to be distributed to a virtual coordinate system according to the first physical coordinates of the target node and the second physical coordinates of the at least one node to be distributed to obtain a target area identifier and a target coordinate axis bitmap, wherein the target area identifier is used to indicate the quadrant of the at least one node to be distributed in the virtual coordinate system, and the target coordinate axis bitmap is used to indicate the coordinate position of the at least one node to be distributed in the virtual coordinate system, where the virtual coordinate system is a coordinate system created with the target node as the origin; Determining at least one initial distribution node based on the target node according to the target area identifier; The information to be distributed and the target coordinate axis bitmap are distributed to the at least one initial distribution node through the target node.
2. The method according to claim 1, characterized in that The step of mapping the at least one node to be distributed to a virtual coordinate system according to the first physical coordinate of the target node and the second physical coordinate of the at least one node to be distributed to obtain a target area identifier and a target coordinate axis bitmap includes: Determining virtual coordinates of the at least one to-be-distributed node in the virtual coordinate system according to the first physical coordinates of the target node and the second physical coordinates of the at least one to-be-distributed node; The target area identifier and the target coordinate axis bitmap are determined according to the virtual coordinates.
3. The method according to claim 2, characterized in that Before determining the virtual coordinates of the at least one to-be-distributed node in the virtual coordinate system according to the first physical coordinates of the target node and the second physical coordinates of the at least one to-be-distributed node, the method further includes: Establishing the virtual coordinate system of a preset network dimension with the target node as the origin; The determining, based on the first physical coordinates of the target node and the second physical coordinates of the at least one node to be distributed, the virtual coordinates of the at least one node to be distributed in the virtual coordinate system respectively includes: According to the first physical coordinates of the target node, the second physical coordinates of the at least one node to be distributed and the preset network dimension, the virtual coordinates of the at least one node to be distributed in the virtual coordinate system are determined.
4. The method according to claim 2, characterized in that The step of determining the target area identifier according to the virtual coordinates includes: Determining a target quadrant of each to-be-distributed node in the virtual coordinate system according to the virtual coordinates; According to the target quadrant corresponding to each to-be-distributed node, the target area identifier corresponding to the target quadrant is determined.
5. The method according to claim 4, characterized in that The step of determining the target area identifier and the target coordinate axis bitmap according to the virtual coordinates includes: Determining an initial distribution coordinate axis corresponding to the target quadrant according to the target area identifier; Mapping at least one virtual coordinate located in the target quadrant onto the initial distribution coordinate axis to obtain a mapping result; The target coordinate axis bitmap is determined according to the mapping result.
6. The method according to claim 5, characterized in that Determining the target coordinate axis bitmap according to the mapping result includes: When the mapping result indicates that the virtual coordinate exists in a target row or a target column perpendicular to the initial distribution coordinate axis, setting the value of the coordinate point corresponding to the target row or the target column on the initial distribution coordinate axis to a first value; When the mapping result indicates that the virtual coordinate does not exist in the target row or the target column perpendicular to the initial distribution coordinate axis, setting the value of the coordinate point corresponding to the target row or the target column on the initial distribution coordinate axis to a second value; The values of each coordinate point on the initial distribution coordinate axis in the virtual coordinate system are aggregated to obtain the target coordinate axis bitmap.
7. The method according to claim 1, characterized in that The determining, according to the target area identifier, at least one initial distribution node based on the target node includes: Determine, based on the target area identifier, sets of regional nodes to be distributed corresponding to the at least one node to be distributed, to obtain at least one set of regional nodes to be distributed, wherein nodes to be distributed with the same target area identifier correspond to the same set of regional nodes to be distributed; According to a preset distribution rule, the at least one initial distribution node corresponding to the at least one set of regional nodes to be distributed is determined, and each set of regional nodes to be distributed corresponds to an initial distribution node.
8. The method according to claim 1, characterized in that After distributing the information to be distributed and the target coordinate axis bitmap to the at least one initial distribution node through the target node, the method further includes: When a first initial distribution node is determined as the node to be distributed according to at least one multicast code in the information to be distributed, the data to be distributed is processed by the first initial distribution node.
9. The method according to claim 1, characterized in that After distributing the information to be distributed and the target coordinate axis bitmap to the at least one initial distribution node through the target node, the method further includes: Determining, according to the target coordinate axis bitmap, the value of the coordinate point corresponding to the first initial distribution node and the values of the coordinate points corresponding to other nodes in the direction of the first coordinate axis; When the value of the coordinate point corresponding to the first initial distribution node is a first value, and the value of the coordinate point corresponding to another node in the first coordinate axis direction is the first value, the information to be distributed and the target coordinate axis bitmap are continuously distributed to the next node in the first coordinate axis direction and the next node in the second coordinate axis direction through the first initial distribution node; When the value of the coordinate point corresponding to the first initial distribution node is a second value, the information to be distributed and the target coordinate axis bitmap are continuously distributed to the next node in the direction of the first coordinate axis through the first initial distribution node; The first coordinate axis direction and the second coordinate axis direction are perpendicular to each other, and the first coordinate axis direction is the direction in which the target node connects to the first initial distribution node.
10. The method according to claim 9, characterized in that After continuing to distribute the information to be distributed and the target coordinate axis bitmap to the next node in the first coordinate axis direction and the next node in the second coordinate axis direction through the first initial distribution node, the method further includes: If it is detected that the node to be distributed still exists in other nodes except the next node in the direction of the second coordinate axis, the information to be distributed and the target coordinate axis bitmap are continuously distributed to the nodes in the direction of the second coordinate axis through the next node in the direction of the second coordinate axis; Until it is detected that the node to be distributed does not exist in the direction of the second coordinate axis, the distribution of the information to be distributed and the target coordinate axis bitmap is stopped.
11. The method according to claim 9, characterized in that The method further comprises: determining a virtual boundary of the virtual coordinate system according to a preset network dimension of the virtual coordinate system; When it is detected that the next node in the direction of the first coordinate axis or the next node in the direction of the second coordinate axis has reached the virtual boundary, distribution of the to-be-distributed information and the target coordinate axis bitmap is stopped.
12. The method according to claim 1, characterized in that The information to be distributed further includes: the priority of the data to be distributed, and distributing the information to be distributed and the target coordinate axis bitmap to the at least one initial distribution node through the target node includes: When it is detected that the priority of the data to be distributed is greater than the preset priority, the information to be distributed and the target coordinate axis bitmap are distributed to the at least one initial distribution node through the target node from the priority channel.
13. A data distribution device, characterized in that: The device comprises: An acquisition module is configured to acquire information to be distributed, wherein the information to be distributed includes at least: data to be distributed, a first physical coordinate of a target node, and at least one multicast code corresponding to the target node; a processing module, configured to determine, according to the at least one multicast code, at least one to-be-distributed node corresponding to the target node; The processing module is further configured to map the at least one node to be distributed to a virtual coordinate system based on the first physical coordinate of the target node and the second physical coordinate of the at least one node to be distributed, to obtain a target area identifier and a target coordinate axis bitmap, wherein the target area identifier is used to indicate the quadrant of the at least one node to be distributed in the virtual coordinate system, and the target coordinate axis bitmap is used to indicate the coordinate position of the at least one node to be distributed in the virtual coordinate system, wherein the virtual coordinate system is a coordinate system created with the target node as the origin; The processing module is further configured to determine at least one initial distribution node based on the target node according to the target area identifier; A transceiver module is used to distribute the information to be distributed and the target coordinate axis bitmap to the at least one initial distribution node through the target node.
14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data distribution method according to any one of claims 1 to 12 when executing the computer program.
15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the data distribution method according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Network-on-chip, data forwarding method and electronic equipment
CN115297060A
Graph data communication method for multi-node system, electronic equipment and storage medium
CN117278475A