Data routing methods, devices, electronic equipment and storage media

CN122340020BActive Publication Date: 2026-08-14SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-02
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

传统路由策略通常只感知当前节点的直接相邻节点状态,在长距离传输中无法提前预测后续节点的拥塞情况,导致可能选择的路径仍然受拥塞影响;而对短距离传输而言,固定两跳或多跳感知会增加不必要的计算开销

Benefits of technology

[0024]本申请实施例提供的数据路由方法、装置、电子设备及存储介质,数据路由方法包括:确定待传输数据包的当前节点到所述待传输数据包的目的节点的路径距离;获取所述片上网络对应的平均跳数;比较所述路径距离和所述平均跳数的大小,在所述路径距离小于或等于所述平均跳数的情况下,基于第一路由选择方式进行数据路由;在所述路径距离大于所述平均跳数的情况下,基于第二路由选择方式进行数据路由;其中,所述基于第一路由选择方式进行数据路由包括:确定与所述当前节点相邻的候选相邻节点,确定所述候选相邻节点的第一空闲缓存单元数量;基于所述第一空闲缓存单元数量确定目标相邻节点,将所述待传输数据包由所述当前节点发送至所述目标相邻节点;所述基于第二路由选择方式进行数据路由包括:确定与所述当前节点相邻的候选相邻节点,以及与所述候选相邻节点相邻的候选间接相邻节点;确定所述候选相邻节点的第二空闲缓存单元数量以及所述候选间接相邻节点的第三空闲缓存单元数量;基于所述第二空闲缓存单元数量和所述第三空闲缓存单元数量确定候选路径评价值,基于所述候选路径评价值确定目标路径;基于所述目标路径发送所述待传输数据包。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122340020B_ABST
    Figure CN122340020B_ABST
Patent Text Reader

Abstract

This application provides a data routing method, apparatus, electronic device, and storage medium, belonging to the field of network interconnection technology. The method includes: determining the path distance from the current node of a data packet to be transmitted to the destination node of the data packet and the average hop count of the on-chip network; when the path distance is less than or equal to the average hop count, performing data routing based on a first routing method, and determining the target neighbor node based on the number of free buffer units of candidate neighbor nodes adjacent to the current node; when the path distance is greater than the average hop count, determining the target path based on the number of free buffer units of candidate indirect neighbor nodes adjacent to the current node. This application dynamically switches routing methods, tracks changes in congestion locations in real time, and avoids routing congestion in advance, effectively reducing network transmission latency and improving data communication efficiency and network throughput.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of on-chip network technology, and in particular to a data routing method, apparatus, electronic device and storage medium. Background Technology

[0002] With the development of System-on-Chip (SoC) and multi-core processors, Network-on-Chip (NoC) has become the primary communication method for data exchange between cores. In a 2D mesh topology, each routing node is connected to adjacent nodes and processor cores via links to transmit and forward data packets. However, as the number of cores increases and communication requirements become more complex, NoCs are prone to node congestion, leading to increased transmission latency and decreased network throughput.

[0003] Existing on-chip network routing methods typically rely on node or link states for congestion awareness, such as selecting paths based on input buffer occupancy. While these methods can mitigate local congestion to some extent, they suffer from the following problems in practical applications: Traditional routing strategies typically only perceive the status of the current node's direct neighbors. In long-distance transmission, they cannot predict the congestion of subsequent nodes in advance, resulting in the possible path selection still being affected by congestion. For short-distance transmission, fixed two-hop or multi-hop perception will increase unnecessary computational overhead.

[0004] Existing technologies generally only focus on the cache usage or queue length of a single node, and cannot simultaneously consider the combined state of adjacent nodes and indirectly adjacent nodes, thus affecting the accuracy of path selection.

[0005] When one or more congested nodes appear in the network, existing methods mostly use fixed detour rules, which are difficult to flexibly deal with the distribution of congested nodes in different locations, and are prone to problems such as backhaul, path duplication or local load concentration.

[0006] In summary, existing on-chip network routing methods struggle to simultaneously meet the following requirements: dynamically selecting the sensing range based on transmission distance, accurately assessing path congestion, and flexibly selecting the optimal path in cases of single-point or multi-point congestion. Therefore, a network routing method is needed that can achieve dynamic hop count awareness, comprehensive congestion assessment, and flexible detours, thereby reducing transmission latency and improving network throughput efficiency. Summary of the Invention

[0007] This application provides a data routing method, apparatus, electronic device, and storage medium to at least solve the above-mentioned technical problems existing in the prior art.

[0008] According to a first aspect of this application, a data routing method is provided, the method being applied to an on-chip network including multiple routing nodes, the data routing method comprising: Determine the path distance from the current node of the data packet to be transmitted to the destination node of the data packet; Obtain the average hop count corresponding to the on-chip network; Compare the path distance with the average hop count, and if the path distance is less than or equal to the average hop count, perform data routing based on the first routing method. If the path distance is greater than the average number of hops, data routing is performed based on the second routing method. The data routing based on the first routing selection method includes: determining candidate neighboring nodes adjacent to the current node, determining the number of first free buffer units of the candidate neighboring nodes; determining the target neighboring node based on the number of first free buffer units, and sending the data packet to be transmitted from the current node to the target neighboring node; The data routing based on the second routing method includes: determining candidate neighboring nodes adjacent to the current node, and candidate indirect neighboring nodes adjacent to the candidate neighboring nodes; determining the number of second free buffer units of the candidate neighboring nodes and the number of third free buffer units of the candidate indirect neighboring nodes; determining a candidate path evaluation value based on the number of second free buffer units and the number of third free buffer units; determining a target path based on the candidate path evaluation value; and sending the data packet to be transmitted based on the target path.

[0009] In one possible implementation, determining the path distance from the current node of the data packet to be transmitted to the destination node of the data packet includes: Obtain the coordinates of the current node and the coordinates of the destination node; Calculate the path distance from the current node to the destination node based on the coordinates of the current node and the coordinates of the destination node.

[0010] In one possible implementation, calculating the path distance from the current node to the destination node based on the coordinates of the current node and the coordinates of the destination node includes: Based on the coordinates of the current node and the coordinates of the destination node, determine the first distance between the current node and the destination node in the first direction, and the second distance between the current node and the destination node in the second direction; The sum of the first distance and the second distance is determined as the path distance from the current node to the destination node.

[0011] In one possible implementation, determining the target neighbor node based on the number of the first free cache units includes: Compare the size of the number of first free cache units corresponding to each of the candidate adjacent nodes; The candidate neighbor node with the largest number of first free cache units is determined as the target neighbor node; The number of the first free cache units is used to characterize the congestion level of the candidate neighboring nodes. The larger the number of the first free cache units, the smaller the congestion level of the candidate neighboring nodes.

[0012] In one possible implementation, determining the candidate path evaluation value based on the number of the second free cache units and the number of the third free cache units, and determining the target path based on the candidate path evaluation value, includes: Based on each candidate neighbor node and each candidate indirect neighbor node, at least one candidate path is determined; wherein each candidate path includes a first path from the current node to the candidate neighbor node, and a second path from the candidate neighbor node to the candidate indirect neighbor node; For each candidate path, an evaluation value is determined based on the number of the second free cache units and the number of the third free cache units; Compare the candidate path evaluation values ​​corresponding to each candidate path, and determine the candidate path with the largest evaluation value as the target path.

[0013] In one possible implementation, determining the candidate path evaluation value based on the number of the second free cache units and the number of the third free cache units includes: Calculate the product of the number of the second free cache units and the number of the third free cache units; The product is determined as the candidate path evaluation value of the candidate path; Compare the product size of each candidate path; The candidate path corresponding to the maximum product value is determined as the target path.

[0014] In one possible implementation, determining the candidate indirect neighboring node adjacent to the candidate neighboring node includes: Determine at least one adjacent routing node that is adjacent to the candidate adjacent node; From the at least one adjacent routing node, determine the adjacent routing node facing the destination node as the candidate indirect adjacent node; The adjacent routing nodes facing the destination node are: routing nodes whose path distance to the destination node is reduced compared to the candidate adjacent nodes.

[0015] According to a second aspect of this application, a data routing apparatus is provided for use in an on-chip network including multiple routing nodes, the data routing apparatus comprising: The distance determination module is used to determine the path distance from the current node of the data packet to be transmitted to the destination node of the data packet; The average hop count acquisition module is used to acquire the average hop count corresponding to the on-chip network; The routing module is used to compare the path distance and the average hop count. If the path distance is less than or equal to the average hop count, data routing is performed based on a first routing method; if the path distance is greater than the average hop count, data routing is performed based on a second routing method. The routing module includes a first routing unit and a second routing unit. The first routing unit is configured to determine candidate neighboring nodes adjacent to the current node, determine the number of first free buffer units of the candidate neighboring nodes, determine the target neighboring node based on the number of first free buffer units, and send the data packet to be transmitted from the current node to the target neighboring node. The second routing unit is configured to determine candidate neighboring nodes adjacent to the current node, and candidate indirect neighboring nodes adjacent to the candidate neighboring nodes; determine the number of second free buffer units of the candidate neighboring nodes and the number of third free buffer units of the candidate indirect neighboring nodes; determine a candidate path evaluation value based on the number of second free buffer units and the number of third free buffer units; determine a target path based on the candidate path evaluation value; and send the data packet to be transmitted based on the target path.

[0016] In one possible implementation, the distance determination module is specifically used for: Obtain the coordinates of the current node and the coordinates of the destination node; Calculate the path distance from the current node to the destination node based on the coordinates of the current node and the coordinates of the destination node.

[0017] In one possible implementation, the distance determination module is further configured to: Based on the coordinates of the current node and the coordinates of the destination node, determine the first distance between the current node and the destination node in the first direction, and the second distance between the current node and the destination node in the second direction; The sum of the first distance and the second distance is determined as the path distance from the current node to the destination node.

[0018] In one possible implementation, the first routing unit is specifically used for: Compare the size of the number of first free cache units corresponding to each of the candidate adjacent nodes; The candidate neighbor node with the largest number of first free cache units is determined as the target neighbor node; The number of the first free cache units is used to characterize the congestion level of the candidate neighboring nodes. The larger the number of the first free cache units, the smaller the congestion level of the candidate neighboring nodes.

[0019] In one possible implementation, the second routing unit is specifically used for: Based on each candidate neighbor node and each candidate indirect neighbor node, at least one candidate path is determined; wherein each candidate path includes a first path from the current node to the candidate neighbor node, and a second path from the candidate neighbor node to the candidate indirect neighbor node; For each candidate path, an evaluation value is determined based on the number of the second free cache units and the number of the third free cache units; Compare the candidate path evaluation values ​​corresponding to each candidate path, and determine the candidate path with the largest evaluation value as the target path.

[0020] In one possible implementation, the second routing unit is further configured to: Calculate the product of the number of the second free cache units and the number of the third free cache units; The product is determined as the candidate path evaluation value of the candidate path; Compare the product size of each candidate path; The candidate path corresponding to the maximum product value is determined as the target path.

[0021] In one possible implementation, the second routing unit is further configured to: Determine at least one adjacent routing node that is adjacent to the candidate adjacent node; From the at least one adjacent routing node, determine the adjacent routing node facing the destination node as the candidate indirect adjacent node; The adjacent routing nodes facing the destination node are: routing nodes whose path distance to the destination node is reduced compared to the candidate adjacent nodes.

[0022] According to a third aspect of this application, an electronic device is provided, comprising: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the data routing method described in this application.

[0023] According to a fourth aspect of this application, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to execute the data routing method described in this application.

[0024] The data routing method, apparatus, electronic device, and storage medium provided in this application include: determining the path distance from the current node of a data packet to be transmitted to the destination node of the data packet; obtaining the average hop count corresponding to the on-chip network; comparing the path distance and the average hop count; and performing data routing based on a first routing method if the path distance is less than or equal to the average hop count; and performing data routing based on a second routing method if the path distance is greater than the average hop count. The first routing method includes: determining candidate neighboring nodes adjacent to the current node, and determining a first empty space of the candidate neighboring nodes. The number of idle buffer units; based on the first number of idle buffer units, a target neighbor node is determined, and the data packet to be transmitted is sent from the current node to the target neighbor node; the data routing based on the second routing method includes: determining candidate neighbor nodes adjacent to the current node, and candidate indirect neighbor nodes adjacent to the candidate neighbor nodes; determining the second number of idle buffer units of the candidate neighbor nodes and the third number of idle buffer units of the candidate indirect neighbor nodes; determining a candidate path evaluation value based on the second number of idle buffer units and the third number of idle buffer units, determining a target path based on the candidate path evaluation value; and sending the data packet to be transmitted based on the target path.

[0025] In this embodiment, the average hop count of the on-chip network is introduced as a dynamic benchmark. The path distance from the current node to the destination node is compared with this benchmark in real time, enabling flexible switching of routing modes based on the transmission distance. By employing lightweight one-hop awareness for short-distance transmission and enabling forward-looking two-hop awareness for long-distance transmission, differentiated and accurate monitoring of network congestion status is achieved, and path quality is quantified based on the product of the number of idle buffer units. This scheme overcomes the shortcomings of "redundant overhead in short-distance" or "blind congestion avoidance in long-distance" caused by the fixed awareness mode in traditional routing algorithms, effectively reducing the latency and hardware power consumption of routing decisions, and achieving an optimal balance between network throughput and transmission efficiency.

[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0027] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, wherein: In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0028] Figure 1 This paper illustrates an on-chip network block diagram of a data routing method in the prior art provided in an embodiment of this application; Figure 2 This paper illustrates the implementation flow of the data routing method provided in an embodiment of this application. Figure 1 ; Figure 3 This illustration shows an on-chip network implementation diagram of the first routing selection method provided in an embodiment of this application; Figure 4 This illustration shows an on-chip network implementation diagram of the second routing method provided in an embodiment of this application; Figure 5 This paper illustrates the implementation flow of the data routing method provided in an embodiment of this application. Figure 2 ; Figure 6 This illustration shows a schematic diagram of an on-chip network implementation for single-node congestion provided in an embodiment of this application; Figure 7 This illustration shows a schematic diagram of an on-chip network implementation with multiple node congestion provided in an embodiment of this application; Figure 8 A schematic diagram of the composition structure of the data routing device provided in an embodiment of this application is shown; Figure 9 A schematic diagram of the composition structure of the electronic device provided in the embodiments of this application is shown. Detailed Implementation

[0029] To make the objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0030] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0032] It should be understood that in the various embodiments of this application, the sequence number of each implementation process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0033] The data routing method described in this embodiment is applied to an on-chip network (ISP) including multiple routing nodes, which can adopt a two-dimensional mesh topology. Each routing node is connected to its neighboring nodes and to the processor core or functional unit via links to realize the transmission and forwarding of data packets. In this embodiment, the routing node includes an input buffer unit for temporarily storing received data packets; the number of idle input buffer units can be used to characterize the congestion state of the node. The more idle buffer units there are, the less congested the node is, and vice versa. In this embodiment, each operation can be completed by the state detection module and path selection module inside the routing node. Data packets are transmitted from the current node to the next routing node in a hop-by-hop manner until they reach the destination node. Through this embodiment, path congestion can be dynamically determined, congested nodes can be avoided in advance, and the optimal path can be selected, thereby achieving efficient data transmission in the ISP.

[0034] like Figure 1 The diagram shown is an on-chip network block diagram of a data routing method in the prior art provided in this application embodiment. In the prior art, the on-chip network adopts a two-dimensional mesh topology, and each routing node is connected to adjacent nodes and processor cores or functional units through links. After the data packet to be transmitted is generated at the source node, it needs to be transmitted hop-by-hop through several routing nodes to the destination node.

[0035] In existing technologies, routing nodes typically determine congestion by detecting the occupancy of the input buffers of neighboring nodes and select the next-hop node for data forwarding according to fixed rules. After a data packet is transmitted from the current node to the next node, the next node performs the same state detection and routing selection until it reaches the destination node.

[0036] In existing technologies, when a node's input buffer is full or nearly saturated with data packets, the node is considered congested. In this case, data packets need to choose alternative paths to bypass the congested node for forwarding. Existing technologies typically employ fixed detour rules or simple local congestion comparison methods to attempt to avoid congested nodes. However, because existing methods are limited to sensing the state of adjacent nodes, they cannot anticipate potential congestion in subsequent nodes. This means that congested nodes may still be encountered during long-distance transmission, increasing data packet transmission latency. Furthermore, fixed detour strategies lack flexibility when multiple nodes are congested, easily leading to path backtracking or localized load concentration, affecting overall network throughput.

[0037] Furthermore, existing technologies employ the same routing strategy for both short-distance and long-distance transmission, lacking a dynamic adjustment mechanism for different transmission distances. This may generate unnecessary perceived overhead in short-distance scenarios, while failing to prevent subsequent congestion nodes in advance in long-distance scenarios. Therefore, existing data routing methods are insufficient in terms of flexibility and efficiency and require improvement.

[0038] like Figure 2 The diagram shown illustrates the implementation flow of the data routing method provided in this application embodiment. Figure 1 Applied to on-chip networks comprising multiple routing nodes, it includes at least the following steps: Step S101: Determine the path distance from the current node of the data packet to be transmitted to the destination node of the data packet.

[0039] In some embodiments, the current node of the data packet to be transmitted refers to the routing node that makes routing decisions for the data packet in the on-chip network; that is, this node is responsible for determining the next-hop routing path and performing data packet forwarding operations. The data packet to be transmitted refers to a data unit sent from the source node that has not yet reached the destination node, and may contain a payload, destination address information, and control information for routing decisions.

[0040] In some embodiments, determining the path distance from the current node of the data packet to be transmitted to the destination node of the data packet includes: obtaining the coordinates of the current node and the coordinates of the destination node; and calculating the path distance from the current node to the destination node based on the coordinates of the current node and the coordinates of the destination node.

[0041] Specifically, the current node of the data packet to be transmitted first obtains its own coordinates in the on-chip network, as well as the coordinates of the target node. These coordinates can be horizontal and vertical coordinates in a two-dimensional grid, such as the X and Y axes, used to identify the position of each routing node in the grid topology. By obtaining the coordinates of the current node and the destination node, basic data can be provided for subsequent path distance calculations.

[0042] In some embodiments, calculating the path distance from the current node to the destination node based on the coordinates of the current node and the coordinates of the destination node includes: determining a first distance between the current node and the destination node in a first direction and a second distance between the current node and the destination node in a second direction based on the coordinates of the current node and the coordinates of the destination node; and determining the sum of the first distance and the second distance as the path distance from the current node to the destination node.

[0043] Specifically, the first direction can be the [X-axis] direction in the coordinate system, and the second direction can be the [Y-axis] direction in the coordinate system. When calculating the path distance based on the coordinates of the current node and the destination node, the following formula (1) can be used for calculation: (1) in, , The coordinates of the current node. , These are the coordinates of the destination node. The path distance represents the shortest hop count from the current node to the destination node along the grid direction, used to determine whether a data packet is transmitted over a short or long distance.

[0044] Step S102: Obtain the average number of hops corresponding to the on-chip network.

[0045] In some embodiments, the average hop count refers to the average number of hops from any source node to any destination node in the on-chip network, used to characterize the overall transmission distance level of the network. Each routing node can obtain the hop count statistics of all source nodes to destination nodes through network topology information.

[0046] In some embodiments, for an on-chip network with a 2D mesh topology, if the network size is... The average number of jumps can be calculated using the following formula (2): (2) in, This represents the number of horizontal nodes in the grid. This represents the number of nodes in the vertical direction of the grid. The result of this formula represents the average shortest hop count from the source node to the destination node in a two-dimensional grid.

[0047] For example, in a 6×6 on-chip network, based on the above formula (2), the average hop count of this two-dimensional network is 4. This average hop count can be used to compare with the path distance from the current node to the destination node to determine the specific routing strategy.

[0048] In some embodiments, the average hop count can be adjusted based on real-time network conditions: if some nodes or links are unavailable or severely congested, these nodes can be removed from the statistics and the average hop count can be recalculated; the network can be divided into regions, and the local average hop count can be calculated in each region for local routing strategy selection, which can improve the path selection accuracy of long-distance data packets in the case of local congestion.

[0049] Step S103: Compare the path distance and the average hop count. If the path distance is less than or equal to the average hop count, perform data routing based on the first routing method.

[0050] Step S104: If the path distance is greater than the average hop count, perform data routing based on the second routing method.

[0051] In some embodiments, the location of congested nodes is random throughout the network, and each routing node has an equal probability of becoming congested. An appropriate routing method is selected based on the location of the congested node to avoid additional time caused by detection. Specifically, the routing node obtains the calculated path distance based on step S101 and the average network hop count determined in step S102, and then compares the two: If the path distance is less than or equal to the average hop count, the data packet is determined to be a short-distance transmission; if the path distance is greater than the average hop count, the data packet is determined to be a long-distance transmission. This comparison allows for a dynamic determination of whether to use the first or second routing method, providing a basis for subsequent steps.

[0052] In some embodiments, the routing method is selected based on the determination results of steps S103 and S104: If the data packet is determined to be for short-distance transmission, the first routing method is used for data routing; if the data packet is determined to be for long-distance transmission, the second routing method is used for data routing.

[0053] Specifically, the first routing method is a single-hop state detection strategy for short-distance data packets, where the data packet only considers the state of the current node's direct adjacent nodes when selecting a path. The second routing method is a two-hop state detection strategy for long-distance data packets, where the data packet needs to consider the state of the current node's adjacent nodes and its indirect adjacent nodes in the direction towards the destination node when selecting a path, providing more comprehensive information for subsequent path selection.

[0054] In some embodiments, the routing node may record the decision information after selecting the routing method for use by the subsequent path selection module, so as to achieve optimal path selection and congestion avoidance for data packets hop by hop.

[0055] Step S105, data routing based on the first routing selection method includes: determining candidate neighboring nodes adjacent to the current node, determining the first number of free buffer units of the candidate neighboring nodes; determining the target neighboring node based on the first number of free buffer units, and sending the data packet to be transmitted from the current node to the target neighboring node.

[0056] In some embodiments, when the path distance is less than or equal to the average hop count of the on-chip network, a first routing method is used for data routing. This method mainly includes the following processes: In some embodiments, when determining candidate neighboring nodes, the current node does not indiscriminately include all its physical neighboring nodes (such as above, below, left, and right) into the candidate set, but only selects neighboring nodes in the direction of the target node.

[0057] For example, such as Figure 3 The diagram shown is an on-chip network implementation of the first routing method provided in this application embodiment. In this coordinate grid, the source node coordinates are (6, 0), the destination node coordinates are (0, 6), and the current node coordinates are (2, 4). Starting from (2, 4), its physical adjacent nodes include (2, 5), (2, 3), (1, 4), and (3, 4).

[0058] However, based on the location of the destination node (0, 6), only directions that decrease the X coordinate or increase the Y coordinate are valid directions toward the destination node. Therefore, the directions of decreasing Y at coordinate (2, 3) and increasing X at coordinate (3, 4) are excluded. Ultimately, only (2, 5) and (1, 4) are considered as candidate neighboring nodes. This strategy effectively reduces unnecessary direction exploration and improves the targeting and efficiency of routing decisions.

[0059] In some embodiments, the current node sends a cache status query request to each candidate neighboring node through a control signal to read the number of first free cache units in the input buffer of each candidate neighboring node in real time.

[0060] In some embodiments, determining the target neighbor node based on the number of the first free cache units includes: comparing the number of the first free cache units corresponding to each of the candidate neighbor nodes; determining the candidate neighbor node with the largest number of the first free cache units as the target neighbor node; wherein, the number of the first free cache units is used to characterize the congestion level of the candidate neighbor node, and the larger the number of the first free cache units, the smaller the congestion level of the candidate neighbor node.

[0061] Specifically, the "number of free buffer units" here refers to the number of unoccupied storage units in the input buffer. The larger the value, the lower the congestion level of the node, and the smaller the value, the higher the congestion level. This ensures that data packets are preferentially sent to the node with the lowest congestion level, thereby reducing transmission delay.

[0062] After obtaining the number of first free cache units of all candidate neighboring nodes, the current node compares the values ​​and determines the candidate neighboring node with the largest number of first free cache units as the target neighboring node.

[0063] For example, in some embodiments, the first number of free buffer units for candidate node (2, 5) is 6, and the first number of free buffer units for candidate node (1, 4) is 9. The number of free buffer units for coordinate (1, 4) is greater than that for coordinate (2, 5), therefore (1, 4) is selected as the target neighbor node. This mechanism ensures that data packets are preferentially sent to the neighbor node with the lowest congestion, thereby reducing end-to-end transmission latency. Simultaneously, since candidate nodes have been filtered according to destination direction, this selection process combines directionality and congestion awareness for dual optimization.

[0064] In some embodiments, when at least two candidate adjacent nodes have the same number of first free buffer units and both are at their maximum values, the current node may be selected using a preset priority strategy. For example, the node that is closer to the destination node in the X direction may be selected first, or a random selection may be made.

[0065] For example, if the number of first free cache units at coordinates (2, 5) and (1, 4) is both 9, then we can compare their path distances to the destination node (0, 6): According to formula (1), the path distance between (2, 5) is |2-0|+|5-6|=3, and the path distance between (1, 4) is |1-0|+|4-6|=3, which are the same. At this point, one can be randomly selected, or a selection can be made based on historical routing statistics preferences (such as lower congestion frequency in a certain direction). This mechanism ensures that even when the cache states are the same, the routing decision remains deterministic and repeatable.

[0066] In some embodiments, the cache state of the current node is read in real time, rather than being updated in batches periodically, which ensures that routing decisions are based on the latest network state.

[0067] Step S106, data routing based on the second routing method includes: determining candidate neighboring nodes adjacent to the current node, and candidate indirect neighboring nodes adjacent to the candidate neighboring nodes; determining the number of second free buffer units of the candidate neighboring nodes and the number of third free buffer units of the candidate indirect neighboring nodes; determining a candidate path evaluation value based on the number of second free buffer units and the number of third free buffer units; determining a target path based on the candidate path evaluation value; and sending the data packet to be transmitted based on the target path.

[0068] In some embodiments, when the path distance exceeds the average hop count of the on-chip network, a second routing method is used for data routing. This second routing method is based on a multi-dimensional congestion awareness mechanism of "current node - candidate neighbor node - candidate indirect neighbor node." The main process includes determining candidate neighbor nodes and candidate indirect neighbor nodes, constructing candidate paths, calculating path evaluation values, and selecting the optimal path. This process assesses the congestion situation of longer paths to prevent data packets from getting trapped in localized congestion areas.

[0069] In some embodiments, determining a candidate indirect neighbor node adjacent to the candidate neighbor node includes: determining at least one neighboring routing node adjacent to the candidate neighbor node; and determining, from the at least one neighboring routing node, a neighboring routing node in the direction toward the destination node as the candidate indirect neighbor node; wherein the neighboring routing node in the direction toward the destination node is a routing node whose path distance to the destination node is reduced compared to the candidate neighbor node.

[0070] Specifically, when constructing the two-hop perception range, not only do the neighboring nodes of the current node need to be filtered, but the filtering of candidate indirect neighboring nodes also strictly follows the principle of facing the destination node.

[0071] For example, such as Figure 4 The diagram shown is a schematic representation of the on-chip network implementation of the second routing method provided in this application embodiment. Figure 4In the diagram, the current node's coordinates are (6, 0), and the destination node's coordinates are (0, 6). The candidate neighboring nodes of the current node (6, 0) are (5, 0) and (6, 1). Starting from the candidate neighboring node (5, 0), its adjacent nodes include (4, 0) and (5, 1) as indirect candidate neighboring nodes. Starting from the candidate neighboring node (6, 1), its adjacent nodes include (5, 1) and (6, 2) as indirect candidate neighboring nodes. Therefore, for the current node (6, 0), the coordinates of its candidate neighboring nodes are (6, 1) and (5, 0), and the coordinates of its indirect candidate neighboring nodes are (6, 2), (5, 1), and (4, 0). Through this process, the system constructs a forward-looking perception area starting from the current node, covering both one-hop and two-hop directions, with all nodes strictly facing the destination direction. This effectively eliminates invalid detour paths that deviate from the destination node, ensuring that the route always approaches the target.

[0072] In some embodiments, after determining the candidate neighboring nodes (6,1), (5,0) and candidate indirect neighboring nodes (6,2), (5,1), and (4,0), the system will construct complete candidate paths based on these nodes. There are four combinations of candidate paths: (6,0)→(6,1)→(6,2), (6,0)→(6,1)→(5,1), (6,0)→(5,0)→(5,1), and (6,0)→(5,0)→(4,0). Each candidate path consists of a "first path from the current node to the candidate neighboring node" and a "second path from the candidate neighboring node to the candidate indirect neighboring node." The system will then perform subsequent evaluation value calculations and comparisons on these four candidate paths.

[0073] In some embodiments, for each constructed candidate path, the system reads the cache status of each node on the path and calculates the candidate path evaluation value.

[0074] For example, for the four candidate paths mentioned above, the number of second free cache units of the candidate adjacent nodes and the number of third free cache units of the candidate indirect adjacent nodes are read respectively.

[0075] In some embodiments, determining the candidate path evaluation value based on the number of the second free cache units and the number of the third free cache units includes: calculating the product of the number of the second free cache units and the number of the third free cache units; determining the product as the candidate path evaluation value of the candidate path; comparing the product size of each candidate path; and determining the candidate path corresponding to the largest product value as the target path.

[0076] Specifically, taking the above four candidate paths as examples, the second free cache quantity of the candidate adjacent node (6,1) is A1, and that of (5,0) is A2; the third free cache quantity of the candidate indirect adjacent node (6,2) is B1, that of (5,1) is B2, and that of (4,0) is B3. The evaluation value of each candidate path is calculated based on the product of the "second free cache unit quantity" and the "third free cache unit quantity": the evaluation value of candidate path 1 = A1 × B1; the evaluation value of candidate path 2 = A1 × B2; the evaluation value of candidate path 3 = A2 × B1; and the evaluation value of candidate path 4 = A2 × B2.

[0077] In this way, the path's evaluation value comprehensively reflects the congestion status of candidate adjacent nodes and candidate indirect adjacent nodes. The larger the product, the less congested the entire path is.

[0078] In this embodiment, after calculating the evaluation values ​​of all candidate paths, the system compares these evaluation values ​​and selects the optimal path for data transmission. For example, after calculation and comparison, it is found that candidate path 4 has the largest evaluation value (A2×B2), which means that the overall idle degree of the path (6,0)→(5,0)→(4,0) is the highest and the congestion risk is the lowest. Therefore, candidate path 4 is determined as the target path, and the data packet to be transmitted is sent from the current node (6,0) along the target path to (5,0), and then forwarded by (5,0) to (4,0) for routing.

[0079] In some embodiments, when multiple candidate paths have the same evaluation value, the optimal path cannot be directly selected. In this case, the system no longer compares the states of indirectly adjacent nodes, but instead backtracks to compare the number of free buffer units of the candidate adjacent nodes (i.e., the first-hop node) among these candidate paths, and selects the candidate path with the largest number of free buffer units as the target path. This method prioritizes ensuring that the first-hop node has the largest buffer space when the global evaluation value cannot distinguish between good and bad, thereby effectively reducing the queuing delay of data packets at the current node and avoiding potential congestion risks caused by random selection.

[0080] like Figure 5 The diagram shown illustrates the implementation flow of the data routing method provided in this application embodiment. Figure 2 This diagram illustrates the flow of the core routing logic in this application, visually demonstrating the complete closed loop from path distance determination to congestion awareness and path selection. The process specifically includes the following steps: S1: Determine the path distance from the current node to the destination node of the data packet to be transmitted; S2: Obtain the average number of hops for the on-chip network; S3: Compare the path distance and the average number of hops to determine if the path distance is greater than the average number of hops. If not, proceed to step S3a; if so, proceed to step S31. S3a: Determine the number of free buffer units in the candidate adjacent nodes; S3b: Determine if there is a maximum value among the number of free buffer units of the candidate adjacent nodes. If yes, proceed to S3c; otherwise, proceed to S3d. S3c: Determine the candidate neighbor node corresponding to the maximum value as the target neighbor node for data routing; S3d: Randomly select a candidate neighbor node as the target neighbor node for data routing; S31: Determine the number of free buffer units for candidate adjacent nodes and candidate indirect adjacent nodes, and calculate their product. S32: Determine if there is a maximum value in the product. If yes, proceed to S33; otherwise, proceed to S3b. S33: Use the path formed by the candidate adjacent nodes and candidate indirect adjacent nodes corresponding to the maximum product as the target path for data routing; S4: Determine whether the data packet to be transmitted has arrived at the destination node from the current node. If yes, the data routing task is completed and the process ends; otherwise, the process returns to S1 and the routing calculation process is re-executed at the new current node until the data packet is successfully delivered.

[0081] pass Figure 5 The process shown implements an adaptive routing mechanism that dynamically switches the sensing mode based on the transmission distance, effectively balancing the overhead and accuracy of routing decisions.

[0082] In some embodiments, congestion may occur at one or more nodes during the routing process. The system identifies the congestion state by monitoring the number of idle buffer units of nodes in real time and adopts corresponding detour strategies to ensure that data packets can successfully reach the destination node.

[0083] In some embodiments, when a single node in the routing path becomes congested, the system treats the number of free buffer units of that congested node as zero, thereby automatically excluding that node during the path selection process.

[0084] like Figure 6The diagram illustrates a single-node congestion implementation of an on-chip network according to an embodiment of this application. Assuming the current node is (3,2) and the destination node is (0,6), the normal shortest path should be (3,2) → (3,3) → ... However, the system detects that the routing node (3,3) is congested, with zero free buffer units in its input buffer. This node is therefore deemed an unselectable path. In this case, the system automatically selects other non-congested candidate neighbor nodes, such as (2,2), as the target neighbor node, thus executing the route (3,2) → (2,2).

[0085] Similarly, if the current node is (4,3) and node (3,3) is congested, the system will select (4,4) as the next hop, that is, execute the route (4,3) → (4,4).

[0086] By setting congested nodes to zero, the system can intelligently and automatically bypass congested nodes, avoiding unnecessary queuing of data packets at congested nodes and thus speeding up the data transmission process.

[0087] In some embodiments, when multiple consecutive congested nodes appear in the routing path, normal forward routing may fail. In this case, the system may select a path that is not towards the destination node for backhaul by comparing the number of free buffer units, thereby enabling detours around the multiple congested nodes.

[0088] like Figure 7 The diagram shown is a schematic of the implementation of a network-on-chip with multiple congested nodes provided in this application embodiment. It is assumed that the current node is (4,3), and its two candidate adjacent nodes (3,3) and (4,4) facing the destination node are both in a congested state.

[0089] In this situation, the system detects that all candidate nodes "towards the destination node" are unavailable. It then expands the selection to include adjacent nodes "not towards the destination node." For example, the current node (4,3) can choose (4,2) or (5,3) as the fallback node. Although this temporarily increases the path distance, it successfully bypasses the congested area formed by (3,3) and (4,4).

[0090] In rare, extreme cases, if all neighboring nodes of the current node (including those facing and not facing the destination node) are congested, the system will control the data packets to be transmitted to wait at the current node. The data packets will remain in the current node's input buffer and will not be forwarded until at least one neighboring node releases a free buffer unit, at which point a routing decision will be made.

[0091] By combining the above-mentioned backhaul detour and in-place waiting strategies, this application can effectively cope with complex multi-node congestion scenarios and ensure that the network maintains connectivity to the maximum extent without deadlock.

[0092] Through the above embodiments of this application, an intelligent data routing scheme for on-chip networks is provided. This application breaks through the rigidity of traditional routing algorithm perception modes by introducing the average hop count as a dynamic benchmark in the on-chip network, realizing a flexible mechanism that dynamically switches between one-hop and two-hop perception based on the transmission distance. For short-distance transmission, lightweight one-hop perception is used, effectively avoiding the additional latency and hardware overhead caused by long-distance perception. For long-distance transmission, forward-looking two-hop perception is enabled, combined with the product operation of the number of idle buffer units and the adjacent node judgment mechanism, achieving accurate prediction of downstream congestion risk and path optimization. Furthermore, by setting the idle buffer of congested nodes to zero and supporting backhaul detour strategies, this application can intelligently handle complex congestion scenarios with single or multiple nodes, avoiding the risk of blindly waiting for data packets in hotspot areas and deadlock. In summary, this application significantly optimizes the accuracy and efficiency of routing decisions while ensuring network connectivity, achieving the best balance between network throughput and transmission latency.

[0093] like Figure 8 The diagram shown is a schematic representation of the structure of a data routing device provided in an embodiment of this application. The data routing device 800 includes at least: The distance determination module 801 is used to determine the path distance from the current node of the data packet to be transmitted to the destination node of the data packet; The average hop count acquisition module 802 is used to acquire the average hop count corresponding to the on-chip network; The routing module 803 is used to compare the path distance and the average hop count. If the path distance is less than or equal to the average hop count, data routing is performed based on a first routing method; if the path distance is greater than the average hop count, data routing is performed based on a second routing method. The routing module 803 includes a first routing unit 804 and a second routing unit 805. The first routing unit 804 is used to determine candidate neighboring nodes adjacent to the current node, determine the number of first free buffer units of the candidate neighboring nodes, determine the target neighboring node based on the number of first free buffer units, and send the data packet to be transmitted from the current node to the target neighboring node; The second routing unit 805 is used to determine candidate neighboring nodes adjacent to the current node, and candidate indirect neighboring nodes adjacent to the candidate neighboring nodes; determine the number of second free buffer units of the candidate neighboring nodes and the number of third free buffer units of the candidate indirect neighboring nodes; determine a candidate path evaluation value based on the number of second free buffer units and the number of third free buffer units; determine a target path based on the candidate path evaluation value; and send the data packet to be transmitted based on the target path.

[0094] In some embodiments, the distance determination module 801 is specifically used for: Obtain the coordinates of the current node and the coordinates of the destination node; calculate the path distance from the current node to the destination node based on the coordinates of the current node and the coordinates of the destination node.

[0095] In some embodiments, the distance determination module 801 is further configured to: Based on the coordinates of the current node and the coordinates of the destination node, determine the first distance between the current node and the destination node in a first direction, and the second distance between the current node and the destination node in a second direction; determine the sum of the first distance and the second distance as the path distance from the current node to the destination node.

[0096] In some embodiments, the first routing unit 804 is specifically used for: The number of first free cache units corresponding to each candidate neighbor node is compared; the candidate neighbor node with the largest number of first free cache units is determined as the target neighbor node; wherein, the number of first free cache units is used to characterize the congestion level of the candidate neighbor node, and the larger the number of first free cache units, the smaller the congestion level of the candidate neighbor node.

[0097] In some embodiments, the second routing unit 805 is specifically used for: Based on each candidate neighbor node and each candidate indirect neighbor node, at least one candidate path is determined; wherein each candidate path includes a first path from the current node to the candidate neighbor node and a second path from the candidate neighbor node to the candidate indirect neighbor node; for each candidate path, a candidate path evaluation value is determined based on the second number of free cache units and the third number of free cache units; the candidate path evaluation values ​​corresponding to each candidate path are compared, and the candidate path with the largest evaluation value is determined as the target path.

[0098] In some embodiments, the second routing unit 805 is further configured to: Calculate the product of the number of the second free cache units and the number of the third free cache units; determine the product as the candidate path evaluation value of the candidate path; compare the product size of each candidate path; and determine the candidate path corresponding to the largest product value as the target path.

[0099] In some embodiments, the second routing unit 805 is further configured to: Identify at least one adjacent routing node that is adjacent to the candidate adjacent node; from the at least one adjacent routing node, identify the adjacent routing node that faces the destination node as the candidate indirect adjacent node; wherein, the adjacent routing node facing the destination node is: a routing node whose path distance to the destination node is reduced compared to the candidate adjacent node.

[0100] like Figure 9 The diagram shown is a schematic representation of the structural composition of an electronic device provided in an embodiment of this application, illustrating a schematic block diagram of an example electronic device 900 that can be used to implement embodiments of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.

[0101] like Figure 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory 902 or a computer program loaded from a storage unit 908 into a random access memory 903. The random access memory 903 may also store various programs and data required for the operation of the electronic device 900. The computing unit 901, the read-only memory 902, and the random access memory 903 are interconnected via a bus 904. An input / output interface 905 is also connected to the bus 904.

[0102] Multiple components in electronic device 900 are connected to input / output interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows electronic device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0103] The computing unit 901 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit, a graphics processing unit, various special-purpose artificial intelligence computing chips, various computing units running machine learning model algorithms, digital signal processors, and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as data routing methods. For example, in some embodiments, the data routing method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 900 via read-only memory 902 and / or communication unit 909. When the computer program is loaded into random access memory 903 and executed by the computing unit 901, one or more steps of the data routing method described above can be performed. Alternatively, in other embodiments, the computing unit 901 can be configured to perform the data routing method by any other suitable means (e.g., by means of firmware).

[0104] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays, application-specific integrated circuits (ASICs), application-specific standard products (ASICs), systems-on-a-chip (SoCs), complex programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0105] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0106] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0107] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0108] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0109] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.

[0110] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0111] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data routing method, characterized in that, The method is applied to an on-chip network including multiple routing nodes, and the data routing method includes: Determining the path distance from the current node of the data packet to be transmitted to the destination node of the data packet includes: obtaining the coordinates of the current node and the coordinates of the destination node; determining a first distance between the current node and the destination node in a first direction and a second distance between the current node and the destination node in a second direction based on the coordinates of the current node and the coordinates of the destination node; and determining the sum of the first distance and the second distance as the path distance from the current node to the destination node. Obtain the average hop count corresponding to the on-chip network; Compare the path distance with the average hop count, and if the path distance is less than or equal to the average hop count, perform data routing based on the first routing method. If the path distance is greater than the average number of hops, data routing is performed based on the second routing method. The data routing based on the first routing selection method includes: determining candidate neighboring nodes adjacent to the current node, determining the number of first free buffer units of the candidate neighboring nodes; determining the target neighboring node based on the number of first free buffer units, and sending the data packet to be transmitted from the current node to the target neighboring node; The data routing based on the second routing selection method includes: determining candidate neighboring nodes adjacent to the current node, and candidate indirect neighboring nodes adjacent to the candidate neighboring nodes; determining the number of second free buffer units of the candidate neighboring nodes and the number of third free buffer units of the candidate indirect neighboring nodes; determining a candidate path evaluation value based on the number of second free buffer units and the number of third free buffer units; determining a target path based on the candidate path evaluation value; and sending the data packet to be transmitted based on the target path. The step of determining a candidate path evaluation value based on the number of the second and third free cache units, and determining a target path based on the candidate path evaluation value, includes: Based on each candidate neighbor node and each candidate indirect neighbor node, at least one candidate path is determined; wherein each candidate path includes a first path from the current node to the candidate neighbor node and a second path from the candidate neighbor node to the candidate indirect neighbor node; for each candidate path, the product of the number of the second free cache units and the number of the third free cache units is calculated; the product is determined as the candidate path evaluation value; the candidate path evaluation values ​​corresponding to each candidate path are compared, and the candidate path with the largest candidate path evaluation value is determined as the target path.

2. The method according to claim 1, characterized in that, The step of determining the target neighbor node based on the number of the first free cache units includes: Compare the size of the number of first free cache units corresponding to each of the candidate adjacent nodes; The candidate neighbor node with the largest number of first free cache units is determined as the target neighbor node; The number of the first free cache units is used to characterize the congestion level of the candidate neighboring nodes. The larger the number of the first free cache units, the smaller the congestion level of the candidate neighboring nodes.

3. The method according to claim 1, characterized in that, Determining candidate indirect neighbor nodes adjacent to the candidate neighbor nodes includes: Determine at least one adjacent routing node that is adjacent to the candidate adjacent node; From the at least one adjacent routing node, determine the adjacent routing node facing the destination node as the candidate indirect adjacent node; The adjacent routing nodes facing the destination node are: routing nodes whose path distance to the destination node is reduced compared to the candidate adjacent nodes.

4. A data routing device, characterized in that, The data routing device, applied to an on-chip network including multiple routing nodes, comprises: The distance determination module is used to determine the path distance from the current node of the data packet to be transmitted to the destination node of the data packet; The distance determination module is specifically used to obtain the coordinates of the current node and the coordinates of the destination node; determine a first distance between the current node and the destination node in a first direction and a second distance between the current node and the destination node in a second direction based on the coordinates of the current node and the destination node; and determine the sum of the first distance and the second distance as the path distance from the current node to the destination node. The average hop count acquisition module is used to acquire the average hop count corresponding to the on-chip network; The routing module is used to compare the path distance with the average hop count. If the path distance is less than or equal to the average hop count, data routing is performed based on a first routing method; if the path distance is greater than the average hop count, data routing is performed based on a second routing method. The routing module includes a first routing unit and a second routing unit. The first routing unit is configured to determine candidate neighboring nodes adjacent to the current node, determine the number of first free buffer units of the candidate neighboring nodes, determine the target neighboring node based on the number of first free buffer units, and send the data packet to be transmitted from the current node to the target neighboring node. The second routing unit is configured to: determine candidate neighboring nodes adjacent to the current node, and candidate indirect neighboring nodes adjacent to the candidate neighboring nodes; determine the number of second free buffer units of the candidate neighboring nodes and the number of third free buffer units of the candidate indirect neighboring nodes; determine a candidate path evaluation value based on the number of second free buffer units and the number of third free buffer units; determine a target path based on the candidate path evaluation value; and send the data packet to be transmitted based on the target path. The second routing unit is specifically configured to determine at least one candidate path based on each candidate neighbor node and each candidate indirect neighbor node; wherein each candidate path includes a first path from the current node to the candidate neighbor node and a second path from the candidate neighbor node to the candidate indirect neighbor node; for each candidate path, the product of the number of the second free cache units and the number of the third free cache units is calculated; the product is determined as the candidate path evaluation value; the candidate path evaluation values ​​corresponding to each candidate path are compared, and the candidate path with the largest candidate path evaluation value is determined as the target path.

5. The apparatus according to claim 4, characterized in that, The first routing unit is specifically used for: Compare the size of the number of first free cache units corresponding to each of the candidate adjacent nodes; The candidate neighbor node with the largest number of first free cache units is determined as the target neighbor node; The number of the first free cache units is used to characterize the congestion level of the candidate neighboring nodes. The larger the number of the first free cache units, the smaller the congestion level of the candidate neighboring nodes.

6. The apparatus according to claim 4, characterized in that, The second routing unit is further configured to: Determine at least one adjacent routing node that is adjacent to the candidate adjacent node; From the at least one adjacent routing node, determine the adjacent routing node facing the destination node as the candidate indirect adjacent node; The adjacent routing nodes facing the destination node are: routing nodes whose path distance to the destination node is reduced compared to the candidate adjacent nodes.

7. An electronic device, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the data routing method of any one of claims 1-3.

8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to execute the data routing method according to any one of claims 1-3.

Citation Information

Patent Citations

  • Network-on-chip routing method and device, storage medium and electronic equipment

    CN120151265A

  • Network-on-chip routing method and device, routing node, equipment, medium and product

    CN120881032A