Ethernet switching equipment, control method thereof and Ethernet network
By introducing ports 0, 1, and 2 into the Ethernet switching device and combining them with monitoring and switching modules, the port status and operating mode are dynamically controlled. This solves the problem that Ethernet ring networks with only one port at the master station cannot achieve ring network redundancy, realizes complete data communication between the master station and slave station networks, reduces dependence on master station hardware, and is suitable for upgrading and transforming non-ring networks.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING FANGXIN SEMICON CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-05-01
AI Technical Summary
Existing Ethernet ring networks struggle to achieve ring redundancy when the master station has only one port, and they place high demands on the master station software, making them unsuitable for upgrading non-ring networks and increasing costs.
By introducing ports 0, 1, and 2 into Ethernet switching devices, and combining them with port monitoring and switching modules, the port status and operating mode can be dynamically controlled to switch data forwarding paths, build logical loops, and reduce dependence on the main station hardware configuration.
It enables complete data communication between the master station and the slave station network with only one communication port at the master station, reduces the dependence on the master station hardware, is suitable for upgrading and transforming non-ring networks, and ensures the continuity and reliability of communication.
Smart Images

Figure CN121967354A_ABST
Abstract
Description
An Ethernet switching device and its control method, and an Ethernet network. Technical Field
[0001] This application relates to the field of Ethernet technology, and in particular to an Ethernet switching device and its control method, and an Ethernet network. Background Technology
[0002] Ethernet networks are often configured with redundancy to ensure that communication can continue even after a single breakpoint occurs. Currently, a ring network structure, as shown in Figure 1, employs ring network redundancy. When a break occurs in the ring network, it can be bypassed, as illustrated in Figure 2, a communication path diagram of a ring network. The frame path when no breakpoint occurs is shown by the dotted line in Figure 2. When a breakpoint occurs, the master station sends frames from two ports in clockwise and counterclockwise directions respectively, allowing the frames to pass through the data exchange modules of all slave stations, enabling read and write operations. However, the ring network communication shown in Figures 1 and 2 places high demands on the master station software and cannot be used for upgrading existing non-ring networks. For example, if the master station has only one port, implementing ring network redundancy requires replacing the master station with one that has two ports, increasing costs. Summary of the Invention
[0003] In view of this, this application provides an Ethernet switching device and its control method, as well as an Ethernet network, which aims to reduce dependence on the master station and facilitate the upgrading and transformation of non-ring networks.
[0004] An Ethernet switching device is characterized by comprising port 0, port 1, and port 2; port 0 establishes a bidirectional communication connection with the master station, port 1 connects to the beginning of the slave network, and port 2 connects to the end of the slave network; the switching device is used to control one or more of ports 0, 1, and 2 to be in an on or off state, and / or control port 2 to be in a bounce state, so as to switch the operating mode of the switching device and adjust the data forwarding path within the switching device; the bounce state means that port 2 receives data sent by the slave network and then sends it back to the slave network from port 2.
[0005] Optionally, the switching device includes a port monitoring module and a switching module, wherein the switching module is connected to the port monitoring module; the port monitoring module is connected to ports 0, 1, and 2 of the switching device, and is used to monitor the physical connection status between the ports of the switching device and the slave network, as well as the data transmission and reception status and timing of the ports of the switching device; the switching module is used to switch the operating mode of the switching device in response to the physical connection status being disconnected, or the transmission and reception status or timing of the ports of the switching device changing.
[0006] Optionally, the switching module is further configured to switch the operating mode of the switching device to a 2-port bounce mode in response to the restoration of the physical connection state or the restoration of the transmission and reception timing of the switching device.
[0007] Optionally, the operating modes of the switching device include full-on mode, port 1-off mode, port 2-off mode, and port 2-reverse mode. In full-on mode, ports 0, 1, and 2 are all on, and the data forwarding path within the switching device is from port 0 to port 1, from port 1 to port 2, and from port 2 to port 0. In port 1-off mode, port 1 is off and ports 0 and 2 are on, and the data forwarding path within the switching device is bidirectional communication between ports 0 and 2. In port 2-off mode, port 2 is off and ports 0 and 1 are on, and the data forwarding path within the switching device is bidirectional communication between ports 0 and 1. In port 2-reverse mode, port 2 is in reverse state and ports 0 and 1 are on, and the data forwarding path within the switching device is bidirectional communication between ports 0 and 1. After receiving data, port 2 then sends it outside the switching device.
[0008] Optionally, the switching device further includes the data switching module configured on port 0, and / or the data switching module configured on port 2; the data switching module is used to forward data from the corresponding port to the next port, or to process the data from the corresponding port and then forward it to the next port.
[0009] Secondly, this application also provides a control method for an Ethernet switching device, applied to an Ethernet switching device as described in any one of the above claims. The method includes: monitoring the physical connection status between the port of the switching device and the slave network, as well as the data transmission and reception status and timing of the port of the switching device; switching the operating mode of the switching device in response to the physical connection status being disconnected, or the transmission and reception status or timing of the port of the switching device changing; and switching the operating mode of the switching device to a 2-port bounce mode in response to the physical connection status being restored, or the transmission and reception timing of the switching device being restored.
[0010] Optionally, switching the operating mode of the switching device when the physical connection state is disconnected, or when the transmit / receive state or transmit / receive timing of the switching device's port changes, includes: if the physical connection state between port 1 of the switching device and the head end of the slave network is detected to be disconnected, then it is determined that a breakpoint has occurred at the head end of the slave network, and the device is switched to port 1 closed mode; if the physical connection state between port 2 of the switching device and the tail end of the slave network is detected to be disconnected, then it is determined that a breakpoint has occurred at the tail end of the slave network, and the device is switched to port 2 closed mode; in port 2 bounce mode, if port 1 receives data sent by the slave network before port 2, it is determined that a breakpoint exists in the slave network, and the device is switched to fully open mode.
[0011] Optionally, in response to the recovery of the transmission and reception timing of the switching device, the operating mode of the switching device is switched to the 2-port bounce mode, including: in the fully open mode, if it is detected that port 2 receives data sent by the slave network first, while port 1 does not receive data sent by the slave network, then it is determined that the breakpoint in the slave network has been recovered, and the device is switched back to the 2-port bounce mode.
[0012] Optionally, the method further includes: resetting the switching device and restoring it to port 2 bounce mode when the device only receives data and does not send data on port 0.
[0013] Thirdly, this application also provides an Ethernet network, including a master station, a slave station network, and an Ethernet switching device as described in any one of the above, wherein the switching device uses the method described in any one of the above to realize complete data communication between the master station and the slave station network.
[0014] This application provides an Ethernet switching device and its control method, as well as an Ethernet network. The Ethernet switching device includes port 0, port 1, and port 2. Port 0 establishes a bidirectional communication connection with the master station, port 1 connects to the beginning of the slave network, and port 2 connects to the end of the slave network. The switching device controls one or more of ports 0, 1, and 2 to be in an on or off state, and / or controls port 2 to be in a bounce state, thereby switching the operating mode of the switching device and adjusting the data forwarding path within the switching device. The bounce state means that port 2 receives data sent by the slave network and then sends it back to the slave network from port 2. Thus, this application achieves switching of the data transmission path between the master station and the slave network by controlling the three ports of the switching device, ensuring complete data communication across the entire network while reducing dependence on the master station's hardware configuration, making it particularly suitable for master station scenarios with only a single communication port. Furthermore, configuring port 2 in bounce mode enables data to be transmitted back to the end of the slave network, allowing even if the master station has only one communication port, a logical loop can be constructed through the switching device to achieve redundant ring network communication. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings used in the description of the embodiment or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 is a schematic diagram of a ring network provided in an embodiment of this application; Figure 2 is a schematic diagram of a communication path in a ring network provided in an embodiment of this application; Figure 3 is a schematic diagram of an Ethernet switching device provided in an embodiment of this application; Figure 4 is a schematic diagram of a transmission path within a switching device under different modes provided in an embodiment of this application; Figure 5 is a schematic diagram of a switching device with data switching modules configured on both ports 0 and 2 provided in an embodiment of this application; Figure 6 is a schematic diagram of a switching device with a data switching module configured on port 2 provided in an embodiment of this application; Figure 7 is a flowchart of a control method for an Ethernet switching device provided in an embodiment of this application; Figure 8 is a schematic diagram of a network communication path without interruptions provided in an embodiment of this application; Figure 9 is a schematic diagram of a network communication path in full-open mode when there is an interruption in the middle of the slave network provided in an embodiment of this application; Figure 10 is a schematic diagram of a communication path in port 1 closed mode when the head end of the slave network is disconnected provided in an embodiment of this application; Figure 11 is a schematic diagram of a communication path in port 2 closed mode when the tail end of the slave network is disconnected provided in an embodiment of this application; Figure 12 is a schematic diagram of a port transmit / receive timing provided in an embodiment of this application. Detailed Implementation
[0017] Referring to the ring topology shown in Figures 1 and 2, there is no switch; identification and routing are handled by the master station. The master station connects to the beginning and end of the slave network through two ports to establish a ring communication path. The master station reads the content of frames retrieved from the slave network for identification and performs routing by concatenating single and mutual transmissions. Frame content identification is generally achieved through the WKC (Working Count) mechanism. Each successful data exchange with a slave increases the slave's WKC. Specifically, when the ring topology is normal, the master station can access all slaves by sending a frame from one port. This frame returns to the master station from the other port, and the WKC count remains normal. If the ring topology is abnormal, the WKC in the returned frame will differ from the expected value. The master station identifies a break in the circuit and sends frames from both ports. These two frames will backtrack at the break point and return to the master station from their respective ports. After receiving these two frames, the master station extracts the portion with a normal WKC, thus completing the read and write operations for all slaves. Therefore, relying on the main station design increases the requirements for the main station software. Furthermore, the main station needs two ports; for upgrades to non-ring networks, such as those with only one main station port, the main station needs to be replaced, increasing costs.
[0018] To address the aforementioned issues, this application provides an Ethernet switching device and its control method, as well as an Ethernet network. The Ethernet switching device includes port 0, port 1, and port 2. Port 0 establishes a bidirectional communication connection with the master station, port 1 connects to the beginning of the slave network, and port 2 connects to the end of the slave network. The switching device controls one or more of ports 0, 1, and 2 to be in an on or off state, and / or controls port 2 to be in a bounce state, thereby switching the operating mode of the switching device and adjusting the data forwarding path within the switching device. The bounce state means that port 2 receives data sent by the slave network and then sends it back to the slave network from port 2. By controlling the three ports of the switching device, the data transmission path between the master station and the slave network is switched, ensuring complete data communication across the entire network while reducing dependence on the master station's hardware configuration, making it particularly suitable for master station scenarios with only a single communication port. Furthermore, configuring port 2 in bounce mode enables data to be transmitted back to the end of the slave network, allowing a logical loop to be constructed through the switching device even if the master station has only one communication port, achieving redundant ring network communication.
[0019] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.
[0020] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0021] Unless otherwise stated, the term "multiple" means two or more. In embodiments of this disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B means: A or B. The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0022] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0023] Referring to Figure 3, which is a schematic diagram of the structure of an Ethernet switching device provided in an embodiment of this application, the Ethernet switching device includes port 0, port 1, and port 2; port 0 establishes a bidirectional communication connection with the master station, port 1 connects to the beginning of the slave network, and port 2 connects to the end of the slave network.
[0024] Port 1 enables bidirectional communication with the head end of the slave network, and port 2 enables bidirectional communication with the tail end of the slave network. The slave network can be a linear network structure composed of multiple cascaded slave devices, where each slave interacts with data via the Industrial Ethernet protocol.
[0025] Optionally, the master station can be a slave station. In this application, the breakpoint analysis and communication path switching are completed by the switching equipment, without relying on the master station in the ring topology structure shown in Figures 1 and 2.
[0026] The switching device is used to control one or more of the ports 0, 1, and 2 to be in an on or off state, and / or to control port 2 to be in a bounce state, so as to switch the operating mode of the switching device and adjust the data forwarding path within the switching device; the bounce state means that port 2 receives data sent by the slave network and then sends it to the slave network from port 2.
[0027] In a switching device, port 0 can remain open. If port 1 is closed, port 1 neither receives nor sends external data, and internal data is transmitted between port 0 and port 2. If port 2 is closed, port 2 neither receives nor sends external data, and internal data is transmitted between port 0 and port 1.
[0028] Furthermore, port 2 can also operate in bounce mode, where data within the switching device is transmitted between ports 0 and 1. Port 2 receives data from the slave network and sends it directly to the slave network, or processes it and sends it back to the slave network. Therefore, port 2 no longer forwards received data to port 0, but instead sends it directly back to the slave network, thus enabling real-time response and processing of data at the tail end of the slave network.
[0029] Based on the aforementioned switching equipment, the data transmission path between the master station and slave station networks can be switched by controlling the three ports of the switching equipment, so as to ensure that the entire network can complete complete data communication, while reducing the dependence on the master station hardware configuration. It is especially suitable for master station scenarios with only a single communication port, so that even if the master station has only one communication port, a logical loop can be built through the switching equipment to achieve ring network redundant communication.
[0030] Based on the above embodiments, referring to Figure 4, which shows a schematic diagram of the transmission path within a switching device under different modes, the operating modes of the switching device in this application may include: full-on mode, 1-port closed mode, 2-port closed mode, and 2-port bounce mode.
[0031] As shown in Figure 4(a), in full-on mode, ports 0, 1, and 2 are all enabled. The data forwarding path within the switching device is from port 0 to port 1, from port 1 to port 2, and from port 2 to port 0. Simultaneously, ports 0, 1, and 2 can all receive and send data.
[0032] As shown in Figure 4(b), in port 1 closed mode, port 1 is in a closed state, and data is only exchanged through ports 0 and 2, with bidirectional transmission between ports 0 and 2 via the forwarding path. Port 1 neither receives nor sends data. Both ports 0 and 2 can receive and send data.
[0033] As shown in Figure 4(c), in port 2-off mode, port 2 is closed while ports 0 and 1 are both open. The data forwarding path within the switching device is bidirectional communication between ports 0 and 1. Port 2 neither receives nor sends data. Both ports 0 and 1 can receive and send data.
[0034] As shown in Figure 4(d), in the 2-port bounce mode, port 2 is in bounce state while ports 0 and 1 are both open. The data forwarding path within the switching device is bidirectional communication between ports 0 and 1. Port 2 receives data and then sends it outside the switching device. Port 0 can interact with the master station, port 1 can interact with the slave network, and port 2 directly sends back the received slave data or processes it before sending it back to the slave network. In this mode, data achieves rapid response at the tail end without passing through the master station, thus reducing communication latency.
[0035] Based on the embodiment described in Figure 4 above, the switching device may further include a data switching module configured on port 0, and / or a data switching module configured on port 2; the data switching module is used to forward data from the corresponding port to the next port, or to process the data from the corresponding port and then forward it to the next port.
[0036] In one example, see Figure 5, which shows a schematic diagram of a switching device structure with data switching modules configured on both port 0 and port 2.
[0037] As shown in Figure 5(a), in full-on mode, both ports 0 and 2 are configured with data exchange modules. Data from port 0 is forwarded to port 1 for output to the slave network via the data exchange module of port 0 (which may or may not process the transmitted data depending on the configuration). Data received from the slave network by port 1 is forwarded to the data processing module of port 2. The data processing module of port 2 outputs through port 2. Data received from the slave network by port 2 is sent to port 0 via the data exchange module of port 2, and then forwarded to the master station from port 0.
[0038] As shown in Figure 5(b), in the port 1 closed mode, port 1 is in the closed state, and bidirectional data forwarding is achieved between port 0 and port 2 through their respective data exchange modules. After receiving data from the master station, port 0 processes it through its data exchange module or transmits it directly to the data exchange module of port 2, and then port 2 sends it to the slave network. Data returned from the slave network is received by port 2 and forwarded to port 0 through its data exchange module, and then transmitted back to the master station from port 0, thus realizing bidirectional communication between the master station and the slave station.
[0039] As shown in Figure 5(c), in port 2 closed mode, the data exchange module on port 0 forwards the received master station data directly to port 1, which then sends it to the slave network. Data returned by the slave is received by port 1, processed by the data exchange module on port 0, or directly transmitted to port 0, and then transmitted back to the master station from port 0. At this time, port 2 is closed and does not participate in any data transmission or reception.
[0040] As shown in Figure 5(d), in the port 2 bounce mode, the data exchange module on port 0 forwards the received master station data directly to port 1, from which port 1 sends it to the slave network. Data returned from the slave is received on port 1, processed by the data exchange module on port 0, or directly transmitted to port 0, and then transmitted back to the master station from port 0. At this time, port 2 is in bounce mode, and the received slave data is processed by the data processing module on port 2 before being output to the slave network from port 2.
[0041] In one example, see Figure 6, which illustrates a schematic diagram of a switching device structure with a data switching module configured on two ports.
[0042] As shown in Figure 6(a), in the fully open mode, only port 2 is configured with a data exchange module. The master station data received by port 0 is directly forwarded to the slave network through port 1. The data returned by the slave station is received by port 1 and processed by the data exchange module of port 2 or directly transmitted to port 2 for output to the slave network. The data fed back by the slave network is transmitted to port 0 through the data exchange module of port 2.
[0043] As shown in Figure 6(b), in the port 1 closed mode, port 1 is closed, and bidirectional data forwarding is achieved between port 0 and port 2 through the data exchange module of port 2.
[0044] As shown in Figure 6(c), in port 2 closed mode, ports 0 and 1 are directly connected. Data from the master station enters through port 0 and is forwarded to the slave network through port 1. Data returned from the slave station is received by port 1 and then transmitted back to the master station through port 0. At this time, port 2 is closed, and the data exchange module of port 2 does not participate in data transmission.
[0045] As shown in Figure 6(d), in the 2-port bounce mode, the master station data received by port 0 is forwarded to the slave network via port 1. The data returned by the slave is received by port 1 and fed back to port 0. Port 2 processes the received slave data according to the configuration or directly returns it to the slave network through the data exchange module of port 2.
[0046] Of course, a data exchange module can also be configured on port 0, which is the same principle as configuring a data exchange module on port 2, and will not be elaborated here.
[0047] Optionally, the data exchange module configured above can perform parsing, verification, filtering, or forwarding of the received data according to the configuration.
[0048] Based on the above embodiments, the switching device of this application may further include a port monitoring module and a switching module, with the switching module connected to the port monitoring module. Through the cooperation of the port monitoring module and the switching module, the switching of the switching device's operating mode is performed. Specifically, this can be implemented as follows: In one possible implementation, the port monitoring module is used to monitor the physical connection status between the switching device's port and the slave network, as well as the data transmission and reception status and timing of the switching device's port. The data transmission and reception status of the port may include receiving data only, sending data only, and receiving and sending data (receiving and sending data). Furthermore, port 2 is also configured with the aforementioned bounce-back status.
[0049] The switching module is used to switch the operating mode of the switching device in response to the physical connection being disconnected or the transmit / receive status or transmit / receive timing of the port of the switching device changing.
[0050] The switching equipment connects to the slave network and has the function of detecting whether the other device connected to each port has gone offline (the physical connection between the two is broken). The port monitoring module is used to monitor the on / off status of the physical connection between the port of the switching equipment and the slave network; the switching module switches the operating mode of the switching equipment according to the on / off status of the physical connection. Therefore, after the port monitoring module detects that the slave network has gone offline, it changes the state of the port according to the location of the offline. For example, if the first end goes offline, the switching module switches the switching equipment to port 1 off mode, thereby modifying the data forwarding path inside the switching equipment (through bidirectional communication between port 2 and the slave network) to bypass the offline port 1 (as shown in Figure 10).
[0051] Furthermore, the aforementioned switching equipment can also monitor the transmission and reception times of data frames on each port (including port 0, port 1, and port 2) through a port monitoring module, and determine whether there is a breakpoint in the slave network connected to ports 1 and 2 based on the frame transmission and reception sequence. For example, in port 2 bounce mode, the normal transmission path is port 0 → port 1 → slave network → port 2 → slave network → port 1 → port 0. That is, after port 1 sends data, port 2 receives the data before port 1. However, if port 1 receives the data before port 2 (port 2 has no data), a breakpoint is detected in the slave network, and the data frame cannot be transmitted to port 2. To ensure communication integrity, the switching module switches the switching equipment from port 2 bounce mode to full-on mode, ensuring that slaves closer to port 1 from the breakpoint send and receive data through port 1, and slaves closer to port 2 from the breakpoint send and receive data through port 2. The data forwarding path inside the switching equipment is modified, and the slave network automatically loops back to bypass the breakpoint (as shown in Figure 9).
[0052] Furthermore, the switching module is also used to switch the operating mode of the switching device to port 2 bounce mode in response to the restoration of the physical connection state (e.g., restoration of the connection between port 1 or port 2 and the slave network), or restoration of the transmit and receive timing of the switching device (e.g., restoration of the connection at an intermediate breakpoint, restoration of transmit and receive timing).
[0053] Based on the above embodiments of the Ethernet switching device, this application also provides a control method for the Ethernet switching device described in any of the above embodiments, as shown in Figure 7, which is a flowchart illustrating the control method for the Ethernet switching device. The control method for the Ethernet switching device includes: S701, monitoring the physical connection status between the port of the switching device and the slave network, as well as the data transmission and reception status and timing of the port of the switching device.
[0054] The switching device connects to the slave network and has a disconnection detection function to detect whether the other connected device has gone offline (the physical connection between the two devices is broken). For example, the aforementioned monitoring of the physical connection status could be that the switching device detects that the physical connection between port 1 of the switching device and the slave network is either disconnected or connected, or detects that the physical connection between port 2 of the switching device and the slave network is either disconnected or connected. Then, if the switching device detects that the port connection is broken, it executes the subsequent step S702 to switch the operating mode of the switching device.
[0055] S702. In response to the physical connection being disconnected, or the transmit / receive status or transmit / receive timing of the port of the switching device changing, the operating mode of the switching device is switched.
[0056] In one example, in response to a slave network outage, the port status is changed based on the location of the outage. For instance, if the head end goes offline, the switching module switches the switching device to port 1 shutdown mode, thereby modifying the data forwarding path inside the switching device (through bidirectional communication between port 2 and the slave network) to bypass the outage port 1, as shown in Figure 10.
[0057] S703. In response to the restoration of the physical connection state or the restoration of the transmission and reception timing of the switching device, the operating mode of the switching device is switched to 2-port bounce mode.
[0058] Based on the above method, this application can determine whether the connectivity of the slave network is abnormal by monitoring the communication status of the switching device ports, thereby dynamically adjusting the operating mode of the switching device and adjusting the data forwarding path to ensure the continuity and reliability of communication. This eliminates the need for software configuration from the master station, reducing reliance on the master station.
[0059] Based on the above method, for step S702, based on the above operating mode of the switching device, the specific implementation can be as follows: when the physical connection between port 1 of the switching device and the head end of the slave network is disconnected, it is determined that there is a breakpoint at the head end of the slave network, and the device switches to port 1 closed mode, thereby modifying the data forwarding path inside the switching device (through bidirectional communication between port 2 and the slave network) to bypass the disconnected port 1 (as shown in Figure 10); when the physical connection between port 2 of the switching device and the tail end of the slave network is disconnected, it is determined that there is a breakpoint at the tail end of the slave network, and the device switches to port 2 closed mode, thereby modifying the data forwarding path inside the switching device (through bidirectional communication between port 1 and the slave network) to bypass the disconnected port 2 (as shown in Figure 11); in port 2 bounce mode, if it is detected that port 1 receives data sent by the slave network before port 2, it is determined that there is a breakpoint in the slave network, and the device switches to full open mode (as shown in Figure 9).
[0060] Furthermore, after the breakpoint is recovered, step S703 is executed, in response to the restoration of the physical connection state or the restoration of the transmission and reception timing of the switching device, the operating mode of the switching device is switched to 2-port bounce mode.
[0061] In the example where the breakpoint occurs in the middle of the slave network, if port 1 receives data sent by the slave network before port 2, it is determined that there is a breakpoint in the middle of the slave network, and port 2 of the switching device switches from bounce mode to full open mode.
[0062] When the switching equipment is running normally (without interruption), it can be in port 2 bounce mode. See Figure 8 for a schematic diagram of a network communication path without interruption. Its output transmission path is port 0 → port 1 → slave network → port 2 (bounce state) → slave network → port 1 → port 0. Therefore, under normal operation, port 1 sends out data, port 2 receives the data first, and port 1 receives the data later.
[0063] In the example where the breakpoint occurs between slave stations in the slave network, after port 1 sends data, the data will be directly redirected at the breakpoint. At this time, port 2 cannot receive the data, while port 1 will receive the redirected data before port 2. Therefore, when it is detected that port 1 receives data earlier than port 2, it is determined that there is a breakpoint in the slave network. In this case, it is necessary to switch to full-open mode. Figure 9 shows a schematic diagram of the network communication path in full-open mode when there is a breakpoint in the middle of the slave network. Both ports 1 and 2 are in the open state. At this time, the data from port 0 is sent to port 1. Port 1 sends data to the slave station closest to port 1 from the breakpoint, and then returns to port 1. From port 1, it is forwarded to port 2. Port 2 sends data to the slave station closest to port 2 from the breakpoint, and then returns to port 2. After receiving the data, port 2 sends it back to port 0.
[0064] Furthermore, when the switching device is operating in full-on mode, if it is detected that port 2 receives data sent by the slave network first, while port 1 does not receive data sent by the slave network, it is determined that the breakpoint in the slave network has been restored, and the device switches back to port 2 bounce mode.
[0065] As shown in Figure 9, when there is a breakpoint in the slave network, the communication path in the fully open mode can be: Port 0 → Port 1 → Slave network (the network closer to Port 1 from the breakpoint) → Port 1 → Port 2 (open state) → Slave network (the network closer to Port 2 from the breakpoint) → Port 2 → Port 0.
[0066] Based on the fully open mode described above, when the communication path changes back to port 0 → port 1 → slave network → port 2 → port 0, port 2 normally receives data and sends it back to port 0, while port 1 no longer receives data back. This indicates that the breakpoint in the slave network has been recovered. Therefore, if port 2 receives data before port 1 (port 1 did not receive data sent by the slave network), the breakpoint can be confirmed to have been recovered, and the system can be switched back to port 2's bounce mode to resume the normal communication flow (port 0 → port 1 → slave network → port 2 → slave network → port 1 → port 0).
[0067] In this way, the data reception timing of the two ports (port 1 and port 2) is continuously monitored and judged to ensure that when the intermediate breakpoint of the slave network occurs again, it can respond in a timely manner and switch modes, thus ensuring the continuity and stability of slave network communication, realizing automatic fault tolerance and rapid recovery, and improving the reliability and operating efficiency of the overall industrial communication system.
[0068] In an example where the breakpoint occurs at the head end of the slave network, Figure 10 illustrates the communication path in port 1 closed mode when the head end of the slave network goes offline. If the switching device detects a physical connection loss with the head end of the slave network at port 1, it determines that a breakpoint has occurred at the head end of the slave network and switches to port 1 closed mode. If the switching device detects that the physical connection with the head end of the slave network has been restored at port 1, it switches back to port 2 bounce mode.
[0069] As shown in Figure 10, when the slave network head ends down, the communication path in port 1 closed mode is: port 0 → port 2 → slave network (slave network head ends back) → port 2 → port 0. During the period when the physical connection of port 1 is disconnected, the data interacting with the slave network is transmitted through port 2.
[0070] In an example where the breakpoint occurs at the tail end of the slave network, Figure 11 illustrates the communication path in port 2-off mode when the tail end of the slave network is offline. If the switch detects a physical disconnection at port 2 of the slave network, a breakpoint is determined at the tail end of the slave network, and the system switches to port 2-off mode. If the switch detects that the physical connection with the tail end of the slave network has been restored at port 2 of the slave network, the system switches back to port 2-rebound mode.
[0071] As shown in Figure 11, when the slave network ends down, the communication path in port 2 closed mode is: port 0 → port 1 → slave network (slave network ends back) → port 1 → port 0. During the period when the physical connection of port 1 is disconnected, the data interacting with the slave network is transmitted through port 1.
[0072] When both ports 1 and 2 detect a normal physical connection and the data reception timing is as expected, the switching device maintains the port 2 bounce mode, as shown in Figure 8.
[0073] Based on the above embodiments, see Figure 12 for a schematic diagram of port transmit and receive timing.
[0074] ① In the 2-port bounce mode, if it is detected that port 2 receives data before port 1 (port 0 receives data from the master station, port 2 receives data from the slave network first, and then port 1 receives data from the slave network), then it is determined that the connection between the switching device and the slave network is uninterrupted, and the switching device continues to operate in the 2-port bounce mode.
[0075] ② It was detected that port 1 received data before port 2 (port 0 receives data from the master station, port 1 receives data sent from the slave station network, and then port 0 sends data to the master station), and port 2 did not receive any data. It was determined that a breakpoint occurred in the slave station network, and the system switched from the bounce mode of port 2 to the full open mode.
[0076] ③ In full-on mode, after detecting that port 0 is receiving data sent by the master station, as shown in Figure 9, if there is a breakpoint in the slave network (a breakpoint occurs between any two connected slave stations in a cascaded slave network), the communication path in full-on mode is: port 0 → port 1 → slave network (the network closest to port 1 from the breakpoint) → port 1 → port 2 (open state) → slave network (the network closest to port 2 from the breakpoint) → port 2 → port 0. That is, port 1 receives data sent by the slave network first, and then port 2 receives data sent by the slave network, so the breakpoint in the slave network has not been recovered.
[0077] ④ In full-open mode, after detecting that port 0 receives data sent by the master station, and assuming there are no breakpoints in the slave network, the communication path becomes port 0 → port 1 → slave network → port 2 → port 0. That is, in full-open mode, port 2 receives data sent by the slave network, and the data is then fed back from port 2 to port 0. However, port 1 does not receive data sent by the slave network, confirming that the breakpoint in the slave network has been resolved, and switches back to port 2 bounce mode.
[0078] ⑤ When the physical connection between port 1 and the breakpoint at the beginning of the slave network is detected to be broken, determine that the breakpoint is at the beginning of the slave network and switch to port 1 closed mode.
[0079] ⑥ When the physical connection between port 1 and the breakpoint at the beginning of the slave network is restored, switch back to the unbroken port 2 bounce mode.
[0080] ⑦ When the physical connection between port 2 and the breakpoint at the end of the slave network is detected to be broken, determine that the breakpoint is at the end of the slave network and switch to port 2 closed mode.
[0081] ⑧ When the physical connection between port 2 and the end of the slave network is restored, switch back to the unbroken port 2 bounce mode.
[0082] ⑨ If data is received on port 0 but no data is sent, and then port 0 receives data again, indicating that there is a problem with the current network and that data frames are completely blocked from returning to the switch, then the switch should be reset.
[0083] ⑩ After the reset, the switching device immediately and automatically switches to the 2-port bounce mode without any breakpoints. This is the default mode, which waits for the next new frame coming in from port 0 to detect network breakpoints.
[0084] In this application, each communication begins with a frame originating from the master station and ends with a frame returning to the master station to complete the communication. A complete communication requires the frame to pass through the switching equipment and all slave stations, and the frame must pass through the data exchange modules of all slave stations so that the master station can exchange data with any slave station. Based on the embodiments of the above method, when a breakpoint occurs at the beginning, middle, or end of the slave network, the switching equipment can accurately identify the breakpoint location and switch to the corresponding operating mode to ensure that the communication link can still complete the entire communication even with a breakpoint, achieving reliable data transmission. When the breakpoint is restored, it automatically returns to the 2-port bounce mode. Thus, when a breakpoint occurs, the switching equipment detects the breakpoint, and if a communication frame is blocked and a complete communication cannot be completed, the switching equipment will adjust the data forwarding path of the switch. After adjustment, the new communication path will be able to complete the entire communication.
[0085] This application also provides a corresponding Ethernet network for implementing the solution provided in this application.
[0086] An Ethernet network includes a master station, a slave station network, and an Ethernet switching device as described in any of the above embodiments. The switching device uses the method described in any of the above embodiments to achieve complete data communication between the master station and the slave station network.
[0087] In the embodiments of this application, the terms "first" and "second" (if they exist) are used only as name identifiers and do not represent the order of first and second.
[0088] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus a general-purpose hardware platform. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as a read-only memory (ROM) / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a router) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0089] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0090] The above description is merely an exemplary implementation of this application and is not intended to limit the scope of protection of this application.
Claims
1. An Ethernet switching device, characterized in that, It includes ports 0, 1, and 2; port 0 establishes a bidirectional communication connection with the master station, port 1 connects to the beginning of the slave network, and port 2 connects to the end of the slave network; the switching device is used to control one or more of ports 0, 1, and 2 to be in an on or off state, and / or control port 2 to be in a bounce state, so as to switch the operating mode of the switching device and adjust the data forwarding path within the switching device; The bounce state is that port 2 receives data sent by the slave network and then sends it back to the slave network from port 2.
2. The switching device according to claim 1, characterized in that, The switching device includes a port monitoring module and a switching module. The switching module is connected to the port monitoring module. The port monitoring module is connected to ports 0, 1, and 2 of the switching device and is used to monitor the physical connection status between the ports of the switching device and the slave network, as well as the data transmission and reception status and timing of the ports of the switching device. The switching module is used to switch the operating mode of the switching device in response to the physical connection status being disconnected or the transmission and reception status or timing of the ports of the switching device changing.
3. The switching device according to claim 2, characterized in that, The switching module is also used to switch the operating mode of the switching device to 2-port bounce mode in response to the restoration of the physical connection state or the restoration of the transmission and reception timing of the switching device.
4. The switching device according to claim 3, characterized in that, The operating modes of the switching equipment include all-on mode, port 1 off mode, port 2 off mode, and port 2 bounce mode. In all-on mode, ports 0, 1, and 2 are all on, and the data forwarding path within the switching equipment is from port 0 to port 1, from port 1 to port 2, and from port 2 to port 0. In port 1 off mode, port 1 is off and ports 0 and 2 are both on, and the data forwarding path within the switching equipment is bidirectional communication between ports 0 and 2. In port 2-off mode, port 2 is closed while ports 0 and 1 are open. The data forwarding path within the switch is bidirectional communication between ports 0 and 1. In port 2-reverse mode, port 2 is in reverse state while ports 0 and 1 are open. The data forwarding path within the switch is bidirectional communication between ports 0 and 1. After receiving data, port 2 then sends it outside the switch.
5. The switching device according to claim 4, characterized in that, The switching device further includes the data switching module configured on port 0, and / or the data switching module configured on port 2; the data switching module is used to forward the data of the corresponding port to the next port, or to process the data of the corresponding port and then forward it to the next port.
6. A control method for an Ethernet switching device, characterized in that, The method, applicable to any one of claims 1-5, comprises: monitoring the physical connection status between the port of the switching device and the slave network, and the data transmission and reception status and timing of the port of the switching device; switching the operating mode of the switching device in response to the physical connection status being disconnected, or the transmission and reception status or timing of the port of the switching device changing; and switching the operating mode of the switching device to a 2-port bounce mode in response to the physical connection status being restored, or the transmission and reception timing of the switching device being restored.
7. The method according to claim 6, characterized in that, The step of switching the operating mode of the switching device when the physical connection is disconnected, or when the transmit / receive status or timing of the port of the switching device changes, includes: if the physical connection between port 1 of the switching device and the head end of the slave network is detected to be disconnected, then it is determined that a breakpoint has occurred at the head end of the slave network, and the device is switched to port 1 closed mode; if the physical connection between port 2 of the switching device and the tail end of the slave network is detected to be disconnected, then it is determined that a breakpoint has occurred at the tail end of the slave network, and the device is switched to port 2 closed mode; in port 2 bounce mode, if port 1 receives data sent by the slave network before port 2, it is determined that a breakpoint exists in the slave network, and the device is switched to fully open mode.
8. The method according to claim 6, characterized in that, In response to the restoration of the transmission and reception timing of the switching device, the operating mode of the switching device is switched to the 2-port bounce mode, including: in the fully open mode, if it is detected that port 2 receives data sent by the slave network first, while port 1 does not receive data sent by the slave network, then it is determined that the breakpoint in the slave network has been restored, and the device is switched back to the 2-port bounce mode.
9. The method according to claim 6, characterized in that, The method further includes: resetting the switching device and restoring it to port 2 bounce mode when the device only receives data and does not send data on port 0.
10. An Ethernet network, characterized in that, The system includes a master station, a slave network, and an Ethernet switching device as described in any one of claims 1-5, wherein the switching device uses the method described in any one of claims 6-9 to achieve complete data communication between the master station and the slave network.
Citation Information
Patent Citations
Industry ethernet based fault processing method, system and a switching arrangement
CN101159523A
Two-way loop network system and its control method
CN101262406A
System and method for implementing reflector ports within hierarchical networks
US20060250969A1
Method and system for looping back traffic in qiq ethernet rings and 1:1 protected PBT trunks
US20080095047A1