A data exchange method and exchange
By employing a ring data forwarding link and real-time identification of port indication information in industrial Ethernet switches, the status of slave ports is dynamically adjusted, solving the problems of high complexity and latency in switches with a large number of slave stations, and achieving efficient subnet segmentation access and low-complexity design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING FANGXIN SEMICON CO LTD
- Filing Date
- 2026-04-28
- Publication Date
- 2026-05-29
AI Technical Summary
Existing industrial Ethernet switches suffer from large data frame transmission delays and high internal structural complexity when dealing with a large number of slave stations, especially as the number of ports increases exponentially.
By employing a ring data forwarding link and real-time identification of port indication information, the data forwarding topology is dynamically adjusted by configuring the opening and closing of ports, thus avoiding complex address management, priority management, and caching circuits.
This achieves a significant reduction in the internal structure complexity of the switch and a reduction in data frame transmission latency while meeting the subnet segmentation access requirements.
Smart Images

Figure CN122120233A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data exchange method and a switch. Background Technology
[0002] For industrial Ethernet, or Ethercat, the network topology is a serial connection. Whether the master station connects to a slave station via a single port or to both ends of the slave station string via two ports, each data frame is transmitted from the master station, through all the slave stations, and back to the master station. When there are a large number of slave stations, the total latency of data frame transmission can be very high. To address this problem, one solution is to group slave stations according to access frequency, placing different groups into different subnets. In a single access operation, only the subnet with the target slave station is accessed; subnets without a relevant slave station are not accessed. Many existing non-Ethercat Ethernet switches use this technology. The switch maintains a static or dynamic address table internally, containing mappings between destination addresses and ports, priorities, and other information. When a port on the switch receives a data frame, it determines which port to forward the frame to based on the destination address in the frame header and the priority information in the address table.
[0003] Figure 1 This is a schematic diagram of frame reception and forwarding using a switch employing existing technology. Figure 1 In the diagram, the port with shaded padding on the switch is connected to the master station, while the other three ports without shaded padding are each responsible for connecting to a slave station. Figure 1 The rectangular area in the center represents the address identification and switching unit. Solid arrows indicate frames sent from the master station to the switch, and dashed arrows indicate forwarded frames. Figure 1 As can be seen, when the switch receives a frame, it forwards the frame to the address identification and switching unit inside the switch. This unit determines which port(s) to send the frame to based on the address, and realizes the forwarding of the frame inside the switch through interconnection with the slave ports.
[0004] Figure 2 This is a schematic diagram of frame forwarding for a switch using existing technology. Figure 2 In the diagram, the port with shaded padding on the switch is connected to the master station, while the other three ports without shaded padding are responsible for connecting to the slave stations. Dashed arrows represent frames returned from the slave stations, and solid arrows represent frames forwarded to the master station. Figure 2 As you can see, when a switch receives a frame from a slave port, it will uniformly return the frame to the port connected to the master station. If multiple slaves return frames simultaneously, in order to avoid data loss, sufficient buffering needs to be implemented inside the switch to store low-priority frame data.
[0005] Existing technologies can address the need for subnet segmentation access, but as mentioned earlier, switches require complex circuitry for address management, priority management, and caching, which is generally highly complex. This is equivalent to designing a switch whose complexity increases exponentially with the number of ports. Summary of the Invention
[0006] Based on the above problems, this application provides a data exchange method and a switch, which aims to eliminate the complex address management, priority management, caching and other circuits inside the switch while meeting the needs of subnet segmentation access, thereby reducing the complexity of the internal structure of the switch.
[0007] The embodiments of this application disclose the following technical solutions: The first aspect of this application provides a data exchange method, which is applied to a switch having one master port and multiple slave ports. The master port is used to connect to a master station, and each of the slave ports is used to connect to a different subnet, wherein the subnet includes one or more slave stations. The ports of the switch are connected in series in a ring-shaped data forwarding link, and the open / closed state of each of the slave ports can be switched. When the open / closed state of any of the slave ports in the data forwarding link changes, the data forwarding topology of the switch changes. The data exchange method includes: Receive the current data frame transmitted from the main port; Port indication information is identified from the current data frame; the port indication information is used to indicate the target slave port and non-target slave port of the current data frame; Based on the port indication information, configure the target slave port to be enabled and the non-target slave port to be disabled; The current data frame is forwarded based on the current data forwarding topology of the switch.
[0008] In an optional implementation of the first aspect, the switch includes an identification unit and multiple bypass selectors; in the data forwarding link, the identification unit is located downstream of the master port and upstream of the first slave port, and the multiple bypass selectors correspond one-to-one with the multiple slave ports and are located downstream of their respective slave ports. The switch also includes multiple closable transmitting modules; the first input terminal of each closable transmitting module is a data input, and the second input terminal is an enable signal input; in the data forwarding link, each of the multiple closable transmitting modules corresponds one-to-one with the multiple slave ports, and is located upstream of the corresponding slave port, with its own output terminal connected to the corresponding slave port; Among the plurality of slave ports, the first input terminal of the closable transmitting module corresponding to the first slave port is connected to the data output terminal of the identification unit, and the first input terminals of the closable transmitting modules corresponding to the other slave ports are respectively connected to the data output terminals of the bypass selectors corresponding to the upstream slave ports adjacent to themselves. The step of configuring the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information includes: The identification unit sends a first type selection signal to the bypass selector corresponding to each target slave port according to the identified port indication information, sends a first control signal to the second input terminal of the closable transmission module corresponding to each target slave port, sends a second type selection signal to the bypass selector corresponding to each non-target slave port, and sends a second control signal to the second input terminal of the closable transmission module corresponding to each non-target slave port. The first control signal is used to configure the data channel of the closable transmitting module corresponding to the target slave port to be turned on, and the first type selection signal is used to configure the bypass selector corresponding to the target slave port to use one input data provided by the target slave port as the output; and the second control signal is used to configure the data channel of the closable transmitting module corresponding to the non-target slave port to be turned off, and the second type selection signal is used to configure the bypass selector corresponding to the non-target slave port to use one input data not from the non-target slave port as the output.
[0009] In an optional implementation of the first aspect, the bypass selector includes at least two selectable input terminals, namely a 0 input terminal and a 1 input terminal, and the bypass selector also includes a data output terminal; The switch has two slave ports, namely the first slave port and the last slave port; In the data forwarding link, the 0 input terminal of the bypass selector corresponding to the first slave port is connected to the data output terminal of the identification unit, and the 1 input terminal is connected to the first slave port. The data output terminal of the bypass selector corresponding to the first slave port is connected to the 0 input terminal of the bypass selector corresponding to the last slave port. The 1 input terminal of the bypass selector corresponding to the last slave port is connected to the last slave port, and the data output terminal of the bypass selector corresponding to the last slave port is connected to the master port.
[0010] In an optional implementation of the first aspect, the bypass selector includes at least two selectable input terminals, namely a 0 input terminal and a 1 input terminal, and the bypass selector also includes a data output terminal; The switch has a total of M slave ports, where M is an integer greater than 2; in the data forwarding link, the first slave port is the first upstream slave port among the M slave ports, and the Mth slave port is the last downstream slave port among the M slave ports. In the data forwarding link, the 0 input terminal of the bypass selector corresponding to the first slave port is connected to the data output terminal of the identification unit, and the 1 input terminal is connected to the first slave port; The 0 input terminal of the bypass selector corresponding to the i-th slave port is connected to the data output terminal of the bypass selector corresponding to the (i-1)-th slave port, and the 1 input terminal of the bypass selector corresponding to the i-th slave port is connected to the i-th slave port; where i is an integer, i is greater than or equal to 2, and i is less than or equal to M; The data output terminal of the bypass selector corresponding to the Mth slave port is connected to the master port.
[0011] In an optional implementation of the first aspect, the identification unit includes a plurality of first registers, each of which corresponds one-to-one with a plurality of slave ports; the output of the first register is connected to the second input of the shut-off transmitting module corresponding to the corresponding slave port, and the output of the first register is connected to the selection terminal of the bypass selector corresponding to the corresponding slave port. After identifying the port indication information from the current data frame, the method further includes: Based on the correspondence between each bit in the port indication information and the plurality of slave ports, sub-indication information for each slave port is determined, and the sub-indication information for the corresponding slave port is stored in the plurality of first registers respectively; wherein, the sub-indication information for the target slave port is 1, and the sub-indication information for the non-target slave port is 0. The identification unit, based on the identified port indication information, sends a first type selection signal to the bypass selector corresponding to each target slave port, sends a first control signal to the second input terminal of the closable transmitting module corresponding to each target slave port, sends a second type selection signal to the bypass selector corresponding to each non-target slave port, and sends a second control signal to the second input terminal of the closable transmitting module corresponding to each non-target slave port, including: The identification unit sends the sub-indication information stored in the first register as 1 to the second input terminal of the connected closable transmitting module using the first control signal as a carrier, and sends it to the selection terminal of the connected bypass selector using the first type selection signal as a carrier; the identification unit sends the sub-indication information stored in the first register as 0 to the second input terminal of the connected closable transmitting module using the second control signal as a carrier, and sends it to the selection terminal of the connected bypass selector using the second type selection signal as a carrier.
[0012] In an optional implementation of the first aspect, the port indication information is pre-added to the current data frame in a preset manner; the preset manner is one of the following: The port indication information is contained in a portion of the bits of the target MAC address of the current data frame; or, the port indication information is contained in a portion of the bits of the source MAC address of the current data frame; or, a data segment is inserted before the target MAC address of the current data frame, and the data segment contains the port indication information.
[0013] In an alternative implementation of the first aspect, before configuring the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information, the method further includes: Determine the port indication information of the previous data frame of the current data frame, and compare the consistency between the port indication information identified in the current data frame and the port indication information of the previous data frame. The step of configuring the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information specifically includes: If the port indication information identified in the current data frame is inconsistent with the port indication information in the previous data frame, then the target slave port is reconfigured and the non-target slave port is closed according to the port indication information identified in the current data frame.
[0014] In an optional implementation of the first aspect, if the port indication information identified in the current data frame is inconsistent with the port indication information of the previous data frame, the step of reconfiguring the opening of the target slave port and the closing of the non-target slave port according to the port indication information identified in the current data frame includes: After the previous data frame of the current data frame has completely returned to the master station through the data forwarding link, the target slave port is reconfigured and the non-target slave port is closed according to the port indication information identified in the current data frame. If the port indication information identified in the current data frame is consistent with the port indication information of the previous data frame, forwarding the current data frame based on the current data forwarding topology of the switch includes: Before the previous data frame of the current data frame has completely returned to the master station through the data forwarding link, the current data frame is forwarded based on the current data forwarding topology of the switch.
[0015] A second aspect of this application provides a switch having one master port and multiple slave ports. The master port is used to connect to a master station, and each slave port is used to connect to a different subnet, wherein the subnet includes one or more slave stations. The ports of the switch are connected in series in a ring-shaped data forwarding link, and the open / closed state of each slave port is switchable. When the open / closed state of any slave port in the data forwarding link changes, the data forwarding topology of the switch changes. The switch is configured to receive current data frames received from the master port; identify port indication information from the current data frames; and use the port indication information to indicate the target slave port and non-target slave port of the current data frames. The switch is also configured to enable the target slave port and disable the non-target slave port according to the port indication information; and to forward the current data frame based on the current data forwarding topology of the switch.
[0016] In an optional implementation of the second aspect, the switch includes an identification unit and multiple bypass selectors; the first input terminal of the closable transmitting module is a data input, and the second input terminal is an enable signal input; in the data forwarding link, the identification unit is located downstream of the master port and upstream of the first slave port, and the multiple bypass selectors correspond one-to-one with the multiple slave ports and are located downstream of their respective slave ports. The switch also includes multiple closable transmitting modules; in the data forwarding link, each of the multiple closable transmitting modules corresponds one-to-one with the multiple slave ports and is located upstream of the corresponding slave port, with its own output connected to the corresponding slave port; Among the plurality of slave ports, the first input terminal of the closable transmitting module corresponding to the first slave port is connected to the data output terminal of the identification unit, and the first input terminals of the closable transmitting modules corresponding to the other slave ports are respectively connected to the data output terminals of the bypass selectors corresponding to the upstream slave ports adjacent to themselves. The switch is specifically configured to, through the identification unit, send a first type selection signal to the bypass selector corresponding to each target slave port according to the identified port indication information; send a first control signal to the second input terminal of the closable transmitting module corresponding to each target slave port; send a second type selection signal to the bypass selector corresponding to each non-target slave port; and send a second control signal to the second input terminal of the closable transmitting module corresponding to each non-target slave port. The switch is configured to: open the data channel of the closable transmitting module corresponding to the target slave port using the first control signal; configure the bypass selector corresponding to the target slave port to use one input data provided by the target slave port as its output using the first type selection signal; and configure the data channel of the closable transmitting module corresponding to the non-target slave port to be closed using the second control signal; and configure the bypass selector corresponding to the non-target slave port to use one input data not from the non-target slave port as its output using the second type selection signal.
[0017] Compared with the prior art, this application has the following beneficial effects: In this technical solution, the master port of the switch connects to the master station, and the slave ports connect to a subnet containing one or more slave stations. Each port in the switch is connected in series in a ring-shaped data forwarding link, and the open / closed state of each slave port can be switched. When the open / closed state of any slave port in the data forwarding link changes, the data forwarding topology of the switch changes. Taking receiving the current data frame as an example, the switch receives the current data frame from its master port; it identifies port indication information from the current data frame, which indicates the target slave port and non-target slave ports of the current data frame; based on the port indication information, it configures the target slave port to be opened and the non-target slave port to be closed; and it forwards the current data frame based on the current data forwarding topology of the switch. In the data exchange method, for each frame received from the master station, it is necessary to identify the port indication information and control the opening or closing of each slave port accordingly. This method of real-time identification of port indication information and further real-time control of the switch's data forwarding topology is very convenient to implement, eliminating the need for complex internal address management, priority management, and buffering circuits within the switch. Therefore, it satisfies the requirements of subnet segmentation access while significantly reducing the complexity of the switch. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic diagram of frame reception and forwarding using a switch employing existing technology; Figure 2 A schematic diagram of frame forwarding in a switch using existing technology; Figure 3 A schematic diagram of a ring-shaped data forwarding link formed by connecting the ports of a switch in series, provided in an embodiment of this application; Figure 4 A flowchart illustrating a data exchange method provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an Ethercat frame; Figure 6 This is a diagram illustrating the storage of port indication information in the first 3 bits of the target MAC address. Figure 7 A schematic diagram of a switch provided for an embodiment of this application; Figure 8 This is a schematic diagram of the data forwarding topology when the port indication information is 111; Figure 9 This is a schematic diagram of the data forwarding topology when the port indication information is 110. Detailed Implementation
[0020] As described earlier, in Ethernet, if a switch connects to a large number of slave stations, the total frame transmission latency will also be relatively high. Therefore, grouping the numerous slave stations into different subnets and combining this with the switch's internal address management, priority management, and buffering circuitry can meet the requirements of subnet segmentation access and reduce the total frame transmission latency. However, this technology comes at the cost of significantly increased complexity in the switch's internal structure, especially as the number of ports increases, leading to an exponential increase in the complexity of the designed switch.
[0021] To address the aforementioned problems, the inventors have developed a data exchange method and switch. For each frame received from the master station, port indication information needs to be identified to determine the target and non-target slave ports, and based on this, the opening or closing of each slave port is controlled. This method of real-time identification of port indication information and further real-time control of the switch's data forwarding topology is very convenient to implement, eliminating the need for complex internal address management, priority management, and buffering circuits within the switch. This allows for both meeting the requirements of subnet segmentation access and significantly reducing the complexity of the switch.
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0023] This application provides a data exchange method, which is applied to a switch having one master port and multiple slave ports. The master port is used to connect to a master station, and each slave port is used to connect to a different subnet, which includes one or more slave stations.
[0024] For easier understanding, it can be combined with Figure 3 , Figure 3 This demonstrates a ring-shaped data forwarding link formed by cascading ports in a switch. Figure 3 In the example, we can see one master port (Port0) and three slave ports: Port1, Port2, and Port3. These four ports are connected in series in a ring-shaped data forwarding link. Port0 connects to the master station, Port1 connects to subnet 1, Port2 connects to subnet 2, and Port3 connects to subnet 3. Each subnet (subnet 1, subnet 2, and subnet 3) contains one or more slave stations. In the ring-shaped data forwarding link, if all slave ports are enabled, data frames arriving at Port0 are forwarded sequentially to Port1, Port2, and Port3, and finally back to Port0.
[0025] In this embodiment, the ports of the switch are connected in series in a ring-shaped data forwarding link, and the on / off state of each slave port can be switched. When the on / off state of any slave port in the data forwarding link changes, the data forwarding topology of the switch changes. That is, although each slave port is still in the ring-shaped data forwarding link... Figure 3 In the ring-shaped data forwarding link shown, the data forwarding topology will change when the open / closed state of one or more slave ports changes, causing one or more slave ports to be unable to receive the forwarded data frames.
[0026] When one or more slave ports switch from the enabled state to the disabled state, the switch's data forwarding topology can be flexibly adjusted to bypass the disabled slave port and transmit the data frame to the enabled port downstream of the disabled slave port; when one or more slave ports switch from the disabled state to the enabled state, the switch's data forwarding topology can be flexibly adjusted to open up the data channel where the originally disabled slave port was located, so that the data frame can be transmitted to the corresponding slave port and then reach the corresponding subnet.
[0027] The data frames transmitted from the master station to the switch through the master port are real-time data frames. For example, the master station sequentially sends the first, second, and third data frames to the switch through Port0, where the third data frame is the latest data frame, also known as the current data frame. The slave ports that the first, second, and third data frames require to be enabled may be the same or different; correspondingly, the slave ports that the first, second, and third data frames require to be disabled may be the same or different. The following example illustrates this with the second and third data frames.
[0028] In one example, the second data frame requires configuring Port1 and Port2 to be enabled and Port3 to be disabled; the third data frame requires configuring Port1 to be enabled and Port2 and Port3 to be disabled. This means that the second data frame only needs to be transmitted to subnet 1 and subnet 2, but not to subnet 3, and the third data frame only needs to be transmitted to subnet 1, but not to subnet 2 and subnet 3. In this embodiment, the switch can identify and analyze the port indication information of the received data frames in real time to realize the real-time configuration of the port open / closed status, and thus adjust the data forwarding topology in real time to achieve the purpose of subnet segmentation access.
[0029] In another example, both the second and third data frames require Port1 and Port2 to be enabled and Port3 to be disabled. This means that both the second and third data frames only need to be transmitted to subnet 1 and subnet 2, and not to subnet 3. Since these two data frames require the same enabled and disabled slave ports, the switch's data forwarding topology does not need to be changed before forwarding the third data frame.
[0030] In practical applications, slave stations can be assigned to different subnets based on factors such as the frequency of access to data provided by the master station or the characteristics of the slave station. This application does not limit the basis or specific method for assigning slave stations to subnets. It is understood that... Figure 3 The number of slave ports shown is for illustrative purposes only. In actual applications, switches can have 2, 4, 5 or even more slave ports.
[0031] Figure 4 This application illustrates the flow of a data exchange method provided by an embodiment. The method is implemented by an industrial Ethernet switch, which enables data exchange between the master and slave stations of the industrial Ethernet network. Figure 4 As shown, the data exchange method provided in this application embodiment includes: S41. Receive the current data frame transmitted from the autonomous port.
[0032] Since the switch's master port is connected to the master station, it can receive data frames transmitted from the master station in real time. For ease of understanding and explanation, taking the current data frame as an example, this embodiment of the application describes some identification and slave port configuration operations performed on the current data frame before forwarding it.
[0033] S42. Identify port indication information from the current data frame.
[0034] In this embodiment, each incoming data frame carries port indication information. This port indication information is essentially the core basis for configuring the port on / off status in the early stages of data frame forwarding. The port indication information is used to indicate the target slave port and non-target slave ports of the current data frame.
[0035] In an optional implementation, the port indication information is generated based on the access requirements of the current data frame. For example, in Figure 3 In the example, slave stations in subnets 2 and 3 have a need to access the current data frame, while slave stations in subnet 1 do not. Therefore, port indication information can be generated indicating that Port 1 is a non-target slave port and Port 2 and Port 3 are target slave ports.
[0036] Figure 5 This is a schematic diagram of the Ethercat frame structure. Message n-1, message n, and message n+1 represent three consecutive data frames. Each data frame, message n, includes a frame header, valid data, and a frame trailer. The frame header contains several components such as the destination MAC address, source MAC address, VLAN tag, and EtherType. Ethercat is based on Ethernet frames, but modifies the EtherType portion; the address information at the beginning of the Ethernet frame is retained. In this embodiment, port indication information is pre-added to the current data frame in a preset manner. Here, three optional preset methods are provided as examples.
[0037] Method 1: Some bits in the target MAC address of the current data frame contain port indication information.
[0038] The target MAC address has 6 bits. Assuming the switch has 3 slave ports, the first 3 bits of the target MAC address can be selected to carry port indication information for these 3 slave ports.
[0039] Figure 6 This is a diagram illustrating the storage of port information in the first three bits of the target MAC address. Figure 6 In the diagram, the first bit, bit 0, corresponds to... Figure 3The control bits of Port1 shown contain sub-indication information for controlling the opening and closing state of Port1; the second bit, bit1, serves as the corresponding... Figure 3 The control bits of Port2 shown contain sub-indication information for controlling the opening and closing state of Port2; the third bit, bit2, serves as the corresponding... Figure 3 The control bits for Port3 shown contain sub-indication information for controlling the open / closed state of Port3. In the example, bits 0-2 are 111, indicating that Ports 1-3 need to be configured to be open, requiring the current data frame to originate from the master station, pass through subnet 1, subnet 2, and subnet 3 in sequence, and finally return to the master station; bits 0-2 are 110, indicating that Ports 1 and 2 need to be configured to be open, and Port 3 needs to be configured to be closed, requiring the current data frame to originate from the master station, pass through subnet 1 and subnet 2 in sequence, skip subnet 3, and finally return to the master station.
[0040] Method 2: Some bits in the source MAC address of the current data frame contain port indication information.
[0041] The source MAC address of an EtherCAT frame also has 6 bits, from which some bits can be selected to store port indication information. Method 2 is similar to Method 1 and can be understood in conjunction with Method 1, so it will not be elaborated here.
[0042] Methods one and two above both utilize extra bits in the existing address field to store port indication information. Method three, which will be introduced below, involves specifically inserting data to store port indication information.
[0043] Method 3: A segment of data is inserted before the target MAC address of the current data frame. This segment of data contains port indication information.
[0044] In practical applications, switches may contain four or more slave ports. To prevent the port indication information of the slave ports from excessively occupying bits of the destination MAC address or the source MAC address, additional data can be inserted to store the port indication information. In method three, a segment of data can be inserted before the destination MAC address to store the port indication information. For example, if the switch contains seven slave ports, seven bits of data can be inserted before the destination MAC address, with each bit corresponding to storing sub-indication information for one slave port.
[0045] S43. Based on the port indication information, configure to enable the target slave port and disable the non-target slave port.
[0046] In this embodiment, configuring the target slave port to be open means ensuring the data channel related to the target slave port in the data forwarding link is unobstructed. This allows the current data frame to successfully reach the target slave port, and the current data frame transmitted from the target slave port to the switch can also be transmitted to the downstream open port. Configuring the non-target slave port to be closed means disabling the data channel related to the non-target slave port in the data forwarding link. This achieves the effect of bypassing the non-target slave port during current data frame forwarding. Specifically, the current data frame cannot reach the non-target slave port and cannot be transmitted to the subnet connected to the non-target slave port. During the switch's transmission of the current data frame, the downstream open slave port of the non-target slave port will not receive data from the non-target slave port.
[0047] S44. Forward the current data frame based on the current data forwarding topology of the switch.
[0048] In this embodiment, the execution of step S43 also affects the data forwarding topology within the switch. After configuring the port open / close status, the switch can forward the current data frame based on the current data forwarding topology. Since the target slave port is configured to be open based on port indication information, and the non-target slave port is configured to be closed based on port indication information, forwarding the current data frame based on the current data forwarding topology effectively meets the requirements for subnet segmentation access for the current data frame, skips unnecessary forwarding paths in the data forwarding link, and thus shortens the forwarding time of the current data frame and the total latency of the current data frame transmission.
[0049] In the above-described method embodiments, for each frame received from the master station, port indication information needs to be identified, and the opening or closing of each slave port is controlled accordingly. This method of real-time identification of port indication information and further real-time control of the switch's data forwarding topology is very convenient to implement, as it does not require complex internal address management, priority management, caching, or other circuits within the switch. Therefore, it satisfies the requirements of subnet segmentation access while greatly reducing the complexity of the switch.
[0050] The following section further introduces one internal structure of a switch, and, in conjunction with this specific structure, describes the data forwarding link and the configuration method for the open / closed state of the slave ports.
[0051] In an optional implementation, the switch includes an identification unit and multiple bypass selectors. In the data forwarding link, the identification unit is located downstream of the master port and upstream of the first slave port. The multiple bypass selectors correspond one-to-one with multiple slave ports and are located downstream of their respective slave ports. The switch also includes multiple shuntable transmitting modules. The first input of each shuntable transmitting module is a data input, and the second input is an enable signal input. In principle, the shuntable transmitting module can be considered an AND gate, opening or closing based on the signal emitted by the identification unit, similar to the effect of an AND gate. In the data forwarding link, each shuntable transmitting module corresponds one-to-one with multiple slave ports and is located upstream of its corresponding slave port, with its output connected to its corresponding slave port. Among the multiple slave ports, the first input of the shuntable transmitting module corresponding to the first slave port is connected to the data output of the identification unit, and the first inputs of the shuntable transmitting modules corresponding to the other slave ports are respectively connected to the data outputs of the bypass selectors corresponding to their adjacent upstream slave ports.
[0052] Figure 7 This is a schematic diagram of a switch provided in an embodiment of this application. Figure 7 The demonstrated switch is configured with one master port (Port0) and three slave ports, which are the first slave port (Port1), the second slave port (Port2), and the third slave port (Port3) along the ring data forwarding link from upstream to downstream. Port1 is the first slave port, and Port3 is the last slave port. Port0 connects to the master station, and Ports 1 through 3 connect to subnets 1 through 3, respectively. Port1 corresponds to the first bypass selector (S1) and the first closable transmitting module (G1), Port2 corresponds to the second bypass selector (S2) and the second closable transmitting module (G2), and Port3 corresponds to the third bypass selector (S3) and the third closable transmitting module (G3).
[0053] Combination Figure 7 The switch structure shown, in the specific implementation step S43, includes configuring the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information, which may specifically include: Based on the identified port indication information, the identification unit sends a first type selection signal to the bypass selector corresponding to each target slave port, and sends a first control signal to the second input terminal of the closable transmitting module corresponding to each target slave port to enable the transmitting module. It also sends a second type selection signal to the bypass selector corresponding to each non-target slave port, and sends a second control signal to the second input terminal of the closable transmitting module corresponding to each non-target slave port to shut down the transmitting module. The data channel of the closable transmitting module corresponding to the target slave port is opened by configuring the first control signal, and the bypass selector corresponding to the target slave port is configured to use one input data provided by the target slave port as the output by configuring the first type selection signal; and the data channel of the closable transmitting module corresponding to the non-target slave port is closed by configuring the second control signal, and the bypass selector corresponding to the non-target slave port is configured to use one input data other than the non-target slave port as the output by configuring the second type selection signal.
[0054] exist Figure 7 The diagram shows three selection signals: Q1' sent to the first bypass selector S1, Q2' sent to the second bypass selector S2, and Q3' sent to the third bypass selector S3. The type of selection signals Q1', Q2', and Q3'—whether they are type I or type II—depends on the sub-indication information in the corresponding bit of the identified port indication information. For example, if bit 0 of selection signal Q1' is 1, then Q1' is a type I selection signal; conversely, if bit 0 is 0, then Q1' is a type II selection signal.
[0055] In addition, Figure 7 The document also demonstrates three control signals: control signal Q1 sent to the first closable transmitting module G1, control signal Q2 sent to the second closable transmitting module G2, and control signal Q3 sent to the third closable transmitting module G3. The type of control signals Q1, Q2, and Q3—whether they are the first control signal or the second control signal—depends on the sub-indication information in the corresponding bit of the identified port indication information. For example, if bit 0 of control signal Q1 is 1, then control signal Q1 is the first control signal; conversely, if bit 0 is 0, then control signal Q1 is the second control signal.
[0056] In practical applications, the selection signals and control signals sent to the bypass selector and the malfunctionable transmitting module corresponding to the same slave port during the same time period should have a matching correlation. For example, during time period T1, if data needs to pass through a certain slave port, a first type selection signal and a first control signal need to be sent to the bypass selector and the malfunctionable transmitting module corresponding to that slave port, respectively; during time period T1, if data needs to bypass a certain slave port, a second type selection signal and a second control signal need to be sent to the bypass selector and the malfunctionable transmitting module corresponding to that slave port, respectively.
[0057] The selection and control signals received by the bypass selector and the closable transmitting module corresponding to the same port can have one of the following types of association: (1) The selection signal and the control signal are the same signal; (2) The selection signal and the control signal are generated based on the same trigger signal; (3) The selection signal is generated based on the control signal; or, the control signal is generated based on the selection signal.
[0058] In one alternative implementation, the bypass selector includes at least two selectable inputs, namely a 0 input and a 1 input, and also includes a data output. The switch has two slave ports: the first slave port and the last slave port. In the data forwarding link, the 0 input of the bypass selector corresponding to the first slave port is connected to the data output of the identification unit, and the 1 input is connected to the first slave port. The data output of the bypass selector corresponding to the first slave port is connected to the 0 input of the bypass selector corresponding to the last slave port. The 1 input of the bypass selector corresponding to the last slave port is connected to the last slave port, and the data output of the bypass selector corresponding to the last slave port is connected to the master port.
[0059] In another alternative implementation, the bypass selector includes at least two selectable inputs, namely a 0 input and a 1 input, and also includes a data output. The switch has a total of M slave ports, where M is an integer greater than 2. In the data forwarding link, the first slave port is the upstream first slave port among the M slave ports, and the Mth slave port is the downstream last slave port among the M slave ports. For example, when M is 3, refer to... Figure 7 As shown, the switch includes three slave ports (Port1~Port3), three closable transmitting modules (G1~G3), and three bypass selectors (S1~S3). In the data forwarding link, the 0 input of the first bypass selector S1 corresponding to Port1 is connected to the data output of the identification unit, and the 1 input of S1 is connected to the first slave port (Port1).
[0060] The 0 input terminal of the bypass selector corresponding to the i-th slave port is connected to the data output terminal of the bypass selector corresponding to the (i-1)-th slave port, and the 1 input terminal of the bypass selector corresponding to the i-th slave port is connected to the i-th slave port; where i is an integer, i is greater than or equal to 2, and i is less than or equal to M. For example, when M is 3, refer to... Figure 7 As shown, the 0 input terminal of the second bypass selector S2 corresponding to the second slave port Port2 is connected to the data output terminal of the first bypass selector S1 corresponding to the first slave port Port1; the 0 input terminal of the third bypass selector S3 corresponding to the third slave port Port3 is connected to the data output terminal of the second bypass selector S2 corresponding to the second slave port Port2.
[0061] The Mth port is connected to the data output of the bypass selector corresponding to the slave port. For example, when M is 3, refer to... Figure 7 As shown, the data output terminal of the third bypass selector S3 corresponding to the third slave port Prot3 is connected to the master port Port0.
[0062] In an optional implementation, the identification unit includes multiple first registers, each corresponding to a single slave port; the output of each first register is connected to the second input of a closable transmitting module corresponding to the corresponding slave port, and the output of each first register is also connected to the selection terminal of a bypass selector corresponding to the corresponding slave port. After identifying the port indication information from the current data frame, the method further includes: Based on the correspondence between each bit in the port indication information and multiple slave ports, sub-indication information for each slave port is determined, and the sub-indication information for the corresponding slave port is stored in multiple first registers respectively; wherein, the sub-indication information for the target slave port is 1, and the sub-indication information for non-target slave ports is 0.
[0063] For example, the first three bits (bits 0, 1, and 2) of the destination MAC address in the frame header of the current data frame store sub-indication information for Port1, Port2, and Port3, respectively. These three bits of sub-indication information can be collectively referred to as port indication information. For instance, if the port indication information for bits 0-2 is 110, it means that the sub-indication information for Port1 and Port2 is both 1, and the sub-indication information for Port3 is 0. That is, it requires Port1 and Port2 to be enabled, and Port3 to be disabled.
[0064] In this embodiment, if the port indication information is the first three bits of the target MAC address stored in the frame header of the current data frame, the identification unit can sample the first three bits of the frame header of the current data frame after they are transmitted from the master port to the switch, and store the sub-indication information of the first three bits obtained after sampling into the first register corresponding to the slave port. Of course, the identification unit can also be configured with other registers to be responsible for storing and transmitting other data in the current data frame. For example, the identification unit also includes one or more second registers, which transmit the valid data of the incoming current data frame to the first downstream slave port, or transmit the valid data to the 0 input terminal of the bypass selector corresponding to the first slave port when the first slave port is closed.
[0065] Based on the identified port indication information, the identification unit sends a first type selection signal to the bypass selector corresponding to each target slave port, sends a first control signal to the second input terminal of the closable transmitting module corresponding to each target slave port, sends a second type selection signal to the bypass selector corresponding to each non-target slave port, and sends a second control signal to the second input terminal of the closable transmitting module corresponding to each non-target slave port, including: The identification unit sends the sub-indication information stored in the first register as 1 to the second input terminal of the connected closable transmitting module via a first control signal, and to the selection terminal of the connected bypass selector via a first type selection signal; the identification unit sends the sub-indication information stored in the first register as 0 to the second input terminal of the connected closable transmitting module via a second control signal, and to the selection terminal of the connected bypass selector via a second type selection signal. Figure 7 In the example, we can see that the selection terminal of S1 receives the selection signal Q1' and thus obtains the sub-indication information of bit0; the selection terminal of S2 receives the selection signal Q2' and thus obtains the sub-indication information of bit1; the selection terminal of S3 receives the selection signal Q3' and thus obtains the sub-indication information of bit2; the second input terminals of G1~G3 each receive the control signals Q1~Q3, and accordingly obtain the sub-indication information of bit0~bit2.
[0066] Figure 8 Marked with red lines Figure 7 The example switch's data forwarding link shows the data forwarding topology when the port indication information is 111; Figure 9 Marked with red lines Figure 7 The example switch's data forwarding link shows the data forwarding topology when port indication information is 110. (Comparison) Figure 8 and Figure 9 It is not difficult to see that, in conjunction with the switch’s internal switch-corresponding switchable transmission modules and bypass selectors, the present application embodiment can achieve flexible adjustment of the switch’s internal data forwarding topology simply by changing the port indication information of the data frame. Thus, it can meet the need for on-demand subnet segmentation access for each data frame received in real time.
[0067] In the optional implementation, before configuring the target slave port to be enabled and the non-target slave port to be disabled based on the port indication information, the data exchange method further includes: Determine the port indication information of the previous data frame of the current data frame, and compare the consistency between the port indication information identified in the current data frame and the port indication information of the previous data frame. Based on port indication information, the system configures the enabling of target slave ports and the disabling of non-target slave ports. This is specifically performed when the port indication information identified in the current data frame differs from that in the previous data frame. In other words, if the port indication information identified in the current data frame is inconsistent with that in the previous data frame, the system reconfigures the enabling of target slave ports and the disabling of non-target slave ports based on the port indication information identified in the current data frame. If they are consistent, there is no need to reconfigure the slave port status to adjust the data forwarding topology.
[0068] If two adjacent data frames have different port indication information, the internal data forwarding topology of the switch needs to be changed. The master station cannot send the next frame until the previous frame has completely returned to the master station to avoid data corruption. However, if two adjacent data frames have the same port indication information, the internal data forwarding topology of the switch does not need to be changed. The master station can start sending the next frame before the previous frame has completely returned to the master station, thus achieving a near-continuous connection between adjacent data frames. This improves the continuity of adjacent data frame transmission and enhances the data access experience for slave users within the subnet connected to the target slave port.
[0069] As described above, if the port indication information identified in the current data frame is inconsistent with the port indication information in the previous data frame, the target slave port and the non-target slave port are reconfigured according to the port indication information identified in the current data frame. This includes: after the previous data frame has completely returned to the master station through the data forwarding link, the target slave port and the non-target slave port are reconfigured according to the port indication information identified in the current data frame.
[0070] If the port indication information identified in the current data frame is consistent with the port indication information of the previous data frame, the current data frame is forwarded based on the current data forwarding topology of the switch, including: before the previous data frame of the current data frame has completely returned to the master station through the data forwarding link, the current data frame is forwarded based on the current data forwarding topology of the switch.
[0071] Based on the data exchange method described above, this application further provides a switch. It possesses the structure and characteristics of the switch mentioned in the method described above, and is accordingly able to execute the steps of the data exchange method described in the preceding method embodiments.
[0072] Specifically, the switch provided in this application embodiment has one master port and multiple slave ports. The master port is used to connect to the master station, and each slave port is used to connect to a different subnet, which includes one or more slave stations. Each port in the switch is connected in series in a ring-shaped data forwarding link, and the open / closed state of each slave port can be switched. When the open / closed state of any slave port in the data forwarding link changes, the data forwarding topology of the switch changes. The switch is used to receive current data frames from autonomous ports; identify port indication information from the current data frames; the port indication information is used to indicate the target slave port and non-target slave port of the current data frame; the switch is also used to configure the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information; and forward the current data frame based on the current data forwarding topology of the switch.
[0073] In the optional implementation, the switch includes an identification unit and multiple bypass selectors; in the data forwarding link, the identification unit is located downstream of the master port and upstream of the first slave port, and the multiple bypass selectors correspond one-to-one with the multiple slave ports and are located downstream of their respective slave ports. The switch also includes multiple closable transmitting modules; the first input terminal of each closable transmitting module is a data input, and the second input terminal is an enable signal input; in the data forwarding link, each closable transmitting module corresponds one-to-one with multiple slave ports and is located upstream of its corresponding slave port, with its own output terminal connected to its corresponding slave port; Among the multiple slave ports, the first input terminal of the closable transmitting module corresponding to the first slave port is connected to the data output terminal of the identification unit, and the first input terminals of the closable transmitting modules corresponding to the other slave ports are respectively connected to the data output terminals of the bypass selectors corresponding to the upstream slave ports adjacent to themselves. The switch, specifically, is configured to, based on the identified port indication information, send a first type selection signal to the bypass selector corresponding to each target slave port, send a first control signal to the second input terminal of the closable transmitting module corresponding to each target slave port, send a second type selection signal to the bypass selector corresponding to each non-target slave port, and send a second control signal to the second input terminal of the closable transmitting module corresponding to each non-target slave port; configure the data channel of the closable transmitting module corresponding to the target slave port to be open using the first control signal, configure the bypass selector corresponding to the target slave port to use one input data provided by the target slave port as its output using the first type selection signal; and configure the data channel of the closable transmitting module corresponding to the non-target slave port to be closed using the second control signal, configure the bypass selector corresponding to the non-target slave port to use one input data other than the non-target slave port as its output using the second type selection signal.
[0074] In an optional implementation, the bypass selector includes at least two selectable input terminals, namely a 0 input terminal and a 1 input terminal, and also includes a data output terminal; The switch has two slave ports, namely the first slave port and the last slave port; In the data forwarding link, the 0 input terminal of the bypass selector corresponding to the first slave port is connected to the data output terminal of the identification unit, and the 1 input terminal is connected to the first slave port. The data output terminal of the bypass selector corresponding to the first slave port is connected to the 0 input terminal of the bypass selector corresponding to the last slave port. The 1 input terminal of the bypass selector corresponding to the last slave port is connected to the last slave port, and the data output terminal of the bypass selector corresponding to the last slave port is connected to the master port.
[0075] In an optional implementation, the bypass selector includes at least two selectable input terminals, namely a 0 input terminal and a 1 input terminal, and also includes a data output terminal; The switch has a total of M slave ports, where M is an integer greater than 2; in the data forwarding link, the first slave port is the first upstream slave port among the M slave ports, and the Mth slave port is the last downstream slave port among the M slave ports. In the data forwarding link, the 0 input terminal of the bypass selector corresponding to the first slave port is connected to the data output terminal of the identification unit, and the 1 input terminal is connected to the first slave port; The 0 input terminal of the bypass selector corresponding to the i-th slave port is connected to the data output terminal of the bypass selector corresponding to the (i-1)-th slave port, and the 1 input terminal of the bypass selector corresponding to the i-th slave port is connected to the i-th slave port; where i is an integer, i is greater than or equal to 2, and i is less than or equal to M; The data output terminal of the bypass selector corresponding to the Mth slave port is connected to the master port.
[0076] In an optional implementation, the identification unit of the switch includes a plurality of first registers, each of which corresponds one-to-one with the plurality of slave ports; the output of the first register is connected to the second input of the closable transmitting module corresponding to the corresponding slave port, and the output of the first register is connected to the selection terminal of the bypass selector corresponding to the corresponding slave port. After identifying the port indication information from the current data frame, the switch further serves to: Based on the correspondence between each bit in the port indication information and the plurality of slave ports, sub-indication information for each slave port is determined, and the sub-indication information for the corresponding slave port is stored in the plurality of first registers respectively; wherein, the sub-indication information for the target slave port is 1, and the sub-indication information for the non-target slave port is 0. Specifically, the switch is used to: send sub-indication information stored in the first register as 1 to the second input terminal of the connected closable transmitting module via the first control signal through the identification unit, and send it to the selection terminal of the connected bypass selector via the first type selection signal; and send sub-indication information stored in the first register as 0 to the second input terminal of the connected closable transmitting module via the second control signal through the identification unit, and send it to the selection terminal of the connected bypass selector via the second type selection signal.
[0077] In an optional implementation, before configuring the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information, the switch is further configured to: Determine the port indication information of the previous data frame of the current data frame, and compare the consistency between the port indication information identified in the current data frame and the port indication information of the previous data frame. Specifically, the switch is used to: if the port indication information identified in the current data frame is inconsistent with the port indication information in the previous data frame, then reconfigure the target slave port and the non-target slave port according to the port indication information identified in the current data frame.
[0078] In an optional implementation, if the port indication information identified in the current data frame is inconsistent with the port indication information of the previous data frame, the switch is specifically configured to: after the previous data frame of the current data frame has completely returned to the master station through the data forwarding link, reconfigure the opening of the target slave port and the closing of the non-target slave port according to the port indication information identified in the current data frame; If the port indication information identified in the current data frame is consistent with the port indication information of the previous data frame, the switch is specifically used to: forward the current data frame based on the current data forwarding topology of the switch before the previous data frame of the current data frame completely returns to the master station through the data forwarding link.
[0079] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data exchange method, characterized in that, The method is applied to a switch having one master port and multiple slave ports, wherein the master port is used to connect to a master station, and each of the slave ports is used to connect to a different subnet, wherein the subnet includes one or more slave stations; Each port in the switch is connected in series in a ring-shaped data forwarding link, and the open / closed state of each slave port can be switched. When the open / closed state of any slave port in the data forwarding link changes, the data forwarding topology of the switch changes. The data exchange method includes: Receive the current data frame transmitted from the main port; Port indication information is identified from the current data frame; the port indication information is used to indicate the target slave port and non-target slave port of the current data frame; Based on the port indication information, configure the target slave port to be enabled and the non-target slave port to be disabled; The current data frame is forwarded based on the current data forwarding topology of the switch.
2. The method according to claim 1, characterized in that, The switch includes an identification unit and multiple bypass selectors; in the data forwarding link, the identification unit is located downstream of the master port and upstream of the first slave port, and the multiple bypass selectors correspond one-to-one with the multiple slave ports and are located downstream of their respective slave ports. The switch also includes multiple closable transmitting modules; the first input terminal of each closable transmitting module is a data input, and the second input terminal is an enable signal input; in the data forwarding link, each of the multiple closable transmitting modules corresponds one-to-one with the multiple slave ports, and is located upstream of the corresponding slave port, with its own output terminal connected to the corresponding slave port; Among the plurality of slave ports, the first input terminal of the closable transmitting module corresponding to the first slave port is connected to the data output terminal of the identification unit, and the first input terminals of the closable transmitting modules corresponding to the other slave ports are respectively connected to the data output terminals of the bypass selectors corresponding to the upstream slave ports adjacent to themselves. The step of configuring the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information includes: The identification unit sends a first type selection signal to the bypass selector corresponding to each target slave port, sends a first control signal to the second input terminal of the closable transmission module corresponding to each target slave port, sends a second type selection signal to the bypass selector corresponding to each non-target slave port, and sends a second control signal to the second input terminal of the closable transmission module corresponding to each non-target slave port, based on the identified port indication information. The first control signal is used to configure the data channel of the closable transmitting module corresponding to the target slave port to be turned on, and the first type selection signal is used to configure the bypass selector corresponding to the target slave port to use one input data provided by the target slave port as the output; and the second control signal is used to configure the data channel of the closable transmitting module corresponding to the non-target slave port to be turned off, and the second type selection signal is used to configure the bypass selector corresponding to the non-target slave port to use one input data not from the non-target slave port as the output.
3. The method according to claim 2, characterized in that, The bypass selector includes at least two selectable input terminals, namely a 0 input terminal and a 1 input terminal, and the bypass selector also includes a data output terminal; The switch has two slave ports, namely the first slave port and the last slave port; In the data forwarding link, the 0 input terminal of the bypass selector corresponding to the first slave port is connected to the data output terminal of the identification unit, and the 1 input terminal is connected to the first slave port. The data output terminal of the bypass selector corresponding to the first slave port is connected to the 0 input terminal of the bypass selector corresponding to the last slave port. The 1 input terminal of the bypass selector corresponding to the last slave port is connected to the last slave port, and the data output terminal of the bypass selector corresponding to the last slave port is connected to the master port.
4. The method according to claim 2, characterized in that, The bypass selector includes at least two selectable input terminals, namely a 0 input terminal and a 1 input terminal, and the bypass selector also includes a data output terminal; The switch has a total of M slave ports, where M is an integer greater than 2; in the data forwarding link, the first slave port is the first upstream slave port among the M slave ports, and the Mth slave port is the last downstream slave port among the M slave ports. In the data forwarding link, the 0 input terminal of the bypass selector corresponding to the first slave port is connected to the data output terminal of the identification unit, and the 1 input terminal is connected to the first slave port; The 0 input terminal of the bypass selector corresponding to the i-th slave port is connected to the data output terminal of the bypass selector corresponding to the (i-1)-th slave port, and the 1 input terminal of the bypass selector corresponding to the i-th slave port is connected to the i-th slave port; Where i is an integer, i is greater than or equal to 2, and i is less than or equal to M; The data output terminal of the bypass selector corresponding to the Mth slave port is connected to the master port.
5. The method according to claim 2, characterized in that, The identification unit includes a plurality of first registers, each of which corresponds one-to-one with a plurality of slave ports; the output of the first register is connected to the second input of the closable transmitting module corresponding to the corresponding slave port, and the output of the first register is connected to the selection terminal of the bypass selector corresponding to the corresponding slave port. After identifying the port indication information from the current data frame, the method further includes: Based on the correspondence between each bit in the port indication information and the plurality of slave ports, sub-indication information for each slave port is determined, and the sub-indication information for the corresponding slave port is stored in the plurality of first registers respectively; wherein, the sub-indication information for the target slave port is 1, and the sub-indication information for the non-target slave port is 0. The identification unit, based on the identified port indication information, sends a first type selection signal to the bypass selector corresponding to each target slave port, sends a first control signal to the second input terminal of the closable transmitting module corresponding to each target slave port, sends a second type selection signal to the bypass selector corresponding to each non-target slave port, and sends a second control signal to the second input terminal of the closable transmitting module corresponding to each non-target slave port, including: The identification unit sends the sub-indication information stored in the first register as 1 to the second input terminal of the connected closable transmitting module using the first control signal as a carrier, and sends it to the selection terminal of the connected bypass selector using the first type selection signal as a carrier; the identification unit sends the sub-indication information stored in the first register as 0 to the second input terminal of the connected closable transmitting module using the second control signal as a carrier, and sends it to the selection terminal of the connected bypass selector using the second type selection signal as a carrier.
6. The method according to claim 5, characterized in that, The port indication information is pre-added to the current data frame in a preset manner; the preset manner is one of the following: The port indication information is contained in a portion of the bits of the target MAC address of the current data frame; or, the port indication information is contained in a portion of the bits of the source MAC address of the current data frame; or, a data segment is inserted before the target MAC address of the current data frame, and the data segment contains the port indication information.
7. The method according to any one of claims 1-6, characterized in that, Before configuring the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information, the method further includes: Determine the port indication information of the previous data frame of the current data frame, and compare the consistency between the port indication information identified in the current data frame and the port indication information of the previous data frame. The step of configuring the target slave port to be enabled and the non-target slave port to be disabled according to the port indication information specifically includes: If the port indication information identified in the current data frame is inconsistent with the port indication information in the previous data frame, then the target slave port is reconfigured and the non-target slave port is closed according to the port indication information identified in the current data frame.
8. The method according to claim 7, characterized in that, If the port indication information identified in the current data frame is inconsistent with the port indication information in the previous data frame, the step of reconfiguring the opening of the target slave port and the closing of the non-target slave port according to the port indication information identified in the current data frame includes: After the previous data frame of the current data frame has completely returned to the master station through the data forwarding link, the target slave port is reconfigured and the non-target slave port is closed according to the port indication information identified in the current data frame. If the port indication information identified in the current data frame is consistent with the port indication information of the previous data frame, forwarding the current data frame based on the current data forwarding topology of the switch includes: Before the previous data frame of the current data frame has completely returned to the master station through the data forwarding link, the current data frame is forwarded based on the current data forwarding topology of the switch.
9. A switch, characterized in that, It has one master port and multiple slave ports. The master port is used to connect to the master station, and each of the slave ports is used to connect to a different subnet, which includes one or more slave stations. Each port in the switch is connected in series in a ring-shaped data forwarding link, and the open / closed state of each slave port can be switched. When the open / closed state of any slave port in the data forwarding link changes, the data forwarding topology of the switch changes. The switch is used to receive the current data frame transmitted from the main port; Port indication information is identified from the current data frame; the port indication information is used to indicate the target slave port and non-target slave port of the current data frame; The switch is also configured to enable the target slave port and disable the non-target slave port according to the port indication information; and to forward the current data frame based on the current data forwarding topology of the switch.
10. The switch according to claim 9, characterized in that, The switch includes an identification unit and multiple bypass selectors; in the data forwarding link, the identification unit is located downstream of the master port and upstream of the first slave port, and the multiple bypass selectors correspond one-to-one with the multiple slave ports and are located downstream of their respective slave ports. The switch also includes multiple closable transmitting modules; the first input terminal of each closable transmitting module is a data input, and the second input terminal is an enable signal input; in the data forwarding link, each of the multiple closable transmitting modules corresponds one-to-one with the multiple slave ports, and is located upstream of the corresponding slave port, with its own output terminal connected to the corresponding slave port; Among the plurality of slave ports, the first input terminal of the closable transmitting module corresponding to the first slave port is connected to the data output terminal of the identification unit, and the first input terminals of the closable transmitting modules corresponding to the other slave ports are respectively connected to the data output terminals of the bypass selectors corresponding to the upstream slave ports adjacent to themselves. The switch is specifically configured to send a first type selection signal to the bypass selector corresponding to each target slave port, send a first control signal to the second input terminal of the closable transmitting module corresponding to each target slave port, send a second type selection signal to the bypass selector corresponding to each non-target slave port, and send a second control signal to the second input terminal of the closable transmitting module corresponding to each non-target slave port, based on the identified port indication information through the identification unit. The first control signal is used to configure the data channel of the closable transmitting module corresponding to the target slave port to be turned on, and the first type selection signal is used to configure the bypass selector corresponding to the target slave port to use one input data provided by the target slave port as the output; and the second control signal is used to configure the data channel of the closable transmitting module corresponding to the non-target slave port to be turned off, and the second type selection signal is used to configure the bypass selector corresponding to the non-target slave port to use one input data not from the non-target slave port as the output.