Disclosure of Invention
In view of the above, the present invention provides a data transmission method, apparatus, computer device, storage medium and program product, so as to solve the problem that when a certain data path in a binary tree routing topology fails, the whole transmission system may fail.
In a first aspect, the present invention provides a data transmission method, the method comprising:
When target data is transmitted through a target topology network, determining a current sub-topology network corresponding to the target data in the target topology network, wherein the target topology network comprises a plurality of layers of routing nodes connected according to a binary tree structure, adjacent routing nodes in each layer of routing nodes in the binary tree structure are in communication connection, and the adjacent routing nodes are in communication connection with the corresponding routing nodes in adjacent layers of the target topology network so as to form a ring-shaped sub-topology network;
determining a target transmission path corresponding to the target data in the sub-topology network based on the output port corresponding to the target data in the target topology network;
And transmitting the target data according to the target transmission path.
In an alternative embodiment, determining, in the sub-topology network, a target transmission path corresponding to the target data based on an output port corresponding to the target data in the target topology network, includes:
Obtaining a routing vector of an input node and an output port corresponding to target data in a current sub-topology network;
Determining the transmission direction of the target data based on the comparison result of the routing vectors;
And determining a target transmission path meeting the transmission distance condition from the transmission paths to be selected, which are matched with the transmission direction.
In the embodiment of the invention, the transmission direction of the target data can be determined based on the comparison result between the preset digits of the routing vectors of the input node and the output port, and the transmission path to be selected with the shortest transmission distance in the transmission direction is determined as the target transmission path, so that the data transmission efficiency of the system is improved.
In an alternative embodiment, determining the transmission direction of the target data based on the comparison result of the routing vectors includes:
determining whether preset digits of the routing vectors are equal;
If yes, determining the transmission direction of the target data as data downlink, wherein the data downlink indicates that the level of the corresponding output node in the current sub-topology network is lower than that of the input node;
if not, determining the transmission direction of the target data as non-data downlink, wherein the data downlink indicates that the hierarchy of the corresponding output node in the current sub-topology network is not lower than the input node.
In the embodiment of the invention, the transmission direction of the target data can be determined based on the comparison result between the preset digits of the routing vectors of the input node and the output port, and the transmission path to be selected with the shortest transmission distance in the transmission direction is determined as the target transmission path, so that the data transmission efficiency of the system is improved.
In an alternative embodiment, the method further comprises:
Determining a target level corresponding to a current routing node where target data are located in a target topology network;
And determining a preset bit number corresponding to the target level based on the association information, wherein the association information is used for indicating the association relation between different levels and the corresponding preset bit number in the target topology network.
In the embodiment of the invention, the transmission direction of the target data can be determined based on the comparison result between the preset digits of the routing vectors of the input node and the output port, and the transmission path to be selected with the shortest transmission distance in the transmission direction is determined as the target transmission path, so that the data transmission efficiency of the system is improved.
In an alternative embodiment, determining a target transmission path that satisfies a transmission distance condition among the candidate transmission paths that match the transmission direction includes:
acquiring an occupiable value of the transmission path to be selected, wherein the occupiable value is used for indicating the occupancy state of the transmission path to be selected;
ordering the occupied positions of the occupiable values based on the transmission distance corresponding to the transmission path to be selected to obtain a path state vector;
and searching the target transmission path with the occupied state being unoccupied in the path state vector based on a preset searching order.
In the embodiment of the invention, the occupied states of the transmission paths to be selected of the sub-topology network can be managed through the path state management module, so that the target transmission path is locked, and the system operation fault caused by data collision is avoided.
In an alternative embodiment, the transmission distance of the transmission path to be selected corresponding to the occupiable value in the path state vector is in direct proportion to the number of bits occupied by the occupiable value.
In the embodiment of the invention, the occupied states of the transmission paths to be selected of the sub-topology network can be managed through the path state management module, so that the target transmission path is locked, and the system operation fault caused by data collision is avoided.
In an alternative embodiment, the occupiable values include a first value and a second value, wherein the first value is used for indicating that the occupied state of the transmission path to be selected is unoccupied, and the second value is used for indicating that the occupied state of the transmission path to be selected is occupied;
Searching the target transmission path with the occupied state being unoccupied in the path state vector based on a preset searching order comprises the following steps:
searching a first transmission path to be selected, which can occupy a first value, in the path state vector based on a preset searching order to obtain a target transmission path.
In the embodiment of the invention, the occupied states of the transmission paths to be selected of the sub-topology network can be managed through the path state management module, so that the target transmission path is locked, and the system operation fault caused by data collision is avoided.
In an alternative embodiment, transmitting the target data according to the target transmission path includes:
Acquiring occupancy information, wherein the occupancy information is used for identifying the occupancy state of each transmission path to be selected in the current sub-topology network;
Updating the occupied state corresponding to the target transmission path in the occupied information to be occupied, and executing the transmission operation of the target data through the target transmission path.
In the embodiment of the invention, the occupied states of the transmission paths to be selected of the sub-topology network can be managed through the path state management module, so that the target transmission path is locked, and the system operation fault caused by data collision is avoided.
In an alternative embodiment, the method further comprises:
acquiring accompanying information corresponding to a current sub-topology network, wherein the accompanying information is used for indicating the transmission condition of target data in a target transmission path;
and monitoring the current routing node of the target data in the target transmission path in real time, and updating the accompanying information based on the current routing node.
In the embodiment of the invention, the route direction management unit can update the accompanying information of the target data when the target data is transmitted in the target transmission path, so that the target data is correctly routed to the target routing node or the output port.
In an alternative embodiment, monitoring, in real time, a current routing node where the target data is located in the target transmission path, and updating the accompanying information based on the current routing node, includes:
Determining the number of paths of remaining sub-paths based on the transmission directions of the current routing node and the target data, and acquiring node identifiers of the current routing node, wherein the remaining sub-paths are used for indicating transmission paths between remaining adjacent routing nodes for transmitting the target data in the sub-topology network;
the accompanying information is updated based on the number of paths and the node identification.
In the embodiment of the invention, the route direction management unit can update the accompanying information of the target data when the target data is transmitted in the target transmission path, so that the target data is correctly routed to the target routing node or the output port.
In an alternative embodiment, the method further includes transmitting the target data according to the target transmission path, and further including:
When the target transmission path comprises a plurality of path nodes, determining a to-be-selected routing node of the next hop based on the current routing node where the target data is located;
And determining a target routing node meeting transmission conditions in the routing nodes to be selected so as to transmit target data through the target routing node, wherein the target routing node is used for indicating the routing nodes which do not transmit the target data in the routing nodes to be selected.
In the embodiment of the invention, the companion information in the current sub-topology network can be queried through the companion information management unit, so that the target routing node which does not transmit the target data is determined from the routing nodes to be selected, and the phenomenon of data reflux in the system is prevented.
In a second aspect, the present invention provides a data transmission apparatus, the apparatus comprising:
a first determining module, configured to determine, when target data is transmitted through a target topology network, a current sub-topology network corresponding to the target data in the target topology network, where the target topology network includes multiple layers of routing nodes connected according to a binary tree structure, adjacent routing nodes in each layer of routing nodes are communicatively connected, and the adjacent routing nodes are communicatively connected with corresponding routing nodes in adjacent layers of the target topology network, so as to form a ring-shaped sub-topology network;
the second determining module is used for determining a target transmission path corresponding to the target data in the sub-topology network based on the output port corresponding to the target data in the target topology network;
And the transmission module is used for transmitting the target data according to the target transmission path.
In a third aspect, the present invention provides a computer device comprising a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to thereby perform the data transmission method of the first aspect or any of its corresponding embodiments.
In a fourth aspect, the present invention provides a computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the data transmission method of the first aspect or any of its corresponding embodiments.
In a fifth aspect, the present invention provides a computer program product comprising computer instructions for causing a computer to perform the data transmission method of the first aspect or any of its corresponding embodiments.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The application scenario is described herein in connection with an application scenario on which execution of a data transmission method depends.
The topology of a computer network refers to the abstract connection mode revealed by various network devices (such as routers, switches, etc.) in the network, including computers, to implement network interconnection. Of interest to computer network topologies is the connection relationship and the diagrammatic representation thereof, and is not concerned with the various details of the connected computers or devices, wherein nodes are primarily the various active devices connected in the network, and thus, the computer network topology is composed of nodes and links.
Specifically, as shown in fig. 1, a schematic diagram of a network topology structure in a related data transmission scheme is shown, where the network topology structure is a binary tree routing topology structure, in the binary tree routing topology structure, a connection line between each node is unique, that is, a data transmission path between any two input/output ports is fixed, so when a unique path between nodes is occupied by a certain data transmission task, other data transmission that needs to pass through the path will be blocked at this time, and transmission between data packets has a serious inter-restriction relationship, which will seriously affect transmission efficiency of the system. In addition, when a data path in the topology fails, the entire transmission system may fail.
For example, as shown in fig. 1, when the input port 0 initiates data transmission to the output port 15, only one corresponding routing path is defined as the input port 0-1 level routing node 0-2 level routing node 0-3 level routing node 0-2 level routing node 1-1 level routing node 3-output port 15. During the data transmission process, the path is locked, and if the rest data packets need to use the path of the level 1 routing node 3-2 routing node 1, the data packets will be blocked, so as to affect the transmission efficiency of the system. In addition, if the route node 0 of the route 2 level to the route node 0 of the route 3 level fails, the data transmission will fail, and the data transmitted by using the route in the system will be affected, so that the whole transmission system will fail.
Based on the above, the embodiment of the invention provides a data transmission method, which can determine a current sub-topology network corresponding to target data in a target topology network when the target data is transmitted through the target topology network, wherein the target topology network comprises a plurality of layers of routing nodes connected according to a binary tree structure, adjacent routing nodes in each layer of routing nodes in the binary tree structure are in communication connection, and the adjacent routing nodes are in communication connection with corresponding routing nodes in adjacent layers of the target topology network so as to form a ring-shaped sub-topology network. Then, based on the output port corresponding to the target data in the target topology network, the target transmission path corresponding to the target data is determined in the sub topology network, and the target data is transmitted according to the target transmission path, so that the topology network of the binary tree structure is improved, compared with the traditional binary tree structure, the transmission path selection in the data transmission process is increased, and the transmission efficiency and the stability of the system are improved.
According to an embodiment of the present invention, there is provided a data transmission method embodiment, it being noted that the steps shown in the flowcharts of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that herein.
In this embodiment, a data transmission method is provided, which may be used in the computer network, and fig. 2 is a flowchart of the data transmission method according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
Step S201, when transmitting target data through a target topology network, determining a current sub-topology network corresponding to the target data in the target topology network, wherein the target topology network comprises a plurality of layers of routing nodes connected according to a binary tree structure, adjacent routing nodes in each layer of routing nodes in the binary tree structure are in communication connection, and the adjacent routing nodes are in communication connection with the corresponding routing nodes in adjacent layers of the target topology network so as to form a ring-shaped sub-topology network.
In the embodiment of the present invention, as shown in fig. 3, the structure schematic diagram of the target topology network is shown, where the target data may include data packets transmitted in the target topology network, and in the target topology network, adjacent routing nodes of each layer are connected by links in pairs, and in the target topology network, each pair of adjacent routing nodes and the routing node connected in the previous layer form a ring sub-topology network, for example, the sub-topology network 1 in fig. 3 includes a level 1 routing node 0, a level 1 routing node 1 and a level 2 routing node 0.
When determining the current sub-topology network, the sub-topology network corresponding to the current routing node where the target data is located may be determined as the current sub-topology network. For example, when the routing node where the target data is currently located is level 1 routing node 0, the current sub-topology network corresponding to the target data is the above sub-topology network 1.
Step S202, determining a target transmission path corresponding to the target data in the sub-topology network based on the output port corresponding to the target data in the target topology network.
Step S203, transmitting the target data according to the target transmission path.
In the embodiment of the invention, firstly, the transmission direction of the target data in the current sub-topology network can be determined based on the corresponding output port of the target data in the target topology network and the current routing node, so as to determine the transmission path to be selected, which is matched with the transmission direction, in the current sub-topology network.
For example, if the current sub-topology network in which the target data is located is the sub-topology network 1, the current routing node is the level 1 routing node 0, and the output port is the output port 11 in fig. 3, the transmission direction should be the data uplink, and at this time, it can be determined that the corresponding target routing node of the target data in the current sub-topology network is the node located in the previous level, that is, the level 2 routing node 0.
Next, a transmission path to be selected, that is, a transmission path 1 and a transmission path 2, where the path end point is the target routing node may be determined in the sub-topology network 1, where the transmission path 1 is a level 1 routing node 0-1 routing node 1-2 routing node 0, and the transmission path 2 is a level 1 routing node 0-2 routing node 0.
After determining the transmission path to be selected, the shortest transmission path to be selected, namely the transmission path 2, may be determined as a target transmission path to improve data transmission efficiency, and it should be understood that if the transmission path 2 is occupied at this time, an idle transmission path, namely the transmission path 1, may be determined as a target transmission path, so as to avoid data blocking.
As can be seen from the foregoing description, in the embodiment of the present invention, when transmitting the target data through the target topology network, the current sub-topology network corresponding to the target data may be determined in the target topology network, where the target topology network includes multiple layers of routing nodes connected according to a binary tree structure, and adjacent routing nodes in each layer of routing nodes in the binary tree structure are communicatively connected, and the adjacent routing nodes are communicatively connected with corresponding routing nodes in adjacent layers of the target topology network, so as to form a ring-shaped sub-topology network. Then, based on the output port corresponding to the target data in the target topology network, the target transmission path corresponding to the target data is determined in the sub topology network, and the target data is transmitted according to the target transmission path, so that the topology network of the binary tree structure is improved, compared with the traditional binary tree structure, the transmission path selection in the data transmission process is increased, and the transmission efficiency and the stability of the system are improved.
In this embodiment, another data transmission method is provided, which may be used in the computer network, and fig. 4 is a flowchart of another data transmission method according to an embodiment of the present invention, as shown in fig. 4, where the flowchart includes the following steps:
Step S401, when transmitting the target data through the target topology network, determining a current sub-topology network corresponding to the target data in the target topology network, wherein the target topology network comprises a plurality of layers of routing nodes connected according to a binary tree structure, and adjacent routing nodes in each layer of routing nodes in the binary tree structure are in communication connection, and the adjacent routing nodes are in communication connection with the corresponding routing nodes in adjacent layers of the target topology network so as to form a ring-shaped sub-topology network. Please refer to step S201 in the embodiment shown in fig. 1 in detail, which is not described herein.
Step S402, determining a target transmission path corresponding to the target data in the sub-topology network based on the output port corresponding to the target data in the target topology network.
Specifically, the step S402 includes:
Step S4021, obtaining a routing vector of the target data at the input node and the output port corresponding to the current sub-topology network.
In step S4022, the transmission direction of the target data is determined based on the comparison result of the routing vectors.
Step S4023, determining a target transmission path satisfying the transmission distance condition among the transmission paths to be selected which match the transmission direction.
In the embodiment of the invention, the transmission direction of the target data can be determined by the routing direction selection unit so as to determine the transmission path to be selected, which is matched with the transmission direction, in the current sub-topology network. Here, the transmission direction may be determined according to a routing vector of the target data at an input node corresponding to the current sub-topology network and an output port, where the input node is a current routing node where the target data is located in the current sub-topology network, and the output port is a destination port where the target data is to arrive in the target topology network.
For example, if the input port of the target data is the input port 1 in fig. 3, the target data needs to be routed to the output port 11, and if the target data is transmitted to the sub-topology network 1, the input node is the level 1 routing node 1, and the destination port to be reached is the output port 11.
After determining the input node and the output port, the routing vector of the input node and the output port may be obtained, where, for the target topology network including 32 input/output ports in total, the number of bits of the routing vector may be a 5-bit binary number set, so that the routing vector may be used to represent the input/output ports from 0 to 32.
It should be understood that in the target topology network described above, the level 1 routing nodes are numbered 0-7, and thus, the routing vectors of the level 1 routing nodes 0-1 routing node 7 can be represented as 00000, 00100, 01000, 0110000, 10000, 10100, 11000, 11100 in order. Similarly, the level 2 routing nodes are numbered 0-3, so that the routing vectors of the level 2 routing nodes 0-2 routing node 3 can be expressed as 00000, 01000, 10000, 11000 in sequence. Similarly, the 3-level routing nodes are numbered 0-1, and thus, the routing vectors of the 3-level routing nodes 0-3-level routing node 1 can be expressed as 00000 and 10000 in sequence. In addition, the transmission direction of the level 4 routing node is set to be downward only, and thus a routing vector may not be set for the level 4 routing node.
Next, the step S4022 may be executed, where the transmission direction of the target data is determined based on the comparison result of the routing vectors of the input node and the output port, and the step S4022 includes:
Step a1, determining whether preset digits of the routing vectors are equal, if yes, executing step a1, and if not, executing step a2.
And a step a1, determining the transmission direction of the target data as data downlink, wherein the data downlink indicates that the hierarchy of the corresponding output node in the current sub-topology network is lower than that of the input node.
And a2, determining the transmission direction of the target data as non-data downlink, wherein the data downlink indicates that the hierarchy of the corresponding output node in the current sub-topology network is not lower than the input node.
In the embodiment of the present invention, the data transmission direction may be divided into data downlink and data non-downlink, where the data non-downlink may include data uplink. Here, the data downstream is used to indicate that the target data is transmitted from a higher level routing node to a lower level routing node, for example, from a 3-level routing node to a 2-level routing node. The data uplink is used to indicate that the target data is transmitted from a low-level routing node to a high-level routing node, for example, from a level 2 routing node to a level 3 routing node.
Here, it may be determined whether the preset number of bits of the routing vector are equal through the above step a1 to determine the transmission direction of the target data, and the step a1 includes:
(1) And determining a target level corresponding to the current routing node where the target data is located in the target topology network.
(2) And determining a preset bit number corresponding to the target level based on the association information, wherein the association information is used for indicating the association relation between different levels and the corresponding preset bit number in the target topology network.
In the embodiment of the present invention, the number of preset bits corresponding to routing nodes of different levels may be different, so that an association relationship between the routing levels and the preset bits may be pre-established, specifically, for a level 1 routing node, the preset bits may be set to be the upper 3 bits of the routing vector, that is, the first 3 bits from left to right in the routing vector, when determining the transmission direction of the target data, the upper 3 bits of the routing vector corresponding to the input node may be compared with the upper 3 bits of the routing vector of the output port, and if the upper 3 bits are the same, the transmission direction is indicated as the target data downlink via the input node, otherwise, the data uplink.
Similarly, for the 2-level routing node, when determining the transmission direction of the target data, the upper 2 bits of the routing vector corresponding to the input node may be compared with the upper 2 bits of the routing vector of the output port, if the two bits are the same, the transmission direction is indicated to be the target data downlink through the input node, otherwise, the data uplink is indicated. In addition, for the 3-level routing node, when determining the transmission direction of the target data, the highest bit of the routing vector corresponding to the input node may be compared with the highest bit of the routing vector of the output port, if the highest bit of the routing vector is the same, the transmission direction is the target data downlink through the input node, otherwise, the data uplink is performed.
It should be understood that for a level 4 routing node, the data transmission direction can only be downstream via that routing node.
For example, as shown in fig. 5, a schematic diagram of determining a transmission direction of target data is shown, wherein if the target data is transmitted to the sub-topology network 1, the input node is the level 1 routing node 1, the destination port to be reached is the output port 11, the routing vector corresponding to the input node is 00001, and the routing vector corresponding to the output port 11 is 01011.
Here, the target level corresponding to the input node is a level 1 routing node, the preset number of bits corresponding to the level 1 routing node is the upper 3 bits of the routing vector, as can be seen from fig. 5, if the routing vectors of the input node and the output port are three higher bits and are not equal, the transmission direction of the target data is the non-data downlink.
In fig. 5, in the sub-topology network 1, the target routing node matched with the non-data downlink transmission direction may be a level 2 routing node 0, the transmission path to be selected matched with the target routing node may be a transmission path to be selected 1:1 level routing node 0-1 level routing node 1-2 level routing node 0, and a transmission path to be selected 2:1 level routing node 0-2 level routing node 0.
Next, a target transmission path of the transmission distance condition may be determined from among the determined transmission paths to be selected. Specifically, the transmission paths to be selected may be ordered according to the transmission distances, so that the transmission path to be selected with the shortest transmission distance is determined as the target transmission path. Here, the level 1 routing node 0 to the level 2 routing node 0 may be determined as the target transmission path.
Step S403, transmitting the target data according to the target transmission path. Please refer to step S203 in the embodiment shown in fig. 1 in detail, which is not described herein.
In the embodiment of the invention, the transmission direction of the target data can be determined based on the comparison result between the preset digits of the routing vectors of the input node and the output port, and the transmission path to be selected with the shortest transmission distance in the transmission direction is determined as the target transmission path, so that the data transmission efficiency of the system is improved.
In some optional embodiments, step S4023 described above, determining, among the transmission paths to be selected that match the transmission direction, a target transmission path that satisfies the transmission distance condition, includes:
And b1, acquiring an occupiable value of the transmission path to be selected, wherein the occupiable value is used for indicating the occupancy state of the transmission path to be selected.
And b2, sorting the occupied positions of the occupiable values based on the transmission distance corresponding to the transmission path to be selected, and obtaining a path state vector.
And b3, searching the target transmission path with the occupied state being unoccupied in the path state vector based on a preset searching order.
In the embodiment of the present invention, the above-mentioned occupiable values include 0 and 1, where 1 represents that the occupied state of the transmission path to be selected is unoccupied, and 0 represents that the occupied state of the transmission path to be selected is occupied. And then, according to the transmission distance corresponding to the transmission path to be selected, the occupied positions of the occupiable values can be ordered to obtain a path state vector.
In specific implementation, the occupiable values can be sequenced according to the sequence from long to short of the transmission distances, so as to obtain a path state vector, wherein the transmission distance of the transmission path to be selected corresponding to the occupiable value in the path state vector is in a direct proportion to the bit number occupied by the occupiable value, namely, the shorter the transmission distance is, the lower the bit number occupied by the corresponding occupiable value in the path state vector is, so that the vector first 1 searching unit can conveniently search the target transmission path with the shortest transmission distance according to the path state vector.
Here, as shown in fig. 6, a schematic diagram of a path state vector corresponding to the transmission path to be selected in the sub-topology network 1 is shown, where the occupiable values of the transmission path to be selected 1 and the transmission path to be selected 2 are both 1, and the transmission distance of the transmission path to be selected 1 is longer than that of the transmission path to be selected 2, and thus the path state vector is 11.
Next, step b3 may be performed based on the vector head 1 searching unit, where step b3 includes searching, based on a preset searching order, for a first transmission path to be selected with a first occupiable value as a first value in the path state vector, to obtain a target transmission path.
In the embodiment of the invention, the occupiable values include a first value 1 and a second value 0, where it can be seen from the above that the first value 1 is used to indicate that the occupied state of the transmission path to be selected is unoccupied, and the second value 0 is used to indicate that the occupied state of the transmission path to be selected is occupied.
On the basis, the preset searching order can be from low order to high order, and when the specific searching is performed, the vector head 1 searching unit can determine the first transmission path with the occupiable value of 1 searched according to the preset searching order as the target transmission path. Thus, as shown in fig. 6, the vector head 1 search unit may determine the transmission path 2 to be selected as the target transmission path.
In some optional embodiments, the step S203 includes:
s11, acquiring occupancy information, wherein the occupancy information is used for identifying the occupancy state of each transmission path to be selected in the current sub-topology network.
S12, updating the occupied state corresponding to the target transmission path in the occupied information to be occupied, and executing the transmission operation of the target data through the target transmission path.
In the embodiment of the present invention, as shown in fig. 7, schematic diagrams of occupancy information corresponding to the above-mentioned sub-topology network 1 are shown, in the occupancy information, 0 is used to indicate that an occupied state of a path is unoccupied, and 1 is used to indicate that an occupied state of the path is occupied.
As can be seen from the above, the initial occupancy states of the transmission path 1 to be selected and the transmission path 2 to be selected are both 0, and the determined target transmission path is the transmission path 2 to be selected, so that the occupancy state of the transmission path 2 to be selected can be updated to 1 based on the path state management module, and the transmission operation of the target data can be executed through the transmission path 2 to be selected.
It should be understood that, if the initial occupancy state of the transmission path 2 to be selected is 1, the transmission path 1 to be selected may be determined as the target transmission path, so as to avoid data blocking and ensure normal transmission of the target data.
In the embodiment of the invention, the occupied states of the transmission paths to be selected of the sub-topology network can be managed through the path state management module, so that the target transmission path is locked, and the system operation fault caused by data collision is avoided.
In some optional embodiments, the step S203 further includes:
Step S21, the accompanying information corresponding to the current sub-topology network is obtained, wherein the accompanying information is used for indicating the transmission condition of the target data in the target transmission path.
Step S22, the current routing node of the target data in the target transmission path is monitored in real time, and the accompanying information is updated based on the current routing node.
In the embodiment of the present invention, the foregoing accompanying information may be managed by the routing direction management unit, as shown in fig. 8, which is a schematic diagram of accompanying information corresponding to the foregoing sub-topology network 1, in which the path node label is used to indicate a current routing node where the target data n is located, and as can be seen from the foregoing, the current routing node where the target data n is located when entering the foregoing sub-topology network 1 is the level 1 routing node 0. When the determined target transmission path is the transmission path 1, the number of paths remaining is 1.
When the target data is transmitted through the target transmission path, the current routing node where the target data is located in the target transmission path can be in real time, and the accompanying information is updated based on the current routing node, which specifically comprises the following steps:
Step c1, determining the number of paths of remaining sub-paths based on the transmission directions of the current routing node and the target data, and acquiring the node identification of the current routing node, wherein the remaining sub-paths are used for indicating the transmission paths between the remaining adjacent routing nodes for transmitting the target data in the sub-topology network.
And step c2, updating the accompanying information based on the number of paths and the node identification.
In the embodiment of the present invention, the number of the remaining sub-paths in the target transmission path is the number of remaining routing nodes that do not transmit the target data, that is, the number of remaining paths in fig. 8, so when the target data is in the sub-topology network 1, the number of remaining paths in the accompanying information is 1, and the path node label (that is, the path node label in fig. 8) is the level 1 routing node 0.
After the target data is monitored to be in the level 2 routing node 0, since the number of paths of the remaining sub-paths in the target transmission path is 0, the determined number of paths is 0, and the node is identified as the level 2 routing node 0, as shown in fig. 8, the accompanying information can be updated based on the number of paths and the node identification.
It should be understood that after the target data arrives at the level 2 routing node 0, it may be determined that the target transmission path is released, at which time the path occupancy state of the target transmission path in fig. 7 may be updated to 0, so as to avoid that the target transmission path is locked.
After the above-mentioned target data is routed to the level 2 node 0, the current sub-topology network corresponding to the target data in the target topology network may be the sub-topology network 2 in fig. 3. Next, the target data may be transmitted in the sub-topology network 2 based on the embodiments corresponding to the steps S202-S203, so that the target data is transmitted through the target transmission path, i.e. the level 2 routing node 0-3 routing node 0, and the target data is transmitted through the target transmission path, i.e. the level 3 routing node 0-2 routing node 1, and the detailed transmission process is not repeated here.
In the embodiment of the invention, the route direction management unit can update the accompanying information of the target data when the target data is transmitted in the target transmission path, so that the target data is correctly routed to the target routing node or the output port.
In some optional embodiments, the step S203 further includes:
Step S31, when a plurality of path nodes are included in the target transmission path, determining a routing node to be selected of the next hop based on the current routing node where the target data is located.
And step S32, determining a target routing node meeting transmission conditions in the routing nodes to be selected so as to transmit target data through the target routing node, wherein the target routing node is used for indicating the routing nodes which do not transmit the target data in the routing nodes to be selected.
In the embodiment of the invention, the transmission condition can be that the target routing node is not a historical routing node which transmits the target data in the current sub-topology network. For example, after the target data is transmitted to the sub-topology network 3 in fig. 3, it is determined that the transmission direction of the target data is downstream based on the high 2-bit comparison result of the routing vector 01000 corresponding to the level 2 routing node 1 and the routing vector 01011 corresponding to the output port 11, and the target routing node is the level 1 routing node 2. At this time, if the transmission path with the shortest transmission distance is occupied by the level 2 routing node 1 to level 1 routing node 2, the determined target transmission path may be the level 2 routing node 1 to level 1 routing node 3 to level 1 routing node 2.
After the target data is transmitted to the level 1 routing node 3 through the target transmission path, if the high 3-bit comparison result of the routing vector 01100 corresponding to the level 1 routing node 3 and the routing vector 01011 corresponding to the output end 11 is unequal, determining that the transmission direction of the target data is a non-data downlink, and at this time, the determined routing node to be selected can be the level 2 routing node 1 and the level 1 routing node 2.
Next, the accompanying information corresponding to the sub-topology network 3 may be queried by the accompanying information management unit, and when the level 2 routing node 1 is included in the accompanying information, the level 2 routing node 1 is a routing node transmitting the target data, and therefore, the level 1 routing node 2 may be determined as the target routing node satisfying the transmission condition.
After the target data is routed to the level 1 routing node 2, the target data is routed to the output port 11 through the target transmission path, i.e. the level 1 routing node 2 to the output port 11, based on the embodiments corresponding to the steps S202-S203, so as to complete the data transmission process of the target data from the input port 1 to the output port 11.
In the embodiment of the invention, the companion information in the current sub-topology network can be queried through the companion information management unit, so that the target routing node which does not transmit the target data is determined from the routing nodes to be selected, and the phenomenon of data reflux in the system is prevented.
The embodiment also provides a data transmission system, which is used for implementing the above embodiment and the preferred implementation manner, and the description is omitted herein. Fig. 9 shows a schematic diagram of the data transmission system, wherein the data transmission system includes a routing direction selection unit, a path state management unit, an accompanying information management unit, a vector head 1 search unit, and a routing direction management unit.
And the routing direction selection unit is used for determining the transmission direction of the target data according to the comparison result of the current routing node or the input port routing vector and the output port routing vector.
In the embodiment of the present invention, the embodiment of determining the transmission direction of the target data is described in the embodiment corresponding to step S4022, which is not described herein.
And the path state management unit is used for providing alternative transmission paths to be selected for the target data in combination with the routing direction selection unit, managing the occupation and release states of the transmission paths to be selected and updating the occupation information.
In the embodiment of the present invention, the implementation manner for the path state management unit is described in the implementation manner corresponding to step S203, and will not be described herein.
And the accompanying information management unit is used for recording the number of the paths remained in each sub-topology network of the current routing data and updating the node identification of the current routing node.
In the embodiment of the present invention, the implementation manner of the accompanying information management unit is described in the implementation manner corresponding to step S203, and will not be described herein.
And the vector head 1 searching unit is used for determining a target transmission path meeting the transmission distance condition from the transmission paths to be selected, which are matched with the transmission direction.
In the embodiment of the present invention, the embodiment corresponding to the vector head 1 search unit is described in the embodiment corresponding to step S4023, which is not described herein.
And the routing direction management unit is used for correctly routing the target data to the target routing node or the output port by combining the currently selected transmission direction, the number of the residual paths and the node identification of the current routing node.
In the embodiment of the present invention, the implementation manner of the routing direction management unit is described in the implementation manner corresponding to step S22, and will not be described herein.
In summary, in the embodiment of the present invention, when target data is transmitted through a target topology network, a current sub-topology network corresponding to the target data may be determined in the target topology network, where the target topology network includes multiple layers of routing nodes connected according to a binary tree structure, adjacent routing nodes in each layer of routing nodes in the binary tree structure are communicatively connected, and the adjacent routing nodes are communicatively connected with corresponding routing nodes in adjacent layers of the target topology network, so as to form a ring-shaped sub-topology network. Then, based on the output port corresponding to the target data in the target topology network, the target transmission path corresponding to the target data is determined in the sub topology network, and the target data is transmitted according to the target transmission path, so that the topology network of the binary tree structure is improved, compared with the traditional binary tree structure, the transmission path selection in the data transmission process is increased, and the transmission efficiency and the stability of the system are improved.
The embodiment also provides a data transmission device, which is used for implementing the above embodiment and the preferred implementation manner, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a data transmission device, as shown in fig. 10, including:
A first determining module 1001, configured to determine, when transmitting target data through a target topology network, a current sub-topology network corresponding to the target data in the target topology network, where the target topology network includes multiple layers of routing nodes connected according to a binary tree structure, and adjacent routing nodes in each layer of routing nodes are communicatively connected, where the adjacent routing nodes are communicatively connected with corresponding routing nodes in adjacent layers of the target topology network, so as to form a ring-shaped sub-topology network.
A second determining module 1002, configured to determine, in the sub-topology network, a target transmission path corresponding to the target data based on an output port corresponding to the target data in the target topology network.
A transmission module 1003, configured to transmit the target data according to the target transmission path.
In some alternative embodiments, the second determining module 1002 is further configured to:
Obtaining a routing vector of an input node and an output port corresponding to target data in a current sub-topology network;
Determining the transmission direction of the target data based on the comparison result of the routing vectors;
And determining a target transmission path meeting the transmission distance condition from the transmission paths to be selected, which are matched with the transmission direction.
In some alternative embodiments, the second determining module 1002 is further configured to:
determining whether preset digits of the routing vectors are equal;
If yes, determining the transmission direction of the target data as data downlink, wherein the data downlink indicates that the level of the corresponding output node in the current sub-topology network is lower than that of the input node;
if not, determining the transmission direction of the target data as non-data downlink, wherein the data downlink indicates that the hierarchy of the corresponding output node in the current sub-topology network is not lower than the input node.
In some alternative embodiments, the second determining module 1002 is further configured to:
Determining a target level corresponding to a current routing node where target data are located in a target topology network;
And determining a preset bit number corresponding to the target level based on the association information, wherein the association information is used for indicating the association relation between different levels and the corresponding preset bit number in the target topology network.
In some alternative embodiments, the second determining module 1002 is further configured to:
acquiring an occupiable value of the transmission path to be selected, wherein the occupiable value is used for indicating the occupancy state of the transmission path to be selected;
ordering the occupied positions of the occupiable values based on the transmission distance corresponding to the transmission path to be selected to obtain a path state vector;
and searching the target transmission path with the occupied state being unoccupied in the path state vector based on a preset searching order.
In some alternative embodiments, the transmission distance of the transmission path to be selected corresponding to the occupiable value in the path state vector is in direct proportion to the number of bits occupied by the occupiable value.
In some alternative embodiments, the occupiable values include a first value and a second value, where the first value is used to indicate that the occupancy state of the transmission path to be selected is unoccupied, and the second value is used to indicate that the occupancy state of the transmission path to be selected is occupied, and the second determining module 1002 is further configured to:
searching a first transmission path to be selected, which can occupy a first value, in the path state vector based on a preset searching order to obtain a target transmission path.
In some alternative embodiments, the transmission module 1003 is further configured to:
Acquiring occupancy information, wherein the occupancy information is used for identifying the occupancy state of each transmission path to be selected in the current sub-topology network;
Updating the occupied state corresponding to the target transmission path in the occupied information to be occupied, and executing the transmission operation of the target data through the target transmission path.
In some alternative embodiments, the transmission module 1003 is further configured to:
acquiring accompanying information corresponding to a current sub-topology network, wherein the accompanying information is used for indicating the transmission condition of target data in a target transmission path;
and monitoring the current routing node of the target data in the target transmission path in real time, and updating the accompanying information based on the current routing node.
In some alternative embodiments, the transmission module 1003 is further configured to:
Determining the number of paths of remaining sub-paths based on the transmission directions of the current routing node and the target data, and acquiring node identifiers of the current routing node, wherein the remaining sub-paths are used for indicating transmission paths between remaining adjacent routing nodes for transmitting the target data in the sub-topology network;
the accompanying information is updated based on the number of paths and the node identification.
In some alternative embodiments, the transmission module 1003 is further configured to:
When the target transmission path comprises a plurality of path nodes, determining a to-be-selected routing node of the next hop based on the current routing node where the target data is located;
And determining a target routing node meeting transmission conditions in the routing nodes to be selected so as to transmit target data through the target routing node, wherein the target routing node is used for indicating the routing nodes which do not transmit the target data in the routing nodes to be selected.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The data transmission device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application SPECIFIC INTEGRATED Circuit) Circuit, a processor and a memory that execute one or more software or firmware programs, and/or other devices that can provide the above functions.
The embodiment of the invention also provides computer equipment, which is provided with the data transmission device shown in the figure 10.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, and as shown in fig. 11, the computer device includes one or more processors 10, a memory 20, and interfaces for connecting components, including a high-speed interface and a low-speed interface. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 11.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the methods shown in implementing the above embodiments.
The memory 20 may include a storage program area that may store an operating system, application programs required for at least one function, and a storage data area that may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The memory 20 may comprise volatile memory, such as random access memory, or nonvolatile memory, such as flash memory, hard disk or solid state disk, or the memory 20 may comprise a combination of the above types of memory.
The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random-access memory, a flash memory, a hard disk, a solid state disk, or the like, and further, the storage medium may further include a combination of the above types of memories. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Portions of the present invention may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or aspects in accordance with the present invention by way of operation of the computer. Those skilled in the art will appreciate that the existence of computer program instructions in a computer-readable medium includes, but is not limited to, source files, executable files, installation package files, and the like, and accordingly, the manner in which computer program instructions are executed by a computer includes, but is not limited to, the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled programs, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed programs. Herein, a computer-readable medium may be any available computer-readable storage medium or communication medium that can be accessed by a computer.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.