Data transmission method and device, electronic equipment and computer readable storage medium
By carrying topology addressing information in Ethernet packets, the destination node equipment for data is quickly identified, which solves the problem of time-consuming address recognition in the prior art and improves the speed and efficiency of Ethernet data transmission.
Patent Information
- Application Number
- CN202411317063.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-17
AI Technical Summary
The address information identification based on MAC address and VLAN tags in the existing Ethernet communication protocol causes the address identification to require reading more bytes during data transmission, resulting in slow data transmission speed and affecting the efficiency of Ethernet data transmission.
By carrying topological addressing information, including topological address and forwarding paths, quickly identify the destination node device of the data, reduce the number of bytes required for address recognition, and reduce the dwell time of data transmission in Ethernet.
It improves the Ethernet data transmission speed, saves address recognition time during data transmission, and enhances the efficiency of data transmission.
Smart Images

Figure CN119324894A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular, to a data transmission method, device, electronic device, and computer-readable storage medium. Background Art
[0002] At present, most of the Ethernet-based communication protocols in the relevant technology use MAC addresses (Media Access Control Address) and VLAN (Virtual Local Area Network) tags as address information identifiers of the receiving location, resulting in the need to read more bytes to identify the address during Ethernet data transmission, which consumes a longer time, causing the data to reside in the device for a longer time when transmitted in the Ethernet, affecting the Ethernet data transmission speed. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to provide a data transmission method, device, electronic device and computer-readable storage medium, which reduce the intermediate residence time of data transmission and improve the Ethernet data transmission speed.
[0004] To achieve the above object, an embodiment of the present application provides a data transmission method, which is applied to a node device in a network topology, including:
[0005] Receive Ethernet messages;
[0006] Reading topology addressing information in the Ethernet message, wherein the topology addressing information includes a topology address and a forwarding path;
[0007] The target node device of the Ethernet message is determined according to the topological address and the forwarding path.
[0008] In one embodiment, the preamble of the Ethernet message carries the topology addressing information, and the step of reading the topology addressing information in the Ethernet message includes:
[0009] The topology addressing information in the preamble of the Ethernet message is read.
[0010] In one embodiment, the topology addressing information is carried in a designated byte segment of the preamble of the Ethernet message, and the step of reading the topology addressing information in the preamble of the Ethernet message includes:
[0011] The topology addressing information is read from a designated byte segment of the preamble.
[0012] In one embodiment, the topology addressing information further includes an operation field; the topology address includes at least one location address and / or at least one port address;
[0013] After the step of reading the topology addressing information from the specified byte segment of the preamble, the data transmission method further includes at least one of the following:
[0014] Parsing the topology addressing information to obtain an operation field and a location address;
[0015] The topology addressing information is parsed to obtain an operation field, a location address, at least one pair of the port address and the location address.
[0016] In one embodiment, the forwarding path is determined according to a matching relationship between each of the location addresses and each of the port addresses.
[0017] In one embodiment, the bits occupied by the operation field, the location address, and the port address respectively meet at least one of the following requirements:
[0018] The operation field and the port address occupy the first bit, and the location address occupies the second bit;
[0019] The operation field occupies the first bit, the bits occupied by the port address are determined according to the maximum number of valid ports, and the bits occupied by the location address are determined according to the maximum number of connected devices.
[0020] In one embodiment, before the step of reading the topology addressing information in the preamble of the Ethernet message, the method further includes at least one of the following:
[0021] Decoding each byte in the preamble of the Ethernet message according to a preset decoding rule;
[0022] The valid content of each byte in the leading code of the Ethernet message is determined according to a preset retention rule, and the valid content is used as a reading object.
[0023] In one embodiment, the step of determining the target node device of the Ethernet message according to the topological address and the forwarding path includes:
[0024] When the topological address is the same as the topological address of the current node device and the message transmission destination in the forwarding path is the current node device, the target node device of the Ethernet message is determined to be the current node device.
[0025] In one embodiment, after the step of determining the target node device of the Ethernet message according to the topological address and the forwarding path, the method further includes:
[0026] When it is determined that the target node device is not the current node device, the Ethernet message is sent to the next node device according to the topology addressing information.
[0027] In one embodiment, the forwarding path is determined according to a topological relationship between the target node device and at least one node device in a network topology.
[0028] In one embodiment, the network topology includes at least one linear topology, and the linear topology includes a plurality of the node devices linearly connected through a first port and a second port.
[0029] In one embodiment, at the connection of the linear topologies at adjacent levels, a branch port of a node device in a first linear topology is connected to a first port or a second port of a node device in a second linear topology.
[0030] In one embodiment, the step of sending the Ethernet message to the next node device according to the topology addressing information includes:
[0031] Determine the current level based on the linear topology where the current node device is located;
[0032] The Ethernet message is sent to a next node device according to the topology addressing information corresponding to the current level.
[0033] In one embodiment, the media access control address of the Ethernet message carries the topology addressing information, and the step of reading the topology addressing information in the Ethernet message further includes:
[0034] The topology addressing information in the media access control address of the Ethernet message is read.
[0035] In addition, to achieve the above-mentioned purpose, the embodiment of the present application further provides a data transmission device, which is applied to a node device in a network topology, including:
[0036] A receiving module, wherein the receiving module is used to receive Ethernet messages;
[0037] A reading module, the reading module is used to read the topology addressing information in the Ethernet message, the topology addressing information includes a topology address and a forwarding path;
[0038] A processing module, wherein the processing module is used to determine a target node device of the Ethernet message according to the topological address and the forwarding path.
[0039] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the data transmission method described above is implemented.
[0040] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the data transmission method as described above is implemented.
[0041] The embodiments of the present application propose a data transmission method, apparatus, electronic device and computer-readable storage medium. In the data transmission method, a node device in a network topology first receives an Ethernet message, and then reads the topology addressing information in the Ethernet message. Since the topology addressing information includes a topology address and a forwarding path, the position of the target node device of the Ethernet message in the network topology can be clearly determined according to the topology address. The embodiments of the present application can quickly realize the destination address identification in the data transmission process by reading the topology addressing information in the Ethernet message. When the topology addressing information is at a specified position in the Ethernet message, the final destination of the Ethernet message can be quickly determined without reading too many bytes when identifying the address, thereby saving a lot of time, avoiding the problem of long residence time of data passing through the device when transmitting in the Ethernet, and improving the Ethernet data transmission speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only part of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 A flowchart of a data transmission method provided in an embodiment of the present application;
[0044] Figure 2 A schematic diagram of a network topology involved in a data transmission method provided in an embodiment of the present application;
[0045] Figure 3 A schematic diagram of byte distribution of a preamble code carrying topological addressing information involved in a data transmission method provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the structure of topological addressing information involved in a data transmission method provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of the structure of a topological address involved in a data transmission method provided in an embodiment of the present application;
[0048] Figure 6 A schematic diagram of a structure in which topological addressing information involved in a data transmission method provided in an embodiment of the present application is described with a fixed number of bytes;
[0049] Figure 7 A schematic diagram of a structure in which topological addressing information involved in a data transmission method provided in an embodiment of the present application is described with a non-fixed number of bytes;
[0050] Figure 8 A schematic diagram of the application principle of a symmetric offset algorithm involved in a data transmission method provided in an embodiment of the present application;
[0051] Fig. 9 A schematic diagram of the application principle of a reserved bit method involved in a data transmission method provided in an embodiment of the present application;
[0052] Fig.10 A schematic diagram of byte distribution of a media access control address carrying topological addressing information involved in a data transmission method provided in an embodiment of the present application;
[0053] Fig.11 A schematic diagram of a 4-layer network structure involved in a data transmission method provided in an embodiment of the present application;
[0054] Fig.12 A schematic diagram of byte distribution of a MAC address of an Ethernet message in which topology addressing information is stored in a fixed number of bytes in a data transmission method provided in an embodiment of the present application;
[0055] Fig.13 A schematic diagram of byte distribution of a MAC address of an Ethernet message in which topology addressing information is stored in a non-fixed byte number description manner, in a data transmission method provided in an embodiment of the present application;
[0056] Fig.14 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;
[0057] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] Ethernet is widely used in industrial communications due to its advantages of high speed and high bandwidth. When transmitting data, Ethernet needs to use address information to indicate the receiving location. The receiving device uses the address information to confirm whether the data target object is itself or not. Ethernet-based devices usually use MAC addresses (Media Access Control) as the source address and destination address of the sender and receiver. In the field of industrial communications, there are high requirements for the real-time performance of data transmission. As the demand for control accuracy increases, the sender hopes that the data will be quickly transmitted to the target receiver in the microsecond bus cycle. For the forwarding architecture that needs to evaluate part of the information in the data frame, shortening the residence time of the data in the Ethernet transmission through the device can increase the data transmission speed of Ethernet.
[0059] In the Profinet protocol, the addressing methods in the configuration phase and real-time communication are based on the MAC address specified in Ethernet IEEE802.3 for target location addressing. In addition, its addressing priority is required during switching, so fast forwarding needs to identify the complete 4-byte priority tag, which means that the 16 bytes in the frame plus the preamble and SFD (Start Frame Delimiter) totaling 24 bytes of packet overhead need to be parsed. In order to meet the microsecond bus cycle, its addressing method uses a modified packet structure to shorten the time to identify forwarding information to 320ns under 100BASE-TX. However, the problem is that this address information needs to be configured in the switching network, so it is not easy to transmit in the IEEE802.1Q bridge network. This method is used in a specific data transmission rate and is not compatible with the standard Ethernet structure.
[0060] In the EtherCAT protocol, in order to achieve the highest performance, the Ethernet data frames passing through are processed based on the "on the fly" method. This method allows the frames to be identified, processed and sent at the same time when passing through the device. Due to its special transmission method, that is, the data frame will pass through all devices, so the delay of passing through the device is only the fixed physical layer delay. There is a similar mechanism in the SERCOS protocol, and its transmission adopts the timely processing "on the fly" mechanism, but the disadvantage of this mechanism is that even if the fast device is connected to the line close to the control system, the frame must pass through the entire network, and this networking method cannot use different data transmission rates.
[0061] In CC-Link IE TSN, Ethernet-based MECHATROLINK-Ⅳ, POWERLINK and Ethernet / IP protocols, the target location address information is identified by Ethernet standard MAC address addressing defined in IEEE802.3.
[0062] It can be seen that most of the Ethernet-based communication protocols (including standard Ethernet protocols) in the related art use MAC addresses and VLAN tags as the address information identifiers of the destination location. For a microsecond communication cycle, this will require the data packet to identify the complete 24 bytes in order to clearly forward the entry information. In a 100BASE-TX network, as the number of devices on the network transmission path increases, data transmission will consume a lot of time in the forwarding delay of each hop.
[0063] Although different protocols reduce the length of address information to reduce recognition time, or shorten the preamble in Ethernet standard data frames to achieve a shorter residence time, it is still necessary to read at least 32 bits of address information to determine the data flow. In the "on the fly" forwarding mechanism, the device forwarding delay is only the time required for the physical layer data transmission operation, but this will reduce the flexibility of data transmission and the efficiency of Ethernet full-duplex transmission mechanism.
[0064] In industrial scenarios, device communication is real-time and deterministic. Specific addressing in Ethernet frames can speed up processing, but the disadvantage is that the standard switching ecosystem cannot cooperate with it in a reasonable way, but some applications may need to use such identification in the existing infrastructure. Therefore, the solutions in the relevant technology do not solve these two problems.
[0065] Based on this, the embodiments of the present application provide a data transmission method, device, electronic device and computer-readable storage medium. The data transmission method is suitable for industrial networks and can be embedded in a standard switching structure. By reading the topology addressing information in the Ethernet message through the node device Ethernet message in the network topology, the destination address identification in the data transmission process can be quickly realized. When the topology addressing information is in a specified position in the Ethernet message, the final destination of the Ethernet message can be quickly determined without reading too many bytes when identifying the address, thereby saving a lot of time, avoiding the problem of long residence time of data passing through the device when transmitting in the Ethernet, and improving the Ethernet data transmission speed.
[0066] The data transmission method, device, electronic device and computer-readable storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the data transmission method in the embodiments of the present application is described.
[0067] Reference Figure 1 , Figure 1 A flow chart of a data transmission method provided in an embodiment of the present application is provided. The data transmission method can be applied to node devices in a network topology, such as Figure 1As shown, the data transmission method provided in this embodiment includes steps S10 to S30:
[0068] Step S10, receiving an Ethernet message;
[0069] In this embodiment, the network topology is an Ethernet topology structure composed of multiple node devices. The Ethernet message can be generated by a node device in the network topology or by other devices outside the network topology. However, no matter where the Ethernet message is generated, it is for transmitting data to a node device in the network topology, that is, the end point of the Ethernet message is in the network topology. This end point may be the current node device in the network topology that has received the Ethernet message, or it may be other node devices in the network topology that have not yet received the Ethernet message.
[0070] Step S20, reading topology addressing information in the Ethernet message, the topology addressing information including the topology address and the forwarding path;
[0071] In this embodiment, when an Ethernet message is generated, it carries topology addressing information as an addressing basis. The topology addressing information is generated based on the topological structure of the network topology and is set to identify the specific location of a node device in the network topology. The topology addressing information is composed of a topology address and a forwarding path. The topology address is set to indicate the hardware address of the final destination of the Ethernet message in the network topology. However, the final destination of the Ethernet message cannot be determined by the topology address alone. It is also necessary to determine the transmission path of the Ethernet message in the network topology in combination with the forwarding path for comprehensive judgment.
[0072] It can be understood that, since the present embodiment reads the topology addressing information in the Ethernet message from the perspective of the receiving side, the specific reading method can be obtained by reverse deduction based on the way in which the sending side inserts the topology addressing information into the Ethernet message. As an example, the topology addressing information can be inserted into the Ethernet message after being generated by the sending side. The specific insertion position can be the leading code (also called the front synchronization code) of the Ethernet message, or the MAC address of the Ethernet message, or other positions in the Ethernet message. The specific insertion position can be selected according to the actual communication function configuration. The communication function configuration indicates the transmission capability of the communication device, which represents the communication capability configured by the device itself. The communication capability can be set manually, or it can be not limited to the device's own capability, and it can be set according to the capabilities of other devices in the network topology and the parameters of the network communication environment. This embodiment does not limit this. Therefore, when reading the topology addressing information in the Ethernet message, it can be read from the leading code of the Ethernet message, or it can be read from the MAC address of the Ethernet message, or it can be read from other positions in the Ethernet message. This embodiment does not limit this.
[0073] Step S30: determining the target node device of the Ethernet message according to the topological address and the forwarding path.
[0074] In this embodiment, the topology addressing information is set to identify the unique address of the target node device in the network topology. Only when the node device indicated by the topology address and the end point indicated by the forwarding path are the same node device, can it be determined that the node device is the final destination of the Ethernet message, that is, the target node device.
[0075] In some feasible embodiments, the forwarding path is determined according to a topological relationship between the target node device and at least one node device in the network topology.
[0076] In order to facilitate understanding of the topological addressing information in this embodiment, this embodiment provides the following Figure 2 A network topology structure shown is used as an example for explanation. Figure 2 As shown in the figure, the network topology can be regarded as a hybrid multi-port bridge network, with the target node device being Figure 2 Taking 107 as an example, if the current node device that receives the Ethernet message is 101, the topological relationship between the target node device and at least one node device in the network topology can be the position of each node device between 101 and 107 and the connection relationship between the ports, and the forwarding path is a data transmission path between 101 and 107.
[0077] In some feasible embodiments, the above network topology includes at least one linear topology, and the linear topology includes a plurality of node devices linearly connected through a first port and a second port.
[0078] In this embodiment, Figure 2 It can be seen that the network topology includes a linear topology 200 composed of node devices 101, 102, and 103, a linear topology 201 composed of node devices 104 and 105, and a linear topology 210 composed of node devices 106 and 107. The first port and the second port can be regarded as linear input / output ports of each node device.
[0079] As an example, the first port can also be regarded as a primary port, which is used to connect to the previous neighbor of the current node device in the same linear topology. If the primary port (for example 2a) belongs to the first node device in a linear topology, it realizes connection with a higher-level linear topology; the second port can also be regarded as a secondary port, which is used to connect to the successor in the same linear topology as the current node device.
[0080] It is understandable that although Figure 2Only a network topology including three linear topologies is shown in the figure, but the data transmission method provided in this embodiment can also be applied to a network topology including only one linear topology, a network topology including two linear topologies, or a network topology including more linear topologies. Figure 2 It does not represent a restriction on the specific number of linear topologies in the network topology.
[0081] In some feasible embodiments, at the connection of linear topologies at adjacent levels, a branch port of a node device in a first linear topology is connected to a first port or a second port of a node device in a second linear topology.
[0082] It should be noted that, in this embodiment, a network topology may include multiple levels of linear topologies. Taking the first linear topology as a higher-level linear topology and the second linear topology as a lower-level linear topology as an example, the node devices in the linear topology of the previous level can be connected to the node devices in the linear topology of the next level through branch ports. A node device can have multiple branch ports. Different linear topologies formed by node devices extended based on the branch ports of different node devices in the same linear topology belong to the same level. The hierarchical height / upper and lower order of linear topologies of different levels can be defined according to the priority order of data transmission, but it does not mean that there are differences in the advantages and disadvantages of node devices of different levels.
[0083] As an example, Figure 2 It can be seen that the linear topology 200 is connected to the linear topology 201 through the node device 102 and the node device 104. Figure 2 The three ports of the node device 102 are shown in the figure, 1a, 1b and 1c, respectively, where 1a and 1b are the first port and the second port of the node device 102, respectively, for connecting the node device 101 and the node device 103 in the same linear topology as the node device 102, 1c is the branch port of the node device 102, for connecting the first port or the second port 2a of the node device 104 in a different linear topology from the node device 102; similarly, the linear topology 201 is connected to the linear topology 210 through the node device 105 and the node device 106, and the branch port 3a of the node device 105 is connected to the first port or the second port of the node device 106.
[0084] Based on the above rules, each node device in the network topology has a unique address. Therefore, the target node device of the Ethernet message in the network topology can be determined by the topology addressing information composed of the unique address and the forwarding path. Figure 2 The network topology shown can not only reflect the topological relationship between the node devices in the network topology through different ports, but also reflect the position of each node device in the network topology, that is, each node device in the same linear topology is marked with a number, as follows:
[0085] In the linear topology 200, the position of the first node device 101 is equal to 1, the position of the next node device 102 should obtain the value of the position of the previous node device and add 1, that is, the position of the node device 102 is 2, and the position of the next node device 103 should obtain the value of the position of the previous node device and add 1, that is, the position of the node device 103 is 3;
[0086] In the linear topology 201, the position of the node device 104 is "2(1), 1", where "2(1)" represents that the node device 104 is located in the first branch of the node device 102, and the last position "1" represents that the node device 104 is the first node device in the linear topology 201. Similarly, the position of the node device 105 is "2(1), 2", where "2(1)" represents that the node device 105 is located in the first branch of the node device 102, and the last position "2" represents that the node device 105 is the second node device in the linear topology 201.
[0087] In the linear topology 210, the position of the node device 106 is "2(1), 2(1), 1", where "2(1), 2(1)" represents that the node device 106 is located in the first branch of the node device 105, and the last position "1" represents that the node device 106 is the first node device in the linear topology 210. Similarly, the position of the node device 107 is "2(1), 2(1), 2", where "2(1), 2(1)" represents that the node device 107 is located in the first branch of the node device 105, and the last position "2" represents that the node device 107 is the second node device in the linear topology 210.
[0088] In the unnumbered linear topology, the position of node device 108 is "2(1), 2(1), 1(1), 1", where "2(1), 2(1), 1(1)" represents that node device 108 is located in the first branch of node device 106, and the last digit "1" represents that node device 108 is the first node device in the branch. Similarly, the position of node device 109 is "2(1), 2(1), 1(2), 1", where "2(1), 2(1), 1(2)" represents that node device 109 is located in the second branch of node device 106, and the last digit "1" represents that node device 109 is the first node device in the branch.
[0089] In some feasible embodiments, the preamble of the Ethernet message carries topology addressing information, and the above step S20 may specifically include:
[0090] Step S21, reading the topology addressing information in the preamble of the Ethernet message.
[0091] It should be noted that in order to reduce the intermediate residence time of data transmission and increase the Ethernet data transmission speed, the topology addressing information can be inserted into the preamble of the Ethernet message when it is generated. In this way, after the node device in the network topology receives the Ethernet message, when it reads the preamble of the Ethernet message, it can obtain the topology addressing information, and then quickly determine whether the current node device is the target node device of the Ethernet message, so as to decide whether to intercept the Ethernet message or continue to forward the Ethernet message. There is no need to completely read the data frame of the entire Ethernet message as in the related technology, which takes a lot of time and affects the data transmission speed.
[0092] In some feasible embodiments, the designated byte segment of the preamble of the Ethernet message carries the topology addressing information, and the above step S21 may specifically include:
[0093] Step S210, reading topology addressing information from a specified byte segment of the preamble.
[0094] It should be noted that, in order not to destroy the original function of the preamble, in this embodiment, the insertion position of the topological addressing information needs to be restricted to a certain extent, such as Figure 3 As shown, since the preamble 110 in the standard Ethernet device has 7 bytes, according to the provisions of IEEE802.3, the first two bytes of the preamble need to be used as clock synchronization codes for 4B / 5B or 7B / 8B encoding to form a stream start separator SSD (corresponding to Figure 3 Therefore, the actual number of operable bytes in the preamble is 5 bytes, and the designated byte segment can be selected from the actual operable 5 bytes according to the length of the topology addressing information. At most, these 5 bytes can be used as the designated byte segment for inserting the topology addressing information 113.
[0095] Reference Figure 4 and Figure 5 In some feasible embodiments, the topology addressing information 300 further includes an operation field 310; the topology address 320 includes at least one location address 322 and / or at least one port address 321;
[0096] In this embodiment, Figure 4 It can be seen that, taking the last 5 bytes of the preamble as an example, which are all designated byte segments occupied by the topology addressing information 300, the operation field 310 in the topology addressing information 300 can occupy the first 2 bits in the topology addressing information area. Based on these 2 bits, the operation field 310 can be used to indicate up to 4 operations, levels or other instructions or identifiers that can be configured as needed; the topology address 320 in the topology addressing information 300 occupies the 38 bits after the operation field 310.
[0097] In this embodiment, Figure 5 The location address 322 and port address 321 in can be passed Figure 2 The location identifier or port identifier of each node device in the network topology shown is obtained by converting, for example, converting a decimal number into a binary number, wherein the location address 322 is used to indicate the location of the node device in the linear topology of different levels, and the port address 321 is used to indicate the branch port of a node device in the linear topology of the previous level connected to the expanded new branch linear topology.
[0098] After the above step S210, the data transmission method may further include at least one of the following:
[0099] Step S211, parsing the topology addressing information to obtain an operation field and a location address;
[0100] As an example, combining Figure 5 and Figure 2 It can be seen that for the node devices 101, 102 and 103 in the top-level linear topology 200, there are no branch ports connected to a node device in the linear topology of the upper level, that is, the topology addressing information 300 of the node devices 101, 102 and 103 does not include the port address 321, and their topology addressing information is composed of only an operation field and a location address; therefore, after reading the valid logical address of the topology addressing information, combined with the characteristic that the operation field only occupies 2 bits, the topology addressing information can be split into an operation field and a location address. In this way, when executing step S30, it is possible to directly determine which node device in the network topology is the target node device of the Ethernet message through the location address (indicating the location of the target node device in the top-level linear topology 200) and the forwarding path.
[0101] Step S212, parsing the topology addressing information to obtain an operation field, a location address, and at least one pair of port address and location address.
[0102] As an example, combining Figure 5 and Figure 2It can be seen that, except for the node devices 101, 102 and 103 in the top-level linear topology 200, the remaining node devices all have branch ports connected to a node device in the linear topology of the upper level, that is, the topological addressing information of the remaining node devices includes not only an operation field and a location address, but also at least one pair of port addresses and location addresses belonging to the same level; therefore, after reading the valid logical address of the topological addressing information, it is possible to first combine the characteristic that the operation field only occupies 2 bits to split out an operation field and a location address of a node device in the topological topology, and then split out the port address and location address of the node device in the branch linear topology that appear in pairs and belong to the node device. In this way, when executing step S30, it is possible to quickly determine which node device in the network topology is the target node device of the Ethernet message through the split location addresses and port addresses.
[0103] In some feasible embodiments, the forwarding path may be determined based on a matching relationship between each location address and each port address.
[0104] As an example, for the application scenario of step S211 above, the forwarding path can be Figure 2 The linear topology 200 in the network topology shown in FIG. 1 is determined, for example, from node device 101 to node device 102, from node device 102 to node device 101, from node device 101 to node device 103, from node device 102 to node device 103, etc. The specific forwarding path can be determined according to the actual situation, and this embodiment does not limit this. For the application scenario of the above step S212, the forwarding path can be Figure 2 It is determined in the network topology shown that the longest forwarding path may be from node device 101 (or 103) to node device 107 (or 108, 109). The specific forwarding path may be determined according to actual conditions, and this embodiment does not impose any limitation on this.
[0105] In some feasible embodiments, the bits occupied by the operation field, the location address, and the port address respectively meet at least one of the following requirements:
[0106] Allocation method 1: The operation field and the port addresses set in different fields occupy the first bit, and the position addresses set in different fields occupy the second bit;
[0107] It should be noted that, in this embodiment, the topology addressing information is described by a fixed number of bytes. Figure 6The topology addressing information 300 used to describe the location of the target node device in the network topology includes an operation field 310, a port address 1-401, a port address 2-402, a port address 3-403, a port address 4-404, a location address 1-411, a location address 2-412, a location address 3-413, a location address 4-414, and a location address 5-415. Each port address and operation field is represented by 2 bits, and each location address is represented by 6 bits. This allows the 5 bytes in the designated byte segment of the preamble to be divided into 5 groups and identify 5 levels respectively: the first level includes the operation field 310 + location address 1-411, the second level includes the port address 1-401 + location address 2-412, the third level includes the port address 2-402 + location address 3-413, the fourth level includes the port address 3-403 + location address 4-414, and the fifth level includes the port address 4-404 + location address 5-415. In combination with the above embodiments, it can be seen that when the topology addressing information is described by a fixed number of bytes, the overall networking structure of the network topology can have at most 5 levels.
[0108] As an example, since the number of bits describing the port address and the location address is fixed, the threshold description of the number of ports of a single node device and the number of node devices in a linear topology that can be represented is shown in Table 1.
[0109] Table 1
[0110]
[0111]
[0112] It can be seen from Table 1 that, when the topology addressing information is described by a fixed number of bytes, a maximum of 62 node devices can be connected to a single linear topology of the network topology, wherein a single node device can have at most 3 branch ports.
[0113] It should be noted that the method of describing the topological addressing information with a fixed number of bytes in which the first bit is 2 bits and the second bit is 6 bits given in this embodiment is only an example, and the bit allocation of the first bit and the second bit can be flexibly adjusted according to actual conditions. For example, when the first bit is 3 bits and the second bit is 5 bits, the 5 bytes in the designated byte segment of the preamble code can also be divided into 5 groups and identify 5 levels respectively. Therefore, this embodiment does not limit the bit allocation in the fixed byte number description.
[0114] Allocation method 2: The operation field occupies the first bit, the bits occupied by the port address are determined according to the maximum number of valid ports, and the bits occupied by the location address are determined according to the maximum number of connected devices.
[0115] It should be noted that, in this embodiment, the topology addressing information is described by a non-fixed number of bytes. Figure 7 By describing in a non-fixed number of bytes, it is possible to more flexibly represent the topology addressing information 300 carried by the Ethernet message within a limited data length. The topology addressing information 300 includes an operation field 430 occupying 2 bits, and a topology address 331 and a topology address 332 that are dynamically allocated and occupy bits.
[0116] In this embodiment, the number of bits occupied by the port address 401 in each level of the network topology depends on the maximum number of valid ports possessed by a node device in all branch linear topologies in the level (i.e., the maximum number of valid ports). The more ports a node device has, the more bits are required to represent the port address; the number of bits occupied by the location address 412 in each level of the network topology depends on the maximum number of connections of the node devices in all branch linear topologies in the level (i.e., the maximum number of connected devices). The more node devices a branch linear topology includes, the more bits are required for the location address 412.
[0117] As an example, assuming that the number of bits required for identification of the i-level port address is Xi, the number of bits required for identifying the location address is Yi, and the maximum number of layers of the network topology is n, the dynamic allocation of topology addresses needs to satisfy the formula:
[0118] It should be noted that since the topology addressing information is inserted in the preamble, in order to avoid confusion between the topology addressing information and the original information in the preamble, it is necessary to avoid the topology addressing information inserted in the preamble from having bytes that are consistent with the stream start delimiter SSD (0x55) or the frame start delimiter SFD (0xD5). Therefore, after the topology addressing information is inserted into the preamble, the preamble can be subjected to an operation similar to encryption processing, so that SSD (0x55) and SFD (0xD5) do not appear in the Ethernet message during transmission.
[0119] In some feasible embodiments, before the above step S21, the data transmission method may further include at least one of the following:
[0120] Step S201, decoding each byte in the preamble of the Ethernet message according to a preset decoding rule;
[0121] It can be understood that when the sending side performs an operation similar to encryption processing on the preamble of the Ethernet message, in order to ensure the normal extraction of the topology addressing information, before reading the topology addressing information in the preamble of the Ethernet message, it is necessary to decode each byte in the preamble of the Ethernet message based on the preset decoding rules corresponding to the aforementioned operation similar to encryption processing.
[0122] As an example, in this embodiment, the operation similar to the encryption process may be a symmetric shift algorithm, such as Figure 8 As shown, the principle of the symmetric offset algorithm is: at the transmitting end 120, each byte in the preamble 110 is quantitatively offset encoded (non-carry offset fixed amount k encoding), and at the receiving end 130, the received Ethernet preamble is decoded with the same amount of offset (non-carry offset fixed amount k decoding). In this way, during the data transmission process, the data in the preamble of the Ethernet message will not present the original value, thereby avoiding the appearance of SSD and SFD values. It should be noted that in this embodiment, when encoding and decoding a single byte, only the non-carry byte is taken.
[0123] Step S202: determine the valid content of each byte in the leading code of the Ethernet message according to a preset retention rule, and take the valid content as a reading object.
[0124] It can be understood that when the sending side performs an operation similar to encryption processing on the preamble of the Ethernet message, in order to ensure the normal extraction of the topology addressing information, before reading the topology addressing information in the preamble of the Ethernet message, it is necessary to determine the valid content of each byte in the preamble of the Ethernet message based on the preset retention rules corresponding to the aforementioned operation similar to encryption processing.
[0125] As an example, in this embodiment, the operation similar to the encryption process can be a reserved bit method, such as Fig. 9 As shown, the principle of the reserved bit method is: the lowest bit 500 of each byte in the preamble 110 is forced to be set to 0, so that SSD (0x55) and SFD (0xD5) will not appear in the preamble, and 2 bits of the 35 available bits are still used as operation fields, and the remaining bits are used to identify topological addressing information. It should be noted that in this embodiment, forcing the lowest bit 500 to be 0 is only an example, and it can also be forced to set the lowest bit 500 to 1, or it can be forced to set the highest bit to 0 or 1, etc., which can be flexibly adjusted according to actual conditions, as long as the purpose is to ensure that SSD (0x55) and SFD (0xD5) do not appear in the Ethernet message during transmission, and this embodiment does not limit this.
[0126] In some feasible embodiments, the media access control address of the Ethernet message carries topology addressing information, and the above step S20 may further specifically include: reading the topology addressing information in the media access control address of the Ethernet message.
[0127] It should be noted that in addition to being set in the preamble of the Ethernet message, the topology addressing information can also be set in other fields of the Ethernet message. This embodiment only takes the example that the topology addressing information can also be set in the media access control address (i.e., MAC address), which is a typical data field in an Ethernet message, as an example for explanation, and does not mean that the topology addressing information can only be set in the MAC address in addition to being set in the preamble.
[0128] It should be noted that when the media access control address of the Ethernet message carries topology addressing information, the preamble code may also carry the topology addressing information. That is to say, you can choose to read the topology addressing information from the preamble code or the media access control address, or you can choose to read the topology addressing information from both the preamble code and the media access control address. This embodiment does not limit this.
[0129] As an example, see Fig.10 In this embodiment, the topology addressing information may be set in the destination MAC field 600 and / or the source MAC field 610. The Ethernet MAC address compliant with IEEE802.3 uses the second bit in the highest byte of the OUI field 601 to identify whether the MAC address is global or local. In this embodiment, the bit identifier 510 is 0, indicating that the MAC address is locally managed and is used to indicate the topology addressing information 602. The processing method of inserting the topology addressing information into the source MAC field 610 is the same as the processing method of inserting the topology addressing information into the destination MAC field 600, and both can be used to indicate the topology addressing information of a node device in the network topology, which will not be described in detail here.
[0130] It is understandable that the description method, encryption and decryption method, etc. of storing the topology addressing information in the MAC address can all use the corresponding implementation method of storing the topology addressing information in the preamble code, and will not be elaborated here.
[0131] In the case of combining the above embodiments, this embodiment provides an application example for assisting understanding, such as Fig.11As shown, in a 4-layer network structure, when a high-priority (assuming 0 is the highest) Ethernet message needs to be sent to the fourth-layer device 108, its data passes through the first-layer device 102 through the branch port 3a, and is transferred to the second-layer device 105, and is transferred to the third layer through port 1c, and is transferred to device 108 through port 4a of the third-layer device 106. Then, the topological address of the fourth-layer device 108 is: 2(1),2(1),1(1),1.
[0132] When the topology addressing information of the fourth layer device 108 is stored in the preamble of the Ethernet message in a manner of describing a fixed number of bytes and encoded using a symmetric offset algorithm, assuming that the offset is 0x56, the description of the topology addressing information of the fourth layer device 108 in the preamble is as shown in Table 2.
[0133] Table 2
[0134]
[0135] When the topological addressing information of the fourth layer device 108 is stored in the MAC address of the Ethernet message in a manner of describing a fixed number of bytes, it can be combined with Fig.12 To understand, by Fig.12 It can be seen that the first byte of OUI-601 in the MAC address area 600 is 0, indicating a local management address, and the topology addressing information 602 in the MAC address area 600 is also stored in 5 bytes, similar to the storage method of the 5 bytes in the preamble.
[0136] In addition, Fig.11 In the case where the topology addressing information of the fourth layer device 108 is stored in the preamble of the Ethernet message in a manner described by a non-fixed number of bytes and is encoded using a reserved bit method, the description of the topology addressing information of the fourth layer device 108 in the preamble is shown in Table 3.
[0137] Table 3
[0138]
[0139] When the topological addressing information of the fourth layer device 108 is stored in the MAC address of the Ethernet message in a manner of describing a non-fixed number of bytes, it can be combined with Fig.13 To understand, by Fig.13 It can be seen that the first byte of OUI-601 in the MAC address area 600 is 0, indicating a local management address, and the information stored in the first two bytes of the topology addressing information 602 in the MAC address area 600 is consistent with the information stored in the first two bytes of the preamble.
[0140] In some feasible embodiments, the above step S30 may specifically include: when the topological address is the same as the topological address of the current node device and the message transmission destination in the forwarding path is the current node device, determining that the target node device of the Ethernet message is the current node device.
[0141] As an example, when the topological address of the current node device is the same as the topological address in the topological addressing information, and the current node device is also the end point indicated by the forwarding path in the topological addressing information, it means that the current node device is the target node device of the Ethernet message; and when the topological address of the current node device is the same as the topological address in the topological addressing information, but the current node device is only a passing node in the forwarding path in the topological addressing information rather than the end point, it means that the current node device is not the target node device of the Ethernet message.
[0142] In some feasible embodiments, after the above step S30, the data transmission method may further include:
[0143] Step S40: When it is determined that the target node device is not the current node device, the Ethernet message is sent to the next node device according to the topology addressing information.
[0144] In this embodiment, when it is determined that the current node device is not the final destination of the Ethernet message, the current node device needs to send the Ethernet message to the next node device so that it continues to be transmitted along the network topology. After receiving the Ethernet message, the next node device will also execute the steps in the above-mentioned data transmission method like the current node device until the Ethernet message is successfully transmitted to the final destination.
[0145] In some feasible embodiments, the above step S40 may specifically include:
[0146] Step S41, determining the current level according to the linear topology where the current node device is located;
[0147] In this embodiment, the linear topology where the current node device is located can be determined according to the position of the current node device in the network topology.
[0148] As an example, combining Figure 2It can be seen that, taking the current node device being the node device 105 as an example, according to its position "2(1), 2", it can be known that it includes two location addresses and one port address, so the linear topology 201 in which it is located belongs to the second level, that is, the current level is the second level; taking the current node device being the node device 106 as an example, according to its position "2(1), 2(1), 1", it can be known that it includes three location addresses and two port addresses, so the linear topology 210 in which it is located belongs to the third level, that is, the current level is the third level; and so on, taking the current node device being the node device 108 as an example, according to its position "2(1), 2(1), 1(1), 1", it can be known that it includes four location addresses and three port addresses, so the corresponding current level is the fourth level.
[0149] Step S42: Send the Ethernet message to the next node device according to the topology addressing information corresponding to the current level.
[0150] In this embodiment, when an Ethernet message is transmitted at a certain level in the network topology, the node devices in the level identify the topological address and forwarding path corresponding to the level in the topological addressing information, and based on this information belonging to the current level, send the Ethernet message to the next node device of the current level, or the node device in the next level of the current level.
[0151] As an example, in Figure 2 In the network topology shown, it is assumed that an Ethernet message needs to be sent from node device 102 to node device 108, and the current node device that receives the Ethernet message is node device 105. According to the topological addressing information of node device 108, including the topological address "2(1), 2(1), 1(1), 1" and the forwarding path "sent from node device 102, passing through the first branch port of node device 102 to reach node device 104, passing through node device 104 to reach node device 105, passing through the first branch port of node device 105 to reach node device 106, passing through the first branch port of node device 106 to reach node device 108", it can be seen that the information belonging to the level where node device 105 is located includes "2(1), 2" and "passing through the first branch port of node device 105 to reach node device 106". Therefore, at node device 105, it is only necessary to transmit the Ethernet message to the node device 106 of the next level via the first branch port according to the above-mentioned partial topological addressing information, instead of node device 105 directly transmitting the Ethernet message to node device 108.
[0152] In addition, the present application also provides a data transmission device, referring to Fig.14 , Fig.14 A schematic diagram of a data transmission device provided in an embodiment of the present application is shown in FIG. Fig.14As shown, in this embodiment, the data transmission device includes: a receiving module 10 , a reading module 20 and a processing module 30 .
[0153] The receiving module 10 is used to receive Ethernet messages;
[0154] The reading module 20 is used to read the topology addressing information in the Ethernet message, and the topology addressing information includes the topology address and the forwarding path;
[0155] The processing module 30 is used to determine the target node device of the Ethernet message according to the topological address and the forwarding path.
[0156] In some feasible embodiments, the preamble of the Ethernet message carries topology addressing information, and the reading module 20 is further used to read the topology addressing information in the preamble of the Ethernet message.
[0157] In some feasible embodiments, the designated byte segment of the preamble of the Ethernet message carries the topology addressing information, and the reading module 20 is further configured to read the topology addressing information from the designated byte segment of the preamble.
[0158] In some feasible embodiments, the topological addressing information further includes an operation field; the topological address includes at least one location address and / or at least one port address; and the reading module 20 is further configured to perform at least one of the following:
[0159] Parsing the topological addressing information to obtain an operation field and a location address;
[0160] The topological addressing information is parsed to obtain an operation field, a location address, and at least one pair of port addresses and the location address.
[0161] In some feasible embodiments, the forwarding path is determined according to a matching relationship between each location address and each port address.
[0162] In some feasible embodiments, the bits occupied by the operation field, the location address, and the port address respectively meet at least one of the following requirements:
[0163] The operation field and port address occupy the first bit, and the location address occupies the second bit;
[0164] The operation field occupies the first bit, the bits occupied by the port address are determined according to the maximum number of valid ports, and the bits occupied by the location address are determined according to the maximum number of connected devices.
[0165] In some feasible embodiments, the data transmission device further includes a decryption module, and the decryption module is used to perform at least one of the following:
[0166] Decoding each byte in the preamble of the Ethernet message according to a preset decoding rule;
[0167] The valid content of each byte in the leading code of the Ethernet message is determined according to the preset retention rule, and the valid content is used as the reading object.
[0168] In some feasible embodiments, the processing module 30 is further used to determine that the target node device of the Ethernet message is the current node device when the topological address is the same as the topological address of the current node device and the message transmission destination in the forwarding path is the current node device.
[0169] In some feasible embodiments, the processing module 30 is further configured to send the Ethernet message to the next node device according to the topology addressing information when it is determined that the target node device is not the current node device.
[0170] In some feasible embodiments, the forwarding path is determined according to a topological relationship between the target node device and at least one node device in the network topology.
[0171] In some feasible embodiments, the network topology includes at least one linear topology, and the linear topology includes a plurality of node devices linearly connected through a first port and a second port.
[0172] In some feasible embodiments, at the connection of linear topologies at adjacent levels, a branch port of a node device in a first linear topology is connected to a first port or a second port of a node device in a second linear topology.
[0173] In some feasible embodiments, the processing module 30 is further used to determine the current level according to the linear topology where the current node device is located; and send the Ethernet message to the next node device according to the topology addressing information corresponding to the current level.
[0174] In some feasible embodiments, the media access control address of the Ethernet message carries the topology addressing information, and the reading module 20 is further used to read the topology addressing information in the media access control address of the Ethernet message.
[0175] The data transmission device provided in this embodiment and the data transmission method provided in the above embodiment belong to the same technical concept. The technical details not fully described in this embodiment can be referred to any of the above embodiments, and this embodiment has the same beneficial effects as executing the data transmission method.
[0176] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] In addition, an embodiment of the present application also provides an electronic device, and the above-mentioned data transmission method applied to the node device in the network topology can be executed by a data transmission device, which can be implemented by software and / or hardware and integrated in the electronic device.
[0178] As an example, the electronic device may be a PC (personal computer), a mobile phone, a notebook, a tablet computer, or other terminal device that can be arranged in a network topology to establish an Ethernet connection with other node devices.
[0179] Reference Fig.15 , Fig.15 The hardware structure diagram of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.15 As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0180] Those skilled in the art will understand that Fig.15 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Fig.15 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a computer program.
[0181] exist Fig.15In the electronic device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in this embodiment can be set in the electronic device, and the electronic device calls the computer program stored in the memory 1005 through the processor 1001, and executes the data transmission method provided in any of the above embodiments for the node device in the network topology.
[0182] The electronic device proposed in this embodiment and the data transmission method applied to the node device in the network topology proposed in the above embodiment belong to the same technical concept. The technical details not described in detail in this embodiment can be referred to any of the above embodiments, and this embodiment has the same beneficial effects as executing the data transmission method.
[0183] In addition, an embodiment of the present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the data transmission method provided in any of the above embodiments is implemented.
[0184] In addition, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the data transmission method provided in any of the above embodiments.
[0185] The computer program product provided in the present application and the data transmission method proposed in the above-mentioned embodiment belong to the same technical concept. Compared with the related art, the beneficial effects of the computer program product provided in the present application are the same as the beneficial effects of the data transmission method provided in the above-mentioned embodiment, which will not be elaborated here.
[0186] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0187] In the above description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the embodiments of the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from hindering the description of the embodiments of the present application.
[0188] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0189] It should also be understood that the references to "one embodiment" or "some embodiments" described in the specification of the embodiments of the present application mean that one or more embodiments of the embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0190] The above is a specific description of some implementation methods of the embodiments of the present application, but the embodiments of the present application are not limited to the above implementation methods. Technical personnel familiar with the field can also make various equivalent modifications or substitutions without violating the spirit of the embodiments of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the embodiments of the present application.
Claims
1. A data transmission method, applied to a node device in a network topology, characterized in that: include: Receive Ethernet messages; Reading topology addressing information in the Ethernet message, wherein the topology addressing information includes a topology address and a forwarding path; The target node device of the Ethernet message is determined according to the topological address and the forwarding path.
2. The data transmission method according to claim 1, characterized in that: The topology addressing information is carried in the preamble of the Ethernet message, and the step of reading the topology addressing information in the Ethernet message includes: The topology addressing information in the preamble of the Ethernet message is read.
3. The data transmission method according to claim 2, characterized in that: The topology addressing information is carried in a designated byte segment of the preamble of the Ethernet message, and the step of reading the topology addressing information in the preamble of the Ethernet message comprises: The topology addressing information is read from a designated byte segment of the preamble.
4. The data transmission method according to claim 3, characterized in that: The topology addressing information further includes an operation field; the topology address includes at least one location address and / or at least one port address; After the step of reading the topology addressing information from the specified byte segment of the preamble, the data transmission method further includes at least one of the following: Parsing the topology addressing information to obtain an operation field and a location address; The topology addressing information is parsed to obtain an operation field, a location address, at least one pair of the port address and the location address.
5. The data transmission method according to claim 4, characterized in that: The forwarding path is determined according to a matching relationship between each of the location addresses and each of the port addresses.
6. The data transmission method according to claim 4, characterized in that: The bits occupied by the operation field, the location address, and the port address respectively meet at least one of the following requirements: The operation field and the port address occupy the first bit, and the location address occupies the second bit; The operation field occupies the first bit, the bits occupied by the port address are determined according to the maximum number of valid ports, and the bits occupied by the location address are determined according to the maximum number of connected devices.
7. The data transmission method according to any one of claims 2 to 6, characterized in that: Before the step of reading the topology addressing information in the preamble of the Ethernet message, the method further includes at least one of the following: Decoding each byte in the preamble of the Ethernet message according to a preset decoding rule; The valid content of each byte in the leading code of the Ethernet message is determined according to a preset retention rule, and the valid content is used as a reading object.
8. The data transmission method according to claim 1, characterized in that: The step of determining the target node device of the Ethernet message according to the topological address and the forwarding path includes: When the topological address is the same as the topological address of the current node device and the message transmission destination in the forwarding path is the current node device, the target node device of the Ethernet message is determined to be the current node device.
9. The data transmission method according to claim 8, characterized in that: After the step of determining the target node device of the Ethernet message according to the topological address and the forwarding path, the method further includes: When it is determined that the target node device is not the current node device, the Ethernet message is sent to the next node device according to the topology addressing information.
10. The data transmission method according to claim 9, characterized in that: The forwarding path is determined according to a topological relationship between the target node device and at least one node device in a network topology.
11. The data transmission method according to claim 10, characterized in that: The network topology includes at least one linear topology, and the linear topology includes a plurality of the node devices linearly connected through a first port and a second port.
12. The data transmission method according to claim 11, characterized in that: At the connection of the linear topologies at adjacent levels, a branch port of a node device in a first linear topology is connected to a first port or a second port of a node device in a second linear topology.
13. The data transmission method according to claim 12, characterized in that: The step of sending the Ethernet message to the next node device according to the topology addressing information includes: Determine the current level based on the linear topology where the current node device is located; The Ethernet message is sent to a next node device according to the topology addressing information corresponding to the current level.
14. The data transmission method according to claim 1, characterized in that: The media access control address of the Ethernet message carries the topology addressing information, and the step of reading the topology addressing information in the Ethernet message further includes: The topology addressing information in the media access control address of the Ethernet message is read.
15. A data transmission device, applied to a node device in a network topology, characterized in that: include: A receiving module, wherein the receiving module is used to receive Ethernet messages; A reading module, the reading module is used to read the topology addressing information in the Ethernet message, the topology addressing information includes a topology address and a forwarding path; A processing module, wherein the processing module is used to determine a target node device of the Ethernet message according to the topological address and the forwarding path.
16. An electronic device, characterized in that: The electronic device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the data transmission method according to any one of claims 1 to 14 when executed by the processor.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 14 is implemented.
Citation Information
Cited By
Data transmission method and apparatus, electronic device and computer-readable storage medium
WO2026061196A1