Routing method, device, equipment, medium and program product

By selecting target nodes for data transmission based on packet status and buffer quantity in a two-dimensional mesh network, the problem of low transmission efficiency in traditional two-dimensional mesh networks is solved, achieving more efficient packet routing.

CN121367668APending Publication Date: 2026-01-20TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410968284.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

Traditional two-dimensional mesh networks have low transmission efficiency and poor routing performance, especially in that they fail to make full use of idle virtual channels during data packet transmission.

Method used

A routing method is adopted to determine the push status of the input port of the next hop node based on the data packet status of the current node to the next hop node, the number of idle buffers in the input port, and the number of secure data packets. Based on the data exchange mode of the two-dimensional grid network, the target hop node is selected for data transmission, and the fast buffer is used without classification.

Benefits of technology

It improves the transmission efficiency and routing performance of two-dimensional mesh networks, makes full use of idle virtual channels, reduces average latency, and improves the efficiency of data packet transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121367668A_ABST
    Figure CN121367668A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of routing, and particularly provides a routing method, device and equipment, a medium and a program product. The routing method comprises the following steps: determining a push state of an input port of a next-hop node according to a data packet state of a current node skipping to the next-hop node, the number of idle caches in the input port of the next-hop node and the number of secure data packets; the push state of the input port represents whether data is allowed to be pushed to the next hop node; if it is determined that the displacement between the current node and the destination node and the push state of the input port meet a set routing condition, obtaining a target jump node based on a next hop node; the current node and the destination node are different nodes in the two-dimensional grid network; and transmitting the current data packet to the target jump node by adopting a data exchange mode corresponding to the two-dimensional grid network. In this way, the routing performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of routing technology, in particular to a routing method, device, equipment, medium and program product. BACKGROUND

[0002] A two-dimensional mesh network is a common on-chip interconnection network. The on-chip interconnection network is a communication architecture integrated on a single chip, used to connect and manage data transmission between multiple computing units and storage units in a multi-core processor or system. Each node in the on-chip interconnection network has a separate router (Router) to handle communication-related tasks to achieve the overlapping execution of computing and communication tasks within the node. The router of each node is configured with one or more input ports and output ports.

[0003] In the conventional way, the Duato protocol (DP) is usually used for data interaction in a two-dimensional mesh network. However, in this way, the transmission efficiency of the two-dimensional mesh network is usually low, and the routing performance is poor. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a routing method, device, equipment, medium and program product to improve the routing performance of a two-dimensional mesh network.

[0005] In one aspect, the embodiments of the present application provide a routing method, the method comprising:

[0006] According to the data packet state of the current node jumping to the next hop node, the number of idle buffers in the input port of the next hop node and the number of safe data packets, the input port pushing state of the next hop node is determined; the data packet state indicates whether the current data packet of the current node is a safe data packet; the input port is provided with at least two fast buffers; the two fast buffers are not used according to the classification; the number of idle buffers is the number of idle fast buffers in the input port; the input port pushing state indicates whether to allow pushing data to the next hop node;

[0007] If it is determined that the displacement between the current node and the destination node, and the input port pushing state meet the set routing condition, the target jump node is obtained based on the next hop node; the current node and the destination node are different nodes in the two-dimensional mesh network;

[0008] Using the corresponding data exchange mode of the two-dimensional mesh network, the current data packet is transmitted to the target jump node.

[0009] In one embodiment, the fast buffer is a buffer area or a virtual channel;

[0010] The data packet state is determined according to a set deadlock-free basic routing algorithm; the basic routing algorithm is a strict in-order routing algorithm or a rotating model algorithm; the rotating model algorithm includes a negative priority algorithm;

[0011] The data exchange mode is any one of the following modes: virtual cut-through, wormhole exchange or buffered wormhole exchange;

[0012] In the case of the data exchange mode being virtual cut-through, the input port push state indicates whether to allow pushing the data packet to the next hop node; in the case of the data exchange mode being wormhole exchange or buffered wormhole exchange, the input port push state indicates whether to allow pushing the data packet header flit to the next hop node.

[0013] In one embodiment, before determining the input port push state of the next hop node according to the data packet state of the current node jumping to the next hop node, the number of free buffers in the input port of the next hop node and the number of safe data packets, the method further comprises:

[0014] In the case of the data exchange mode being virtual cut-through, if the data packet follows the basic routing algorithm when arriving at the next hop node, it is determined that the data packet state is safe, otherwise, it is determined that the data packet state is unsafe;

[0015] In the case of the data exchange mode being wormhole exchange or buffered wormhole exchange, if the data packet header flit of the current data packet follows the basic routing algorithm when arriving at the next hop node, it is determined that the data packet state is safe, otherwise, it is determined that the data packet state is unsafe.

[0016] In one embodiment, determining the input port push state of the next hop node according to the data packet state of the current node jumping to the next hop node, the number of free buffers in the input port of the next hop node and the number of safe data packets comprises:

[0017] In the case of the number of free buffers being greater than 1, it is determined that the input port push state is to allow pushing data;

[0018] In the case of the number of free buffers being 1 and the number of safe data packets being not less than 1, it is determined that the input port push state is to allow pushing data;

[0019] In the case of the number of free buffers being 1 and the number of safe data packets being 0, if the data packet state is safe, it is determined that the input port push state is to allow pushing data;

[0020] In the case of the number of free buffers being 0, it is determined that the input port push state is not to allow pushing data.

[0021] In one embodiment, if it is determined that the displacement between the current node and the destination node and the input port push state meet the set routing condition, a target jump node is obtained based on the next hop node, including:

[0022] The displacement of the current node and the destination node in the jump direction is obtained; the jump direction is the direction between the current node and the next hop node;

[0023] If the displacement is not zero and the input port push state is to allow pushing data, the next hop node is determined as a candidate node;

[0024] The target jump node is selected from the candidate node.

[0025] In one embodiment, the target jump node is selected from the candidate node, including:

[0026] If the candidate node is one, the candidate node is determined as the target jump node;

[0027] If the candidate node is at least two, the target jump node is selected according to the free cache amount of each candidate node.

[0028] In one embodiment, the current data packet is transmitted to the target jump node by using a data exchange mode corresponding to a two-dimensional grid network, including:

[0029] If there are multiple current data packets in the current node that apply to use the same output port, the data exchange mode is used to transmit each current data packet to the target jump node through the output port in turn according to the priority of each current data packet.

[0030] In one embodiment, in the case of wormhole exchange or cache wormhole exchange, different data packets are allowed to share the same fast cache in time.

[0031] In one embodiment, the method further includes:

[0032] If the current node and the destination node are the same node, the current data packet is processed by the current node.

[0033] In one aspect, an embodiment of the present application provides a routing device, including:

[0034] The determining unit is configured to determine an input port push state of the next hop node according to a data packet state of the current node jumping to the next hop node, a number of idle buffers in the input port of the next hop node, and a number of secure data packets; the data packet state indicates whether the current data packet of the current node is a secure data packet; the input port is provided with at least two fast buffers; the two fast buffers are not used according to categories; the number of idle buffers is a number of idle fast buffers in the input port; and the input port push state indicates whether to allow pushing data to the next hop node.

[0035] The obtaining unit is configured to obtain a target jump node based on the next hop node if it is determined that a displacement between the current node and the destination node and the input port push state meet a set routing condition; the current node and the destination node are different nodes in a two-dimensional grid network.

[0036] The transmitting unit is configured to transmit the current data packet to the target jump node in a data exchange mode corresponding to the two-dimensional grid network.

[0037] In an embodiment, the fast buffer is a buffer area or a virtual channel.

[0038] The data packet state is determined according to a set deadlock-free basic routing algorithm; the basic routing algorithm is a XY routing algorithm or a turn model algorithm; the turn model algorithm includes a negative priority algorithm.

[0039] The data exchange mode is any one of the following modes: virtual cut-through, wormhole exchange, or buffer wormhole exchange.

[0040] In a case where the data exchange mode is virtual cut-through, the input port push state indicates whether to allow pushing a data packet to the next hop node; in a case where the data exchange mode is wormhole exchange or buffer wormhole exchange, the input port push state indicates whether to allow pushing a data packet header flit to the next hop node.

[0041] In an embodiment, the determining unit is further configured to:

[0042] In a case where the data exchange mode is virtual cut-through, if the data packet complies with the basic routing algorithm when arriving at the next hop node, it is determined that the data packet state is secure, otherwise, it is determined that the data packet state is non-secure.

[0043] In a case where the data exchange mode is wormhole exchange or buffer wormhole exchange, if a data packet header flit of the current data packet complies with the basic routing algorithm when arriving at the next hop node, it is determined that the data packet state is secure, otherwise, it is determined that the data packet state is non-secure.

[0044] In an embodiment, the determining unit is configured to:

[0045] In a case where the number of idle caches is greater than 1, it is determined that the input port pushing state is to allow pushing data.

[0046] In a case where the number of idle caches is 1 and the number of safe data packets is not less than 1, it is determined that the input port pushing state is to allow pushing data.

[0047] In a case where the number of idle caches is 1 and the number of safe data packets is 0, if the data packet state is safe, it is determined that the input port pushing state is to allow pushing data.

[0048] In a case where the number of idle caches is 0, it is determined that the input port pushing state is to not allow pushing data.

[0049] In an embodiment, the obtaining unit is configured to:

[0050] Obtain a displacement of the current node and the destination node in a hop direction; the hop direction is a direction between the current node and a next hop node;

[0051] If the displacement is not zero and the input port pushing state is to allow pushing data, the next hop node is determined as a candidate node.

[0052] From the candidate nodes, a target hop node is selected.

[0053] In an embodiment, the obtaining unit is configured to:

[0054] If the candidate nodes are one, the candidate node is determined as the target hop node.

[0055] If the candidate nodes are at least two, the target hop node is selected according to the number of idle caches of each candidate node.

[0056] In an embodiment, the transmission unit is configured to:

[0057] If there are multiple current data packets in the current node that apply for using the same output port, a data exchange mode is adopted, and each current data packet is transmitted to the target hop node through the output port according to the priority of each current data packet.

[0058] In an embodiment, in a case where the data exchange mode is wormhole exchange or cache wormhole exchange, different data packets are allowed to share the same fast cache in time.

[0059] In an embodiment, the transmission unit is further configured to:

[0060] If the current node and the destination node are the same node, the current data packet is processed by the current node.

[0061] In an embodiment, the electronic device is provided.

[0062] a processor; and

[0063] The memory stores computer instructions for causing the processor to perform the steps of the method provided in any of the various optional implementations of the routing described above.

[0064] In one aspect, the embodiments of the present application provide a computer readable storage medium storing computer instructions for causing a computer to perform the steps of the method provided in any of the various optional implementations of the routing described above.

[0065] In one aspect, the embodiments of the present application provide a computer program product comprising computer readable code, or a non-volatile computer readable storage medium carrying computer readable code, which, when run in a processor of an electronic device, causes the processor in the electronic device to perform the steps of the method provided in any of the various optional implementations of the routing described above.

[0066] The method of routing in the embodiments of the present application comprises determining an input port push state of a next hop node according to a data packet state of a current node jumping to the next hop node, a number of free buffers in the input port of the next hop node, and a number of secure data packets; the data packet state indicates whether a current data packet of the current node is a secure data packet; at least two fast buffers are provided in the input port; the two fast buffers are not used according to categories; the number of free buffers is a number of free fast buffers in the input port; the input port push state indicates whether to allow pushing data to the next hop node; if a displacement between the current node and a destination node and the input port push state meet a set routing condition, a target jump node is obtained based on the next hop node; the current node and the destination node are different nodes in a two-dimensional grid network; and the current data packet is transmitted to the target jump node by using a data exchange mode corresponding to the two-dimensional grid network. In this way, the fast buffers are not used according to categories, and routing is performed based on the data packet state, so that the free virtual channels can be fully utilized, and the transmission efficiency and the routing performance are improved. BRIEF DESCRIPTION OF DRAWINGS

[0067] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the description of the embodiments or the prior art will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.

[0068] Figure 1 is an example diagram of data interaction based on the Duato protocol in the traditional way.

[0069] Figure 2is a flow chart of a method of routing in embodiments of the present application.

[0070] Figure 3 is an example diagram of data transmission in embodiments of the present application.

[0071] Figure 4 is a diagram of average delay evaluation based on C++ network simulator in embodiments of the present application.

[0072] Figure 5 is a diagram of received traffic evaluation based on C++ network simulator in embodiments of the present application.

[0073] Figure 6 is a diagram of average delay evaluation based on GEM5 network simulator in embodiments of the present application.

[0074] Figure 7 is a structural block diagram of a device of routing in embodiments of the present application.

[0075] Figure 8 is a structural schematic diagram of an electronic device in embodiments of the present application. DETAILED DESCRIPTION

[0076] The technical solutions of the present application will be described clearly and completely below in conjunction with the drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application. In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.

[0077] In actual application scenarios, the Duato protocol is usually used for data interaction in a two-dimensional mesh network. Referring to Figure 1 , an example diagram of data interaction based on the Duato protocol in a traditional manner is shown. Figure 1 In the figure, P1, P2 and P3 are different three data packets, R1 and R2 are different two virtual channels, and the virtual channel is a kind of fast cache. R1 is an adaptive channel, and R2 is an escape channel. When data exchange is performed through the Duato protocol, R1 and R2 are classified and used according to the type of the virtual channel to which they belong, and the use conditions of R1 and R2 are different. Node A and node B are two different nodes in a two-dimensional mesh network.

[0078] Figure 1 As shown in (a), there are two data packets to be transmitted in node A, i.e., data packet P1 and data packet P2. Figure 1(b) shows that data packet P2 in node A is pushed to B through adaptive channel R1, and data packet P1 in node A is pushed to B through elusion channel R2. There is also data packet P3 in node A to be transmitted. Figure 1 (c) shows that, according to the Duato protocol, data packet P3 must pass through adaptive channel R2 to reach B, and even if R2 is idle, data packet P3 can use the idle R2 only after R1 is idle. It can be seen that, in this way, the idle virtual channel cannot be fully utilized, the average delay is usually high, the transmission efficiency is low, and the routing performance of the two-dimensional mesh network is poor.

[0079] Based on the defects of the related technologies described above, the embodiments of the present application provide a routing method, device, equipment, medium and program product, aiming to improve the routing performance of the two-dimensional mesh network.

[0080] In an application scenario, a target routing node to which a current data packet in a current node can be routed is determined according to an idle fast buffer in a next hop node of the current node, and the current data packet is transmitted to the target routing node through a specified data exchange mode. The fast buffers in each input port of each node in the two-dimensional mesh network are not used according to categories.

[0081] The data exchange mode includes at least one of the following: virtual cut-through (VCT), wormhole (WH), and buffered wormhole (BW). The transmission characteristics of each of the above data exchange modes are described below.

[0082] In a VCT exchange network (a network using VCT for data exchange), as long as the buffer of the next hop on the shortest path of the message is available, routing selection can be made, and it is not necessary to wait until the entire data packet is buffered before making routing selection of the next hop. When the message is blocked, the router of the VCT exchange network that is blocked needs to be able to store the entire data packet, that is, the buffer of each input port of the VCT exchange network needs to be able to store a complete data packet.

[0083] In a WH exchange network (a two-dimensional mesh network using WH for data exchange), a message is divided into multiple flits, and each flit of the message is pushed in a pipelined manner in the two-dimensional mesh network. When the data packet header flit is blocked, each router input port on the routing path only needs to store one or more flits instead of the entire data packet.

[0084] In a BW switch network (a two-dimensional mesh network using BW to exchange data), similar to WH switching, a message is divided into multiple flits, and the flits of each message are pushed in a pipelined manner in the two-dimensional mesh network. When the packet header flit is blocked, the current router needs to store a complete data packet. The flow control unit in the BW switch network is a flit, not a complete data packet.

[0085] The method for routing provided in the embodiments of the present application can be applied to an electronic device, and the type of the electronic device is not limited in the present application, which can be any suitable device type, for example, the electronic device can be a device other than a two-dimensional mesh network, or can be a node in a two-dimensional mesh network, and details are not described herein.

[0086] Referring to Figure 1 FIG. 1 shows a flowchart of the method for routing in the embodiments of the present application, and the method will be described below in combination with Figure 1 The specific implementation process of the method can include steps 201-203.

[0087] Step 201: Determine the input port push state of the next hop node according to the data packet state of the current node jumping to the next hop node, the number of idle buffers in the input port of the next hop node, and the number of safe data packets.

[0088] The next hop node of the current node refers to multiple nodes directly connected to the current node in the two-dimensional mesh network, and the number of the next hop nodes of the current node is usually 4, and is usually located in the upper, lower, left and right four directions of the current node.

[0089] The data packet state indicates whether the current data packet of the current node is a safe data packet; the input port is provided with at least two fast buffers; for example, the input port can be provided with two fast buffers. The fast buffer can be a buffer or a virtual channel (VC). It should be noted that the current node and the next hop node are both nodes in the two-dimensional mesh network, and each input port of each node in the two-dimensional mesh network is provided with at least two fast buffers. The two fast buffers are not used according to categories; that is, when data transmission is performed, it is not necessary to distinguish whether the two fast buffers are adaptive or escape channels. The number of idle buffers is the number of idle fast buffers in the input port.

[0090] The input port push state indicates whether data is allowed to be pushed to the next hop node. If the flow control condition of the input port is met, it is determined that data is allowed to be pushed to the next hop node, otherwise, it is determined that data is not allowed to be pushed to the next hop node.

[0091] In the case of the data exchange mode being VCT, the input port push state indicates whether to allow pushing the data packet to the next hop node; in the case of the data exchange mode being WH or BW, the input port push state indicates whether to allow pushing the data packet header flit to the next hop node.

[0092] In the input port, k fast buffers are provided, and at most k-1 non-safe data packets can be in the k fast buffers. For example, two buffers are provided in the input port, and at most one non-safe data packet can be in the two buffers. k is a natural number greater than 2.

[0093] The basic routing algorithm can be a Dimension-Order Routing (DOR) algorithm or a spin model algorithm. The spin model algorithm includes a negative-first-routing (NFR) algorithm. The routing function corresponding to the basic routing algorithm is a sub-routing function proposed in the embodiments of the present application.

[0094] The number of safe data packets is the number of safe data packets. The safe data packet is a data packet with a safe data packet state. The data packet state includes safe and non-safe.

[0095] In an implementation, when determining the data packet state of the next hop node jumped by the current node, any of the following methods can be used:

[0096] Method one: in the case of the data exchange mode being VCT, if the data packet arrives at the next hop node in compliance with the basic routing algorithm, it is determined that the data packet state is safe, otherwise, it is determined that the data packet state is non-safe.

[0097] Method two: in the case of the data exchange mode being WH or BW, if the data packet header flit of the current data packet arrives at the next hop node in compliance with the basic routing algorithm, it is determined that the data packet state is safe, otherwise, it is determined that the data packet state is non-safe.

[0098] In the case of the data exchange mode being WH or BW, the safety of the data packet is consistent with the state of the header flit (i.e., the data packet header flit) of the data packet.

[0099] The following describes the data packet received by the current node as an example.

[0100] As an example, in the case of the data exchange mode being VCT, if the data packet arrives at the current node in compliance with the set basic routing algorithm, the data packet is a safe data packet; if the data packet arrives at the current node without complying with the basic routing algorithm, the data packet is a non-safe data packet, i.e., the data packet state is non-safe.

[0101] As another example, in the case of data exchange mode being WH, if the data packet header slice of the data packet arrives at the current node and follows the set basic routing algorithm, the data packet is a safe data packet; if the data packet header slice arrives at the current node and does not follow the basic routing algorithm, the data packet is a non-safe data packet.

[0102] As another example, in the case of data exchange mode being BW, if the data packet header slice of the data packet arrives at the current node and follows the set basic routing algorithm, the data packet is a safe data packet; if the data packet header slice arrives at the current node and does not follow the basic routing algorithm, the data packet is a non-safe data packet.

[0103] In an implementation, when determining the input port push state of the next hop node, the following steps can be adopted:

[0104] In the case of the number of idle buffers being greater than 1, the input port push state is determined to be allowed to push data; in the case of the number of idle buffers being 1 and the number of safe data packets being not less than 1, the input port push state is determined to be allowed to push data; in the case of the number of idle buffers being 1 and the number of safe data packets being 0, if the data packet state is safe, the input port push state is determined to be allowed to push data; in the case of the number of idle buffers being 0, the input port push state is determined to be not allowed to push data.

[0105] As an example, in the case of data exchange mode being VCT, the input port of the next hop node contains 2 buffers, f idle buffers and s safe data packets, the following algorithm can be adopted to determine the input port push state of the next hop node.

[0106] Wherein, the algorithm input is the current node (c x , c y ) and the destination node coordinates (d x , d y ), the number of idle buffers (i.e. the number of idle buffers) is f, and the number of safe data packets is s. The algorithm is {if f>1, the data packet can be pushed to the next hop node, return true, the input port push state is allowed to push the data packet, i.e. the data packet can be pushed to the input port of the next hop node. If f=1 and s=1, the data packet can be pushed to the next hop node, return true. If f=1, s=0, and the router from the current node to the next hop node follows the basic routing algorithm, the data packet can be pushed to the next hop node, return true. If the above conditions are not met, return false, the input port push state is not allowed to push data.}

[0107] That is, in the case of VCT, if the input port of the next hop node contains two idle buffers, the current packet can be pushed to the input port of the next hop node no matter how. If the input port of the next hop node contains one idle buffer and one safe packet, the current packet can be pushed to the next hop. If the input port of the next hop node contains one idle buffer and one unsafe packet, the current packet can be pushed to the next hop because the current node router follows the base routing algorithm to the next hop router. If none of the above conditions is met, the current packet cannot be pushed to the next hop node.

[0108] As an example, in the case of WH, if the input port of the next hop node contains two VC, f idle VC and s safe packets, the following algorithm can be used to determine the push state of the input port of the next hop node.

[0109] Wherein, the algorithm input is the current node (c x , c y ) and the destination node coordinates (d x , d y ), the number of idle buffers f, and the number of safe packets s. The algorithm is {if f>1, the packet can be pushed to the next hop node, return true, that is, the input port push state is to allow the push packet header flit, that is, the data packet flit can be pushed to the input port of the next hop node. If f=1 and s=1, the packet can be pushed to the next hop node, return true. If f=1, s=0, and the current node router follows the base routing algorithm to the next hop node router, the packet can be pushed to the next hop node, return true. If none of the above conditions is met, return false, and the input port push state is not allowed to push data.}

[0110] That is, in the case of WH, if the input port of the next hop node contains two idle VC, the current packet can be pushed to the input port of the next hop node no matter how. If the input port of the next hop node contains one idle VC and one safe packet, the current packet can be pushed to the next hop node. If the input port of the next hop node contains one idle VC and one unsafe packet, the current packet can be pushed to the next hop if the current node router follows the base routing algorithm to the next hop router. If none of the above conditions is met, the current packet cannot be pushed to the input port of the next hop node.

[0111] As an example, in the case of BW data exchange mode, if the input port of the next hop node contains 2 VC, f free VC and s safe data packets, the following algorithm can be used to determine the push state of the input port of the next hop node.

[0112] wherein the algorithm input is the current node (c x , c y ) and the destination node coordinates (d x , d y ), the number of free buffers is f, and the number of safe data packets is s. The algorithm is: if f > 1, the data packet can be pushed to the next hop node, and true is returned, i.e. the input port push state is to allow pushing the data packet header flit, i.e. the data packet flit can be pushed to the input port of the next hop node. If f = 1 and s = 1, the data packet can be pushed to the next hop node, and true is returned. If f = 1, s = 0, and the current node to the next hop node router complies with the basic routing algorithm, the data packet can be pushed to the next hop node, and true is returned. If none of the above conditions are met, false is returned, and the input port push state is not to allow pushing the data.

[0113] That is, in the case of BW data exchange mode, when the input port of the next hop node contains two idle VCs, the current data packet can be pushed to the input port of the next hop node regardless of how. When the input port of the next hop node contains one idle VC and one safe data packet, the current data packet can be pushed to the next hop node. When the input port of the next hop node contains one idle VC and one unsafe data packet, if the current node router to the next hop node router complies with the basic routing algorithm, the current data packet can be pushed to the next hop. If none of the above conditions are met, the current data packet cannot be pushed to the input port of the next hop node.

[0114] In this way, it can be determined whether the current data packet can be pushed to the input port of the next hop node.

[0115] Step 202: If it is determined that the displacement between the current node and the destination node and the input port push state meet the set routing condition, the target hop node is obtained based on the next hop node.

[0116] wherein the current node and the destination node are different nodes in a two-dimensional grid network.

[0117] Further, if the current node and the destination node are the same node, the current data packet is directly processed by the current node.

[0118] In one embodiment, when step 202 is performed, the following steps can be used:

[0119] The displacement of the current node and the destination node in the jump direction is obtained; the jump direction is the direction between the current node and the next hop node; if the displacement is not zero and the input port push state is to allow pushing data, the next hop node is determined as a candidate node; from the candidate nodes, a target jump node is selected.

[0120] The determination of the candidate node is described below.

[0121] As an example, the current node has four next hop nodes. In the case of a basic routing algorithm being a dimension sequence routing algorithm, the following algorithm can be used to select candidate nodes from each next hop node. The algorithm inputs are: the current node C is (c x , c y ) and the destination node D is (d x , d y ), based on (c x , c y ) and (d x , d y ) to obtain the displacement x off in the x direction and the offset y off in the y direction between CD. The number of idle buffers of each next hop node input port is (f x -, f x +, f y -, f y +), and the number of safe data packets of each next hop node input port is (s x -, s x +, s y -, s y +). Different output ports of the current node can correspond to different direction next hop nodes, and each output port can be represented as (ch x -, ch x +, ch y -, ch y +). The function flow-control() is constructed based on the dimension sequence routing algorithm, and the input port push state of each direction next hop node is obtained through flow-control().

[0122] The algorithm is: (1) S <- Ф; S represents a candidate set containing the output ports of the candidate nodes that can push data packets, i.e. the candidate set S is empty; (2) if C = D, ch <- internal, exit; it means that if the current node is the destination node, the current data packet is directly processed through the kernel of the current node; (3) if the displacement x off > 0 and the input port push state flow-control() of ch x + is true, S <- S U {chx (4) If x off < 0 and ch x - has true input port push state flow-control(), S <- S U {ch x -} ; (5) If y off > 0 and ch y + has true input port push state flow-control(), S <- S U {ch y +} ; (6) If y-direction offset y off < 0 and ch y - has true input port push state flow-control(), S <- S U {ch y -} ; (7) If S ≠ Ф, ch <- select(S). The selected output port is obtained, and the next hop node in the corresponding direction is determined as the candidate node.

[0123] Wherein, the function flow-control() is constructed based on the dimension sequence routing algorithm, and the function flow-control() is used to determine to return a logic value representing the input port push state. When the flow control condition of the input port is met, the function returns true, otherwise false. First, it is judged whether x off ≠ 0, if yes, x is selected as the corresponding direction which is the routable direction. Then it is judged whether y off ≠ 0, if yes, y is selected as the corresponding direction which is the routable direction. As long as there is a step not finished, the data packet can be pushed, but the flow control condition can be different.

[0124] As an example, the current node has 4 next hop nodes. In the case of the basic routing algorithm being a negative priority algorithm, the following algorithm can be used to select the candidate node from each next hop node. The algorithm input is: the current node C is (c x , c y ) and the destination node D is (d x , d y ), and the displacement x off in x direction and the offset y off in y direction between CD are obtained based on (c x , c y ) and (d x , d y ). The idle buffer number of each next hop node input port is (f x -, f x +, f y -, f y +), and the safe data packet number of each next hop node input port is (sx -,s x +,s y -,s y +). Different output ports of the current node can correspond to the next-hop nodes in different directions, and each output port can be represented as (ch). x -, ch x +,ch y -, ch y +). A function flow-control() is constructed based on the negative priority algorithm, and the input port push status of the next hop node in each direction is obtained through flow-control().

[0125] The algorithm is as follows: (1) S←Ф; S represents the candidate set containing the output ports of candidate nodes that can push data packets, i.e., the candidate set S is an empty set; (2) If C=D, ch←internal, exit; means that if the current node is the destination node, the current data packet is directly processed through the kernel of the current node; (3) If x off <0 and ch x - The input port push status flow-control() is true, S←S∪{ch x -};If the offset in the y direction is y off <0 and ch y - The input port push status flow-control() is true, S←S∪{ch y -};(4) If the displacement in the x direction x off >0 and ch x + The input port push status flow-control() is true, S←S∪{ch x +};If y off >0 and ch y + The input port push status flow-control() is true, S←S∪{ch y +};(5) If S≠Ф, ch=select(S), exit. Obtain the filtered output ports and determine the next hop node in the corresponding direction as a candidate node.

[0126] Specifically, a function `flow-control()` is constructed based on a negative priority algorithm. This function determines and returns a logical value representing the push status of the input port. It returns `true` if the flow control condition of the input port is met, and `false` otherwise. (The last sentence, "Check if x...", is a separate, unrelated statement and doesn't directly relate to the function description.) off If x is not equal to 0, then x is selected as the routable direction, and it is determined whether y is true. off≠0, if yes, select y as the corresponding direction as a routable direction. As long as there are steps not completed, the data packet can be pushed, but the flow control condition can be different.

[0127] In an implementation, if the candidate nodes are at least two, the candidate node corresponding to the maximum of the free buffer quantity of each candidate node is returned preferentially.

[0128] In an implementation, when selecting the target jump node from the candidate nodes, the following steps can be adopted:

[0129] If the candidate nodes are one, the candidate node is determined as the target jump node; if the candidate nodes are at least two, the target jump node is selected according to the free buffer quantity of each candidate node.

[0130] As an example, if the candidate nodes are multiple, the maximum of the free buffer quantity of each candidate node is determined, and the candidate node corresponding to the maximum is determined as the target jump node.

[0131] Step 203: adopt the data exchange mode corresponding to the two-dimensional mesh network to transmit the current data packet to the target jump node.

[0132] In an implementation, in the case that the data exchange mode is wormhole exchange or buffer wormhole exchange, different data packets are allowed to share the same fast buffer in time.

[0133] In an implementation, if multiple current data packets in the current node apply to use the same output port, the data exchange mode is adopted to transmit each current data packet to the target jump node through the output port in turn according to the priority of each current data packet.

[0134] The priority can be determined according to the application order, i.e., first come first served, and the data packet inserted into the network first can be served preferentially.

[0135] Referring to FIG. 1, Figure 3 FIG. 1 is an example diagram of data transmission in an embodiment of the present application. Figure 3 In FIG. 1, P1, P2 and P3 are different three data packets, and the buffer of the input port in node B is not classified. Data packet P1 is a secure data packet, and data packet P2 is a non-secure data packet. Figure 3 As shown in (a), node A has two data packets to be transmitted, i.e., data packet P1 and data packet P2. Figure 3 As shown in (b), data packet P1 and data packet P2 in node A are pushed to B. Node A has a data packet P3 to be transmitted. When the non-secure data packet P2 moves out of node B, the input port of node B has only one secure data packet, and data packet P3 can be pushed to B whether it follows the step of the baseline routing algorithm or not.

[0136] In the embodiments of the present application, the network simulator based on C++ and the network simulator based on GEM5 are respectively used to compare and test the routing performance of the four routing modes in the 8x8 two-dimensional mesh network in three communication modes, to illustrate the performance of different routing modes. The performance can include average delay and throughput. The simulator can faithfully implement the selection function and allocation policy of the algorithm.

[0137] The four routing modes include DP routing, DOR routing, channel overlap algorithm (overlap), and the routing mode of the present application. The routing mode of the present application can be referred to as a flow control mechanism based on packet state information, which can be represented as PKS. The three communication modes include uniform no timeout communication mode, transpose no timeout communication mode, and hotspot no timeout communication mode.

[0138] Referring to FIG. 1, it is an average delay evaluation diagram based on a C++ network simulator. Figure 4 Referring to FIG. 2, it is a received traffic evaluation diagram based on a C++ network simulator. Figure 5 Referring to FIG. 3, it is an average delay evaluation diagram based on a GEM5 network simulator. Figure 6 The horizontal coordinates in FIGS. 1, 2 and 3 are all injection rates, with the unit of flits / cycle / node. Figures 4-6 The vertical coordinates in FIGS. 1, 2 and 3 are all average delays, with the unit of cycle. Figure 4 The vertical coordinates in FIGS. 1, 2 and 3 are all average delays, with the unit of cycle. Figure 6 The vertical coordinates in FIGS. 1, 2 and 3 are all average delays, with the unit of cycle. Figure 5 The vertical coordinates in FIGS. 1, 2 and 3 are all average delays, with the unit of cycle.

[0139] Referring to FIG. 4(a), in the uniform no timeout communication mode, the PKS algorithm is about 10% slower than the DOR saturation, but the DOR saturation is relatively slow. The three fully adaptive routing algorithms saturate relatively quickly, and the saturation point of the overlap is slightly later than that of the DP. Figure 4 Referring to FIG. 4(b), in the transpose no timeout communication mode, the PKS algorithm is about 10% slower than the DOR saturation, but the DOR saturation is relatively slow. The three fully adaptive routing algorithms saturate relatively quickly, and the saturation point of the overlap is slightly later than that of the DP. Figure 4(b) shows that, in the transpose no timeout communication mode, the DOR is much weaker than the three fully adaptive routing algorithms. Compared with the three fully adaptive routing algorithms, the overlap is optimal, and the saturation point of the DP is slightly later than that of the PKS algorithm. Refer to Figure 4 (c) shows that, in the hotspot no timeout communication mode, the PKS algorithm and the overlap algorithm are slightly better than the DP, and the three fully adaptive routing algorithms are much better than the DOR. Figure 5 The figure shows the throughput rate of the four routing modes applied to an 8x8 two-dimensional mesh network in three communication modes, respectively.

[0140] Figure 6 The simulation results in the GEM5 simulation environment are given. Figure 6 (a) In the uniform no timeout communication mode, the saturation point of the PKS is delayed by nearly 10% compared with the DOR, delayed by about 16% compared with the overlap, and delayed by about 28% compared with the DP. As shown in Figure 6 (b) shows that, in the transpose no timeout communication mode, the saturation point of the PKS is delayed by about 30%, about 33%, and 48% compared with the overlap, the DP, and the DOR, respectively. Figure 6 (c) shows the performance evaluation in the hotspot no timeout communication mode.

[0141] In the embodiments of the present application, the fast cache is not classified for use, the idle virtual channel can be fully utilized, the routing is performed based on the packet state, the transmission efficiency is high, and the routing performance is improved.

[0142] Based on the same inventive concept, the embodiments of the present application also provide a routing device. Since the principles of the above device and equipment for solving problems are similar to those of the routing method, the implementation of the above device can be referred to the implementation of the method, and the repeated parts will not be described herein. The device can be applied to electronic equipment, and the type of the electronic equipment is not limited in the present application, which can be any suitable device type, such as terminal equipment and servers, and the like, which will not be described herein.

[0143] Refer to Figure 7 The figure shows the structure block diagram of the routing device in the embodiments of the present application. In some embodiments, the routing device of the present application includes:

[0144] The determining unit 701 is configured to determine an input port push state of the next hop node according to a data packet state of a current node jumping to the next hop node, a number of idle buffers in an input port of the next hop node, and a number of secure data packets; the data packet state indicates whether a current data packet of the current node is a secure data packet; the input port is provided with at least two fast buffers; the two fast buffers are not used according to categories; the number of idle buffers is a number of idle fast buffers in the input port; and the input port push state indicates whether to allow pushing data to the next hop node.

[0145] The obtaining unit 702 is configured to obtain a target jump node based on the next hop node if it is determined that a displacement between the current node and a destination node and the input port push state meet a set routing condition; the current node and the destination node are different nodes in a two-dimensional grid network.

[0146] The transmitting unit 703 is configured to transmit the current data packet to the target jump node in a data exchange mode corresponding to the two-dimensional grid network.

[0147] In an embodiment, the fast buffer is a buffer area or a virtual channel.

[0148] The data packet state is determined according to a set deadlock-free basic routing algorithm; the basic routing algorithm is a XY routing algorithm or a turn model algorithm; the turn model algorithm includes a negative priority algorithm.

[0149] The data exchange mode is any one of the following modes: virtual cut-through, wormhole exchange, or buffer wormhole exchange.

[0150] In a case where the data exchange mode is virtual cut-through, the input port push state indicates whether to allow pushing a data packet to the next hop node; in a case where the data exchange mode is wormhole exchange or buffer wormhole exchange, the input port push state indicates whether to allow pushing a data packet header flit to the next hop node.

[0151] In an embodiment, the determining unit 701 is further configured to:

[0152] In a case where the data exchange mode is virtual cut-through, if the data packet follows the basic routing algorithm when arriving at the next hop node, it is determined that the data packet state is secure, otherwise, it is determined that the data packet state is non-secure.

[0153] In a case where the data exchange mode is wormhole exchange or buffer wormhole exchange, if a data packet header flit of the current data packet follows the basic routing algorithm when arriving at the next hop node, it is determined that the data packet state is secure, otherwise, it is determined that the data packet state is non-secure.

[0154] In an embodiment, the determining unit 701 is configured to:

[0155] In the case that the number of idle caches is greater than 1, it is determined that the input port pushing state is to allow pushing data.

[0156] In the case that the number of idle caches is 1 and the number of safe data packets is not less than 1, it is determined that the input port pushing state is to allow pushing data.

[0157] In the case that the number of idle caches is 1 and the number of safe data packets is 0, if the data packet state is safe, it is determined that the input port pushing state is to allow pushing data.

[0158] In the case that the number of idle caches is 0, it is determined that the input port pushing state is to not allow pushing data.

[0159] In an implementation, the obtaining unit 702 is configured to:

[0160] Obtain the displacement of the current node and the destination node in the hop direction; the hop direction is the direction between the current node and the next hop node;

[0161] If the displacement is not zero and the input port pushing state is to allow pushing data, the next hop node is determined as a candidate node.

[0162] From the candidate nodes, a target hop node is selected.

[0163] In an implementation, the obtaining unit 702 is configured to:

[0164] If the candidate nodes are one, the candidate node is determined as the target hop node.

[0165] If the candidate nodes are at least two, the target hop node is selected according to the number of idle caches of each candidate node.

[0166] In an implementation, the transmission unit 703 is configured to:

[0167] If there are multiple current data packets in the current node that apply to use the same output port, a data exchange mode is adopted to transmit each current data packet to the target hop node through the output port in turn according to the priority of each current data packet.

[0168] In an implementation, in the case that the data exchange mode is wormhole exchange or cache wormhole exchange, different data packets are allowed to share the same fast cache in time.

[0169] In an implementation, the transmission unit 703 is further configured to:

[0170] If the current node and the destination node are the same node, the current data packet is processed by the current node.

[0171] The method for routing in the embodiments of the present application comprises determining an input port pushing state of a next hop node according to a data packet state of the next hop node jumped from a current node, a number of idle buffers in the input port of the next hop node, and a number of secure data packets; the data packet state indicates whether the current data packet of the current node is a secure data packet; the input port is provided with at least two fast buffers; the two fast buffers are not used according to categories; the number of idle buffers is a number of idle fast buffers in the input port; the input port pushing state indicates whether to allow pushing data to the next hop node; if it is determined that a displacement between the current node and a destination node, and the input port pushing state meet a set routing condition, a target jump node is obtained based on the next hop node; the current node and the destination node are different nodes in a two-dimensional grid network; the current data packet is transmitted to the target jump node by using a data exchange mode corresponding to the two-dimensional grid network. In this way, the fast buffers are not used according to categories, and routing is based on the data packet state, so that idle virtual channels can be fully utilized, and transmission efficiency and routing performance are improved.

[0172] In the embodiments of the present application, an electronic device is provided, comprising:

[0173] a processor; and

[0174] a memory storing computer instructions for causing the processor to execute the method of any of the above embodiments.

[0175] In the embodiments of the present application, a computer readable storage medium storing computer instructions for causing a computer to execute the method of any of the above embodiments is provided.

[0176] The embodiments of the present application also provide a computer program product comprising computer readable code or a non-volatile computer readable storage medium carrying computer readable code, when the computer readable code is run in the processor of the electronic device, the processor in the electronic device executes the method of any of the above embodiments.

[0177] Figure 8 A structural schematic diagram of an electronic device 8000 is shown. Referring to Figure 8 As shown, the electronic device 8000 comprises a processor 8010 and a memory 8020, and optionally, a power supply 8030, a display unit 8040, and an input unit 8050.

[0178] The processor 8010 is the control center of the electronic device 8000, connects various components by using various interfaces and lines, executes various functions of the electronic device 8000 by running or executing software programs and / or data stored in the memory 8020, and thus monitors the electronic device 8000 as a whole.

[0179] In the embodiments of the present application, the processor 8010 executes the steps in the above embodiments when invoking the computer program stored in the memory 8020.

[0180] Optionally, the processor 8010 can include one or more processing units. Preferably, the processor 8010 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and applications, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 8010. In some embodiments, the processor, the memory, can be implemented on a single chip, and in some embodiments, they can also be implemented on separate chips respectively.

[0181] The memory 8020 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, various applications, etc.; and the data storage area can store data created according to the use of the electronic device 8000, etc. In addition, the memory 8020 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device, etc.

[0182] The electronic device 8000 further includes a power supply 8030 (such as a battery) for supplying power to each component. The power supply can be logically connected to the processor 8010 through a power management system, so as to realize the functions of managing charging, discharging, and power consumption, etc. through the power management system.

[0183] The display unit 8040 can be used to display information input by the user or information provided to the user, as well as various menus of the electronic device 8000, etc. In the embodiments of the present application, it is mainly used to display the display interface of each application in the electronic device 8000 and the objects such as text, pictures, etc. displayed in the display interface. The display unit 8040 can include a display panel 8041. The display panel 8041 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0184] The input unit 8050 can be used to receive information such as numbers or characters input by the user. The input unit 8050 can include a touch panel 8051 and other input devices 8052. The touch panel 8051, also known as a touch screen, can collect touch operations of the user on or near it (such as the user's operation on or near the touch panel 8051 using a finger, a stylus, or any suitable object or accessory).

[0185] Specifically, the touch panel 8051 can detect a user's touch operation, and detect signals caused by the touch operation, convert the signals into touch coordinates, send the touch coordinates to the processor 8010, and receive commands from the processor 8010 and execute the commands. In addition, the touch panel 8051 can be implemented in various types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type. The other input device 8052 can include one or more of, but is not limited to, a physical keyboard, function keys (such as volume control buttons, power on / off buttons, etc.), a trackball, a mouse, a joystick, etc.

[0186] Of course, the touch panel 8051 can cover the display panel 8041, and when the touch panel 8051 detects a touch operation thereon or nearby, the touch panel 8051 transmits the touch operation to the processor 8010 to determine the type of the touch event, and then the processor 8010 provides corresponding visual output on the display panel 8041 according to the type of the touch event. Although in the above description, the touch panel 8051 and the display panel 8041 are implemented as two independent components to realize the input and output functions of the electronic device 8000, in some embodiments, the touch panel 8051 and the display panel 8041 can be integrated to realize the input and output functions of the electronic device 8000. Figure 8

[0187] The electronic device 8000 can further include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs in specific applications, the above electronic device 8000 can further include a camera and other components, since these components are not the components mainly used in the embodiments of the present application, they are not shown in the above description and will not be described in detail. Figure 8

[0188] Those skilled in the art can understand that Figure 8 The above is only an example of an electronic device, and does not constitute a limitation on the electronic device, and can include more or fewer components than the diagram, or combine certain components, or different components.

[0189] For the convenience of description, each part is divided into modules (or units) according to functions and described respectively. Of course, in the implementation of the present application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.​​

Claims

1. A method of routing, characterized by, The method comprises: determining an input port push state of a next hop node according to a data packet state of a current node jumping to the next hop node, a number of free buffers in an input port of the next hop node, and a number of secure data packets; the data packet state indicates whether a current data packet of the current node is a secure data packet; the input port is provided with at least two fast buffers; the two fast buffers are not used according to categories; the number of free buffers is a number of free fast buffers in the input port; the input port push state indicates whether data is allowed to be pushed to the next hop node; if it is determined that a displacement between the current node and a destination node and the input port push state meet a set routing condition, obtaining a target jump node based on the next hop node; the current node and the destination node are different nodes in a two-dimensional grid network; transmitting the current data packet to the target jump node by using a data exchange mode corresponding to the two-dimensional grid network.

2. The method of claim 1, wherein, The fast buffer is a buffer area or a virtual channel; The data packet state is determined according to a set deadlock-free basic routing algorithm; the basic routing algorithm is a virtual sequence routing algorithm or a rotation model algorithm; the rotation model algorithm includes a negative priority algorithm; The data exchange mode is any one of the following modes: virtual cut-through, wormhole exchange, or buffer wormhole exchange; In a case where the data exchange mode is virtual cut-through, the input port push state indicates whether a data packet is allowed to be pushed to the next hop node; In a case where the data exchange mode is wormhole exchange or buffer wormhole exchange, the input port push state indicates whether a data packet header flit is allowed to be pushed to the next hop node.

3. The method of claim 2, wherein, Before determining the input port push state of the next hop node according to the data packet state of the current node jumping to the next hop node, the number of free buffers in the input port of the next hop node, and the number of secure data packets, the method further comprises: In a case where the data exchange mode is virtual cut-through, if the data packet follows the basic routing algorithm when arriving at the next hop node, it is determined that the data packet state is secure, otherwise, it is determined that the data packet state is non-secure; In a case where the data exchange mode is wormhole exchange or buffer wormhole exchange, if a data packet header flit of the current data packet follows the basic routing algorithm when arriving at the next hop node, it is determined that the data packet state is secure, otherwise, it is determined that the data packet state is non-secure.

4. The method of claim 1, wherein, The determining the input port push state of the next hop node according to the data packet state of the current node jumping to the next hop node, the number of free buffers in the input port of the next hop node, and the number of secure data packets comprises: in a case where the number of free buffers is greater than 1, determining that the input port push state is to allow data to be pushed; in a case where the number of free buffers is 1 and the number of secure data packets is not less than 1, determining that the input port push state is to allow data to be pushed; In the case that the number of idle buffers is 1 and the number of secure data packets is 0, if the data packet state is secure, it is determined that the input port push state is to allow pushing data. In the case that the number of idle buffers is 0, it is determined that the input port push state is to not allow pushing data.

5. The method according to any one of claims 1 to 4, characterized in that, If it is determined that the displacement between the current node and the destination node and the input port push state meet a set routing condition, a target jump node is obtained based on the next hop node, including: Obtaining the displacement of the current node and the destination node in a jump direction; the jump direction is the direction between the current node and the next hop node; If the displacement is not zero and the input port push state is to allow pushing data, the next hop node is determined as a candidate node; Selecting the target jump node from the candidate nodes.

6. The method of claim 5, wherein, The selecting of the target jump node from the candidate nodes includes: If the candidate nodes are one, the candidate node is determined as the target jump node; If the candidate nodes are at least two, the target jump node is selected according to the number of idle buffers of each candidate node.

7. The method according to any one of claims 1 to 4, characterized in that, The transmission of the current data packet to the target jump node by using the data exchange mode corresponding to the two-dimensional grid network includes: If there are multiple current data packets in the current node that apply to use the same output port, the data exchange mode is used to transmit each current data packet to the target jump node through the output port in turn according to the priority of each current data packet.

8. The method according to any one of claims 1 to 4, characterized in that, In the case that the data exchange mode is wormhole exchange or buffer wormhole exchange, different data packets are allowed to share the same fast buffer in time.

9. The method according to any one of claims 1 to 4, characterized in that, The method further includes: If the current node and the destination node are the same node, the current data packet is processed by the current node.

10. An apparatus for routing, characterized by The device includes: A determination unit is configured to determine an input port push state of a next hop node according to a data packet state of a current node jumping to the next hop node, a number of idle buffers in an input port of the next hop node, and a number of secure data packets; the data packet state indicates whether the current data packet of the current node is a secure data packet; the input port is provided with at least two fast buffers; the two fast buffers are not used according to categories; the number of idle buffers is the number of idle fast buffers in the input port; the input port push state indicates whether to allow pushing data to the next hop node; An obtaining unit is configured to obtain a target jump node based on the next hop node if it is determined that the displacement between the current node and the destination node and the input port push state meet a set routing condition; the current node and the destination node are different nodes in a two-dimensional grid network; A transmission unit is configured to transmit the current data packet to the target jump node by using a data exchange mode corresponding to the two-dimensional grid network.

11. An electronic device, comprising: including: a processor; and ​ a memory storing computer instructions for causing the processor to perform the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, a computer program product storing computer instructions for causing a computer to perform the method according to any one of claims 1 to 9.

13. A computer program product, characterised in that, a non-transitory computer readable storage medium including or carrying computer readable code which, when executed in a processor of an electronic device, causes the processor in the electronic device to perform the method according to any one of claims 1 to 9.