Ethernet networking method, network module, program product and storage medium
By designing multiple network modules in the Ethernet networking system to form ring links in opposite directions and filling the wiring harness failure when receiving loop detection instructions, the problem of difficult to ensure network bandwidth and stability in the prior art is solved, and the stability and integrity of networking are ensured at a lower cost.
Patent Information
- Application Number
- CN202510646268.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-06-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, industrial site networking solutions cannot ensure network bandwidth and stability on a lower cost basis.
By designing an Ethernet networking system, in which a plurality of network modules form at least two ring links with opposite data transmission directions, the input connector of any network module is connected to the output connector of the latter network module, and the output connector is connected to the input connector of the latter network module. When the system receives the loop detection command, it fills the failure condition of its own wiring harness and determines the transmission method based on the failure condition to ensure the stability of data transmission.
It realizes the network bandwidth and stability on a lower cost basis, ensuring that when a problem occurs in one ring link, the other ring link can be used to maintain data transmission and improve the integrity and reliability of the network.
Smart Images

Figure CN120165996A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network transmission technologies, and more particularly, to an Ethernet networking method, a network module, a program product, and a storage medium. Background Art
[0002] Common on-site networking methods in industrial applications include: industrial Ethernet, RS485 network, and Controller Area Network (CAN) network. Among them, industrial Ethernet usually uses the Ethernet for Control Automation Technology (EtherCAT) protocol; this is a high-performance, real-time industrial Ethernet communication protocol, which is widely used in data transmission between automation, control, and industrial equipment, especially in occasions where fast response and high precision are required. The RS485 network usually uses the MODBUS protocol, which is a popular industrial networking method now. Its characteristics are simple and convenient to implement, and there are many instruments that support RS485.
[0003] The CAN network usually uses the CANopen protocol, which is a high-level communication protocol built on CAN, including a communication sub-protocol and a device sub-protocol. It is often used in embedded systems and is also a common field bus in industrial control. CANopen supports network management, device monitoring, and communication between nodes, including a simple transport layer that can handle the segmented transmission and combination of data. Generally, the data link layer and the physical layer are implemented using the CAN network.
[0004] However, none of the above-mentioned multiple on-site networking solutions commonly used in the prior art can meet the requirements of networking bandwidth and stability at a relatively low cost. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide an Ethernet networking method, a network module, a program product, and a storage medium, so as to solve the technical problem that the networking solutions in the prior art cannot meet the requirements of networking bandwidth and stability at a relatively low cost.
[0006] In a first aspect, the embodiments of this application provide an Ethernet networking system, including: a plurality of network modules, each network module including multiple groups of connectors, and each group of connectors including an input connector and an output connector corresponding to the input connector; the plurality of network modules are connected in sequence to form at least two ring links with opposite data transmission directions, where the input connector of any one of the plurality of network modules is connected to the output connector of the subsequent network module, and the output connector of any one of the plurality of network modules is connected to the input connector of the subsequent network module.
[0007] In the above solution, each network module included in the Ethernet networking system provided by the embodiments of the present application includes at least two input connectors and at least two output connectors. Based on the above network modules, multiple network modules can be connected in sequence to form at least two ring links with opposite data transmission directions. In this way, when there is a problem with the wire harness on one of the ring links, the wire harness on the other ring link can still be used for data transmission, thereby ensuring the integrity of the networking as much as possible. Compared with the networking solutions in the prior art, the Ethernet networking system provided by the embodiments of the present application can meet the requirements of networking bandwidth and stability at a lower cost.
[0008] In a second aspect, the embodiments of the present application provide an Ethernet networking method, which is applied to any network module in the Ethernet networking system described in the first aspect. The Ethernet networking method includes: when receiving a first loop detection instruction sent by a previous network module, filling the wire harness failure situation of itself into the first loop detection instruction to obtain a second loop detection instruction; and sending the second loop detection instruction to the previous network module or the next network module according to the wire harness failure situation.
[0009] In the above solution, any network module in the Ethernet networking system can fill the wire harness failure situation of itself when receiving the first loop detection instruction, so as to share the wire harness failure situation with other network modules; at the same time, any network module can also determine the subsequent transmission mode according to its own wire harness failure situation, so as to complete the loop detection as much as possible.
[0010] In an optional implementation manner, the sending the second loop detection instruction to the previous network module or the next network module according to the wire harness failure situation includes: if the wire harness failure situation indicates that the output wire harness between the current network module and the next network module fails, sending the second loop detection instruction to the next network module through the input wire harness between the current network module and the next network module. In the above solution, if only the output wire harness between the current network module and the next network module fails, it means that there is no loop disconnection between these two network modules. Therefore, data can be normally transmitted by switching data transmission to another input wire harness.
[0011] In an alternative embodiment, sending the second loop detection instruction to the previous network module or the next network module according to the harness failure situation includes: if the harness failure situation indicates that both the output harness and the input harness between the module and the next network module have failed, sending the second loop detection instruction to the previous network module. In the above solution, if both the output harness and the input harness between the current network module and the next network module have failed, it means that the loop between these two network modules is disconnected or the network module becomes an island. Therefore, by changing the data transmission direction, the normal data transmission can be ensured.
[0012] In an alternative embodiment, the Ethernet networking method further includes: determining whether the harness related to itself has failed to obtain the harness failure situation. In the above solution, the network device can determine whether the harness related to itself has failed, so that when receiving the first loop detection instruction, it can fill in the harness failure situation and determine the subsequent transmission method, thereby completing the loop detection as much as possible.
[0013] In a third aspect, an embodiment of the present application provides an Ethernet networking method, which is applied to a certain network module in the Ethernet networking system as described in the first aspect. The Ethernet networking method includes: selecting any one of at least two ring links as a first ring link, and based on the data transmission direction corresponding to the first ring link, sending a third loop detection instruction to the next network module; receiving a fourth loop detection instruction returned through the first ring link, where the fourth loop detection instruction includes the harness failure situation corresponding to the network module passed by the third loop detection instruction.
[0014] In the above solution, for the host module in the Ethernet networking system, loop detection can be performed by sending a third loop detection instruction, so as to ensure the normal operation of the loop as much as possible.
[0015] In an alternative embodiment, after receiving the fourth loop detection instruction returned via the first ring link, the Ethernet networking method further includes: comparing the number of network modules included in the fourth loop detection instruction with a preset number of modules; if the number of network modules is not equal to the preset number of modules, randomly selecting a second ring link from the remaining ring links, and based on the data transmission direction corresponding to the second ring link, sending a fifth loop detection instruction to the subsequent network module; receiving a sixth loop detection instruction returned via the second ring link, where the sixth loop detection instruction includes the harness failure condition corresponding to the network module through which the fifth loop detection instruction passes. In the above solution, in the case where the third loop detection instruction does not traverse all network modules, further loop detection is performed by sending a new loop detection instruction based on the data transmission direction corresponding to other ring links, so as to ensure the normal operation of the loop as much as possible.
[0016] Fourthly, an embodiment of the present application provides an Ethernet networking device, which is applied to any network module in the Ethernet networking system described in the first aspect. The Ethernet networking device includes: a filling module, configured to fill the harness failure condition of itself into the first loop detection instruction when receiving the first loop detection instruction sent by the previous network module, to obtain a second loop detection instruction; a first sending module, configured to send the second loop detection instruction to the previous network module or the subsequent network module according to the harness failure condition.
[0017] In the above solution, any network module in the Ethernet networking system can fill the harness failure condition of itself when receiving the first loop detection instruction, so that the above harness failure condition can be shared with other network modules; at the same time, any network module can also determine the subsequent transmission mode according to its own harness failure condition, so as to complete the loop detection as much as possible.
[0018] In an alternative embodiment, the first sending module is specifically configured to: if the harness failure condition indicates that the output harness between the current network module and the subsequent network module fails, send the second loop detection instruction to the subsequent network module through the input harness between the current network module and the subsequent network module. In the above solution, if only the output harness between the current network module and the subsequent network module fails, it means that there is no loop disconnection between these two network modules. Therefore, data can be normally transmitted by switching data transmission to another input harness.
[0019] In an alternative embodiment, the first sending module is specifically configured to: if the harness failure situation indicates that both the output harness and the input harness between the current network module and the subsequent network module have failed, send the second loop detection instruction to the previous network module. In the above solution, if both the output harness and the input harness between the current network module and the subsequent network module have failed, it indicates that there is a loop disconnection between these two network modules or the network module has become an island. Therefore, by changing the data transmission direction, the normal data transmission can be ensured.
[0020] In an alternative embodiment, the Ethernet networking device further includes: a judgment module, configured to judge whether the harness related to itself has failed, so as to obtain the harness failure situation. In the above solution, the network device can judge whether the harness related to itself has failed, so that when receiving the first loop detection instruction, it can fill in the harness failure situation and determine the subsequent transmission mode, so as to complete the loop detection as much as possible.
[0021] In a fifth aspect, an embodiment of the present application provides an Ethernet networking device, which is applied to a certain network module in the Ethernet networking system as described in the first aspect. The Ethernet networking device includes: a second sending module, configured to select any one of at least two ring links as a first ring link, and based on the data transmission direction corresponding to the first ring link, send a third loop detection instruction to the subsequent network module; a first receiving module, configured to receive a fourth loop detection instruction returned through the first ring link, where the fourth loop detection instruction includes the harness failure situation corresponding to the network module passed by the third loop detection instruction.
[0022] In the above solution, for the host module in the Ethernet networking system, the loop detection can be performed by sending a third loop detection instruction, so as to ensure the normal operation of the loop as much as possible.
[0023] In an alternative embodiment, the Ethernet networking device further includes: a comparison module, configured to compare the number of network modules included in the fourth loop detection instruction with a preset number of modules; a third sending module, configured to, if the number of network modules is not equal to the preset number of modules, select any one of the remaining ring links as a second ring link, and based on the data transmission direction corresponding to the second ring link, send a fifth loop detection instruction to the subsequent network module; a second receiving module, configured to receive a sixth loop detection instruction returned through the second ring link, where the sixth loop detection instruction includes the harness failure situation corresponding to the network module passed by the fifth loop detection instruction. In the above solution, in the case where the third loop detection instruction does not traverse all network modules, by sending a new loop detection instruction based on the data transmission direction corresponding to other ring links, further loop detection is performed, so as to ensure the normal operation of the loop as much as possible.
[0024] In a sixth aspect, an embodiment of the present application provides a network module, including: a control chip for executing the Ethernet networking method described in the second aspect or the Ethernet networking method described in the third aspect; a processor for controlling the control chip; multiple groups of connectors, each group of connectors including an input connector and an output connector corresponding to the input connector, and the connectors are used to connect other network modules.
[0025] In a seventh aspect, an embodiment of the present application provides a computer program product, including computer program instructions, and when the computer program instructions are read and run by a processor, they execute the Ethernet networking method described in the second aspect or the Ethernet networking method described in the third aspect.
[0026] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores computer program instructions. When the computer program instructions are run by a computer, the computer is made to execute the Ethernet networking method described in the second aspect or the Ethernet networking method described in the third aspect.
[0027] To make the above objects, features, and advantages of the present application more obvious and understandable, specific embodiments of the present application are hereinafter given, and in conjunction with the accompanying drawings, the detailed description is as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation of the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0029] Figure 1 It is a structural block diagram of a network module provided by an embodiment of the present application; Figure 2 It is a structural block diagram of another network module provided by an embodiment of the present application; Figure 3 It is a structural block diagram of an Ethernet networking system provided by an embodiment of the present application; Figure 4 It is a flowchart of an Ethernet networking method provided by an embodiment of the present application; Figure 5 It is a schematic diagram of a loop disconnection provided by an embodiment of the present application; Figure 6 It is a schematic diagram of a disconnection processing provided by an embodiment of the present application; Figure 7Another schematic diagram of disconnection processing provided by the embodiment of the present application; Figure 8 A schematic diagram of an island provided by the embodiment of the present application; Figure 9 A schematic diagram of the maximum tolerable harness failure provided by the embodiment of the present application; Figure 10 A schematic diagram of a harness failure diagnosis process provided by the embodiment of the present application; Figure 11 A flowchart of another Ethernet networking method provided by the embodiment of the present application; Figure 12 A structural block diagram of an Ethernet networking device provided by the embodiment of the present application; Figure 13 A structural block diagram of another Ethernet networking device provided by the embodiment of the present application.
[0030] Icon: 100 - Network module; 101 - Control chip; 102 - Processor; 103 - Connector. Detailed implementation manners
[0031] Next, the technical solutions in the embodiments of the present application will be described with reference to the accompanying drawings in the embodiments of the present application.
[0032] Please refer to Figure 1 , Figure 1 A structural block diagram of a network module provided by the embodiment of the present application. The network module 100 may include: a control chip 101, a processor 102, and multiple groups of connectors 103.
[0033] Specifically, the above control chip 101 is used to execute the Ethernet networking method provided by the embodiment of the present application, and its specific implementation manners will be introduced in subsequent embodiments and will not be described here for the time being. It should be noted that the specific implementation manners of the above control chip 101 are not specifically limited in the embodiments of the present application, and those skilled in the art can make appropriate adjustments according to the actual situation. For example: the control chip 101 may adopt a switch chip, a CAN controller, an RS485 controller, a physical layer (Physical Layer Chip, PHY) chip, and other communication controllers, etc.
[0034] The above-mentioned processor 102 is used to control the above-mentioned control chip 101. Among them, the processor 102 includes one or more, which can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 102 can be a general-purpose processor, including a central processing unit (CPU), a microcontroller unit (MCU), a network processor (NP), or other conventional processors; it can also be a dedicated processor, including a neural-network processing unit (NPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Moreover, when there are multiple processor 102s, a part of them can be general-purpose processors, and another part can be dedicated processors.
[0035] As an implementation, when the processor 102 uses an MCU and the control chip 101 uses a Switch chip, the MCU can control the Switch chip through a media independent interface (MII).
[0036] Each group of connectors 103 in the above-mentioned multiple groups of connectors 103 includes an input connector and an output connector corresponding to the input connector, and each connector 103 is used to connect to other network modules 100. Among them, the input connector of the current network module is used to connect to the output connector of other network modules 100, and the data in the current network module 100 can be sent to other network modules 100 through this input connector; similarly, the output connector of the current network module 100 is used to connect to the input connector of other network modules 100, and the data in the current network module 100 can receive the data sent by other network modules 100 through this output connector.
[0037] As an implementation, two network modules 100 can be connected through a network cable.
[0038] It should be noted that the embodiments of the present application do not specifically limit the specific implementation manner of the above-mentioned connector 103. Those skilled in the art can make appropriate adjustments according to the actual situation. For example, the connector 103 can be an RJ45 network port, or other types of connectors 103. In addition, the embodiments of the present application do not specifically limit the number of the above-mentioned connectors 103. For example, the network module 100 can include two groups of connectors 103 (i.e., including 4 connectors 103), or the network module 100 can include three groups of connectors 103 (i.e., including 6 connectors 103), etc.
[0039] It can be understood that Figure 1 The structure shown is only schematic, and the network module 100 may further include more or fewer components than Figure 1 shown therein, or have a different configuration from Figure 1 shown therein. Figure 1 Each component shown therein can be implemented by hardware, software, or a combination thereof.
[0040] Taking Figure 2 the network module 100 shown as an example, the network module 100 includes a control chip Switch, a processor MCU, and two groups of connectors. Among them, the first group of connectors includes connector RJ45 1 and connector RJ45 2. Connector RJ45 1 is connected to the output connector of other network modules through input network cable 1, and connector RJ45 2 is connected to the input connector of other network modules through output network cable 1. The second group of connectors includes connector RJ45 3 and connector RJ45 4. Connector RJ45 3 is connected to the output connector of other network modules through input network cable 2, and connector RJ45 4 is connected to the input connector of other network modules through output network cable 2.
[0041] Please refer to Figure 3 Figure 3 which is a structural block diagram of an Ethernet networking system provided by an embodiment of the present application. The Ethernet networking system may include: a plurality of network modules, and the above-mentioned plurality of network modules are sequentially connected to form at least two ring links with opposite data transmission directions.
[0042] Specifically, the input connector of any one of the plurality of network modules is connected to the output connector of the subsequent network module, and the output connector of any one of the plurality of network modules is connected to the input connector of the subsequent network module. It can be understood that since each network module includes multiple groups of connectors, therefore, the plurality of network modules can form at least two ring links when connected once, and in the embodiments of the present application, the data transmission directions corresponding to the above two ring links are opposite.
[0043] Taking Figure 3 Taking the shown Ethernet networking system as an example, this Ethernet networking system includes 16 network modules, namely network module 1, network module 2, …, network module 16. Each network module includes two groups of connectors. Assuming that network module 1 is the host module, the data transmission direction is: network module 1, network module 2, network module 3, …, network module 15, network module 16, network module 1 for the first ring link; similarly, the data transmission direction is: network module 1, network module 16, network module 15, …, network module 3, network module 2, network module 1 for the second ring link; it can be seen that the data transmission directions corresponding to the two ring links are opposite.
[0044] It should be noted that Figure 3 the arrows shown in indicate that when the wiring harnesses in the Ethernet networking are normal, each wiring harness is unidirectional communication; however, when the wiring harnesses in the Ethernet networking fail, some wiring harnesses can be bidirectional communication.
[0045] It should be noted that the embodiments of the present application do not specifically limit the number of network modules included in the Ethernet networking system. Those skilled in the art can make appropriate adjustments according to the actual situation. For example: as Figure 3 shown by the 16 network modules, or other numbers of network modules, etc.
[0046] In addition, the embodiments of the present application do not specifically limit the connection sequence of multiple network modules. Those skilled in the art can make appropriate adjustments according to the actual situation. For example, as Figure 3 shown, network module 1 is connected to network module 2, network module 2 is connected to network module 3, …, network module 15 is connected to network module 16, network module 16 is connected to network module 1; or, network module 1 is connected to network module 16, network module 16 is connected to network module 3, …, network module 14 is connected to network module 15, network module 15 is connected to network module 1, etc.
[0047] In the above solution, the network modules included in the Ethernet networking system provided by the embodiments of the present application all include at least two input connectors and at least two output connectors. Based on the above network modules, multiple network modules can be connected in sequence to form at least two ring links with opposite data transmission directions. In this way, when the wiring harness on one of the ring links has a problem, the wiring harness on the other ring link can still be used for data transmission, so as to ensure the integrity of the networking as much as possible. Compared with the networking solutions in the prior art, the Ethernet networking system provided by the embodiments of the present application can meet the requirements of networking bandwidth and stability at a lower cost.
[0048] Based on the above network module and Ethernet networking system, an embodiment of the present application further provides an Ethernet networking method, which is applied to any network module. Please refer to Figure 4 , Figure 4 which is a flowchart of an Ethernet networking method provided by an embodiment of the present application. The Ethernet networking method may specifically include the following steps: Step S401: When receiving a first loop detection instruction sent by the previous network module, fill the harness failure situation of itself into the first loop detection instruction to obtain a second loop detection instruction.
[0049] Step S402: According to the harness failure situation, send the second loop detection instruction to the previous network module or the next network module.
[0050] Specifically, in the above step S401, the previous network module corresponding to the current network module refers to the previous network of the current network module on the ring link; that is, on the ring link, the output connector of the previous network module is connected to the input connector of the current network module, and the previous network module can send data to the current network module through the above connection. Similarly, the next network module corresponding to the current network module refers to the next network of the current network module on the ring link; that is, on the ring link, the input connector of the next network module is connected to the output connector of the current network module, and the current network module can send data to the next network module through the above connection.
[0051] It can be understood that the above descriptions of the previous network module and the next network module are only used to characterize the connection relationship between network modules, and do not represent the actual physical position relationship of network modules.
[0052] Taking Figure 3 the shown Ethernet networking system as an example, the data transmission direction is: Network Module 1, Network Module 2, Network Module 3,..., Network Module 15, Network Module 16, Network Module 1 is the first ring link. On this ring link, if Network Module 2 is the current network module, then Network Module 1 is the previous network module of Network Module 2, and Network Module 3 is the next network module of Network Module 2; Data transmission direction: Network Module 1, Network Module 16, Network Module 15,..., Network Module 3, Network Module 2, Network Module 1 is the second ring link. On this ring link, if Network Module 2 is the current network module, then Network Module 3 is the previous network module of Network Module 2, and Network Module 1 is the next network module of Network Module 2.
[0053] As an implementation method, any network module in the ring link can be used as the starting point of loop detection. The network module sends a loop detection instruction to the ring link. The loop detection instruction traverses all network modules that can be traversed, and finally returns to the network module to achieve loop detection. As another implementation method, a network module in the ring link can be a host module. The host module is the starting point of loop detection. The host module sends a loop detection instruction to the ring link. The loop detection instruction traverses all network modules that can be traversed, and finally returns to the host module to achieve loop detection.
[0054] It should be noted that the starting point of the loop detection can select any ring link to send when sending the loop detection instruction. If the loop detection instruction can traverse all network modules in the Ethernet networking system, the loop detection can be ended; if the loop detection instruction cannot traverse all network modules in the Ethernet networking system, another ring link can be selected to send a new loop detection instruction, and so on, until the loop detection instructions sent multiple times have traversed all network modules in the Ethernet networking system together, or the loop detection instruction has been sent for each ring link.
[0055] It can be understood that there are two situations regarding the loop detection instruction received by the current network module: in the first situation, if the current network module is the subsequent network module of the starting point of the loop detection, then the current network module receives the original loop detection instruction; in the second situation, if the current network module is not the subsequent network module of the starting point of the loop detection, then the current network module receives the loop detection instruction that has been processed by the previous network module.
[0056] For the convenience of description, the loop detection instructions received by the current network module in the above two situations are uniformly named as the first loop detection instruction, and the loop detection instruction obtained after the first loop detection instruction is processed by the current network module is named as the second loop detection instruction. After receiving the first loop detection instruction, the current network module can process the first loop detection instruction in the following manner: fill its own wiring harness failure condition into the first loop detection instruction, thereby obtaining the second loop detection instruction.
[0057] The above-mentioned wiring harness failure condition may be information predetermined by the current network module before executing step S401. As an implementation mode, the current network module may determine its own wiring harness failure condition before receiving the first loop detection instruction; as another implementation mode, the current network module may also determine its own wiring harness failure condition after receiving the first loop detection instruction.
[0058] It should be noted that the embodiments of the present application do not specifically limit the specific implementation manner for the current network module to determine its own harness failure situation. Those skilled in the art can make appropriate adjustments according to the actual situation. For example, a harness diagnosis instruction can be sent to other network modules through the harness, or a harness diagnosis instruction sent by other network devices can be received through the harness, etc.
[0059] In the above step S402, according to the harness failure situation, the current network module can send the second loop detection instruction to the previous network module or the next network module. For example, if all the harnesses between the current network module and the next network fail, the second loop detection instruction can be sent to the previous network module, so that the previous network module can send the second loop detection instruction to the previous network module again until the second loop detection instruction is sent back to the starting point of the loop detection.
[0060] For another example, if there are non-failed harnesses between the current network module and the next network, the second loop detection instruction can be sent to the next network module, so that the next network module can send the second loop detection instruction to the next network module again until the second loop detection instruction is sent back to the starting point of the loop detection.
[0061] In the above solution, any network module in the Ethernet networking system can fill in its own harness failure situation when receiving the first loop detection instruction, so as to share the above harness failure situation with other network modules; at the same time, any network module can also determine the subsequent transmission method according to its own harness failure situation, so as to complete the loop detection as much as possible.
[0062] Further, on the basis of the above embodiments, in the case of harness failure, it is divided into two cases according to whether a loop is disconnected. Please refer to Figure 5 , Figure 5 which is a schematic diagram of a loop disconnection provided by the embodiments of the present application. Among them, the harness between two network modules is represented by a dotted line, indicating that the harness between the two network modules fails.
[0063] If all the harnesses between network module 11 and network module 12 fail, data cannot be transmitted between network module 11 and network module 12, that is, the loop between network module 11 and network module 12 is disconnected; while if the harness between network module 11 and network module 12 is not failed or only one harness fails, data can be transmitted between network module 11 and network module 12, that is, the loop between network module 11 and network module 12 is not disconnected.
[0064] As an implementation manner, in the case where the loop is not disconnected, if a harness failure is found, it can be switched to another harness. Please refer to Figure 6 , Figure 6A schematic diagram of disconnection processing provided by an embodiment of the present application. Among them, the wire harness between two network modules is represented by a dotted line, indicating that the wire harness between the two network modules fails. Figure 6 The dotted line shown in it represents the loop direction. At this time, step S402 above may specifically include the following steps: If the wire harness failure situation indicates that the output wire harness between the current network module and the subsequent network module fails, then send the second loop detection instruction to the subsequent network module through the input wire harness between the current network module and the subsequent network module.
[0065] It can be understood that if the wire harness failure situation indicates that the input wire harness between the current network module and the subsequent network module fails, then the second loop detection instruction can be sent to the subsequent network module through the output wire harness between the current network module and the subsequent network module.
[0066] In the above solution, if only the output wire harness fails between the current network module and the subsequent network module, it means that there is no loop disconnection between these two network modules. Therefore, data transmission can be switched to another input wire harness to ensure normal data transmission.
[0067] As another implementation manner, in the case of loop disconnection, the data transmission direction can be changed, and finally return to the starting point of the loop link from both ends of the two disconnected loops respectively. Please refer to Figure 7 , Figure 7 Another schematic diagram of disconnection processing provided by an embodiment of the present application. Among them, the wire harness between two network modules is represented by a dotted line, indicating that the wire harness between the two network modules fails. Figure 7 The dotted line shown in it represents the loop direction. At this time, step S402 above may specifically include the following steps: If the wire harness failure situation indicates that both the output wire harness and the input wire harness between the current network module and the subsequent network module fail, then send the second loop detection instruction to the previous network module.
[0068] It can be understood that in addition to Figure 7 the loop disconnection situation shown, there may also be a situation where an island appears in the Ethernet networking system. Please refer to Figure 8 , Figure 8 A schematic diagram of an island provided by an embodiment of the present application. The wire harnesses between network module 11 and network module 12 all fail, and the wire harnesses between network module 13 and network module 14 all fail. Therefore, the loop between network module 11 and network module 12 is disconnected, and the loop between network module 13 and network module 14 is disconnected. Network module 12 and network module 13 form an island. At this time, step S402 above may specifically include the following steps: If the wire harness failure situation indicates that both the output wire harness and the input wire harness between the current network module and the subsequent network module fail, then send the second loop detection instruction to the previous network module.
[0069] Among them, during the process of loop detection, the network modules forming an island (such as Figure 9 the network module 12 and the network module 13 in
[0070] Further, based on the above embodiments, the embodiments of the present application have a very high tolerance for harness failures. For example, Figure 8 as shown, at least four harness failures need to occur simultaneously, and these four harness failures result in the formation of an island in the network. If no island appears, please refer to Figure 9 Figure 9 which is a schematic diagram of the maximum tolerable harness failures provided by the embodiments of the present application. The maximum number of tolerable harness failures is half of the total number of harnesses plus one.
[0071] In the above solution, if both the output harness and the input harness between the current network module and the next network module fail, it indicates that a loop is disconnected between these two network modules or a network module becomes an island. Therefore, the data transmission direction can be adapted to ensure normal data transmission.
[0072] Further, based on the above embodiments, the Ethernet networking method provided by the embodiments of the present application may further include the following steps: Determine whether the harness related to itself fails to obtain the harness failure situation.
[0073] Specifically, please refer to Figure 10 Figure 10 which is a schematic diagram of a harness failure diagnosis process provided by the embodiments of the present application. In Figure 10 the network module 10, the network module 11, and the network module 12 are three consecutive network modules in the Ethernet networking, and 0101, 0102, 0103, and 0104 are the harnesses used during networking. Taking the network module 11 as an example, during the harness failure diagnosis, the network module 11 can send a communication detection instruction to the network module 10 through 0101. If the network module 10 receives this instruction, it will return a response instruction. If the network module 11 receives the response instruction, it means that the harness 0101 is not failed; otherwise, it means that the harness 0101 is failed. Similarly, it can be detected whether 0102, 0103, and 0104 are failed.
[0074] In the above solution, the network device can determine whether the harness related to itself fails, so that when receiving the first loop detection instruction, it can fill in the harness failure situation and determine the subsequent transmission method to complete the loop detection as much as possible.
[0075] Based on the above network module and Ethernet networking system, an embodiment of the present application further provides another Ethernet networking method. This Ethernet networking method is applied to a certain network module, that is, the host module. Please refer to Figure 11 , Figure 11 which is a flowchart of another Ethernet networking method provided by an embodiment of the present application. This Ethernet networking method may specifically include the following steps: Step S1101: Select any one of at least two ring links as the first ring link, and based on the data transmission direction corresponding to the first ring link, send a third loop detection instruction to the subsequent network module.
[0076] Step S1102: Receive a fourth loop detection instruction returned through the first ring link. The fourth loop detection instruction includes the harness failure situation corresponding to the network module passed by the third loop detection instruction.
[0077] Specifically, the host module can select a loop detection direction and send a loop detection instruction. This loop detection instruction traverses all the network modules that it can traverse and finally returns to this network module to implement loop detection. After receiving this loop detection instruction, other network modules in the Ethernet networking can detect whether the harness related to themselves fails, fill the detection result into the loop detection instruction, and judge whether a loop interruption occurs according to the detection result. If no loop interruption occurs, send the loop detection instruction filled with data in the loop detection direction. If a loop interruption occurs, change the loop detection direction and continue to transmit the loop detection instruction until the filled loop detection instruction returns to the host module.
[0078] It can be understood that the host module can judge whether there is a harness failure, a loop interruption, and whether there is an island in the Ethernet networking according to the received loop detection instruction filled with data.
[0079] In the above solution, for the host module in the Ethernet networking system, loop detection can be performed by sending a third loop detection instruction, so as to ensure the normal operation of the loop as much as possible.
[0080] Further, on the basis of the above embodiment, after the above step S1102, the Ethernet networking method provided by an embodiment of the present application may further include the following steps: Step 1), compare the number of network modules included in the fourth loop detection instruction with a preset number of modules.
[0081] Step 2), if the number of network modules is not equal to the preset number of modules, select any one of the remaining ring links as the second ring link, and based on the data transmission direction corresponding to the second ring link, send a fifth loop detection instruction to the subsequent network module.
[0082] Step 3), receive the sixth loop detection instruction returned through the second loop link, where the sixth loop detection instruction includes the harness failure condition corresponding to the network module passed by the fifth loop detection instruction.
[0083] Specifically, when the host module sends a loop detection instruction, it can choose any one loop link to send. If the loop detection instruction can traverse all network modules in the Ethernet networking system, the loop detection can be ended; if the loop detection instruction cannot traverse all network modules in the Ethernet networking system, another loop link can be selected to send a new loop detection instruction, and so on, until the loop detection instructions sent multiple times together traverse all network modules in the Ethernet networking system, or loop detection instructions have been sent for each loop link.
[0084] In the above solution, in the case where the third loop detection instruction does not traverse all network modules, a new loop detection instruction is sent based on the data transmission direction corresponding to other loop links for further loop detection, so as to ensure the normal operation of the loop as much as possible.
[0085] Further, on the basis of the above embodiments, if the data transmission volume is too large and the network module cannot process it in time, the MCU can control the Switch chip to pause sending data to the MCU. At this time, the data received by the Switch chip will be stored in the internal cache of the chip; at the same time, the MCU can send an instruction to the upstream of the data transmission link to perform the same operation and slow down the speed of sending data downstream to obtain time for processing data.
[0086] Further, on the basis of the above embodiments, each module will send a reception success instruction to the data sending source after receiving the data. If the data source does not receive the reception success instruction after a period of time, the data will be resent.
[0087] Further, on the basis of the above embodiments, after the loop detection is completed, the host module can know the number of modules on the loop. At this time, the host can perform automatic coding according to the situation of the loop. If the loop is complete, select a coding direction and send an automatic coding instruction in this direction. After the module receives the instruction, it will obtain its own ID in turn; if the loop is disconnected, send automatic coding instructions to both sides respectively.
[0088] Please refer to Figure 12 , Figure 12A structural block diagram of an Ethernet networking device provided by an embodiment of the present application, which is applied to any network module in an Ethernet networking system. The Ethernet networking device 1200 includes: a filling module 1201, configured to fill its own harness failure situation into the first loop detection instruction when receiving the first loop detection instruction sent by the previous network module, to obtain a second loop detection instruction; a first sending module 1202, configured to send the second loop detection instruction to the previous network module or the next network module according to the harness failure situation.
[0089] In the above solution, any network module in the Ethernet networking system can fill its own harness failure situation when receiving the first loop detection instruction, so as to share the above harness failure situation with other network modules; at the same time, any network module can also determine the subsequent transmission mode according to its own harness failure situation, so as to complete the loop detection as much as possible.
[0090] Further, on the basis of the above embodiment, the first sending module 1202 is specifically configured to: if the harness failure situation indicates that the output harness between the current network module and the next network module fails, send the second loop detection instruction to the next network module through the input harness between the current network module and the next network module.
[0091] In the above solution, if only the output harness between the current network module and the next network module fails, it means that there is no loop disconnection between these two network modules. Therefore, data transmission can be switched to another input harness to ensure normal data transmission.
[0092] Further, on the basis of the above embodiment, the first sending module 1202 is specifically configured to: if the harness failure situation indicates that both the output harness and the input harness between the current network module and the next network module fail, send the second loop detection instruction to the previous network module.
[0093] In the above solution, if both the output harness and the input harness between the current network module and the next network module fail, it means that there is a loop disconnection between these two network modules or the network module becomes an island. Therefore, data transmission direction can be adapted to ensure normal data transmission.
[0094] Further, on the basis of the above embodiment, the Ethernet networking device 1200 further includes: a judgment module, configured to judge whether the harness related to itself fails, to obtain the harness failure situation.
[0095] In the above solution, the network device can judge whether the harness related to itself fails, so that when receiving the first loop detection instruction, it can fill the harness failure situation and determine the subsequent transmission mode, so as to complete the loop detection as much as possible.
[0096] Please refer to Figure 13 , Figure 13 which is a structural block diagram of another Ethernet networking device provided by an embodiment of this application, and is applied to a certain network module in an Ethernet networking system. The Ethernet networking device 1300 includes: a second sending module 1301, configured to select any one of at least two ring links as a first ring link, and based on the data transmission direction corresponding to the first ring link, send a third loop detection instruction to a subsequent network module; a first receiving module 1302, configured to receive a fourth loop detection instruction returned through the first ring link, where the fourth loop detection instruction includes a harness failure condition corresponding to the network module through which the third loop detection instruction passes.
[0097] In the above solution, for the host module in the Ethernet networking system, loop detection can be performed by sending a third loop detection instruction, so as to ensure the normal operation of the loop as much as possible.
[0098] In an alternative embodiment, the Ethernet networking device 1300 further includes: a comparison module, configured to compare the number of network modules included in the fourth loop detection instruction with a preset number of modules; a third sending module, configured to, if the number of network modules is not equal to the preset number of modules, select any one of the remaining ring links as a second ring link, and based on the data transmission direction corresponding to the second ring link, send a fifth loop detection instruction to a subsequent network module; a second receiving module, configured to receive a sixth loop detection instruction returned through the second ring link, where the sixth loop detection instruction includes a harness failure condition corresponding to the network module through which the fifth loop detection instruction passes.
[0099] In the above solution, when the third loop detection instruction does not traverse all network modules, further loop detection is performed by sending a new loop detection instruction based on the data transmission direction corresponding to other ring links, so as to ensure the normal operation of the loop as much as possible.
[0100] The embodiments of the present application further provide a computer program product, including a computer program stored on a computer-readable storage medium. The computer program includes computer program instructions. When the computer program instructions are executed by a computer, the computer can execute the steps of the Ethernet networking method in the foregoing embodiments. For example, it includes: Step S401: When receiving a first loop detection instruction sent by a previous network module, fill the harness failure situation of itself into the first loop detection instruction to obtain a second loop detection instruction. Step S402: According to the harness failure situation, send the second loop detection instruction to the previous network module or the next network module. Or, for example, it includes: Step S1101: Select any first ring link from at least two ring links, and based on the data transmission direction corresponding to the first ring link, send a third loop detection instruction to the next network module. Step S1102: Receive a fourth loop detection instruction returned through the first ring link, where the fourth loop detection instruction includes the harness failure situation corresponding to the network module through which the third loop detection instruction passes.
[0101] The embodiments of the present application further provide a computer-readable storage medium. The computer-readable storage medium stores computer program instructions. When the computer program instructions are run by a computer, the computer executes the Ethernet networking method described in the foregoing method embodiments.
[0102] In the embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some communication interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.
[0103] In addition, the units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0104] Furthermore, in each embodiment of the present application, the functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0105] It should be noted that if a function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0106] In this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0107] The above are only embodiments of the present application and are not used to limit the protection scope of the present application. For those skilled in the art, the present application can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. An Ethernet networking method, characterized in that: Any network module used in an Ethernet networking system, the Ethernet networking system includes multiple network modules, each network module includes multiple groups of connectors, each group of connectors includes an input connector and an output connector corresponding to the input connector, the multiple network modules are connected in sequence to form at least two ring links with opposite data transmission directions, wherein the input connector of any network module in the multiple network modules is connected to the output connector of the next network module, and the output connector of any network module in the multiple network modules is connected to the input connector of the next network module, and the Ethernet networking method includes: When receiving the first loop detection instruction sent by the previous network module, filling its own wiring harness failure condition into the first loop detection instruction to obtain a second loop detection instruction; The second loop detection instruction is sent to a previous network module or a subsequent network module according to the failure condition of the wiring harness.
2. The Ethernet networking method according to claim 1, characterized in that: The step of sending the second loop detection instruction to a previous network module or a subsequent network module according to the wiring harness failure condition includes: If the wiring harness failure indicates that the output wiring harness between the subsequent network module and the subsequent network module fails, the second loop detection instruction is sent to the subsequent network module through the input wiring harness between the subsequent network module and the subsequent network module.
3. The Ethernet networking method according to claim 1, characterized in that: The step of sending the second loop detection instruction to a previous network module or a subsequent network module according to the wiring harness failure condition includes: If the wiring harness failure indicates that both the output wiring harness and the input wiring harness between the latter network module and the latter network module fail, the second loop detection instruction is sent to the former network module.
4. The Ethernet networking method according to any one of claims 1 to 3, characterized in that: The Ethernet networking method further includes: Determine whether the wiring harness related to itself is failed, and obtain the failure status of the wiring harness.
5. An Ethernet networking method, characterized in that: A network module applied to an Ethernet networking system, the Ethernet networking system comprising a plurality of network modules, each network module comprising a plurality of connector groups, each connector group comprising an input connector and an output connector corresponding to the input connector, the plurality of network modules being sequentially connected to form at least two ring links with opposite data transmission directions, wherein the input connector of any network module among the plurality of network modules is connected to the output connector of the next network module, and the output connector of any network module among the plurality of network modules is connected to the input connector of the next network module, the Ethernet networking method comprising: Selecting a first ring link from at least two ring links, and sending a third loop detection instruction to a subsequent network module based on a data transmission direction corresponding to the first ring link; A fourth loop detection instruction returned via the first ring link is received, wherein the fourth loop detection instruction includes a wiring harness failure condition corresponding to a network module along the path of the third loop detection instruction.
6. The Ethernet networking method according to claim 5, characterized in that: After receiving the fourth loop detection instruction returned through the first ring link, the Ethernet networking method further includes: Comparing the number of network modules included in the fourth loop detection instruction with the preset number of modules; If the number of the network modules is not equal to the number of the preset modules, a second ring link is selected from the remaining ring links, and based on the data transmission direction corresponding to the second ring link, a fifth loop detection instruction is sent to the next network module; A sixth loop detection instruction returned via the second ring link is received, wherein the sixth loop detection instruction includes a wiring harness failure condition corresponding to a network module along the path of the fifth loop detection instruction.
7. A network module, characterized in that: include: A control chip, used to execute the Ethernet networking method according to any one of claims 1 to 4 or the Ethernet networking method according to claim 5 or 6; A processor, used to control the control chip; Multiple groups of connectors, each group of connectors includes an input connector and an output connector corresponding to the input connector, and the connectors are used to connect other network modules.
8. A computer program product, characterized in that The method comprises computer program instructions, and when the computer program instructions are read and executed by a processor, the Ethernet networking method according to any one of claims 1 to 4 or the Ethernet networking method according to claim 5 or 6 is executed.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a computer, the computer executes the Ethernet networking method according to any one of claims 1 to 4 or the Ethernet networking method according to claim 5 or 6.
Citation Information
Patent Citations
Method for preventing generation of loop, host node and system
CN101184013A
Dual-link redundancy control method based on EPA switch
CN102394787A
Looped network node MAC address table refreshing and optimizing method
CN104158715A