Routing method, device, medium and product of three-dimensional hypercube network structure
By setting binary codes for the routing nodes of the top and bottom layers of the three-dimensional hypercube, a three-dimensional hypercube network is formed, which solves the problem of high latency in traditional networks and achieves a reduction in network latency and an improvement in connectivity.
Patent Information
- Application Number
- CN202511188314.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-08-25
AI Technical Summary
Traditional three-dimensional hypercube topology networks have relatively high network latency. How can we effectively reduce network latency?
Binary three-digit codes are set for the routing nodes of the top and bottom layers of the three-dimensional hypercube. The highest bit of the routing nodes in the same layer is the same, while the highest bit of the routing nodes in the top and bottom layers is different. The routing nodes are connected according to the codes to form a three-dimensional hypercube network structure. The XOR result of nodes in the same layer contains one '1', while the XOR result of nodes in different layers contains two '1's.
It effectively reduces network latency. The diameter of the three-dimensional hypercube network is two, and the connectivity is four, which reduces network transmission delay.
Smart Images

Figure CN120750836B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interconnected networks, and in particular to a routing method, device, medium, and product for a three-dimensional hypercube network structure. Background Technology
[0002] Interconnection networks are key to building high-performance massively parallel processing systems. Their design goal is to reliably and efficiently connect a certain number of functional nodes at the lowest possible cost to form a cost-effective large-scale parallel system.
[0003] Traditional interconnected networks are mostly directly interconnected, such as the k-element n-cube structure, which is a typical example. Each terminal node in the network contains a router for message passing between nodes. Indirectly interconnected networks separate the terminal nodes and routers; the router can be used as an independent communication device. A typical topology is the butterfly topology. Each router is connected to its neighbors via bidirectional links or two unidirectional links (each responsible for one direction); these links are called channels. It is important to note that as the number of interconnected nodes increases, the aggregate bandwidth of the entire system also increases.
[0004] The hypercube is a concept derived from geometry; it can have any dimension, such as n, and possesses... There are n vertices, each vertex is connected to n edges, and all edges are connected to each other at right angles at the vertices. Figure 1 It is a three-dimensional hypercube topology network. Hypercube structures applied to on-chip networks possess symmetry, regularity, path diversity, and scalability. However, traditional three-dimensional hypercube topologies have a diameter of 3, resulting in relatively high network latency.
[0005] It is evident that effectively reducing network latency is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide a routing method, device, medium, and product for a three-dimensional hypercube network structure, which can effectively reduce network latency.
[0007] Firstly, a method for constructing a three-dimensional hypercube network structure is provided, comprising: setting corresponding codes for four routing nodes of the top-level structure and four routing nodes of the bottom-level structure of the three-dimensional hypercube; the codes are three-digit binary codes, and the highest bits of the routing nodes in the same layer are the same, while the highest bits of the routing nodes in the top-level structure and the routing nodes in the bottom-level structure are different; connecting the routing nodes of the three-dimensional hypercube according to the codes corresponding to the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure to obtain the three-dimensional hypercube network structure, wherein, for routing nodes in the same layer, each routing node is connected to two other routing nodes, and the XOR result of the codes of the two connected routing nodes contains one; the routing nodes of the top-level structure are connected to two routing nodes of the bottom-level structure, and the XOR result of the codes of the two connected routing nodes contains two ones.
[0008] In a preferred embodiment, the present invention can be further configured as follows: setting corresponding codes for the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure of the three-dimensional hypercube, including: for each target binary number, determining the code corresponding to the routing node of the top-level structure based on the target binary number and the most significant bit of the routing node of the top-level structure, wherein the lower two bits of the code corresponding to the routing node of the top-level structure are the higher two bits of the target binary number; determining the code corresponding to the routing node of the bottom-level structure based on the target binary number and the most significant bit of the routing node of the bottom-level structure, wherein the lower two bits of the code corresponding to the routing node of the bottom-level structure are the higher two bits of the target binary number; wherein the target binary number includes: a first binary number, a second binary number, a third binary number, and a fourth binary number; wherein the first binary number is a four-digit number, and two adjacent bits are both 1, or two adjacent bits are both 1 after cyclically shifting by one bit; the second target binary number is the binary number after cyclically shifting by one bit of the first binary number; the third target binary number is the binary number after cyclically shifting by one bit of the second binary number; and the fourth target binary number is the binary number after cyclically shifting by one bit of the third binary number.
[0009] In a preferred embodiment, the present invention can be further configured as follows: Based on the codes corresponding to the four routing nodes of the top-level structure and the codes corresponding to the four routing nodes of the bottom-level structure, the routing nodes of the three-dimensional hypercube are connected to obtain a three-dimensional hypercube network structure. This includes: for routing nodes at the same level, connecting the routing nodes at the same level based on the result of XORing the codes of any two routing nodes, wherein if the result contains a '1', the two routing nodes are connected; for routing nodes at different levels, the highest bit of the routing node's code is inverted to obtain the code of the first routing node at the different level; the highest bit of the routing node's code is inverted, and the last two bits of the routing node's code are shifted by one bit according to a preset motion map to obtain the code of the second routing node at the different level; the routing node is connected to the first routing node and the second routing node respectively; wherein the preset motion map is a two-bit binary value motion map, wherein the result of XORing two adjacent values contains a '1'; after completing the connection of routing nodes at the same level and the connection of routing nodes at different levels, a three-dimensional hypercube network structure is obtained.
[0010] In a preferred embodiment, the present invention can be further configured as follows: inverting the highest bit of the routing node's encoding, and shifting the last two bits of the routing node's encoding by one bit according to a preset motion map to obtain the encoding of the second routing node at different layers of the routing node, including: if the highest bit of the routing node's encoding is one, then shifting the last two bits of the routing node's encoding to the right by one bit according to the preset motion map to obtain the encoding of the second routing node at different layers of the routing node; if the highest bit of the routing node's encoding is zero, then shifting the last two bits of the routing node's encoding to the left by one bit according to the preset motion map to obtain the encoding of the second routing node at different layers of the routing node.
[0011] In a preferred embodiment, the present invention can be further configured such that: the routing node is a single routing node, the network diameter of the three-dimensional hypercube is two, and the network connectivity of the three-dimensional hypercube is four.
[0012] In a preferred embodiment, the present invention can be further configured such that: the routing node includes multiple sub-routing nodes, the multiple sub-routing nodes are triangular pyramid structures, the network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four.
[0013] In a preferred embodiment, the present invention can be further configured such that the encoding of each sub-router node includes: the encoding of the router node and the connection encoding of the router node to which the sub-router node is connected.
[0014] Secondly, a device for constructing a three-dimensional hypercube network structure is provided, comprising: an encoding setting module, used to set corresponding codes for the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure of the three-dimensional hypercube; the encoding is a three-digit binary code, and the highest bit of the routing nodes in the same layer is the same, while the highest bit of the routing nodes in the top-level structure is different from that in the bottom-level structure; a connection module, used to connect the routing nodes of the three-dimensional hypercube according to the codes corresponding to the four routing nodes in the top-level structure and the four routing nodes in the bottom-level structure to obtain the three-dimensional hypercube network structure, wherein, for routing nodes in the same layer, each routing node is connected to two other routing nodes, and the XOR result of the codes of the two connected routing nodes contains one; the routing nodes of the top-level structure are connected to two routing nodes of the bottom-level structure, and the XOR result of the codes of the two connected routing nodes contains two ones.
[0015] Thirdly, a three-dimensional hypercube network structure is provided, including: four routing nodes in the top layer structure and four routing nodes in the bottom layer structure; wherein, each routing node has a corresponding code, which is a three-digit binary code, and the highest bit of the routing nodes in the same layer structure is the same, while the highest bit of the routing nodes in the top layer structure and the routing nodes in the bottom layer structure are different; a routing node in the same layer structure connects to two other routing nodes, and the XOR result of the codes of the two connected other routing nodes contains one; a routing node connects to two routing nodes in different layers, and the XOR result of the codes of the two connected routing nodes contains two ones.
[0016] In a preferred embodiment, the present invention can be further configured as follows: the routing node is a single routing node, the network diameter of the three-dimensional hypercube is two, and the network connectivity of the three-dimensional hypercube is four; or, the routing node includes multiple sub-routing nodes, the multiple sub-routing nodes are triangular pyramid structures, the network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four.
[0017] Fourthly, a routing method for a three-dimensional hypercube network structure is provided. The three-dimensional hypercube network structure is based on the three-dimensional hypercube network structure of the third aspect. The routing method for the three-dimensional hypercube network structure includes: obtaining a routing request for the three-dimensional hypercube network structure, the routing request including: a first code of a source routing node and a second code of a destination routing node; if the first code and the second code are the same, then a routing process is determined; if the first code and the second code are different, and the source routing node and the destination routing node are in the same layer, then a routing process is determined based on the lower two bits of the XOR result of the first code and the second code; if the first code and the second code are different, and the source routing node and the destination routing node are not in the same layer, then a third code and a fourth code of a routing node in another layer connected to the source routing node are determined based on the first code; and a routing process is determined based on the third code and the fourth code.
[0018] In a preferred embodiment, the present invention can be further configured to: determine the routing process based on the lower two bits of the result of the XOR of the first code and the second code, including: if the lower two bits of the result of the XOR of the first code and the second code have only one '1', then the routing process is determined to be direct routing from the source routing node to the destination routing node; if the lower two bits of the result of the XOR of the first code and the second code have two '1's, then two one-hot codes are determined, and the result of the XOR of the two one-hot codes is the result of the XOR of the first code and the second code; and the routing process is determined based on any one of the two one-hot codes, the first code, and the second code.
[0019] In a preferred embodiment, the present invention can be further configured as follows: determining a routing process based on a third code and a fourth code, including: if the first target code in the third code and the fourth code is the same as the second code, then determining the routing process as direct routing from the source routing node to the destination routing node; otherwise, performing an XOR operation between the third code, the fourth code, and the second code to obtain a first value and a second value; determining an intermediate routing node, wherein the intermediate routing node is the routing node corresponding to the target code, and the target code is a code in which only one of the first value and the second value is a '1'; and determining the routing process based on the source routing node, the intermediate routing node, and the destination routing node.
[0020] In a preferred embodiment, the present invention can be further configured as follows: determining a routing process based on a third code and a fourth code, including: if a first target code in the third code and the fourth code is the same as a second code, then determining the routing process as direct routing from the source routing node to the destination routing node; otherwise, determining a fifth code and a sixth code of the routing node in the same layer connected to the source routing node based on the first code; determining a seventh code and an eighth code of the routing node in another layer connected to the routing node corresponding to each of the fifth and sixth codes; determining the code in the seventh and eighth codes corresponding to each of the fifth and sixth codes that is the same as the second code; determining a second target code corresponding to the code that is the same as the second code, wherein the second target code is either the fifth code or the sixth code; and determining the routing process based on the source routing node, the routing node corresponding to the second target code, and the destination routing node.
[0021] In a preferred embodiment, the present invention can be further configured as follows: if the routing node includes multiple sub-routing nodes, the multiple sub-routing nodes are triangular pyramid structures, the network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four; the encoding of each sub-routing node includes: the encoding of the routing node and the connection encoding of the routing nodes connected to the sub-routing node; the routing request also includes: the first connection encoding of the source routing node and the second connection encoding of the destination routing node; and further includes: after determining the routing process, determining the routing path within the triangular pyramid based on the node encoding and connection encoding of the adjacent routing nodes in the routing process.
[0022] Fifthly, a routing device for a three-dimensional hypercube network structure is provided, comprising: an acquisition module for acquiring a routing request for the three-dimensional hypercube network structure, the routing request including: a first code of a source routing node and a second code of a destination routing node; a routing process determination module for determining a routing process if the first code and the second code are the same; if the first code and the second code are different, and the source routing node and the destination routing node are in the same layer structure, determining a routing process based on the lower two bits of the XOR result of the first code and the second code; if the first code and the second code are different, and the source routing node and the destination routing node are not in the same layer structure, determining a third code and a fourth code of a routing node in another layer structure connected to the source routing node based on the first code; and determining a routing process based on the third code and the fourth code.
[0023] A sixth aspect provides an electronic device comprising a memory and a processor, the memory storing a computer program, the processor executing the method of any one of the first aspects, and / or the method of any one of the fourth aspects when running the computer program.
[0024] In a seventh aspect, a computer-readable storage medium is provided, wherein at least one piece of program code is stored therein, the program code being loaded and executed by a processor to implement the method as described in any of the first aspects, and / or the method as described in any of the fourth aspects.
[0025] Eighthly, a computer program product is provided, comprising a computer program or instructions that, when executed by a processor, implement the method as described in any of the first aspects, and / or the method as described in any of the fourth aspects.
[0026] In summary, the method for constructing a three-dimensional hypercube network structure provided by this invention has the following beneficial technical effects: Four routing nodes in the top-level structure of the three-dimensional hypercube are assigned corresponding codes, and four routing nodes in the bottom-level structure are assigned corresponding codes; the codes are three-digit binary codes, and the highest-order bits of routing nodes in the same layer are the same, while the highest-order bits of routing nodes in the top-level structure and those in the bottom-level structure are different; based on the codes corresponding to the four routing nodes in the top-level structure and the four routing nodes in the bottom-level structure, the routing nodes of the three-dimensional hypercube are connected to obtain the three-dimensional hypercube network structure. Specifically, for routing nodes in the same layer, each routing node connects to two other routing nodes, and the XOR result of the codes of the two connected routing nodes contains one; the routing nodes in the top-level structure connect to two routing nodes in the bottom-level structure, and the XOR result of the codes of the two connected routing nodes contains two ones. Through the above construction method, based on a hypercube topology network in the same dimension, this invention effectively reduces network latency.
[0027] In addition, the present invention also provides a three-dimensional hypercube network structure, routing method, device and medium, all of which have the above-mentioned beneficial technical effects. Attached Figure Description
[0028] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 It is a conventional three-dimensional hypercube topology network.
[0030] Figure 2 This is a schematic diagram of node encoding in a conventional three-dimensional hypercube topology network.
[0031] Figure 3This is a flowchart illustrating a method for constructing a three-dimensional hypercube network structure according to an embodiment of the present invention.
[0032] Figure 4 This is a schematic diagram of an improved three-dimensional hypercube network structure provided in an embodiment of the present invention.
[0033] Figure 5 This is a schematic diagram of an encoding method provided in an embodiment of the present invention.
[0034] Figure 6 This is a schematic diagram of a preset movement map provided in an embodiment of the present invention.
[0035] Figure 7 This is a schematic diagram of a triangular pyramid structure provided in an embodiment of the present invention.
[0036] Figure 8 This invention provides a topological structure combining a triangular pyramid and an improved hyper-three-dimensional cube.
[0037] Figure 9 This is a schematic diagram of the node encoding of a topological structure combining a triangular pyramid and an improved hyper-3D cube, provided in an embodiment of the present invention.
[0038] Figure 10 This is a schematic diagram of the encoded triangular pyramid, which combines a triangular pyramid and an improved hyper-three-dimensional cube topology, according to an embodiment of the present invention.
[0039] Figure 11 This is a schematic diagram of a three-dimensional hypercube network structure construction device provided in an embodiment of the present invention.
[0040] Figure 12 This is a schematic diagram of a routing method for a three-dimensional hypercube network structure provided in an embodiment of the present invention.
[0041] Figure 13 This is a schematic diagram of a routing device for a three-dimensional hypercube network structure provided in an embodiment of the present invention.
[0042] Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0043] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0044] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0045] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0046] Interconnection topology typically has the following four main attributes: (1) Node degree: The number of channels connecting a node to its neighboring nodes, or the number of router ports in a node. (2) Network diameter: The maximum value of the shortest distance between two nodes in the network. The smaller the network diameter, the lower the network communication delay. (3) Number of links: The total number of links in the entire network. Since the topology is fixed, the number of links is also fixed. (4) Bipartite bandwidth: The bandwidth of the link corresponding to the minimum cut set of all nodes in the network is the bipartite bandwidth. The higher the bipartite bandwidth, the stronger the network communication capability.
[0047] for Figure 1 The three-dimensional hypercube shown has the following characteristics: Characteristic 1: It has 8 routing nodes; binary labels 000-111; the binary representation of each routing node is XORed bit-by-bit with 001, 010, and 100 to obtain the routing nodes directly connected to it; for example, routing node 010, XORed bit-by-bit with 001, 010, 100, and 1000, yields 011, 000, 110, and 010, which are exactly the four routing nodes directly connected to 010; for example... Figure 2 As shown. Feature 2: Each link between routing nodes is full-duplex (allowing data to be transmitted bidirectionally on the link simultaneously). Feature 3: The link relationships between each routing node and the other 8 routing nodes are as follows: (1) Directly connected to the other 3 routing nodes through 3 full-duplex links; 3 adjacent routing nodes can be reached directly through one hop, such as routing node 000, which is directly connected to routing nodes 001, 010, and 100, and can be directly routed; (2) 3 routing nodes on the same plane and diagonally opposite it can be reached through two hops; such as routing node 000, which can be reached through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through two hops through three hops through three hops through three hops through feature 3. As can be seen from feature 3, the network diameter between the routing nodes of the three-dimensional hypercube is 3.
[0048] This invention proposes an improved three-dimensional hypercube network structure based on the traditional three-dimensional hypercube network. Compared with the traditional three-dimensional hypercube network, the network diameter is shorter, which can effectively reduce network transmission latency.
[0049] This invention provides a method for constructing a three-dimensional hypercube network structure, such as... Figure 3 As shown, the method provided in this embodiment of the invention can be executed by an electronic device. The three-dimensional hypercube network structure includes a top-level structure and a bottom-level structure. The method includes: S101, setting corresponding codes for the four routing nodes of the top-level structure of the three-dimensional hypercube and setting corresponding codes for the four routing nodes of the bottom-level structure.
[0050] The encoding is a three-digit binary code, and the highest bit of the routing nodes in the same layer is the same, while the highest bit of the routing nodes in the top layer is different from that in the bottom layer.
[0051] In telecommunications networks, a node is a connection point, representing a redistribution point or a communication endpoint (some terminal devices). Routing refers to the network-wide process of determining the end-to-end path for packets as they travel from source to destination. In this embodiment of the invention, the nodes of the three-dimensional hypercube are routing nodes. See also... Figure 4 , Figure 4 This is a schematic diagram of an improved three-dimensional hypercube network structure provided in an embodiment of the present invention. Figure 4 As shown, each routing node in the top-level and bottom-level structures is assigned a corresponding three-digit code; the highest bit of routing nodes in the same layer is the same, while the highest bit of routing nodes in the top-level structure is different from that in the bottom-level structure.
[0052] In one scenario, the top-level routing nodes include: 100, 110, 111, 101; and the bottom-level routing nodes include: 000, 010, 011, 001. In another scenario, the top-level routing nodes include: 000, 010, 011, 001; and the bottom-level routing nodes include: 100, 110, 111, 101. This embodiment of the invention does not limit the specific implementation of these routing nodes.
[0053] In some embodiments, setting corresponding codes for the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure of the three-dimensional hypercube includes: for each target binary number, determining the code corresponding to the routing node of the top-level structure based on the target binary number and the most significant bit of the routing node of the top-level structure, wherein the lower two bits of the code corresponding to the routing node of the top-level structure are the higher two bits of the target binary number; determining the code corresponding to the routing node of the bottom-level structure based on the target binary number and the most significant bit of the routing node of the bottom-level structure, wherein the lower two bits of the code corresponding to the routing node of the bottom-level structure are the higher two bits of the target binary number; wherein the target binary number includes: a first binary number, a second binary number, a third binary number, and a fourth binary number; wherein the first binary number is a four-digit number, and two adjacent bits are both 1, or two adjacent bits are both 1 after cyclically shifting by one bit; the second target binary number is the binary number after cyclically shifting by one bit of the first binary number; the third target binary number is the binary number after cyclically shifting by one bit of the second binary number; and the fourth target binary number is the binary number after cyclically shifting by one bit of the third binary number.
[0054] Specifically, the first binary number can be set to any one of 1100, 1001, 0110, and 0011. For example, the first binary number is 1100, the second binary number is 1001, the third binary number is 0011, and the fourth binary number is 0110. Alternatively, the first binary number is 0011, the second binary number is 0110, the third binary number is 1100, and the fourth binary number is 1001.
[0055] Specifically, the encoding rules for the routing node labels in the top and bottom layers of the topology, taking 0011 as an example, are as follows: Figure 5 As shown, Figure 5 This invention provides an encoding method comprising: First, setting an initial 4-bit number 0011, taking its high 2 bits as the lower 2 bits of the first bottom / top node label (clockwise / counterclockwise). The bottom and top node labels are distinguished by the highest bit (the 3rd bit), where the 3rd bit being 1 indicates a top node and the 3rd bit being 0 indicates a bottom node (e.g., ...). Figure 5 As shown in the first row, the high two bits of the initial value 0011 are 00, so the low two bits of the first bottom and top nodes are 00. At this time, the bottom node is labeled 0_00 and the top node is labeled 1_00.
[0056] Of course, the top-level node can also be set to 0, and the bottom-level node can be set to 1. This embodiment of the invention is not limited to this.
[0057] Understandable, Figure 5 The diagram shows a cyclic left shift, but a cyclic right shift is also possible; however, this embodiment of the invention does not limit the scope of the invention.
[0058] The second step is to circularly shift the initial 4-bit number 0011 one bit to the left, resulting in 0110. This is the same encoding method as the first step, yielding the second inner / top-level node numbers clockwise / counterclockwise as 0_01 and 1_01 (e.g., ...). Figure 5 As shown in the second row).
[0059] Third, repeat the above steps, shifting the 4-digit number left twice more to obtain the 3rd / 4th inner / top-level node labels in clockwise / counterclockwise direction (e.g., ...). Figure 5 As shown in the third and fourth lines), it forms Figure 4 The topology shown has node labels.
[0060] S102. Based on the codes corresponding to the four routing nodes of the top-level structure and the codes corresponding to the four routing nodes of the bottom-level structure, connect the routing nodes of the three-dimensional hypercube to obtain the three-dimensional hypercube network structure.
[0061] Specifically, for routing nodes at the same layer, each routing node connects to two other routing nodes, and the XOR result of the encodings of the two connected routing nodes contains one; the routing nodes of the top-level structure connect to two routing nodes of the bottom-level structure, and the XOR result of the encodings of the two connected routing nodes contains two ones.
[0062] In this embodiment of the invention, for routing nodes at the same layer, each routing node connects to two other routing nodes, and the XOR result of the codes of the two connected routing nodes contains a '1', that is, they are connected in order according to the four codes of the top layer determined sequentially based on the first binary number in S101. For example, for the top layer structure, if the codes determined sequentially are 100, 101, 111, and 110, then the connection order is 100-101-111-110-100.
[0063] For routing nodes at different layers, the result of the XOR operation of the encodings of two routing nodes connected to each other at different layers contains two ones.
[0064] As can be seen from the above, taking the routing node as an example, the node degree of the obtained three-dimensional hypercube is 4 and the network diameter is 2. Compared with the traditional three-dimensional hypercube topology with a network diameter of 3, it can effectively reduce network transmission latency.
[0065] As can be seen, in this embodiment of the invention, corresponding codes are set for the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure of the three-dimensional hypercube. The codes are three-digit binary codes, and the highest bits of the routing nodes in the same layer are the same, while the highest bits of the routing nodes in the top-level structure and the bottom-level structure are different. Based on the codes corresponding to the four routing nodes in the top-level structure and the four routing nodes in the bottom-level structure, the routing nodes of the three-dimensional hypercube are connected to obtain the three-dimensional hypercube network structure. Specifically, for routing nodes in the same layer, each routing node connects to two other routing nodes, and the XOR result of the codes of the two connected routing nodes contains one '1'. Similarly, for routing nodes in the top-level structure, two routing nodes in the bottom-level structure are connected, and the XOR result of the codes of the two connected routing nodes contains two '1's. Through the above construction method, based on the hypercube topology network in the same dimension, the present invention effectively reduces network latency.
[0066] One possible implementation of this invention is as follows: S102, based on the codes corresponding to the four routing nodes of the top-level structure and the codes corresponding to the four routing nodes of the bottom-level structure, the routing nodes of the three-dimensional hypercube are connected to obtain a three-dimensional hypercube network structure, including:
[0067] S1021. For routing nodes at the same layer, connect the routing nodes at the same layer based on the result of XORing the encodings of any two routing nodes. If there is a '1' in the result, then connect the two routing nodes.
[0068] In this embodiment of the invention, for the four routing nodes in the underlying structure: coded as 0_00, 0_01, 0_10, and 0_11, the first bit of each code is "0"; the result of XORing the codes of two directly adjacent routing nodes is only "1", meaning that they can be reached in one step; the result of XORing the codes of two diagonally opposite routing nodes is two "1", meaning that they need two steps to reach them; for example, if the bitwise XORing of routing node 0_01 with 0_00 and 0_11 results in 0_01 and 0_10, and the XOR result is only "1", then routing node 0_01 can reach 0_00 and 0_11 in one step; if the bitwise XORing of 0_01 with 0_10 results in 0_11, then routing node 0_01 needs two steps to reach 0_10. For the four routing nodes in the top-level structure: coded as 1_00, 1_01, 1_10, and 1_11, the first bit of each code is "1". The result of XORing the codes of two directly adjacent routing nodes is only "1", which means that it can be reached in one step. The result of XORing the codes of two diagonally opposite routing nodes is two "1", which means that it takes two steps to reach them.
[0069] Of course, the encoding of the top-level routing node and the encoding of the bottom-level routing node can be interchanged. This embodiment of the invention will not elaborate further; please refer to the above method.
[0070] S1022. For routing nodes at different layers, invert the highest bit of the routing node's encoding to obtain the encoding of the first routing node at different layers.
[0071] Taking the top-level node as an example, each top-level routing node is connected to two bottom-level routing nodes. The encoding of these two routing nodes is: by inverting the highest bit, we can obtain the encoding of the first routing node of the bottom-level routing node directly connected to it.
[0072] Of course, it is also possible to invert the highest bit of the underlying routing node to obtain the encoding of the first routing node of the top-level connection. This embodiment of the invention is not limited to this, and users can customize the settings.
[0073] S1023. Invert the highest bit of the routing node's encoding, shift the last two bits of the routing node's encoding by one bit according to the preset movement map, and obtain the encoding of the second routing node at different layers of the routing node; connect the routing node to the first routing node and the second routing node respectively; wherein, the preset movement map is a movement map of two-bit binary values, wherein the result of XORing two adjacent values contains a 1.
[0074] One possible implementation of this invention involves inverting the most significant bit of the routing node's encoding and shifting the last two bits of the routing node's encoding by one bit according to a preset motion map to obtain the encoding of a second routing node at a different layer. This includes: if the most significant bit of the routing node's encoding is one, then shifting the last two bits of the routing node's encoding one bit to the right according to the preset motion map to obtain the encoding of a second routing node at a different layer; if the most significant bit of the routing node's encoding is zero, then shifting the last two bits of the routing node's encoding one bit to the left according to the preset motion map to obtain the encoding of a second routing node at a different layer.
[0075] In this embodiment of the invention, the construction of the preset movement map corresponds to the encoding of the underlying and top-level structures. That is, if the encoding is a four-bit left shift, the corresponding preset movement map is set based on the last two bits after the four-bit left shift. For example, if the result of a four-bit left shift is 1100, 1001, 0011, 0110, then the preset movement map is: 00 left shifted to 01, 01 left shifted to 11, 11 left shifted to 10, and 10 left shifted to 00; the right shift is the opposite.
[0076] Specifically, taking a four-bit binary number circularly shifted left as an example, the highest bit is directly inverted, and the lower two bits are shifted according to... Figure 6 Shift one position to the left.
[0077] For top-level nodes: For example, for top-level node 1_10, the encoding of the two directly connected bottom-level nodes is as follows: First: Invert the highest bit, 0_10; Second: Invert the highest bit, and then encode the lowest two bits according to... Figure 6 Shift one position to the right, resulting in 0_11. This means that the top-level node 1_10 is directly connected to the bottom-level nodes 0_10 and 0_11.
[0078] For bottom-level nodes: Each bottom-level node is connected to two top-level nodes, encoded as follows: First: Invert the highest bit to obtain the directly connected top-level node; Second: Invert the highest bit, and then use the lowest two bits... Figure 6 Shift left by one bit. For example, for the top-level node 0_10, the encoding of the two directly connected bottom-level nodes is as follows: First: Invert the highest bit, 1_10; Second: Invert the highest bit, and then... Figure 6 Shift left by one bit, to 1_00. That is, the bottom node 0_10 is directly connected to the bottom nodes 1_10 and 1_00.
[0079] S1024. After completing the connection of routing nodes in the same layer and the connection of routing nodes in different layers, a three-dimensional hypercube network structure is obtained.
[0080] In one possible implementation of this invention, the routing node is a single routing node, the network diameter of the three-dimensional hypercube is two, and the network connectivity of the three-dimensional hypercube is four.
[0081] Furthermore, embodiments of the present invention propose a topology combining a triangular pyramid and an improved hyper-3D cube. In one possible implementation, a triangular pyramid can be used to replace any one or more routing nodes in the 3D cube. In another possible implementation, a triangular pyramid can be used to replace all routing nodes in the 3D cube.
[0082] See the triangular pyramid structure. Figure 7 In a triangular pyramid structure, the sub-routing nodes are interconnected. Furthermore, since the in-degree and out-degree of the three-dimensional hypercube network is 4, each sub-routing node of the triangular pyramid can correspond to a routing node connected to it (if the connected routing node is a single routing node, it can be directly connected; if it is a triangular pyramid structure, it can be connected to one of the sub-routing nodes).
[0083] In one possible implementation of this invention, the routing node includes multiple sub-routing nodes, which are triangular pyramid structures with a network diameter of five and a network connectivity of four. The encoding of each sub-routing node includes the routing node's own encoding and the connection encoding of the routing nodes to which the sub-routing node is connected.
[0084] A conventional five-dimensional hypercube includes 32 routing nodes and a network diameter of 5, but its out-degree and in-degree are both 5. In this invention, the topology contains 32 routing nodes, a network diameter of 5, but each routing node has an out-degree and in-degree of 4, which is more conducive to backend layout and cabling.
[0085] This involves constructing eight triangular pyramid structures, and then replacing the constructed eight triangular pyramid structures. Figure 4 Eight routing nodes in the improved 3D hypercube; resulting in... Figure 8 The topological structure shown combines a triangular pyramid and an improved hyper-3D cube.
[0086] The encoding method for each routing node in the topology combining a triangular pyramid and an improved 3D hypercube: The shape of the topology combining a triangular pyramid and an improved 3D hypercube is as follows: Figure 4 The same structure, so first follow Figure 4 The eight triangular pyramid structures are encoded in a manner such as... Figure 9 As shown. Then, the four routing nodes inside each pyramid structure are encoded, and each routing node is numbered as follows. Where i represents the number of the triangular pyramid (the code of the routing node); j indicates that the routing node is connected to the j-th triangular pyramid structure (the connection code); it can be known that the number is The routing node and its number are Connect the routing nodes to obtain Figure 10 Topological encoding combining triangular pyramids and improved hyper-3D cubes.
[0087] In this embodiment of the invention, the topology combining a triangular pyramid and an improved three-dimensional hypercube is characterized by: the network having 32 routing nodes; the network diameter between routing nodes within the same triangular pyramid being 1; the diameter of the entire topology network being 5; and the out-degree and in-degree of each routing node being 4.
[0088] The following describes a device for constructing a three-dimensional hypercube network structure according to an embodiment of the present invention. The device described below can be referred to in correspondence with the method described above. The device in this embodiment is installed in an electronic device. Figure 11 , Figure 11This is a structural block diagram of an apparatus according to one embodiment of the present invention, comprising: an encoding setting module 210, used to set corresponding codes for four routing nodes of the top-level structure of a three-dimensional hypercube and four routing nodes of the bottom-level structure; the codes are three-digit binary codes, and the highest bits of the routing nodes in the same layer are the same, while the highest bits of the routing nodes in the top-level structure and the routing nodes in the bottom-level structure are different; and a connection module 220, used to connect the routing nodes of the three-dimensional hypercube according to the codes corresponding to the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure to obtain a three-dimensional hypercube network structure, wherein, for routing nodes in the same layer, each routing node is connected to two other routing nodes, and the XOR result of the codes of the two connected routing nodes contains one; the routing nodes of the top-level structure are connected to two routing nodes of the bottom-level structure, and the XOR result of the codes of the two connected routing nodes contains two ones.
[0089] In one possible implementation, the encoding setting module 210 is used to determine, for each target binary number, the encoding corresponding to the routing node of the top-level structure based on the target binary number and the most significant bit of the routing node of the top-level structure, wherein the lower two bits of the encoding corresponding to the routing node of the top-level structure are the higher two bits of the target binary number; and to determine the encoding corresponding to the routing node of the bottom-level structure based on the target binary number and the most significant bit of the routing node of the bottom-level structure, wherein the lower two bits of the encoding corresponding to the routing node of the bottom-level structure are the higher two bits of the target binary number; wherein the target binary number includes: a first binary number, a second binary number, a third binary number, and a fourth binary number; wherein the first binary number is a four-digit number, and two adjacent bits are both 1, or two adjacent bits are both 1 after cyclically shifting by one bit; the second target binary number is the binary number after cyclically shifting by one bit of the first binary number; the third target binary number is the binary number after cyclically shifting by one bit of the second binary number; and the fourth target binary number is the binary number after cyclically shifting by one bit of the third binary number.
[0090] In one possible implementation, the connection module 220 is used to connect routing nodes at the same layer based on the result of XORing the codes of any two routing nodes, wherein if the result contains a '1', the two routing nodes are connected; for routing nodes at different layers, the highest bit of the routing node's code is inverted to obtain the code of the first routing node at the different layer; the highest bit of the routing node's code is inverted, and the last two bits of the routing node's code are shifted by one bit according to a preset motion map to obtain the code of the second routing node at the different layer; the routing node is then connected to the first routing node and the second routing node respectively; wherein the preset motion map is a two-bit binary value motion map, wherein the result of XORing two adjacent values contains a '1'; after completing the connection of routing nodes at the same layer and the connection of routing nodes at different layers, a three-dimensional hypercube network structure is obtained.
[0091] In one possible implementation, the connection module 220 is configured to, if the highest bit of the routing node's encoding is one, shift the last two bits of the routing node's encoding one position to the right according to a preset movement map to obtain the encoding of the second routing node at a different layer of the routing node; if the highest bit of the routing node's encoding is zero, shift the last two bits of the routing node's encoding one position to the left according to a preset movement map to obtain the encoding of the second routing node at a different layer of the routing node.
[0092] In one feasible implementation, the routing node is a single routing node, the network diameter of the 3D hypercube is two, and the network connectivity of the 3D hypercube is four.
[0093] In one feasible implementation, the routing node includes multiple sub-routing nodes, which are triangular pyramidal structures. The network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four.
[0094] In one possible implementation, the encoding of each child routing node includes: the encoding of the routing node and the connection encoding of the routing nodes to which the child routing node is connected.
[0095] Furthermore, this embodiment of the invention provides a three-dimensional hypercube network structure, including: four routing nodes in the top layer structure and four routing nodes in the bottom layer structure; wherein, each routing node has a corresponding code, which is a three-digit binary code, and the highest bit of the routing nodes in the same layer structure is the same, while the highest bit of the routing nodes in the top layer structure and the routing nodes in the bottom layer structure are different; a routing node in the same layer structure connects to two other routing nodes, and the XOR result of the codes of the two connected other routing nodes contains one; a routing node connects to two routing nodes in different layers, and the XOR result of the codes of the two connected routing nodes contains two ones.
[0096] In one possible implementation of this invention, the routing node is a single routing node, the network diameter of the three-dimensional hypercube is two, and the network connectivity of the three-dimensional hypercube is four; or, the routing node includes multiple sub-routing nodes, the multiple sub-routing nodes are triangular pyramid structures, the network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four.
[0097] For details, please refer to the embodiments of the construction method of the three-dimensional hypercube network structure.
[0098] Furthermore, this embodiment of the invention provides a routing method for a three-dimensional hypercube network structure, see [link to relevant documentation]. Figure 12 The method includes:
[0099] S201. Obtain the routing request of the three-dimensional hypercube network structure. The routing request includes: the first encoding of the source routing node and the second encoding of the destination routing node.
[0100] For a routing request, the first encoding of the source routing node is denoted as . The second code of the target routing node is denoted as For example, the eight routing nodes are grouped and labeled as follows: Top-level routing node Routing nodes in the underlying structure .
[0101] S202. If the first code and the second code are the same, then determine the routing process.
[0102] Source routing node With the destination routing node Perform a bitwise XOR operation, and record the result as... ;if , and The corresponding nodes are the same routing node. If all routing nodes are a single node, then the routing process is considered complete.
[0103] If both the source and destination routing nodes have multiple sub-routing nodes, then if the source routing node has multiple sub-routing nodes, the sub-routing node with the same code is determined from the connection codes of the multiple sub-routing nodes in the source routing node based on the code of the destination routing node, and the routing process is to route to the destination routing node through that sub-routing node. If the destination routing node has multiple sub-routing nodes, the sub-routing node with the same code is determined from the connection codes of the multiple sub-routing nodes in the destination routing node based on the code of the source routing node, and the routing process is to route to that sub-routing node through the source routing node. If both the source and destination routing nodes have multiple sub-routing nodes, the sub-routing node with the same code is determined from the connection codes of the multiple sub-routing nodes in the source routing node based on the code of the destination routing node, and the routing process is to route to the sub-routing node of the destination routing node through the determined sub-routing node of the source routing node.
[0104] S203. If the first code and the second code are different, and the source routing node and the destination routing node are in the same layer structure, then the routing process is determined based on the lower two bits of the result of the XOR operation of the first code and the second code.
[0105] Determine the source routing node and the target routing node Location, and Belonging to or belong to .
[0106] One possible implementation of this invention involves determining a routing process based on the lower two bits of the XOR result of the first code and the second code, including: if the lower two bits of the XOR result of the first code and the second code contain only one "1", then the routing process is determined to be a direct route from the source routing node to the destination routing node; if the lower two bits of the XOR result of the first code and the second code contain two "1"s, then two one-hot codes are determined, and the result of XORing the two one-hot codes is the result of XORing the first code and the second code; the routing process is determined based on any one of the two one-hot codes, the first code, and the second code.
[0107] Source routing node With the destination routing node Perform a bitwise XOR operation, and record the result as... If the source routing node and the destination routing node are in the same layer, then... The first digit must be "0". (Check...) If the lower two digits are only "1", then You can reach it in one step. ,Right now and For direct connections, direct routing is sufficient; routing ends there. If the lower two bits are both "1", then Decompose it into two one-hot encoded XORs; Then, the routing is divided into two steps: In other words, the routing process is: source routing node - intermediate node (the node corresponding to the encoding obtained by XORing the source routing node with the one-hot encoding) - destination routing node.
[0108] Example 1: Belonging to ,and The two lowest digits are both "1", so that Decomposed into two one-hot XOR operations: Then, the routing is divided into two steps: ,or, .
[0109] S204. If the first code and the second code are different, and the source routing node and the destination routing node are not in the same layer structure, then determine the third code and the fourth code of the routing node in another layer structure connected to the source routing node based on the first code; determine the routing process based on the third code and the fourth code.
[0110] and Different belong to or not belonging to After determining the first code, for example, if the first code is a top-level node, the highest bit of the first code is inverted to obtain the third code. The highest bit of the first code is then inverted, and the lowest two bits of the first code are shifted according to a preset graph to obtain new lowest two bits, thus obtaining the fourth code. For the specific method of determining the third and fourth codes, please refer to the embodiment of the above construction method.
[0111] As can be seen, in this embodiment of the invention, by adopting an improved three-dimensional hypercube network structure and routing based on requests, the link length of the routing can be reduced and the network latency can be reduced.
[0112] In one possible implementation of this invention, S204, determining the routing process based on the third and fourth codes includes: if the first target code in the third and fourth codes is the same as the second code, then determining the routing process as direct routing from the source routing node to the destination routing node; otherwise, performing an XOR operation between the third and fourth codes and the second code to obtain a first value and a second value; determining intermediate routing nodes, where the intermediate routing nodes are the routing nodes corresponding to the target codes, and the target codes are codes containing only one of the first and second values; and determining the routing process based on the source routing node, intermediate routing nodes, and destination routing node.
[0113] Taking S as the top-level routing node as an example, calculate the codes of the two underlying nodes directly connected to S, and the third code. Fourth code .if If D is included, it means that S can reach D in one routing step, that is, S and D are directly connected, and a direct route is sufficient, thus ending the routing process; if If it contains D, then The first value is obtained by performing a bitwise XOR operation with D. Second value ; Statistical analysis , The number of "1"s in the middle is denoted as If only one node is 1, it is the destination node for the first step of routing; the current routing node is already directly connected to the destination node D, so routing can proceed directly.
[0114] like That is, S belongs to the top layer and D belongs to the bottom layer. Calculate the two bottom-layer nodes that are directly connected to S. . If it contains D, then XOR each bit with D to obtain , ; Statistical analysis , The number of "1"s in the middle is denoted as If only one is 1, then The destination node for the first step of routing: The current routing node is already directly connected to the destination node D, so routing can proceed directly. .
[0115] Another possible implementation of this invention, S204, involves determining the routing process based on the third and fourth codes, including: if the first target code in the third and fourth codes is the same as the second code, then the routing process is determined to be a direct route from the source routing node to the destination routing node; otherwise, the fifth and sixth codes of the routing nodes in the same layer connected to the source routing node are determined based on the first code; the seventh and eighth codes of the routing nodes in another layer connected to the routing nodes corresponding to the fifth and sixth codes are determined; the codes in the seventh and eighth codes corresponding to the fifth and sixth codes that are the same as the second code are determined; the second target code corresponding to the code that is the same as the second code is determined, and the second target code is either the fifth code or the sixth code; and the routing process is determined based on the source routing node, the routing node corresponding to the second target code, and the destination routing node.
[0116] In this embodiment of the invention, the encodings of the two underlying nodes directly connected to S are calculated, and the third encoding is... Fourth code .if , If D is included, it means that S can reach D in one routing step, that is, S and D are directly connected, and a direct route is sufficient, thus ending the routing process; if , If D is not included, then calculate the encoding of the two top-level nodes directly connected to S, the fifth encoding. , sixth code Then calculate with , Two directly connected underlying nodes , The node that contains D in the two directly connected underlying nodes is the destination node for the first step. Since the current routing node is already directly connected to the destination node D, routing can be done directly.
[0117] For example, That is, S belongs to the top layer and D belongs to the bottom layer. Calculate the two bottom-layer nodes connected to S. . If D is included, then calculate the two top-level nodes directly connected to S. Calculate and respectively Two directly connected underlying nodes If it includes D, then The destination node for the first step of routing: The current routing node is already directly connected to the destination node D, so routing can proceed directly. .
[0118] Another possible implementation of this invention involves a routing node comprising multiple sub-routing nodes, wherein the multiple sub-routing nodes are triangular pyramid structures, the network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four; the encoding of each sub-routing node includes: the encoding of the routing node and the connection encoding of the routing nodes connected to the sub-routing node; the routing request further includes: the first connection encoding of the source routing node and the second connection encoding of the destination routing node; and further includes: after determining the routing process, determining the routing path within the triangular pyramid based on the node encoding and connection encoding of the adjacent routing nodes in the routing process.
[0119] Specifically, source routing nodes , target routing node Step 1: Judgment and Are they the same? If This indicates that S and D are within the same triangular pyramid structure. S can reach D in one step within the pyramid, and the routing ends. Proceed to the second step; Second step: This indicates that S and D are not within the same triangular pyramid structure, requiring routing between the pyramids. At this point, all the pyramids are treated as a single unit, as shown below. Figure 4 The network shown is, according to Figure 4 The network routing method routes to the triangular pyramid containing node D. The third step: then routing occurs within the triangular pyramid containing D. Example: Source routing node. , target routing node Step 1: Judgment and Is it compatible? Proceed to the second step; the second step requires starting from the triangular pyramid. Routing to the triangular pyramid The routing method between triangular pyramids is as follows: The specific routing method for routing nodes is as follows: .
[0120] Based on any of the above embodiments, this invention proposes an improved three-dimensional hypercube network structure based on the traditional three-dimensional hypercube network. Compared with the traditional three-dimensional hypercube network, this improved structure has a shorter network diameter, which can effectively reduce network transmission latency. A routing algorithm suitable for the improved three-dimensional hypercube network structure is also proposed. This algorithm is simple and easy to implement in hardware. Furthermore, through extension, a topology combining a triangular pyramid and the improved hypercube is proposed. This topology contains 32 routing nodes, and while the network diameter remains 5, the out-degree and in-degree of each routing node are 4, which is more conducive to backend layout and cabling. A specific routing algorithm is also provided; the algorithm is simple and easy to implement in hardware.
[0121] The following describes a routing device for a three-dimensional hypercube network structure provided by an embodiment of the present invention. The device described below can be referred to in correspondence with the method described above. The device in this embodiment is installed in an electronic device. Figure 13 , Figure 13 This is a structural block diagram of an apparatus according to one embodiment of the present invention, comprising: an acquisition module 310, configured to acquire a routing request for a three-dimensional hypercube network structure, the routing request including: a first code of a source routing node and a second code of a destination routing node; a routing process determination module 320, configured to determine a routing process if the first code and the second code are the same; if the first code and the second code are different, and the source routing node and the destination routing node are in the same layer structure, then determine the routing process based on the lower two bits of the XOR result of the first code and the second code; if the first code and the second code are different, and the source routing node and the destination routing node are not in the same layer structure, then determine the third code and the fourth code of a routing node in another layer structure connected to the source routing node based on the first code; and determine the routing process based on the third code and the fourth code.
[0122] In one possible implementation, the routing process determination module 320 is used to determine the routing process as direct routing from the source routing node to the destination routing node if the lower two bits of the result of the XOR of the first code and the second code are only one; if the lower two bits of the result of the XOR of the first code and the second code are both one, then two one-hot codes are determined, and the result of the XOR of the two one-hot codes is the result of the XOR of the first code and the second code; the routing process is determined based on any one-hot code of the two one-hot codes, the first code, and the second code.
[0123] In one possible implementation, the routing process determination module 320 is used to determine the routing process as direct routing from the source routing node to the destination routing node if the first target code in the third code and the fourth code is the same as the second code; otherwise, the third code, the fourth code and the second code are XORed to obtain a first value and a second value; intermediate routing nodes are determined, which are the routing nodes corresponding to the target code, and the target code is the code with only one '1' in the first value and the second value; the routing process is determined based on the source routing node, intermediate routing nodes and the destination routing node.
[0124] In one possible implementation, the routing process determination module 320 is used to determine the routing process as direct routing from the source routing node to the destination routing node if the first target code in the third and fourth codes is the same as the second code; otherwise, it determines the fifth and sixth codes of the routing nodes in the same layer connected to the source routing node based on the first code; determines the seventh and eighth codes of the routing nodes in another layer connected to the routing nodes corresponding to the fifth and sixth codes; determines the codes in the seventh and eighth codes corresponding to the fifth and sixth codes that are the same as the second code; determines the second target code corresponding to the code that is the same as the second code, wherein the second target code is either the fifth code or the sixth code; and determines the routing process based on the source routing node, the routing node corresponding to the second target code, and the destination routing node.
[0125] In one possible implementation, if a routing node includes multiple sub-routing nodes, the multiple sub-routing nodes are triangular pyramid structures, the network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four; the encoding of each sub-routing node includes: the encoding of the routing node and the connection encoding of the routing nodes connected to the sub-routing node; the routing request also includes: the first connection encoding of the source routing node and the second connection encoding of the destination routing node; the routing process determination module 320 is further configured to: after determining the routing process, determine the routing path within the triangular pyramid based on the node encoding and connection encoding of the adjacent routing nodes in the routing process.
[0126] Figure 14 A structural diagram of an electronic device provided in an embodiment of the present invention, such as... Figure 14 As shown, the electronic device includes: a memory 60 for storing a computer program; and a processor 61 for executing the computer program to implement the steps of the method as described in the above embodiments.
[0127] The processor 61 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 61 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 61 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 61 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0128] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 60 is used to store at least the following computer program 601, which, after being loaded and executed by the processor 61, is capable of implementing the relevant steps of the method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. The operating system 602 may include Windows, Unix, Linux, etc.
[0129] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.
[0130] Those skilled in the art will understand that Figure 14 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.
[0131] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, magnetic disks, or optical disks, and other media capable of storing program code.
[0132] Based on this, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described above.
[0133] Based on this, embodiments of the present invention also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-described method.
[0134] The foregoing has provided a detailed description of the construction method, network structure, routing method, device, medium, and product of a three-dimensional hypercube network structure provided by embodiments of the present invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0135] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0136] The foregoing has provided a detailed description of the construction method, network structure, routing method, device, medium, and product of a three-dimensional hypercube network structure provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of this invention.
Claims
1. A routing method for a three-dimensional hypercube network structure, characterized in that, The three-dimensional hypercube network structure includes: four routing nodes in the top layer and four routing nodes in the bottom layer; each routing node has a corresponding code, which is a three-digit binary code, and the highest bit of routing nodes in the same layer is the same, while the highest bit of the routing nodes in the top layer and the routing nodes in the bottom layer are different; a routing node in the same layer connects to two other routing nodes, and the XOR result of the codes of the two connected routing nodes contains one; a routing node connects to two routing nodes in different layers, and the XOR result of the codes of the two connected routing nodes contains two ones; Routing methods for three-dimensional hypercube network structures include: Obtain a routing request for a three-dimensional hypercube network structure, the routing request including: a first encoding of the source routing node and a second encoding of the destination routing node; If the first code and the second code are the same, then the routing process is determined; If the first code and the second code are different, and the source routing node and the destination routing node are in the same layer structure, then the routing process is determined based on the lower two bits of the result of the XOR operation between the first code and the second code. If the first code and the second code are different, and the source routing node and the destination routing node are not in the same layer structure, then the third code and the fourth code of the routing node in another layer structure connected to the source routing node are determined according to the first code; and the routing process is determined according to the third code and the fourth code.
2. The routing method for a three-dimensional hypercube network structure according to claim 1, characterized in that, The routing process is determined based on the lower two bits of the XOR result of the first code and the second code, including: If the lower two bits of the result of the XOR of the first code and the second code are both 1, then the routing process is determined to be direct routing from the source routing node to the destination routing node. If the lower two bits of the result of the XOR of the first code and the second code are both ones, then two one-hot codes are determined, and the result of the XOR of the two one-hot codes is the result of the XOR of the first code and the second code; the routing process is determined based on any one-hot code of the two one-hot codes, the first code and the second code.
3. The routing method for a three-dimensional hypercube network structure according to claim 1, characterized in that, Based on the third and fourth codes, the routing process is determined, including: If the first target code in the third and fourth codes is the same as the second code, then the routing process is determined to be direct routing from the source routing node to the destination routing node; Otherwise, the third and fourth codes are XORed with the second code to obtain the first and second values; intermediate routing nodes are determined, wherein the intermediate routing nodes are the routing nodes corresponding to the target code, and the target code is the code with only one '1' in the first and second values; the routing process is determined based on the source routing node, intermediate routing nodes, and destination routing node.
4. The routing method for a three-dimensional hypercube network structure according to claim 1, characterized in that, Based on the third and fourth codes, the routing process is determined, including: If the first target code in the third and fourth codes is the same as the second code, then the routing process is determined to be direct routing from the source routing node to the destination routing node; Otherwise, the fifth and sixth codes of the routing nodes in the same layer connected to the source routing node are determined according to the first code; Determine the seventh and eighth codes of the routing nodes in another layer of the structure to which the fifth and sixth codes are respectively connected; Determine the codes in the seventh and eighth codes corresponding to the fifth and sixth codes that are identical to the second code; Determine a second target code that corresponds to the code that is identical to the second code, wherein the second target code is either the fifth code or the sixth code; The routing process is determined based on the source routing node, the routing node corresponding to the second target code, and the destination routing node.
5. The routing method for a three-dimensional hypercube network structure according to claim 1, characterized in that, If the routing node includes multiple sub-routing nodes, and the multiple sub-routing nodes are triangular pyramid structures, the network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four; The encoding of each child routing node includes: the encoding of the routing node and the connection encoding of the routing nodes to which the child routing node is connected; The routing request also includes: a first connection code of the source routing node and a second connection code of the destination routing node; Also includes: After determining the routing process, the routing path within the pyramid is determined based on the node codes and connection codes of adjacent routing nodes in the routing process.
6. The routing method for a three-dimensional hypercube network structure according to claim 1, characterized in that, Also includes: Set the corresponding codes for the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure of the 3D hypercube; The encoding is a three-digit binary code, and the highest bit of the routing nodes in the same layer is the same, while the highest bit of the routing nodes in the top layer is different from the highest bit of the routing nodes in the bottom layer. Based on the codes corresponding to the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure, the routing nodes of the three-dimensional hypercube are connected to obtain the three-dimensional hypercube network structure. Among them, for routing nodes of the same level, each routing node is connected to two other routing nodes, and the XOR result of the codes of the two connected routing nodes contains one; the routing nodes of the top-level structure are connected to two routing nodes of the bottom-level structure, and the XOR result of the codes of the two connected routing nodes contains two ones.
7. The routing method for a three-dimensional hypercube network structure according to claim 6, characterized in that, Set corresponding codes for the four routing nodes of the top-level structure and the four routing nodes of the bottom-level structure of the 3D hypercube, including: For each target binary number, the encoding corresponding to the routing node of the top-level structure is determined based on the target binary number and the most significant bit of the routing node of the top-level structure, wherein the lower two bits of the encoding corresponding to the routing node of the top-level structure are the higher two bits of the target binary number; the encoding corresponding to the routing node of the bottom-level structure is determined based on the target binary number and the most significant bit of the routing node of the bottom-level structure, wherein the lower two bits of the encoding corresponding to the routing node of the bottom-level structure are the higher two bits of the target binary number. The target binary number includes: a first binary number, a second binary number, a third binary number, and a fourth binary number; the first binary number is a four-digit number, and two adjacent digits are both 1, or two adjacent digits are both 1 after cyclically shifting by one; the second target binary number is the binary number after cyclically shifting by one; the third target binary number is the binary number after cyclically shifting by one; and the fourth target binary number is the binary number after cyclically shifting by one.
8. The routing method for a three-dimensional hypercube network structure according to claim 7, characterized in that, Based on the codes corresponding to the four routing nodes in the top-level structure and the four routing nodes in the bottom-level structure, the routing nodes of the three-dimensional hypercube are connected to obtain the three-dimensional hypercube network structure, including: For routing nodes at the same layer, connect the routing nodes at the same layer based on the result of XORing the encodings of any two routing nodes. If there is a '1' in the result, then the two routing nodes are connected. For routing nodes at different layers, the highest bit of the routing node's encoding is inverted to obtain the encoding of the first routing node at the different layers; the highest bit of the routing node's encoding is inverted, and the last two bits of the routing node's encoding are shifted by one bit according to a preset movement map to obtain the encoding of the second routing node at the different layers; the routing node is then connected to the first routing node and the second routing node respectively; wherein, the preset movement map is a movement map of two-bit binary values, wherein the result of XORing two adjacent values contains a 1; After completing the connection of routing nodes in the same layer and the connection of routing nodes in different layers, a three-dimensional hypercube network structure is obtained.
9. The routing method for a three-dimensional hypercube network structure according to claim 8, characterized in that, Invert the highest bit of the routing node's encoding, and shift the last two bits of the routing node's encoding by one bit according to a preset movement map to obtain the encoding of the second routing node at different layers, including: If the highest bit of the routing node's code is one, then the last two bits of the routing node's code are shifted one bit to the right according to the preset movement map to obtain the codes of the second routing nodes at different layers of the routing node. If the highest bit of the routing node's encoding is zero, then the last two bits of the routing node's encoding are shifted one bit to the left according to the preset moving map to obtain the encoding of the second routing node at a different layer of the routing node.
10. The routing method for a three-dimensional hypercube network structure according to claim 6, characterized in that, The routing node is a single routing node, the network diameter of the three-dimensional hypercube is two, and the network connectivity of the three-dimensional hypercube is four.
11. The routing method for a three-dimensional hypercube network structure according to claim 6, characterized in that, The routing node includes multiple sub-routing nodes, which are triangular pyramid structures. The network diameter of the three-dimensional hypercube is five, and the network connectivity of the three-dimensional hypercube is four.
12. The routing method for a three-dimensional hypercube network structure according to claim 11, characterized in that, The encoding of each child routing node includes: the encoding of the routing node and the connection encoding of the routing nodes to which the child routing node is connected.
13. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the routing method for a three-dimensional hypercube network structure as described in any one of claims 1 to 12.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the routing method for the three-dimensional hypercube network structure as described in any one of claims 1 to 12.
15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it is a routing method for a three-dimensional hypercube network structure as described in any one of claims 1 to 12.
Citation Information
Patent Citations
Network-on-chip communication method and device, computer equipment and storage medium
CN118714019A
Path determination method and device, medium and product
CN119094429A