A forwarding device, a forwarding method and a forwarding apparatus
By using mode switching and caching technology in the forwarding device, the high latency problem in rack bus connection mode is solved, and low-latency long-distance data transmission is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUPCON TECH CO LTD
- Filing Date
- 2023-12-27
- Publication Date
- 2026-07-07
Smart Images

Figure CN117749561B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a forwarding device, forwarding method, and forwarding apparatus. Background Technology
[0002] Large industrial control systems have a large number of expansion I / O nodes or communication nodes, which are typically connected using a rack bus, i.e., all nodes are connected to the same differential line. While this connection method is convenient and inexpensive to run, the size of the system's installation rack limits the maximum length of the rack, thus making it impossible to connect all nodes to a single rack.
[0003] Currently, the common practice is to decode the data on the bus and then re-encode it into Ethernet or other interface protocols before sending the data outwards via Ethernet or other interfaces. This method is not limited by bus signal quality or drive capability, but encoding and decoding introduce significant latency, leading to a decrease in system response speed and consequently high latency in data forwarding. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a forwarding device, a forwarding method, and a forwarding apparatus for connecting multiple rack buses to realize data forwarding between buses and solve the problem of high latency in existing data forwarding.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] The first aspect of the present invention discloses a forwarding device, the forwarding device comprising: a first connector interface, a second connector interface, a first receiver, a second transmitter, a third transmitter, a first bus occupancy detector, a first buffer, a bus interface, and a controller;
[0007] The controller is communicatively connected to the first connector interface, the second connector interface, the first receiver, the second transmitter, the first bus occupancy detector, the first buffer, and the bus interface, respectively.
[0008] A differential line of the first connector interface is connected to the corresponding first receiver through the first bus occupancy detector. The first receiver is connected to the first buffer. The first receiver is the receiver of the first connector interface.
[0009] A differential line of the second connector interface is connected to the second transmitter, which is the transmitter of the second connector interface;
[0010] The first buffer is connected to one end of the half-duplex differential interface of the bus interface through the third transmitter. The bus interface is connected to a rack bus on the industrial control system rack. The third transmitter is the transmitter of the bus interface.
[0011] When the forwarding device is in idle mode, if the first receiver receives the first data, the first receiver sends the first data to the second transmitter of the second connector interface for transmission via the second transmitter.
[0012] When the first bus occupancy detector detects a first state in the bus level, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device to the receiving mode based on the first state.
[0013] When the forwarding device is in receiving mode, the first receiver stores the first data in the corresponding first buffer for buffering, and then sends the first data buffered in the first buffer through the third transmitter.
[0014] Optionally, it may also include: the first transmitter and the second receiver;
[0015] Another differential line of the first connector interface is connected to the first transmitter, which is the transmitter of the first connector interface;
[0016] Another differential line of the second connector interface is connected to the second transmitter, and the second receiver is the receiver of the second connector interface;
[0017] When the first receiver receives the first data and the forwarding device is in receive mode, the controller disables the first transmitter and the second receiver.
[0018] Optional, also includes:
[0019] When the first bus occupancy detector detects a second state in the bus level, it sends the second state to the controller, and the controller switches the receiving mode of the forwarding device to a transition mode based on the second state.
[0020] Optionally, it may also include: a second bus occupancy detector, a second buffer, and a third bus occupancy detector;
[0021] The input terminal of the second connector interface is connected to the corresponding second receiver through the second bus occupancy detector, and the second receiver is connected to the second buffer.
[0022] The third bus occupancy detector is connected to the other end of the half-duplex differential interface of the bus interface;
[0023] If the first bus occupancy detector, the second bus occupancy detector, and the third bus occupancy detector do not detect a second state in the bus level within a first preset time, they are sent to the controller so that the controller can switch the transition mode to the idle mode.
[0024] Optional, also includes:
[0025] When the forwarding device is in idle mode, if the second receiver receives the second data, the second receiver sends the second data to the first transmitter of the first connector interface for transmission via the first transmitter.
[0026] When the second bus occupancy detector detects that the bus level has a first state, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device to the receiving mode based on the first state.
[0027] When the forwarding device is in receive mode, the second receiver stores the second data in the corresponding buffer for buffering, and sends the second data buffered in the buffer through the bus interface.
[0028] Optional, also includes:
[0029] If the second receiver receives the second data and the forwarding device is in idle mode, the controller disables the first receiver and the second transmitter.
[0030] Optional features also include: a third receiver, a third buffer, and a multiplexer;
[0031] The bus interface is connected to a rack bus on the industrial control system rack. One end of the half-duplex differential interface of the bus interface is connected to a third transmitter, and the other end of the half-duplex differential interface of the bus interface is connected to a third bus occupancy detector.
[0032] The first buffer and the second buffer are respectively connected to the third transmitter through a multiplexer, and the third bus occupancy detector is connected to the third receiver through the third buffer. The third receiver is the receiver of the bus interface.
[0033] The third receiver is connected to both the first transmitter and the second transmitter.
[0034] When the forwarding device is in idle mode, if the third receiver receives third data and the third bus occupancy detector detects that the bus level has a first state, the first state is sent to the controller, and the controller switches the idle mode of the forwarding device to the transmission mode based on the first state.
[0035] When the forwarding device is in transmit mode, the third receiver transmits the third data through the first transmitter and the second transmitter.
[0036] Optional, also includes:
[0037] If the third receiver receives the third data and the forwarding device is in idle mode, the controller disables the first receiver, the second receiver, and the third transmitter.
[0038] A second aspect of this invention discloses a forwarding method applicable to the forwarding device shown in the first aspect of this invention. The forwarding device includes a first connector interface, a second connector interface, a first receiver, a second transmitter, a third transmitter, a first bus occupancy detector, a first buffer, a bus interface, and a controller. The method includes:
[0039] When the forwarding device is in idle mode, if the first receiver receives the first data, the first receiver sends the first data to the second transmitter of the second connector interface for transmission via the second transmitter.
[0040] When the first bus occupancy detector detects a first state in the bus level, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device to the receiving mode based on the first state.
[0041] When the forwarding device is in receiving mode, the first receiver stores the first data in the corresponding first buffer for buffering, and then sends the first data buffered in the first buffer through the third transmitter.
[0042] A third aspect of the present invention discloses a forwarding device, including the forwarding device described in the first aspect of the present invention, wherein the number of the forwarding devices is multiple;
[0043] The forwarding device is connected to a rack bus on the rack of the industrial control system via a bus interface;
[0044] Each of the aforementioned forwarding devices is connected to a ring network via the first connector interface or the second connector interface.
[0045] Based on the above embodiments of the present invention, a forwarding device, forwarding method, and forwarding apparatus are provided. The forwarding device includes: a first connector interface, a second connector interface, a first receiver, a second transmitter, a third transmitter, a first bus occupancy detector, a first buffer, a bus interface, and a controller. The controller is communicatively connected to the first connector interface, the second connector interface, the first receiver, the second transmitter, the first bus occupancy detector, the first buffer, and the bus interface. A differential line of the first connector interface is connected to the corresponding first receiver through the first bus occupancy detector. The first receiver is connected to the first buffer, and the first receiver is a receiver of the first connector interface. A differential line of the second connector interface is connected to the second transmitter, and the second transmitter is a transmitter of the second connector interface. The first buffer is connected to the first bus occupancy detector. The third transmitter is connected to one end of the half-duplex differential interface of the bus interface, which is connected to a rack bus on the industrial control system rack. The third transmitter is the transmitter of the bus interface. When the forwarding device is in idle mode, if the first receiver receives the first data, the first receiver sends the first data to the second transmitter of the second connector interface for transmission via the second transmitter. When the first bus occupancy detector detects a first state in the bus level, it sends the first state to the controller, which switches the idle mode of the forwarding device to the receiving mode based on the first state. When the forwarding device is in receiving mode, the first receiver stores the first data in the corresponding first buffer for buffering, and then transmits the first data buffered in the first buffer through the third transmitter. In this embodiment of the invention, if the first receiver receives data, it will transmit it from the second transmitter and after buffering in the first buffer, through the third transmitter in a delay-free manner, thus achieving low latency and stability, and is not subject to distance control, thereby supporting long-distance transmission. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0047] Figure 1 This is a schematic diagram of the structure of the forwarding device shown in an embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram illustrating the specific structure of the forwarding device according to an embodiment of the present invention;
[0049] Figure 3This is a schematic diagram illustrating the change of the level signal according to an embodiment of the present invention;
[0050] Figure 4 This is a schematic diagram illustrating the available structures of the forwarding device under different modes according to embodiments of the present invention;
[0051] Figure 5 This is a flowchart illustrating the different mode switching processes in an embodiment of the present invention;
[0052] Figure 6 This is an example diagram illustrating the forwarding process in an embodiment of the present invention;
[0053] Figure 7 This is a flowchart illustrating a forwarding method according to an embodiment of the present invention. Detailed Implementation
[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0056] It should be noted that the descriptions involving "first," "second," etc., in this invention are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0057] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0058] See Figure 1 This is a schematic diagram of the bus forwarding device shown in an embodiment of the present invention.
[0059] The bus forwarding device includes forwarding devices 10, and the number of forwarding devices 10 is n, where n is a positive integer greater than or equal to 2;
[0060] The forwarding device 10 is connected to a rack bus on the rack of the industrial control system via a bus interface;
[0061] Each of the aforementioned forwarding devices 10 is connected to a ring network via CONN1 or CONN2 of the communication interface SerDes, i.e., the first connector interface or the second connector.
[0062] The number of forwarding devices 10 corresponds one-to-one with the number of rack buses in the industrial control system. That is, one rack bus connects to one forwarding device 10, and each device 10 is connected in a ring network through CONN1 or CONN2 of the communication interface SerDes.
[0063] Specifically, if the number of rack buses in the industrial control system Q is n, including 1, 2, 3...n, then n forwarding devices 10 will be set in the industrial control system Q. That is, forwarding device 1 is connected to rack bus 1, forwarding device 2 is connected to rack bus 2, forwarding device 3 is connected to rack bus 3, and so on, with forwarding device n connected to rack bus n.
[0064] In this embodiment of the invention, a specific structural diagram of the forwarding device 10 is also shown, such as... Figure 2 As shown, the forwarding device 10 includes a first connector interface CONN1, a second connector interface CONN2, a first receiver R1, a second transmitter T2, a third transmitter T3, a first bus occupancy detector Sens1, and a first first-in-first-out buffer FIFO1. The controller is communicatively connected to the first connector interface CONN1, the second connector interface CONN2, the first receiver R1, the second transmitter T2, the first bus occupancy detector Sens1, the first first-in-first-out buffer FIFO1, and the bus interface BUS1.
[0065] Since CONN1 and CONN2 are full-duplex SerDes, with one pair of differential lines each for the transmitter and receiver, they are in the frame. Figure 2 The middle section is represented by two lines; BUS1, being a half-duplex differential interface, has only one pair of differential lines, so it is represented by two lines in the frame. Figure 2 It is represented by a single line.
[0066] Among them, a pair of differential lines refers to two conductors, one positive and one negative, which transmit data by changing the voltage difference between the two conductors.
[0067] A differential line of the first connector interface CONN1 is connected to the corresponding first receiver R1 through the first bus occupancy detector Sens1. The first receiver R1 is connected to the first buffer FIFO1. The first receiver R1 is the receiver of the first connector interface CONN1.
[0068] A differential line of the second connector interface CONN2 is connected to the second transmitter T2, and the second transmitter T2 is the transmitter of the second connector interface CONN2;
[0069] The first buffer FIFO1 is connected to one end of the half-duplex differential interface of the bus interface BUS1 through the third transmitter T3. The bus interface BUS1 is connected to a rack bus on the industrial control system rack. The third transmitter T3 is the transmitter of the bus interface BUS1.
[0070] When the forwarding device 10 is in idle mode, if the first receiver R1 receives the first data, the first receiver R1 sends the first data to the second transmitter T2 of the second connector interface CONN2 for transmission via the second transmitter T2.
[0071] It should be noted that the idle mode is the default working state of the forwarding device 10. When no data passes through, the forwarding device 10 will always be in this idle mode.
[0072] Optionally, the controller disables the transceivers of the BUS interface, namely the third transmitter T3 and the third receiver R3, based on the idle mode.
[0073] In a specific implementation, when the forwarding device 10 is in idle mode, the first data entering from the first connector interface CONN1 will be directly sent out from another CONN, namely CONN2. At this time, receiving and forwarding do not need to wait for any judgment. Therefore, forwarding in this way ensures that there is no delay in the output of the forwarding.
[0074] When the first bus occupancy detector Sens1 detects that the bus level has a first state, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device 10 to the receiving mode based on the first state.
[0075] In a specific implementation, firstly, when the forwarding device 10 is in idle mode, the first bus occupancy detector Sens1 detects in real time whether data is passing through, i.e., it is occupied. When the first bus occupancy detector Sens1 detects that the bus level has a first preset number of falling edges, it considers that there is occupancy. In other words, the first bus occupancy detector Sens1 detects that the bus level has a first state.
[0076] It should be noted that the first state refers to the bus level having a first preset number of falling edges consecutively.
[0077] Next, the first bus occupancy detector Sens1 sends a first state to the controller, and the controller switches the idle mode of the forwarding device 10 to the receiving mode based on the first state.
[0078] It should be noted that the first preset number of times is set in advance based on the actual situation, for example, it can be set to 3 times.
[0079] The specific process by which the first bus occupancy detector Sens1 detects a first preset number of consecutive falling edges on the bus level includes:
[0080] The first bus occupancy detector, Sens1, detects changes in the frequency of the bus level relative to a preset bus clock frequency. If there are consecutive instances of a bus level frequency higher than the preset bus clock frequency, a bus level frequency lower than the preset bus clock frequency, and so on, i.e., a total of a first preset number of high-low-high-low-high-low level changes, then it is determined that the bus level has consecutively experienced a first preset number of falling edges. Figure 3 As shown.
[0081] like Figure 3 As shown, the signal changes of the BUS CLK bus clock represent changes in the bus level; DATA Signal represents changes in the data signal; and Sens Out represents changes in the signal detected by the bus occupancy detector Sens1.
[0082] When the first bus occupancy detector Sens1 or other bus occupancy detector detects a first preset number of consecutive falling edges, it is considered that there is occupancy. When a second preset number of consecutive 1s (i.e., high level) are detected, it is considered that the occupancy is released and the state is idle.
[0083] It should be noted that the instant when the voltage level changes from high (digit "1") to low (digit "0") is called the falling edge.
[0084] The preset bus clock frequency is set by technicians based on multiple experiments or experience, and this embodiment of the invention does not limit it.
[0085] The second preset number of times is set in advance according to the actual situation, for example, it can be set to 5 times.
[0086] When the forwarding device 10 is in receive mode, the first receiver R1 stores the first data in the corresponding first buffer FIFO1 for buffering, and sends the first data buffered in the first buffer FIFO1 through the bus interface BUS1.
[0087] In the specific implementation, the third transmitter T3 of the BUS interface is enabled simultaneously. The MUX of the BUS interface connects the first buffer FIFO1 with data input to the transmitter of BUS1, namely the third transmitter T3. At this time, the third receiver R3 of the BUS interface is kept disabled so that the first data buffered by the first buffer FIFO1 can be sent from the bus interface BUS1. Since the FIFO buffer depth is a fixed value, the forwarding delay is also a fixed value, and this fixed value is relatively short. Therefore, this invention uses FIFO to control the bus forwarding delay, so that the delay has the advantage of high controllability.
[0088] See also Figure 2 It also includes: the first transmitter T1 and the second receiver R2;
[0089] Another differential line of the first connector interface CONN1 is connected to the first transmitter T1, which is the transmitter of the first connector interface CONN1.
[0090] Another differential line of the second connector interface CONN2 is connected to the second transmitter T2, and the second receiver R2 is the receiver of the second connector interface CONN2;
[0091] When the first receiver R1 receives the first data and the forwarding device 10 is in receive mode, the controller performs a disable operation on the first transmitter T1 and the second receiver R2.
[0092] Optional, also includes:
[0093] The second receiver R2 receives the first data after the first receiver R1 and discards it.
[0094] In the specific implementation, when the second receiver R2 also receives the first data, since the forwarding device 10 is in receiving mode, the second receiver R2 is disabled, and the first data received by the second receiver R2 is directly discarded.
[0095] Optional, also includes:
[0096] When the first bus occupancy detector Sens1 detects a second state in the bus level, it sends the second state to the controller. Based on the second state, the controller switches the receiving mode of the forwarding device to a transition mode.
[0097] It should be noted that the specific process of the first bus occupancy detector Sens1 detecting the existence of the second state of the bus level includes: whether the frequency of the bus level detected by the first bus occupancy detector Sens1 does not have a level flip within a second preset time, i.e., a long 1. If the frequency of the bus level detected by the first bus occupancy detector Sens1 does not have a level flip within a second preset time, it indicates that the bus level exists in the second state. At this time, the forwarding device 10 enters the transition mode from the receiving mode.
[0098] It should be noted that the second preset time is set by technicians based on the actual situation.
[0099] In the specific implementation, after the first data transmission on the first receiver R1 is completed, the first receiver R1 will start receiving long 1; because the first bus occupancy detector Sens1 detects long 1, the forwarding device 10 enters the transition mode, and the second receiver R2 is still disabled.
[0100] In this embodiment of the invention, if the forwarding device 10 returns directly to the idle mode after ending the receiving mode, it is possible that another CONN receiver receives an incomplete data frame and forwards it, resulting in a bus network communication conflict. The forwarding device 10 will keep the states of the receivers and transmitters of the two CONNs the same as in the receiving mode, but will turn off the transmitter of the BUS interface.
[0101] Optionally, after the first data transmission on the second receiver R2 is completed, the second receiver R2 begins to receive data of length 1.
[0102] In this embodiment of the invention, the first bus occupancy detector Sens1 is used to detect the frame header to determine whether the bus is occupied, eliminating the need for decoding. The first data received by the first receiver is sent to another CONN transmitter to achieve delay-free forwarding. At the same time, the transmitter of the BUS interface is enabled, and the first data is forwarded from the first repeater to the corresponding buffer FIFO and sent through the BUS interface. At this time, the bus delay is the depth of the FIFO buffer. This invention uses FIFO to control the delay of bus forwarding, so that the delay has the advantage of high controllability and achieves low-latency forwarding.
[0103] See also Figure 2The forwarding device 10 also includes: a second bus occupancy detector Sens2, a second first-in-first-out buffer FIFO2, and a third bus occupancy detector Sens3;
[0104] The input terminal of the second connector interface CONN2 is connected to the corresponding second receiver R2 through the second bus occupancy detector Sens2, and the second receiver R2 is connected to the second buffer FIFO2;
[0105] The third bus occupancy detector Sens3 is connected to the other end of the half-duplex differential interface of the bus interface BUS1.
[0106] If none of the first bus occupancy detector Sens1, the second bus occupancy detector Sens2, and the third bus occupancy detector Sens3 detects a second state of bus level within a first preset time, they are sent to the controller so that the controller can switch the transition mode to the idle mode.
[0107] In a specific implementation, the first bus occupancy detector Sens1, the second bus occupancy detector Sens2, and the third bus occupancy detector Sens3 detect whether there is no level flip within a first preset time period for the frequency of the bus level, i.e., a long 1. If the first bus occupancy detector Sens1, the second bus occupancy detector Sens2, and the third bus occupancy detector Sens3 all detect that there is a level flip within a second preset time period for the frequency of the bus level, it indicates that the bus level has not detected a second state, and at this time the control forwarding device 10 enters the idle mode.
[0108] Optionally, when the forwarding device 10 is in idle mode, if the second receiver R2 receives the second data, the second receiver R2 sends the second data to the first transmitter T1 of the first connector interface CONN1 for transmission via the first transmitter T1.
[0109] In a specific implementation, when the forwarding device 10 is in idle mode, it is forwarded to the transmitter of CONN1 with zero delay. At this time, receiving and forwarding do not need to wait for any judgment. Therefore, forwarding in this way ensures that there is no delay in the output of the forwarded device.
[0110] When the second bus occupancy detector Sens2 detects that the bus level has a first state, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device 10 to the receiving mode based on the first state.
[0111] In the specific implementation, firstly, when the forwarding device 10 is in idle mode, the second bus occupancy detector Sens2 detects in real time whether data is passing through, i.e., whether it is occupied. Figure 3 As shown, when the second bus occupancy detector Sens2 detects that the bus level has a first preset number of falling edges, it considers that there is occupancy. In other words, the second bus occupancy detector Sens2 detects that the bus level is in a first state.
[0112] Next, the second bus occupancy detector Sens2 sends a second state to the controller, which then switches the idle mode of the forwarding device 10 to the receive mode based on the second state.
[0113] It should be noted that the process by which the second bus occupancy detector Sens2 detects the presence of a first state of bus level is the same as the specific implementation process by which the first bus occupancy detector Sens1 detects the presence of a first state of bus level; they can be referred to interchangeably.
[0114] The second data can be a response to the first data, or it can be other data.
[0115] When the forwarding device 10 is in receiving mode, the second receiver R2 stores the second data in the corresponding second buffer FIFO2 for buffering, and sends the second data buffered in the second buffer FIFO2 through the bus interface BUS1.
[0116] In the specific implementation, the third transmitter T3 of the BUS interface is enabled simultaneously. The MUX of the BUS interface connects the second buffer FIFO2 with data input to the transmitter of BUS1, namely the third transmitter T3. At this time, the third receiver R3 of the BUS interface is kept disabled so that the second data buffered by the second buffer FIFO2 can be sent from the bus interface BUS1. Since the FIFO buffer depth is a fixed value, the forwarding delay is also a fixed value, and this fixed value is relatively short. Therefore, this invention uses FIFO to control the bus forwarding delay, so that the delay has the advantage of high controllability.
[0117] Optionally, when the second receiver R2 receives the second data and the forwarding device 10 is in receive mode, the controller performs a disable operation on the second transmitter T2 and the first receiver R1.
[0118] Optional, also includes:
[0119] The first receiver R1 receives the second data after the second receiver R2 and discards it.
[0120] In the specific implementation, when the first receiver R1 also receives the second data, since the forwarding device 10 is in receiving mode, the first receiver R1 is disabled, and the second data received by the first receiver R1 is directly discarded.
[0121] Optional, also includes:
[0122] After the second data transmission on the second receiver R2 is completed, the second receiver starts receiving long 1s. Since the second receiver's Sens2 detects long 1s, it sends them to the controller to control the forwarding device 10 to enter the transition mode. The first receiver R1 remains disabled.
[0123] In this embodiment of the invention, the second bus occupancy detector Sens1 is used to detect the frame header to determine whether the bus is occupied, eliminating the need for decoding. The second data received by the second receiver is sent to another CONN transmitter to achieve delay-free forwarding. At the same time, the transmitter of the BUS interface is enabled, and the second data is forwarded from the second repeater to the corresponding buffer FIFO and sent through the BUS interface. At this time, the bus delay is the depth of the FIFO buffer. This invention uses FIFO to control the delay of bus forwarding, so that the delay has the advantage of high controllability and achieves low-latency forwarding.
[0124] See also Figure 2 The forwarding device 10 further includes: a third receiver R3, a third first-in-first-out buffer FIFO3, and a multiplexer MUX;
[0125] The bus interface BUS1 is connected to a rack bus on the industrial control system rack. One end of the half-duplex differential interface of the bus interface BUS1 is connected to the third transmitter T3, and the other end of the half-duplex differential interface of the bus interface is connected to the third bus occupancy detector Sens3.
[0126] The first buffer FIFO1 and the second buffer FIFO2 are respectively connected to the third transmitter T3 through a multiplexer MUX, and the third bus occupancy detector Sens3 is connected to the third receiver R3 through the third buffer FIFO3.
[0127] The third receiver R3 is connected to the first transmitter T1 and the second transmitter T2 respectively;
[0128] It should be noted that the default fixed values of the first buffer FIFO1, the second buffer FIFO2, and the third buffer FIFO3 are 5 bits, which are used to cooperate with Sens to forward data and avoid data header loss due to the delay of Sens detection.
[0129] When the forwarding device 10 is in idle mode, if the third receiver R3 receives third data and the third bus occupancy detector Sens3 detects that the bus level has a first state, the first state is sent to the controller, and the controller switches the idle mode of the forwarding device 10 to the transmission mode based on the first state.
[0130] It should be noted that the process by which the third bus occupancy detector Sens3 detects the existence of the first state of the bus level is the same as the process by which the first bus occupancy detector Sens1 detects the existence of the first state of the bus level, and they can be referred to each other.
[0131] The third data can be a response to the first data, or other data.
[0132] When the forwarding device 10 is in transmission mode, the third receiver R3 transmits the third data through the first transmitter T1 and the second transmitter T2.
[0133] In a specific implementation, when the forwarding device 10 is in the transmission mode, the third data buffered by the third buffer FIFO13 of the BUS1 interface is input to the third receiver R3 and forwarded to the first transmitter T1 and the second transmitter T2 for transmission.
[0134] Optional, also includes:
[0135] If the third receiver R3 receives the third data and the forwarding device 10 is in idle mode, the controller disables the first receiver R1, the second receiver R2 and the third transmitter T1.
[0136] Optionally, it can also include receiving long 1 after the third data transmission on the third receiver R3 is completed.
[0137] The third bus occupancy detector Sens3 detects a long 1 for a first preset time period and sends it to the controller so that the controller can control the forwarding device to enter the idle mode from the sending mode.
[0138] It should be noted that the embodiments of the present invention show the structural diagrams of the forwarding device available in different modes such as idle mode, receive mode, transition mode, and send mode.
[0139] Can Figure 4 As shown in section a, in idle mode, the forwarding device 10 disables the transceivers of the BUS interface, namely the third transmitter T3 and the third receiver R3. This is the default working state of the forwarding device 10. If no data passes through, the forwarding device 10 will continue to work in this state.
[0140] In this mode, if data enters from CONN1 or CONN2, it will be sent out directly from another CONN. This reception and forwarding does not require waiting for any judgment and there is almost no delay.
[0141] Can Figure 4As shown in section b, in receive mode, the forwarding device 10 disables the transmitter of this CONN and the receiver of another CONN. That is, if the first receiver receives data, the first transmitter and the second receiver are disabled. Similarly, if the second receiver receives data, the second transmitter and the first receiver are disabled, and the third receiver of the BUS interface remains disabled.
[0142] This is the operating state where any CONN port forwards data to another CONN and the BUS interface after detecting a data frame. In this mode, the transmitter of this CONN and the receiver of the other CONN are disabled, maintaining delay-free forwarding from the receiver of this CONN to the transmitter of the other CONN. Simultaneously, the third transmitter of the BUS interface is enabled. The MUX of the BUS interface connects the FIFO corresponding to the CONN receiver with data input to the BUS transmitter, and the third receiver of the BUS interface remains disabled. The delay of data forwarding from the CONN to the BUS is the depth of the FIFO buffer. Since the FIFO buffer depth is a fixed value, the forwarding delay is also a fixed value.
[0143] like Figure 4 As shown in section c, in transition mode, the forwarding device 10 keeps the states of the receivers and transmitters of the two CONNs unchanged from the receiving mode, but shuts down the third transmitter of the BUS interface.
[0144] This is a transitional state after the forwarding device 10 exits the receive mode. If it returns directly to the idle mode after ending the receive mode, another CONN receiver may receive an incomplete data frame and forward it, causing a communication conflict on the bus network.
[0145] like Figure 4 As shown in section d, in transmit mode, the receivers of the two CONNs and the transmitters of the BUS interface are disabled, namely the first receiver, the second receiver, and the third transmitter.
[0146] This is the working state of the forwarding node BUS interface after detecting a data frame and forwarding data to the two CONNs. The data buffered by the third buffer FIFO13 is input to the third receiver of the BUS interface and forwarded to the first and second transmitters for transmission.
[0147] The delay in data forwarding from the BUS to the CONN is the depth of the FIFO buffer. Since the depth of the FIFO buffer is a fixed value, the forwarding delay is also a fixed value.
[0148] Furthermore, the process of switching between different modes can be as follows: Figure 5As shown, once the forwarding device 10 is powered on and ready to start, it waits for all Sens, namely the first bus occupancy detector Sens1, the second bus occupancy detector Sens2, and the third bus occupancy detector Sens3, to detect no data before entering idle mode.
[0149] When the third bus occupancy detector Sens3 detects data occupancy, the forwarding device 10 enters the transmit mode from the idle mode; when the third bus occupancy detector Sens3 does not detect a level flip for a period of time, i.e. a long 1, the forwarding device 10 returns to the idle mode.
[0150] When a Sens of a certain CONN interface, namely the first bus occupancy detector Sens1 or the second bus occupancy detector Sens2, detects data occupancy, the forwarding device 10 enters the receiving mode from the idle mode; when the Sens of this CONN, namely the first bus occupancy detector Sens1 or the second bus occupancy detector Sens2, does not detect a level flip for a period of time, i.e. a long 1, the forwarding device 10 enters the transition mode from the receiving mode.
[0151] After the forwarding device 10 enters the transition mode, if the Sens of the CONN that was occupied with data before entering the transition mode detects data occupancy again, or if the third bus occupancy detector Sens3 detects data occupancy, the forwarding device 10 will transition from the transition mode to the receive mode or the transmit mode. Otherwise, the forwarding device 10 will wait until all Sens have not detected a level transition for a period of time, i.e., a long 1, before returning to the idle mode.
[0152] To better understand the forwarding device shown in the above embodiments of the present invention, the forwarding process of the forwarding device is illustrated below with an example, such as... Figure 6 As shown.
[0153] Once forwarding device 10 is powered on and ready to start, it waits for all Sens (i.e., the first bus occupancy detector Sens1, the second bus occupancy detector Sens2, and the third bus occupancy detector Sens3) to detect no data before entering idle mode.
[0154] When t = 0.5, since the external master node is closer to the first receiver R1, i.e. the receiver of CONN1, the token frame M1+M2 frame header arrives at the first receiver R1 first, and is then forwarded to the second transmitter T2, i.e. the transmitter of CONN2, with zero delay.
[0155] At t=1, because the first bus occupancy detector Sens1, i.e., CONN1's Sens detects multiple falling edges of the frame header, the forwarding device 10 enters the receiving mode, forwards the working state of the token frame M1+M2 frame header to CONN2 and the BUS interface, and disables the transmitter of CONN1, i.e., the first transmitter T1, and the receiver of CONN2, i.e., the second receiver R2, so that the first receiver R1 to the second transmitter T2 can be forwarded without delay. At the same time, the transmitter of the BUS interface, i.e., the third transmitter T3, is enabled. The MUX of the BUS interface connects the first buffer FIFO1 corresponding to the first receiver R1 with data input to the third transmitter T3. The third receiver R3 remains disabled so that the token frame M1+M2 buffered by the FIFO corresponding to the first receiver R1 can be sent from the bus interface BUS1, i.e., the third transmitter T3.
[0156] At t=3.5, the second receiver R2 also received the token frame M1+M2, but because the forwarding device 10 was operating in receive mode, the second receiver R2 was disabled, and the token frame M1+M2 received by the second receiver R2 was directly discarded.
[0157] At t=13.5, the token frame M1+M2 on the first receiver R1 is completed, and the first bus occupancy detector Sens1 begins to receive a long 1.
[0158] At t=14, the first bus occupancy detector Sens1 detects a long 1, and the forwarding device 10 enters the transition mode, while the second receiver R2 remains disabled.
[0159] At t=16.5, the token frame M1+M2 is transmitted on the second receiver R2, and the second receiver R2 begins to receive long 1.
[0160] At t=17, the second bus occupancy detector Sens2 detects a long 1. The forwarding device 10 will wait until all Sens has not detected a level flip for a period of time, that is, after a long 1, and then return to the idle mode. The forwarding device 10 enters the idle mode.
[0161] At t=17.5, since the external slave node is closer to the second receiver R2, the second receiver R2 receives the reply frame S1 before the first receiver R1. The header of the reply frame S1 arrives at the second receiver R2 first, and is then forwarded to the first transmitter T1 with zero delay.
[0162] At t=18, because the second bus occupancy detector Sens2, i.e., CONN2's Sens detects multiple falling edges of the frame header, the forwarding device 10 enters the receiving mode, forwards the working state of the reply frame S1 to CONN1 and the BUS interface, and disables the first receiver R1 and the second transmitter T2, so that the second receiver R2 to the first transmitter T1 can perform delay-free forwarding. At the same time, the transmitter of the BUS interface is enabled, and the BUS interface MUX connects the second buffer FIFO2 with data input to the third transmitter T3. The third receiver R3 remains disabled so that the reply frame S1 after being buffered by the buffer FIFO can be sent from the bus interface BUS1, i.e., the third transmitter T3.
[0163] At t=22.5, the first receiver R1 also received the reply frame S1, but because the forwarding node was working in receive mode, the first receiver R1 was disabled and the data received by the first receiver R1 was directly discarded.
[0164] At t=24.5, the second receiver R2 finishes transmitting the reply frame S1, and the second bus occupancy detector Sens2 begins to receive long 1s.
[0165] At t=25, the second bus occupancy detector Sens2 detects a long 1, and the forwarding device 10 enters the transition mode, while the first receiver R1 remains disabled.
[0166] At t=26, the reply frame S2 sent by other nodes on the local bus arrives at the third receiver R3.
[0167] At t=26.5, due to the third bus occupancy detector Sens3, i.e., the BUS Sens detects multiple falling edges of the frame header, when the third bus occupancy detector Sens3 detects data occupancy, the forwarding device 10 enters the transmission mode from the idle mode. When the forwarding device 10 enters the transmission mode, the working state of the BUS interface forwarding data to the first transmitter T1 and the second transmitter T2 after detecting the data frame, the first receiver R1, the second receiver R2 and the third transmitter T3 are disabled. The data buffered by the third buffer FIFO13 of the BUS interface is input to the third receiver R3 of the BUS interface and forwarded to the first transmitter T1 and the second transmitter T2 for transmission.
[0168] At t=33, the reply frame S2 on the third receiver R3 is completed, and the third bus occupancy detector Sens3 begins to receive a long 1.
[0169] At t=33.5, the third bus occupancy detector Sens3 detected a long 1, and the forwarding node entered idle mode.
[0170] In this embodiment of the invention, a third bus occupancy detector (Sens) is used to detect the frame header to determine whether the bus is occupied, eliminating the need for decoding. The received data is sent to the first transmitter and the second transmitter via a third receiver through a third buffer (FIFO) so that the first transmitter and the second transmitter can send it out. This invention uses FIFO to control the bus forwarding delay, making the delay highly controllable, thereby achieving low-latency forwarding.
[0171] Based on the forwarding device shown in the above embodiments of the present invention, correspondingly, the present invention also provides a flowchart of a forwarding method, as follows: Figure 7 The method includes:
[0172] Step S701: When the forwarding device is in idle mode, if the first receiver receives the first data, the first receiver sends the first data to the second transmitter of the second connector interface for transmission through the second transmitter.
[0173] Step S702: When the first bus occupancy detector detects that the bus level has a first state, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device to the receiving mode based on the first state.
[0174] Step S703: When the forwarding device is in receiving mode, the first receiver stores the first data in the corresponding first buffer for buffering, and sends the first data buffered in the first buffer through the third transmitter.
[0175] Optionally, when the first receiver receives the first data and the forwarding device is in receive mode, the controller disables the first transmitter and the second receiver.
[0176] Optionally, when the first bus occupancy detector detects a second state in the bus level, it sends the second state to the controller, and the controller switches the receiving mode of the forwarding device to a transition mode based on the second state.
[0177] Optionally, if the first bus occupancy detector, the second bus occupancy detector, and the third bus occupancy detector do not detect the second state of the bus level within a first preset time, they are sent to the controller so that the controller can switch the transition mode to the idle mode.
[0178] Optional, also includes:
[0179] When the forwarding device is in idle mode, if the second receiver receives the second data, the second receiver sends the second data to the first transmitter of the first connector interface for transmission through the first transmitter.
[0180] When the second bus occupancy detector detects that the bus level has a first state, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device to the receiving mode based on the first state.
[0181] When the forwarding device is in receive mode, the second receiver stores the second data in the corresponding buffer for buffering, and sends the second data buffered in the buffer through the bus interface.
[0182] Optional, also includes:
[0183] If the second receiver receives the second data and the forwarding device is in idle mode, the controller disables the first receiver and the second transmitter.
[0184] Optionally, when the forwarding device is in idle mode, if the third receiver receives third data and the third bus occupancy detector detects that the bus level has a first state, the first state is sent to the controller, and the controller switches the idle mode of the forwarding device to the transmission mode based on the first state.
[0185] When the forwarding device is in transmit mode, the third receiver transmits the third data through the first transmitter and the second transmitter.
[0186] Optionally, if the third receiver receives the third data and the forwarding device is in idle mode, the controller disables the first receiver, the second receiver, and the third transmitter.
[0187] It should be noted that the specific implementation process of the forwarding method is the same as that of the forwarding device described above, and they can be referred to each other.
[0188] In this embodiment of the invention, the second bus occupancy detector Sens1 is used to detect the frame header to determine whether the bus is occupied, eliminating the need for decoding. The second data received by the second receiver is sent to another CONN transmitter to achieve delay-free forwarding. At the same time, the transmitter of the BUS interface is enabled, and the second data is forwarded from the second repeater to the corresponding buffer FIFO and sent through the BUS interface. At this time, the bus delay is the depth of the FIFO buffer. This invention uses FIFO to control the delay of bus forwarding, so that the delay has the advantage of high controllability and achieves low-latency forwarding.
[0189] 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 describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. 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.
[0190] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0191] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A relay device, characterized in that, The forwarding device includes: a first connector interface, a second connector interface, a first receiver, a second transmitter, a third transmitter, a first bus occupancy detector, a first buffer, a bus interface, and a controller; The controller is communicatively connected to the first connector interface, the second connector interface, the first receiver, the second transmitter, the first bus occupancy detector, the first buffer, and the bus interface, respectively. A differential line of the first connector interface is connected to the corresponding first receiver through the first bus occupancy detector. The first receiver is connected to the first buffer. The first receiver is the receiver of the first connector interface. A differential line of the second connector interface is connected to the second transmitter, which is the transmitter of the second connector interface; The first buffer is connected to one end of the half-duplex differential interface of the bus interface through the third transmitter. The bus interface is connected to a rack bus on the industrial control system rack. The third transmitter is the transmitter of the bus interface. When the forwarding device is in idle mode, if the first receiver receives the first data, the first receiver sends the first data to the second transmitter of the second connector interface for transmission via the second transmitter. When the first bus occupancy detector detects a first state in the bus level, it sends the first state to the controller. The controller then switches the idle mode of the forwarding device to the receiving mode based on the first state. The first state is defined as the bus level having a first preset number of consecutive falling edges. When the forwarding device is in receiving mode, the first receiver stores the first data in the corresponding first buffer for buffering, and then sends the first data buffered in the first buffer through the third transmitter.
2. The forwarding device according to claim 1, characterized in that, Also includes: First transmitter and second receiver; Another differential line of the first connector interface is connected to the first transmitter, which is the transmitter of the first connector interface; Another differential line of the second connector interface is connected to the second transmitter, and the second receiver is the receiver of the second connector interface; When the first receiver receives the first data and the forwarding device is in receive mode, the controller disables the first transmitter and the second receiver.
3. The forwarding device according to claim 2, characterized in that, Also includes: When the first bus occupancy detector detects a second state in the bus level, it sends the second state to the controller. The controller then switches the receiving mode of the forwarding device to a transition mode based on the second state. The second state is that the bus level does not flip within a second preset time.
4. The forwarding device according to claim 3, characterized in that, Also includes: Second bus occupancy detector, second buffer, and third bus occupancy detector; The input terminal of the second connector interface is connected to the corresponding second receiver through the second bus occupancy detector, and the second receiver is connected to the second buffer. The third bus occupancy detector is connected to the other end of the half-duplex differential interface of the bus interface; If the first bus occupancy detector, the second bus occupancy detector, and the third bus occupancy detector do not detect a second state in the bus level within a first preset time, they are sent to the controller so that the controller can switch the transition mode to the idle mode.
5. The forwarding device according to claim 4, characterized in that, Also includes: When the forwarding device is in idle mode, if the second receiver receives the second data, the second receiver sends the second data to the first transmitter of the first connector interface for transmission via the first transmitter. When the second bus occupancy detector detects that the bus level has a first state, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device to the receiving mode based on the first state. When the forwarding device is in receive mode, the second receiver stores the second data in the corresponding buffer for buffering, and sends the second data buffered in the buffer through the bus interface.
6. The forwarding device according to claim 5, characterized in that, Also includes: If the second receiver receives the second data and the forwarding device is in idle mode, the controller disables the first receiver and the second transmitter.
7. The forwarding device according to claim 4, characterized in that, Also includes: Third receiver, third buffer and multiplexer; The bus interface is connected to a rack bus on the industrial control system rack. One end of the half-duplex differential interface of the bus interface is connected to a third transmitter, and the other end of the half-duplex differential interface of the bus interface is connected to a third bus occupancy detector. The first buffer and the second buffer are respectively connected to the third transmitter through a multiplexer, and the third bus occupancy detector is connected to the third receiver through the third buffer. The third receiver is the receiver of the bus interface. The third receiver is connected to both the first transmitter and the second transmitter. When the forwarding device is in idle mode, if the third receiver receives third data and the third bus occupancy detector detects that the bus level has a first state, the first state is sent to the controller, and the controller switches the idle mode of the forwarding device to the transmission mode based on the first state. When the forwarding device is in transmit mode, the third receiver transmits the third data through the first transmitter and the second transmitter.
8. The forwarding device according to claim 7, characterized in that, Also includes: If the third receiver receives the third data and the forwarding device is in idle mode, the controller disables the first receiver, the second receiver, and the third transmitter.
9. A forwarding method, characterized in that, The forwarding device according to any one of claims 1-8, the forwarding device comprising a first connector interface, a second connector interface, a first receiver, a second transmitter, a third transmitter, a first bus occupancy detector, a first buffer, a bus interface, and a controller, the method comprising: When the forwarding device is in idle mode, if the first receiver receives the first data, the first receiver sends the first data to the second transmitter of the second connector interface for transmission via the second transmitter. When the first bus occupancy detector detects a first state in the bus level, it sends the first state to the controller, and the controller switches the idle mode of the forwarding device to the receiving mode based on the first state. When the forwarding device is in receiving mode, the first receiver stores the first data in the corresponding first buffer for buffering, and then sends the first data buffered in the first buffer through the third transmitter.
10. A relay device, characterized in that, The forwarding device includes any one of claims 1-8, wherein the number of the forwarding devices is multiple; The forwarding device is connected to a rack bus on the rack of the industrial control system via a bus interface; Each of the aforementioned forwarding devices is connected to a ring network via the first connector interface or the second connector interface.