Dual-network-port redundant EtherCAT master station data transmission method, apparatus and device, and storage medium
By setting up a dual network port redundant structure on the EtherCAT master station and dynamically determining the redundant transmission mode, the problem of traditional EtherCAT system being unable to transmit data normally in a single link failure is solved, and a cost-effective redundant transmission solution is achieved.
Patent Information
- Application Number
- CN202411717125.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Traditional EtherCAT master-slave systems cannot transmit data normally in the event of a single link failure, and adding backup masters to achieve redundant transmission requires additional hardware costs.
By setting up a dual network port redundant structure in the EtherCAT master station, using the status detection of the first and second network ports and the data packet count statistics, the redundant transmission mode is dynamically determined to realize the transmission and reception of data.
The EtherCAT system can be quickly restored and communicated normally in the event of link failure without adding a backup master, reducing system costs and improving the reliability of data transmission.
Smart Images

Figure CN119544600A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Ethernet automatic control technology, and in particular to a dual-port redundant EtherCAT master station data transmission method, device, equipment and storage medium. Background Art
[0002] With the rapid development of industrial automation, the stability and real-time performance of industrial Ethernet are crucial to the continuous operation of the entire production line. As a high-performance industrial Ethernet technology, EtherCAT has been able to provide low-latency and highly deterministic communication through its unique real-time Ethernet protocol.
[0003] The traditional EtherCAT master-slave system is a single master station running on the network, and the redundancy adopts a dual-link ring network mode. Although it can enhance the reliability problem to a certain extent, if a single point failure occurs in the link, the entire system will not be able to complete normal data transmission. To solve this problem, by adding a backup master station, the flow of master station data is controlled according to the single point failure in the link, so that the EtherCAT system can recover quickly in the face of a link failure. This method requires the addition of additional hardware (i.e., backup master station), resulting in increased cost investment. Summary of the invention
[0004] The embodiments of the present application provide a dual-network-port redundant EtherCAT master station data transmission method, apparatus, device and storage medium, which can solve the technical problem of high cost of EtherCAT master-slave station systems with normal transmission of EtherCAT master station data, and reduce the cost of EtherCAT master-slave station systems with normal transmission of EtherCAT master station data.
[0005] In a first aspect, an embodiment of the present application provides a dual-network-port redundant EtherCAT master station data transmission method, which is used for an EtherCAT master station, and the EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations, the EtherCAT master station includes a first network port and a second network port, the first network port includes a first sending network port and a first receiving network port, the second network port includes a second sending network port and a second receiving network port, and multiple EtherCAT slave stations are connected one by one to form a slave station link, the first sending network port is connected to the first EtherCAT slave station at the first end of the slave station link, the second EtherCAT slave station at the second end of the slave station link is connected to the second receiving network port, the first sending network port, the slave station link, and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave station link, the first EtherCAT slave station at the first end of the slave station link is connected to the first receiving network port, and the second sending network port, the slave station link, and the first receiving network port form a second network link;
[0006] The dual-network-port redundant EtherCAT master station data transmission method comprises:
[0007] Receive a first enable signal, and in response to the first enable signal, detect a first network port state and a second network port state, wherein the first network port state is a communication connection state between the first network port and the first EtherCAT slave station, and the second network port state is a communication connection state between the second network port and the second EtherCAT slave station;
[0008] When the first network port state and the second network port state are both in a connected state, controlling the first sending network port to send data to the first EtherCAT slave station, and receiving corresponding data through the first receiving network port or the second receiving network port;
[0009] When the second receiving network port receives the corresponding data, in the EtherCAT master station, the data is forwarded to the second sending network port, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port;
[0010] Counting a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port;
[0011] A redundant transmission mode is determined according to a comparison result of the first quantity and the second quantity, and data is sent and received according to the redundant transmission mode.
[0012] In one embodiment, determining a redundant transmission mode according to a comparison result of the first quantity and the second quantity, and sending and receiving data according to the redundant transmission mode includes:
[0013] When the comparison result is that the first number is less than or equal to the second number, determining that the redundant transmission mode is the first redundant mode;
[0014] According to the first redundant mode, the first sending network port is controlled to send data to the first EtherCAT slave station, and the corresponding data is received from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted from the first EtherCAT slave station to the second EtherCAT slave station based on the first network link;
[0015] In the EtherCAT master station, the data received by the second receiving network port is forwarded to the second sending network port;
[0016] Sending data to the second EtherCAT slave station through the second sending network port, and receiving corresponding data from the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted from the second EtherCAT slave station to the first EtherCAT slave station based on the second network link;
[0017] Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0018] In one embodiment, determining a redundant transmission mode according to a comparison result of the first quantity and the second quantity, and sending and receiving data according to the redundant transmission mode includes:
[0019] When the comparison result shows that the first number is greater than the second number, determining that the redundant transmission mode is the second redundant mode;
[0020] In the second redundant mode, it is determined that there are a first target slave station and a second target slave station whose communication is disconnected in the slave station link, and the first target slave station and the second target slave station are two adjacent EtherCAT slave stations corresponding to the communication disconnection position;
[0021] Control the first sending network port to send data based on the first network link, and receive the returned data through the first receiving network port, wherein the data is transmitted to the first target slave station based on the first network link, and is returned to the first receiving network port through the first target slave station based on the second network link;
[0022] In the EtherCAT master station, the data received by the first receiving network port is forwarded to the second sending network port;
[0023] Send data based on the second network link through the second sending network port, and receive the returned data through the second receiving network port, wherein the data is transmitted to the second target slave station based on the second network link, and is returned to the second receiving network port through the second target slave station based on the first network link;
[0024] Data analysis and processing are performed based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0025] In one embodiment, after receiving the first enable signal and detecting the first network port status and the second network port status in response to the first enable signal, the method includes:
[0026] When the first network port state is a disconnected state and the second network port state is a connected state, determining that the redundant transmission mode is a third redundant mode;
[0027] In the third redundant mode, data is sent to the second EtherCAT slave station through the second sending network port, and returned data is received from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted to the first EtherCAT slave station based on the second network link, and is returned to the second EtherCAT slave station through the first EtherCAT slave station based on the first network link;
[0028] Data analysis and processing are performed based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0029] In one embodiment, after receiving the first enable signal and detecting the first network port status and the second network port status in response to the first enable signal, the method includes:
[0030] When the first network port is in a connected state and the second network port is in a disconnected state, determining that the redundant transmission mode is a third redundant mode;
[0031] In the third redundant mode, data is sent to the first EtherCAT slave station through the first sending network port, and data returned by the first EtherCAT slave station is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link;
[0032] Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0033] In one embodiment, the EtherCAT master station further includes a first PHY transceiver and a second PHY transceiver, wherein the first PHY transceiver is connected to the first network port, and the second PHY transceiver is connected to the second network port;
[0034] Detecting the status of the first network port and the status of the second network port includes:
[0035] Detecting a first link signal state of the first PHY transceiver, and detecting a second link signal state of the second PHY transceiver;
[0036] When the first link signal state is in a high level state, determining that the first network port state is in a disconnected state;
[0037] When the first link signal state is in a low level state, determining that the first network port state is in a connected state;
[0038] When the second link signal state is in a high level state, determining that the second network port state is in a disconnected state;
[0039] When the second link signal state is in a low level state, it is determined that the second network port state is in a connected state.
[0040] In one embodiment, the dual-port redundant EtherCAT master station data method further includes:
[0041] receiving a second enable signal, and determining, in response to the second enable signal, that the operating mode is a redundant shutdown mode;
[0042] In the redundant shutdown mode, the first transmitting network port is controlled to send data to the first EtherCAT slave station, and the data returned by the first EtherCAT slave station is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link;
[0043] Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0044] In one embodiment, the dual-port redundant EtherCAT master station data method further includes:
[0045] In the corresponding redundant transmission mode, when it is detected that the first network port state and the second network port state are both disconnected, the working mode is determined to be the redundant closed mode, and data is sent and received according to the redundant closed mode.
[0046] In a second aspect, an embodiment of the present application provides a dual-network-port redundant EtherCAT master station data transmission device, which is used for an EtherCAT master station. The EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations. The EtherCAT master station includes a first network port and a second network port. The first network port includes a first sending network port and a first receiving network port. The second network port includes a second sending network port and a second receiving network port. Multiple EtherCAT slave stations are connected one by one to form a slave station link. The first sending network port is connected to the first EtherCAT slave station at the first end of the slave station link, and the second EtherCAT slave station at the second end of the slave station link is connected to the second receiving network port. The first sending network port, the slave station link, and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave station link, and the first EtherCAT slave station at the first end of the slave station link is connected to the first receiving network port. The second sending network port, the slave station link, and the first receiving network port form a second network link.
[0047] The dual-port redundant EtherCAT master station data transmission device includes:
[0048] A first enabling response module, used to receive a first enabling signal, and in response to the first enabling signal, detect a first network port state and a second network port state, wherein the first network port state is a communication connection state between the first network port and the first EtherCAT slave station, and the second network port state is a communication connection state between the second network port and the second EtherCAT slave station;
[0049] A first transceiver control module is used to control the first sending network port to send data to the first EtherCAT slave station when the first network port state and the second network port state are both in a connected state, and receive corresponding data through the first receiving network port or the second receiving network port;
[0050] A second transceiver control module is used to forward the data to the second sending network port in the EtherCAT master station when the corresponding data is received at the second receiving network port, and send the data to the second EtherCAT slave station through the second sending network port, and receive the data through the first receiving network port;
[0051] A quantity counting module, used for counting a first quantity of data packets received by the first receiving network port and a second quantity of data packets received by the second receiving network port;
[0052] The first working mode determination module is used to determine the redundant transmission mode according to the comparison result of the first quantity and the second quantity, and send and receive data according to the redundant transmission mode.
[0053] In a third aspect, an embodiment of the present application provides a dual-port redundant EtherCAT master station data transmission device, comprising:
[0054] memory and one or more processors;
[0055] The memory is used to store one or more programs;
[0056] When the one or more programs are executed by the one or more processors, the one or more processors implement the dual-network-port redundant EtherCAT master station data transmission method as described in the first aspect.
[0057] In a fourth aspect, an embodiment of the present application provides a storage medium storing computer executable instructions, which, when executed by a computer processor, are used to execute the dual-port redundant EtherCAT master station data transmission method as described in the first aspect.
[0058] In the embodiment of the present application, during data transmission at the EtherCAT master station, by setting a first network and a second network port at the EtherCAT master station, when a first network port state corresponding to the first network port and a second network port state corresponding to the second network port are both in a connected state, a first sending network port in the first network port is controlled to send data to the first EtherCAT slave station, and the corresponding data is received through the first receiving network port or the second receiving network port; when the corresponding data is received at the second receiving network port, the data is forwarded to the second sending network port in the EtherCAT master station, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port or the second receiving network port; a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port are counted; a redundant transmission mode is determined according to a comparison result of the first number and the second number, and data is sent and received according to the redundant transmission mode. By adopting the above technical means, there is no need to add an additional backup master station. The corresponding redundant transmission mode can be performed through the first network port and the second network port based on the statistical results of the number of data packets. When there is a single point failure in the link, normal communication can be achieved through the cooperation of the first network port and the second network port. In this way, the technical problem of high cost caused by the additional addition of a backup master station in the EtherCAT master-slave system can be avoided. Normal data transmission can be achieved based on the cooperation of the first network port and the second network port of the EtherCAT master station, thereby reducing the cost of the EtherCAT master-slave system with normal data transmission of the EtherCAT master station.
[0059] The beneficial effects of the dual-port redundant EtherCAT master station data transmission device, dual-port redundant EtherCAT master station data transmission equipment and storage medium provided above can refer to the beneficial effects of the dual-port redundant EtherCAT master station data transmission method. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 It is a first structural schematic diagram of an EtherCAT master-slave system provided in an embodiment of the present application;
[0061] Figure 2 It is a flow chart of a dual-port redundant EtherCAT master station data transmission method provided in an embodiment of the present application;
[0062] Figure 3 This is a first structural diagram of an EtherCAT master station provided in an embodiment of the present application;
[0063] Figure 4 This is a first transmission schematic diagram of an EtherCAT master station data transmission provided by an embodiment of the present application;
[0064] Figure 5This is a second transmission schematic diagram of an EtherCAT master station data transmission provided by an embodiment of the present application;
[0065] Figure 6 This is a third transmission schematic diagram of an EtherCAT master station data transmission provided by an embodiment of the present application;
[0066] Figure 7 is a transmission schematic diagram of a first redundancy mode provided in an embodiment of the present application;
[0067] Figure 8 This is a second structural diagram of an EtherCAT master station provided in an embodiment of the present application;
[0068] Fig. 9 is a transmission schematic diagram of a second redundancy mode provided in an embodiment of the present application;
[0069] Fig.10 This is a first transmission schematic diagram of a third redundancy mode provided in an embodiment of the present application;
[0070] Fig.11 This is a second transmission schematic diagram of a third redundancy mode provided in an embodiment of the present application;
[0071] Fig.12 It is a structural schematic diagram of a dual-network-port redundant EtherCAT master station data transmission device provided in an embodiment of the present application;
[0072] Fig.13 It is a structural schematic diagram of a dual-network-port redundant EtherCAT master station data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0074] The traditional EtherCAT master-slave system is a single master station running on the network, and the redundancy adopts a dual-link ring network mode. Although it can enhance the reliability problem to a certain extent, if a single point failure occurs in the link, the entire system will not be able to complete normal data transmission. To solve this problem, by adding a backup master station, the flow of master station data is controlled according to the single point failure in the link, so that the EtherCAT system can recover quickly in the face of a link failure. This method requires the addition of additional hardware (i.e., backup master station), resulting in increased cost investment.
[0075] Based on this, a dual-network-port redundant EtherCAT master station data transmission method, apparatus, device and storage medium of an embodiment of the present application are provided, and the purpose is that when the EtherCAT master station transmits data, by setting a first network and a second network port in the EtherCAT master station, when the first network port state corresponding to the first network port and the second network port state corresponding to the second network port are both in a connected state, the first sending network port in the first network port is controlled to send data to the first EtherCAT slave station, and the corresponding data is received through the first receiving network port or the second receiving network port; when the corresponding data is received at the second receiving network port, in the EtherCAT master station, the data is forwarded to the second sending network port, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port or the second receiving network port; a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port are counted; a redundant transmission mode is determined according to a comparison result of the first number and the second number, and data is sent and received according to the redundant transmission mode. By adopting the above technical means, there is no need to add an additional backup master station. The corresponding redundant transmission mode can be performed through the first network port and the second network port based on the statistical results of the number of data packets. When there is a single point failure in the link, normal communication can be achieved through the cooperation of the first network port and the second network port. In this way, the technical problem of high cost caused by the additional addition of a backup master station in the EtherCAT master-slave system can be avoided. Normal data transmission can be achieved based on the cooperation of the first network port and the second network port of the EtherCAT master station, thereby reducing the cost of the EtherCAT master-slave system with normal data transmission of the EtherCAT master station.
[0076] Figure 11 is a first structural diagram of an EtherCAT master-slave system provided in an embodiment of the present application. The EtherCAT master-slave system 1 includes an EtherCAT master 11 and an EtherCAT slave 12 . The EtherCAT master station 11 is used to form an EtherCAT master-slave system 1 with multiple EtherCAT slave stations 12. The EtherCAT master station 11 includes a first network port 111 and a second network port 112. The first network port 111 includes a first sending network port TX1 and a first receiving network port RX1. The second network port 112 includes a second sending network port TX2 and a second receiving network port RX2. Multiple EtherCAT slave stations 12 are connected one by one to form a slave link. The first sending network port TX1 is connected to the first EtherCAT slave station 121 at the first end of the slave link, and the second EtherCAT slave station 122 at the second end of the slave link is connected to the second receiving network port RX2. The first sending network port TX1, the slave link, and the second receiving network port RX2 form a first network link; the second sending network port TX2 is connected to the second EtherCAT slave station 122 at the second end of the slave link, the first EtherCAT slave station 121 at the first end of the slave link is connected to the first receiving network port RX1, and the second sending network port TX2, the slave link, and the first receiving network port RX1 form a second network link.
[0077] The first network port 111 and the second network port 112 are respectively connected to a PHY transceiver circuit.
[0078] It should be noted that different EtherCAT slave stations 12 are connected by a network cable, which can transmit in both directions, forming the aforementioned first network link and second network link. Therefore, when there is a communication disconnection between the EtherCAT slave stations 12, the communication connection of the first network link and the second network link at the corresponding disconnection position is disconnected.
[0079] Figure 2 A flow chart of a dual-port redundant EtherCAT master station data transmission method provided in an embodiment of the present application is given. The dual-port redundant EtherCAT master station data transmission method provided in this embodiment can be executed by a dual-port redundant EtherCAT master station data transmission device, which can be implemented by software and / or hardware. The dual-port redundant EtherCAT master station data transmission device can be composed of two or more physical entities, or can be composed of one physical entity. Generally speaking, the dual-port redundant EtherCAT master station data transmission device can be an Ethernet communication device.
[0080] The following description is based on the Ethernet communication device as the main body of the dual-port redundant EtherCAT master station data transmission method. Figure 2The dual-network-port redundant EtherCAT master station data transmission method is used for the aforementioned EtherCAT master station, and the dual-network-port redundant EtherCAT master station data transmission method specifically includes:
[0081] S101, receiving a first enable signal, and detecting a first network port status and a second network port status in response to the first enable signal, wherein the first network port status is a communication connection status between the first network port and a first EtherCAT slave station, and the second network port status is a communication connection status between the second network port and a second EtherCAT slave station.
[0082] The first enable signal is a signal for turning on redundancy enable. When the redundancy enable function is turned on, the second network port is used as a redundant network port to realize the redundancy function. When the user turns on redundancy enable, the EtherCAT master station receives the first enable signal, and in response to the first enable signal, detects the state of the first network port and the state of the second network port, wherein the state of the first network port is the communication connection state between the first network port and the first EtherCAT slave, and the state of the second network port is the communication connection state between the second network port and the second EtherCAT slave. The first network port state is used to determine whether the communication connection between the first network port and the first EtherCAT slave is normal, and the second network port state is used to determine whether the communication connection between the second network port and the second EtherCAT slave is normal. Subsequently, the corresponding data packet quantity test and / or the corresponding redundant transmission mode are performed according to the first network port state and the second network port state.
[0083] Figure 3 This is a first structural diagram of an EtherCAT master station provided in an embodiment of the present application, referring to Figure 3, the EtherCAT master station 11 also includes a first PHY transceiver 113 and a second PHY transceiver 114, wherein the first PHY transceiver 113 is connected to the first network port 111, and the second PHY transceiver 114 is connected to the second network port 112. When detecting the state of the first network port 111 and the state of the second network port 112, the first link signal state of the first PHY transceiver 113 is detected, and the second link signal state of the second PHY transceiver 114 is detected. When the first link signal state is in a high level state, it is determined that the state of the first network port 111 is a disconnected state, that is, the first network port 111 and the first EtherCAT slave station 121 are in a communication disconnected state; when the first link signal state is in a low level state, it is determined that the state of the first network port 111 is a connected state, that is, the first network port 111 and the first EtherCAT slave station 121 are in a communication connected state. When the second link signal state is in a high level state, the state of the second network port 112 is determined to be a disconnected state, that is, the second network port 112 and the second EtherCAT slave station 122 are in a communication disconnected state; when the second link signal state is in a low level state, the state of the second network port 112 is determined to be a connected state, that is, the second network port 112 and the second EtherCAT slave station 122 are in a communication connected state.
[0084] Subsequently, a corresponding data transmission mode may be determined according to the status of the first network port and the status of the second network port.
[0085] S102, when the first network port status and the second network port status are both in a connected state, controlling the first sending network port to send data to the first EtherCAT slave station, and receiving corresponding data through the first receiving network port or the second receiving network port.
[0086] When the first network port status is a connected state, it means that the communication connection between the first network port and the first EtherCAT slave is normal, and when the second network port status is a connected state, it means that the communication connection between the second network port and the second EtherCAT slave is normal. Therefore, when the first network port status and the second network port status are both connected, data transmission can be used to test whether there is a communication disconnection in the slave link. Therefore, when the first network port status and the second network port status are both connected, the first sending network port is controlled to send data to the first EtherCAT slave, and the corresponding data is received through the first receiving network port or the second receiving network port. Subsequently, it can be determined whether there is a communication disconnection in the slave link according to the number of data packets received by the first receiving network port and the second receiving network port, as well as the corresponding disconnection position point when there is a communication disconnection.
[0087] Exemplarily, when both the first network port state and the second network port state are connected, after controlling the first sending network port to send data to the first EtherCAT slave station, if the slave station link communication is normal, that is, there is no communication disconnection between the first network link and the second network link, then the data is transmitted based on the transmission of the first network link, transmitted to the second EtherCAT slave station at the second end of the slave station link, and transmitted to the second receiving network port through the second EtherCAT slave station, and received by the second receiving network port. At this time, the number of data packets received by the second receiving network port is greater than the number of data packets received by the first receiving network port. Figure 4 This is a first transmission schematic diagram of an EtherCAT master station data transmission provided in an embodiment of the present application, referring to Figure 4 When the first network link communicates normally, the first transmitting network port TX1 is controlled to send data to the first EtherCAT slave station 121, and the data is transmitted to the second EtherCAT slave station 122 at the second end of the slave station link through the first network link, and is transmitted to the second receiving network port RX2 through the second EtherCAT slave station 122, and is received by the second receiving network port RX2. At this time, the number of data packets received by the second receiving network port RX2 is greater than the number of data packets received by the first receiving network port RX1.
[0088] If the slave link communication is abnormal, that is, there is an abnormality in the network cable between two EtherCAT slaves, the first network link and the second network link at this location are both disconnected, and the two EtherCAT slaves close to the first network port are defined as the first target slave, and the second target slave is located close to the second network port. After the first sending network port is controlled to send data to the first EtherCAT slave, the corresponding data is transmitted to the EtherCAT slave with disconnected communication (i.e., the first target slave), and the EtherCAT slave (i.e., the first target slave) will return the corresponding data through the second network link, so that the data is returned to the first EtherCAT slave, and then returned to the first receiving network port through the first EtherCAT slave. At this time, the number of data packets received by the first receiving network port is greater than the number of data packets received by the second receiving network port. Figure 5 This is a second transmission schematic diagram of an EtherCAT master station data transmission provided in an embodiment of the present application, referring to Figure 5, when the slave link communication is abnormal, for example, there is a communication disconnection between the third EtherCAT slave station 123 and the second EtherCAT slave station 122, that is, there is a communication disconnection between the network cable of the third EtherCAT slave station 123 and the second EtherCAT slave station 122, and the third EtherCAT slave station 123 and the second EtherCAT slave station 122 cannot communicate through the first network link and the second network link. When the first sending network port TX1 is controlled to send data to the first EtherCAT slave station 121, the data is transmitted to the third EtherCAT slave station 123 of the slave link through the first network link. Based on the communication disconnection between the third EtherCAT slave station 123 and the second EtherCAT slave station 122, the data cannot be transmitted to the second EtherCAT slave station 122, and the third EtherCAT slave station 123 will return the corresponding data, based on the second network link to the first EtherCAT slave station 121, and through the first EtherCAT slave station 121 to the first receiving network port RX1. At this time, the number of data packets received by the first receiving network port RX1 is greater than the number of data packets received by the second receiving network port RX2.
[0089] S103, when the corresponding data is received at the second receiving network port, in the EtherCAT master station, the data is forwarded to the second sending network port, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port.
[0090] When the second receiving network port receives the corresponding data, it means that the communication of the slave link is normal, that is, the communication between the first network link and the second network link is normal. At this time, in the EtherCAT master station, the data is forwarded to the second sending network port, and the data is sent to the second EtherCAT slave through the second sending network port, and the data is received through the first receiving network port. Subsequently, it can be determined whether there is a communication disconnection in the slave link according to the number of data packets received by the first receiving network port and the second receiving network port, and the corresponding disconnection position point when there is a communication disconnection.
[0091] Exemplarily, when the second receiving network port receives the corresponding data, in the EtherCAT master station, the data is forwarded to the second sending network port, and after the data is sent to the second EtherCAT slave station through the second sending network port, if the slave link communication is normal, that is, there is no communication disconnection between the first network link and the second network link, then the data is transmitted based on the transmission of the second network link, transmitted to the first EtherCAT slave station at the first end of the slave station link, and transmitted to the first receiving network port through the first EtherCAT slave station, and received by the first receiving network port. At this time, the number of data packets received by the first receiving network port is equal to the number of data packets received by the second receiving network port. Figure 6 This is a third transmission schematic diagram of an EtherCAT master station data transmission provided in an embodiment of the present application, referring to Figure 4 and Figure 6 , when the slave link communication is normal, based on Figure 4 When the second receiving network port RX2 receives the corresponding data, the data is forwarded to the second sending network port TX2 in the EtherCAT master station 11, and the data is sent to the second EtherCAT slave station 122 through the second sending network port TX2. The data is transmitted to the first EtherCAT slave station 121 at the first end of the slave station link through the second network link, and is transmitted to the first receiving network port RX1 through the first EtherCAT slave station 121. At this time, the number of data packets received by the first receiving network port RX1 is equal to the number of data packets received by the second receiving network port RX2.
[0092] In summary, through the aforementioned data transmission, when the slave link communication connection is normal, the number of data packets received by the first receiving network port is less than or equal to the number of data packets received by the second receiving network port. When there is a communication anomaly in the slave link, the number of data packets received by the first receiving network port is greater than the number of data packets received by the second receiving network port. Therefore, it can be determined whether there is a communication anomaly in the slave link by comparing the number of data packets received by the first receiving network port with the number of data packets received by the second network port.
[0093] S104 , counting a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port.
[0094] Through the aforementioned data transmission, a first number of data packets received by the first network port is counted, and a second number of data packets received by the second receiving network port is counted. Subsequently, it is determined whether there is a slave link disconnection and which redundant transmission mode to execute based on the first number and the second number to ensure normal data transmission of the EtherCAT master-slave system.
[0095] S105 . Determine a redundant transmission mode according to a comparison result between the first quantity and the second quantity, and send and receive data according to the redundant transmission mode.
[0096] Through the aforementioned data transmission, when the slave link communication connection is normal, the first number of data packets received by the first receiving network port is less than or equal to the second number of data packets received by the second receiving network port, then the redundant transmission mode can be determined to be the first redundant mode, and the first redundant mode can be understood as the data transmission mode when the first network port state and the second network port state are both connected and the slave link communication is normal, and the second network port serves as the redundant network port of the EtherCAT master station. When there is a communication anomaly in the slave link, the first number of data packets received by the first receiving network port is greater than the second number of data packets received by the second receiving network port, then the redundant transmission mode is determined to be the second redundant mode, and the second redundant mode can be understood as the data transmission mode when the first network port state and the second network port state are both connected and the slave link communication is abnormal.
[0097] A redundant transmission mode is determined according to a comparison result of the first quantity and the second quantity, and data is sent and received according to the redundant transmission mode.
[0098] Figure 7 is a transmission schematic diagram of a first redundancy mode provided in an embodiment of the present application, referring to Figure 7 According to the first redundant mode, that is, when the first network port status and the second network port status are both connected and the slave link communication is normal, the EtherCAT master station 11 controls the first sending network port TX1 to send data to the first EtherCAT slave station 121, which is transmitted to the second EtherCAT slave station 122 through the transmission of the first network link, and receives the corresponding data from the second EtherCAT slave station 122 through the second receiving network port RX2. In the EtherCAT master station 11, the data received by the second receiving network port RX2 is forwarded to the second sending network port TX2. The data is sent to the second EtherCAT slave station 122 through the second sending network port TX2, transmitted to the first EtherCAT slave station 121 through the second network link, and the corresponding data is received from the first EtherCAT slave station 121 through the first receiving network port RX1. The EtherCAT master station 11 performs data analysis and processing based on the data received by the first receiving network port RX1 to determine the corresponding operating status of each EtherCAT slave station 12.
[0099] Figure 8 This is a second structural diagram of an EtherCAT master station provided in an embodiment of the present application, referring to Figure 8, the EtherCAT master station 11 also includes an FPGA chip 115, wherein the FPGA chip 115 includes a PS module 1151 and a PL module 1152. The PS (Processing system) module 1151 is the ARM processor part in the FPGA chip 115, and the PL (Programmable Logic) module 1152 is the programmable logic part in the FPGA chip 115. The switching logic of the transmission mode of this example is implemented by the PL module 1152 and is not processed by the PS module 1151. Among them, the first network port 111 and the second network port 112 are both connected to the PL module 1152, and the first network port 111 and the second network port 112 are also connected to the PS module 1151. Based on the ARM processor function of the PS module 1151, data analysis and processing can be performed. Therefore, the EtherCAT master station 11 can perform data analysis and processing based on the data received by the first receiving network port RX1 to determine the corresponding operating status of each EtherCAT slave station 12.
[0100] In one embodiment, in the second redundant mode, that is, when the first network port state and the second network port state are both connected and the slave link communication is abnormal, it is determined that there are a first target slave station and a second target slave station with communication disconnection in the slave link, and the first target slave station and the second target slave station are two adjacent EtherCAT slave stations corresponding to the communication disconnection position. Control the first sending network port to send data based on the first network link, and receive the returned data through the first receiving network port, wherein the data is transmitted to the first target slave station based on the first network link, and is returned to the first receiving network port through the first target slave station based on the second network link. In the EtherCAT master station, the data received by the first receiving network port is forwarded to the second sending network port; the data is sent through the second sending network port based on the second network link, and the returned data is received through the second receiving network port, wherein the data is transmitted to the second target slave station based on the second network link, and is returned to the second receiving network port through the second target slave station based on the first network link. The EtherCAT master station performs data analysis and processing based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0101] Fig. 9 is a transmission schematic diagram of a second redundancy mode provided in an embodiment of the present application, referring to Fig. 9, in the second redundant mode, that is, when the first network port status and the second network port status are both connected and the slave link communication is abnormal, it is assumed that there is a communication disconnection between the third EtherCAT slave station 123 and the second EtherCAT slave station 122, and the third EtherCAT slave station 123 is determined to be the first target slave station, and the second EtherCAT slave station 122 is the second target slave station. Control the first sending network port TX1 to send data to the first EtherCAT slave station 121, and transmit it to the third EtherCAT slave station 123 (i.e., the first target slave station) through the transmission of the first network link. Based on the communication disconnection between the third EtherCAT slave station 123 and the second EtherCAT slave station 122, the data cannot be transmitted to the second EtherCAT slave station 122, so the third EtherCAT slave station 123 returns the corresponding data, and returns it to the first EtherCAT slave station 121 based on the second network link, and receives the returned data from the first EtherCAT slave station 121 through the first receiving network port RX1. In the EtherCAT master station 11, the data received by the first receiving network port RX1 is forwarded to the second sending network port TX1; it is sent to the second EtherCAT slave station 122 through the second sending network port TX1, and is transmitted to the corresponding second target slave station based on the second network link transmission. Based on the second EtherCAT slave station 122 at this time as the second target slave station, the data is returned through the second EtherCAT slave station 122, and the data returned by the second EtherCAT slave station 122 is received through the second receiving network port RX2. The EtherCAT master station 11 performs data analysis and processing based on the data received by the second receiving network port RX2 to determine the corresponding operating status of each EtherCAT slave station 12.
[0102] In the above, when the first network port state and the second network port state of the EtherCAT master station are both connected, that is, the communication connection between the first network port and the first EtherCAT slave station is normal, and the communication connection between the second network port and the second EtherCAT slave station is also normal, the comparison between the first data of the data packet received by the first receiving network port and the second number of the data packet received by the second receiving network port determines whether there is a communication anomaly in the slave station link. When it is determined that the communication of the slave station link is normal, data transmission is performed based on the first redundant mode to achieve normal data transmission of the EtherCAT master-slave station system. When it is determined that there is a communication anomaly in the slave station link, data transmission is performed through the second redundant mode to achieve normal data transmission of the EtherCAT master-slave station system. Based on the EtherCAT master station with dual network ports, data transmission in different redundant transmission modes is performed for different communication connection conditions to ensure normal data transmission of the EtherCAT master-slave station system. Compared with the existing method that requires additional backup master stations or backup nodes, this embodiment does not require additional hardware equipment, thereby reducing the cost of the EtherCAT master-slave station system; in addition, different redundant transmission modes can be switched according to the actual communication connection conditions, thereby improving the flexibility and intelligence of the EtherCAT master station data.
[0103] When detecting the status of the first network port and the second network port, when there is one and only one network port whose communication status is normal, the redundant transmission mode is determined to be the third redundant mode. The third redundant mode can be understood as a data transmission mode when there is one and only one network port with abnormal communication. For example, when the status of the first network port is disconnected and the status of the second network port is connected, or when the status of the first network port is connected and the second network port is disconnected, the redundant transmission mode is determined to be the third redundant mode. In the third redundant mode, data is transmitted through the network port whose status is connected.
[0104] Fig.10 is a first transmission schematic diagram of a third redundancy mode provided in an embodiment of the present application, referring to Fig.10, when the first network port is in a connected state and the second network port is in a disconnected state, the redundant transmission mode is determined to be the third redundant mode, and data is only sent and received through the first network port 11. In the third redundant mode, data is sent to the first EtherCAT slave station 121 through the first sending network port TX1, and based on the transmission of the first network link, the data is transmitted to the second EtherCAT slave station 122, and the data is returned through the second EtherCAT slave station 122, and based on the transmission of the second network link, the data is transmitted to the first EtherCAT slave station 121, and the data returned by the first EtherCAT slave station 121 is received through the first receiving network port RX1. Data analysis and processing are performed according to the data received by the first receiving network port RX1 to determine the corresponding operating state of each EtherCAT slave station 12.
[0105] Fig.11 is a second transmission schematic diagram of a third redundancy mode provided in an embodiment of the present application, referring to Fig.11 , when the first network port state is disconnected and the second network port state is connected, the redundant transmission mode is determined to be the third redundant mode, and data is only sent and received through the second network port 12. In the third redundant mode, data is sent to the second EtherCAT slave 122 through the second sending network port TX2, and based on the transmission of the second network link, it is transmitted to the first EtherCAT slave 121. Based on the disconnected state of the first network port, the data is returned through the first EtherCAT slave 121, and the data is returned to the second EtherCAT slave 122 through the first network link, and the returned data is received from the second EtherCAT slave 122 through the second receiving network port RX2. The EtherCAT master station 11 performs data analysis and processing based on the data received by the second receiving network port RX2 to determine the corresponding operating state of each EtherCAT slave 12.
[0106] The above is a data transmission method when the redundant enabling function is performed based on the first enable signal. In addition, there is also a redundant shutdown mode. When the EtherCAT master station receives the second enable signal, in response to the second enable signal, it is determined that the working mode is a redundant shutdown mode. The redundant shutdown mode can be understood as data transmission only through the first network port or data transmission only through the second network port. Exemplarily, taking data transmission only through the first network port as an example, in the redundant shutdown mode, the first sending network port is controlled to send data to the first EtherCAT slave station, and the data returned by the first EtherCAT slave station is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station based on the second network link through the second EtherCAT slave station; data analysis and processing are performed according to the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0107] In one embodiment, in the aforementioned process of data transmission based on the first enable signal, when it is detected that the first network port state and the second network port state are both in the disconnected state, the working mode is determined to be the redundant closed mode, and data is sent and received according to the redundant closed mode. It should be noted that at this time, based on the fact that the first network port state and the second network port state are both in the disconnected state, data may not be transmitted to the EtherCAT slave station, and determining that the working mode is the redundant closed mode is only an internal mode switch, and the corresponding data transmission can only be performed after the first network port state becomes connected.
[0108] As described above, a redundancy function is integrated in the EtherCAT master station. By setting two network ports, namely the first network port and the second network port, the link state of the PHY transceiver and the number of data packets sent and received are used to determine the data flow direction (i.e., the working mode), thereby improving the fault recovery function of the EtherCAT network without increasing the cost and complexity, thereby improving the data transmission reliability of the EtherCAT network.
[0109] As described above, compared with the existing method of requiring additional redundant nodes or backup master stations, this embodiment does not require additional redundant nodes and hardware equipment, and can implement simple functions in the EtherCAT master station. Through the FPGA chip in the EtherCAT master station, the flow direction of the master station data (i.e., the working mode) is automatically switched according to the network status, and it can quickly recover from link failures, thereby reducing the cost of adding redundant nodes or backup master stations, and reducing the complexity of the system, facilitating future maintenance, and thereby improving the stability of the system.
[0110] In the above, by setting the first network and the second network port in the EtherCAT master station, when the first network port state corresponding to the first network port and the second network port state corresponding to the second network port are both in the connected state, the first sending network port in the first network port is controlled to send data to the first EtherCAT slave station, and the corresponding data is received through the first receiving network port or the second receiving network port; when the corresponding data is received at the second receiving network port, the data is forwarded to the second sending network port in the EtherCAT master station, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port or the second receiving network port; a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port are counted; a redundant transmission mode is determined according to a comparison result of the first number and the second number, and data is sent and received according to the redundant transmission mode. By adopting the above technical means, there is no need to add an additional backup master station. The corresponding redundant transmission mode can be performed through the first network port and the second network port based on the statistical results of the number of data packets. When there is a single point failure in the link, normal communication can be achieved through the cooperation of the first network port and the second network port. In this way, the technical problem of high cost caused by the additional addition of a backup master station in the EtherCAT master-slave system can be avoided. Normal data transmission can be achieved based on the cooperation of the first network port and the second network port of the EtherCAT master station, thereby reducing the cost of the EtherCAT master-slave system with normal data transmission of the EtherCAT master station.
[0111] Based on the above embodiments, Fig.12 This is a schematic diagram of the structure of a dual-port redundant EtherCAT master station data transmission device provided in an embodiment of the present application. Fig.12The dual-network-port redundant EtherCAT master station data transmission device provided in this embodiment is used for an EtherCAT master station. The EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations. The EtherCAT master station includes a first network port and a second network port. The first network port includes a first sending network port and a first receiving network port. The second network port includes a second sending network port and a second receiving network port. Multiple EtherCAT slave stations are connected one by one to form a slave station link. The first sending network port is connected to the first EtherCAT slave station at the first end of the slave station link, and the second EtherCAT slave station at the second end of the slave station link is connected to the second receiving network port. The first sending network port, the slave station link, and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave station link, and the first EtherCAT slave station at the first end of the slave station link is connected to the first receiving network port. The second sending network port, the slave station link, and the first receiving network port form a second network link. The dual-port redundant EtherCAT master station data transmission device specifically includes: a first enabling response module 21 , a first transceiver control module 22 , a second transceiver control module 23 , a quantity statistics module 24 and a first working mode determination module 25 .
[0112] Wherein, the first enabling response module 21 is used to receive a first enabling signal, and in response to the first enabling signal, detect the first network port state and the second network port state, the first network port state is the communication connection state between the first network port and the first EtherCAT slave station, and the second network port state is the communication connection state between the second network port and the second EtherCAT slave station;
[0113] A first transceiver control module 22, used to control the first transmitting network port to send data to the first EtherCAT slave station and receive corresponding data through the first receiving network port or the second receiving network port when the first network port state and the second network port state are both in a connected state;
[0114] The second transceiver control module 23 is used to forward the data to the second sending network port in the EtherCAT master station when the corresponding data is received at the second receiving network port, and send the data to the second EtherCAT slave station through the second sending network port, and receive the data through the first receiving network port;
[0115] A quantity counting module 24, configured to count a first quantity of data packets received by the first receiving network port and a second quantity of data packets received by the second receiving network port;
[0116] The first working mode determination module 25 is used to determine a redundant transmission mode according to a comparison result between the first quantity and the second quantity, and to send and receive data according to the redundant transmission mode.
[0117] In one embodiment, the first working mode determination module 25 includes: a first mode determination submodule, a first sending submodule, a first forwarding submodule, a second sending submodule and a first data processing submodule;
[0118] A first mode determination submodule, configured to determine that the redundant transmission mode is the first redundant mode when the comparison result is that the first number is less than or equal to the second number;
[0119] A first sending submodule is used to control the first sending network port to send data to the first EtherCAT slave station according to the first redundant mode, and receive corresponding data from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted from the first EtherCAT slave station to the second EtherCAT slave station based on the first network link;
[0120] A first forwarding submodule is used to forward data received by the second receiving network port to the second sending network port in the EtherCAT master station;
[0121] A second sending submodule, used to send data to the second EtherCAT slave station through the second sending network port, and receive corresponding data from the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted from the second EtherCAT slave station to the first EtherCAT slave station based on the second network link;
[0122] The first data processing submodule is used to perform data analysis and processing according to the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0123] In one embodiment, the first working mode determination module 25 includes: a second mode determination submodule, a target slave station determination submodule, a third sending submodule, a second forwarding submodule, a fourth sending submodule and a second data processing submodule;
[0124] A second mode determination submodule, configured to determine that the redundant transmission mode is a second redundant mode when the comparison result shows that the first number is greater than the second number;
[0125] A target slave station determination submodule is used to determine, in the second redundant mode, a first target slave station and a second target slave station where communication is disconnected in the slave station link, the first target slave station and the second target slave station being two adjacent EtherCAT slave stations at corresponding communication disconnection positions;
[0126] A third sending submodule is used to control the first sending network port to send data based on the first network link, and receive the returned data through the first receiving network port, wherein the data is transmitted to the first target slave station based on the first network link, and is returned to the first receiving network port through the first target slave station based on the second network link;
[0127] A second forwarding submodule is used to forward the data received by the first receiving network port to the second sending network port in the EtherCAT master station;
[0128] a fourth sending submodule, configured to send data through the second sending network port based on the second network link, and receive the returned data through the second receiving network port, wherein the data is transmitted to the second target slave station based on the second network link, and is returned to the second receiving network port through the second target slave station based on the first network link;
[0129] The second data processing submodule is used to perform data analysis and processing according to the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0130] In one embodiment, the first working mode determination module 25 further includes: a third mode determination submodule, a fifth sending submodule and a third data processing submodule;
[0131] A third mode determination submodule, used to determine that the redundant transmission mode is a third redundant mode when the first network port state is a disconnected state and the second network port state is a connected state;
[0132] a fifth sending submodule, for sending data to the second EtherCAT slave station through the second sending network port and receiving returned data from the second EtherCAT slave station through the second receiving network port in a third redundant mode, wherein the data is transmitted to the first EtherCAT slave station based on the second network link and is returned to the second EtherCAT slave station through the first EtherCAT slave station based on the first network link;
[0133] The third data processing submodule is used to perform data analysis and processing according to the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0134] In one embodiment, the first working mode determination module 25 further includes: a fourth mode determination submodule, a sixth sending submodule and a fourth data processing submodule;
[0135] A fourth mode determination submodule, configured to determine that the redundant transmission mode is a third redundant mode when the first network port is in a connected state and the second network port is in a disconnected state;
[0136] a sixth sending submodule, configured to send data to the first EtherCAT slave station through the first sending network port and receive data returned by the first EtherCAT slave station through the first receiving network port in a third redundant mode, wherein the data is transmitted to the second EtherCAT slave station based on the first network link and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link;
[0137] The fourth data processing submodule is used to perform data analysis and processing according to the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0138] In one embodiment, the EtherCAT master station further includes a first PHY transceiver and a second PHY transceiver, wherein the first PHY transceiver is connected to the first network port, and the second PHY transceiver is connected to the second network port;
[0139] The first enabling response module 21 includes: a signal detection submodule, a first state determination submodule, a second state determination submodule, a third state determination submodule and a fourth state determination submodule;
[0140] A signal detection submodule, configured to detect a first link signal state of the first PHY transceiver and a second link signal state of the second PHY transceiver;
[0141] A first state determination submodule, used to determine that the state of the first network port is a disconnected state when the state of the first link signal is a high level state;
[0142] A second state determination submodule, used to determine that the state of the first network port is a connected state when the state of the first link signal is a low level state;
[0143] A third state determination submodule, used to determine that the second network port state is a disconnected state when the second link signal state is a high level state;
[0144] The fourth state determination submodule is used to determine that the second network port state is a connected state when the second link signal state is a low level state.
[0145] In one embodiment, the dual-port redundant EtherCAT master station data transmission device further includes: a second enabling response module, a third transceiver control module and a first data analysis module;
[0146] A second enable response module, configured to receive a second enable signal, and determine that the working mode is a redundant shutdown mode in response to the second enable signal;
[0147] A third transceiver control module is used to control the first transmitting network port to send data to the first EtherCAT slave station in a redundant shutdown mode, and receive data returned by the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link;
[0148] The first data analysis module is used to perform data analysis and processing according to the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
[0149] In one embodiment, the dual-port redundant EtherCAT master station data device further includes: a redundant shutdown control module;
[0150] The redundant shutdown control module is used to determine the working mode as the redundant shutdown mode in the corresponding redundant transmission mode when it is detected that the first network port state and the second network port state are both disconnected, and to send and receive data according to the redundant shutdown mode.
[0151] The dual-port redundant EtherCAT master station data transmission device provided in the embodiment of the present application can be used to execute the dual-port redundant EtherCAT master station data transmission method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0152] The present application embodiment provides a dual-port redundant EtherCAT master station data transmission device, referring to Fig.13 The dual-port redundant EtherCAT master station data transmission device includes: a processor 31, a memory 32, a communication module 33, an input device 34 and an output device 35. The number of processors in the dual-port redundant EtherCAT master station data transmission device can be one or more, and the number of memories in the dual-port redundant EtherCAT master station data transmission device can be one or more. The processor, memory, communication module, input device and output device of the dual-port redundant EtherCAT master station data transmission device can be connected through a bus or other methods.
[0153] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the dual-port redundant EtherCAT master station data transmission method of any embodiment of the present application (for example, the first enabling response module, the first transceiver control module, the second transceiver control module, the quantity statistics module and the first working mode determination module in the dual-port redundant EtherCAT master station data transmission device). The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device or other non-volatile solid-state storage device. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.
[0154] The communication module 33 is used for data transmission.
[0155] The processor 31 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory, that is, realizes the above-mentioned dual-network-port redundant EtherCAT master station data transmission method.
[0156] The input device 34 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the device. The output device 35 may include a display device such as a display screen.
[0157] The dual-network-port redundant EtherCAT master station data transmission device provided above can be used to execute the dual-network-port redundant EtherCAT master station data transmission method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0158] The embodiment of the present application also provides a storage medium storing computer executable instructions, which are used to execute a dual-network port redundant EtherCAT master station data transmission method when executed by a computer processor. The dual-network port redundant EtherCAT master station data transmission method includes: receiving a first enable signal, responding to the first enable signal, detecting a first network port state and a second network port state, the first network port state is a communication connection state between the first network port and the first EtherCAT slave station, and the second network port state is a communication connection state between the second network port and the second EtherCAT slave station; when the first network port state and the second network port state are both connected When in the state, the first sending network port is controlled to send data to the first EtherCAT slave station, and the corresponding data is received through the first receiving network port or the second receiving network port; when the corresponding data is received at the second receiving network port, the data is forwarded to the second sending network port in the EtherCAT master station, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port; a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port are counted; a redundant transmission mode is determined according to a comparison result of the first number and the second number, and data is sent and received according to the redundant transmission mode.
[0159] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (for example, in different computer systems connected by a network). The storage medium may store program instructions (for example, embodied as a computer program) that can be executed by one or more processors.
[0160] Of course, the computer executable instructions of a storage medium storing computer executable instructions provided in an embodiment of the present application are not limited to the above dual-network-port redundant EtherCAT master station data transmission method, and can also execute related operations in the dual-network-port redundant EtherCAT master station data transmission method provided in any embodiment of the present application.
[0161] The dual-network-port redundant EtherCAT master station data transmission device, storage medium and dual-network-port redundant EtherCAT master station data transmission equipment provided in the above embodiments can execute the dual-network-port redundant EtherCAT master station data transmission method provided in any embodiment of the present application. For technical details not described in detail in the above embodiments, please refer to the dual-network-port redundant EtherCAT master station data transmission method provided in any embodiment of the present application.
[0162] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the protection scope of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A dual-port redundant EtherCAT master station data transmission method, characterized in that: Used for an EtherCAT master station, the EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations, the EtherCAT master station includes a first network port and a second network port, the first network port includes a first sending network port and a first receiving network port, the second network port includes a second sending network port and a second receiving network port, the multiple EtherCAT slave stations are connected one by one to form a slave link, the first sending network port is connected to the first EtherCAT slave station at the first end of the slave link, the second EtherCAT slave station at the second end of the slave link is connected to the second receiving network port, the first sending network port, the slave link and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave link, the first EtherCAT slave station at the first end of the slave link is connected to the first receiving network port, the second sending network port, the slave link and the first receiving network port form a second network link; The method comprises: Receive a first enable signal, and in response to the first enable signal, detect a first network port state and a second network port state, wherein the first network port state is a communication connection state between the first network port and the first EtherCAT slave station, and the second network port state is a communication connection state between the second network port and the second EtherCAT slave station; When the first network port status and the second network port status are both in a connected state, controlling the first sending network port to send data to the first EtherCAT slave station, and receiving corresponding data through the first receiving network port or the second receiving network port; When the second receiving network port receives corresponding data, in the EtherCAT master station, the data is forwarded to the second sending network port, and the data is sent to the second EtherCAT slave station through the second sending network port, and the data is received through the first receiving network port; Counting a first number of data packets received by the first receiving network port and a second number of data packets received by the second receiving network port; A redundant transmission mode is determined according to a comparison result of the first quantity and the second quantity, and data is sent and received according to the redundant transmission mode.
2. The method according to claim 1, characterized in that The step of determining a redundant transmission mode according to a comparison result of the first quantity and the second quantity, and sending and receiving data according to the redundant transmission mode, includes: When the comparison result is that the first number is less than or equal to the second number, determining that the redundant transmission mode is a first redundant mode; According to the first redundant mode, controlling the first sending network port to send data to the first EtherCAT slave station, and receiving corresponding data from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted from the first EtherCAT slave station to the second EtherCAT slave station based on the first network link; In the EtherCAT master station, forwarding the data received by the second receiving network port to the second sending network port; sending the data to the second EtherCAT slave station through the second sending network port, and receiving corresponding data from the first EtherCAT slave station through the first receiving network port, wherein the data is transmitted from the second EtherCAT slave station to the first EtherCAT slave station based on the second network link; Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
3. The method according to claim 1, characterized in that The step of determining a redundant transmission mode according to a comparison result of the first quantity and the second quantity, and sending and receiving data according to the redundant transmission mode, includes: When the comparison result is that the first number is greater than the second number, determining that the redundant transmission mode is a second redundant mode; In the second redundant mode, determining that there are a first target slave station and a second target slave station whose communication is disconnected in the slave station link, the first target slave station and the second target slave station being two adjacent EtherCAT slave stations corresponding to the communication disconnection position; Controlling the first sending network port to send data based on the first network link, and receiving returned data through the first receiving network port, wherein the data is transmitted to the first target slave station based on the first network link, and is returned to the first receiving network port through the first target slave station based on the second network link; In the EtherCAT master station, forwarding the data received by the first receiving network port to the second sending network port; Sending the data through the second sending network port based on the second network link, and receiving the returned data through the second receiving network port, wherein the data is transmitted to the second target slave station based on the second network link, and is returned to the second receiving network port through the second target slave station based on the first network link; Data analysis and processing are performed based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
4. The method according to claim 1, characterized in that After receiving the first enable signal and detecting the first network port status and the second network port status in response to the first enable signal, the method includes: When the first network port state is a disconnected state and the second network port state is a connected state, determining that the redundant transmission mode is a third redundant mode; In the third redundant mode, data is sent to the second EtherCAT slave station through the second sending network port, and returned data is received from the second EtherCAT slave station through the second receiving network port, wherein the data is transmitted to the first EtherCAT slave station based on the second network link, and is returned to the second EtherCAT slave station based on the first network link through the first EtherCAT slave station; Data analysis and processing are performed based on the data received by the second receiving network port to determine the corresponding operating status of each EtherCAT slave station.
5. The method according to claim 1, characterized in that: After receiving the first enable signal and detecting the first network port status and the second network port status in response to the first enable signal, the method includes: When the first network port is in a connected state and the second network port is in a disconnected state, determining that the redundant transmission mode is a third redundant mode; In the third redundant mode, data is sent to the first EtherCAT slave station through the first sending network port, and data returned by the first EtherCAT slave station is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link; Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
6. The method according to claim 1, characterized in that The EtherCAT master station further includes a first PHY transceiver and a second PHY transceiver, wherein the first PHY transceiver is connected to the first network port, and the second PHY transceiver is connected to the second network port; The detecting the first network port status and the second network port status comprises: detecting a first link signal state of the first PHY transceiver, and detecting a second link signal state of the second PHY transceiver; When the state of the first link signal is in a high level state, determining that the state of the first network port is a disconnected state; When the state of the first link signal is in a low level state, determining that the state of the first network port is a connected state; When the second link signal state is in a high level state, determining that the second network port state is in a disconnected state; When the second link signal state is in a low level state, it is determined that the second network port state is in a connected state.
7. The method according to claim 1, characterized in that The method further comprises: receiving a second enable signal, and determining, in response to the second enable signal, that the operating mode is a redundant shutdown mode; In the redundant shutdown mode, the first transmitting network port is controlled to send data to the first EtherCAT slave station, and the data returned by the first EtherCAT slave station is received through the first receiving network port, wherein the data is transmitted to the second EtherCAT slave station based on the first network link, and is returned to the first EtherCAT slave station through the second EtherCAT slave station based on the second network link; Data analysis and processing are performed based on the data received by the first receiving network port to determine the corresponding operating status of each EtherCAT slave station.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: In the corresponding redundant transmission mode, when it is detected that the first network port state and the second network port state are both disconnected, the working mode is determined to be the redundant closed mode, and data is sent and received according to the redundant closed mode.
9. A dual-port redundant EtherCAT master station data transmission device, characterized in that: Used for an EtherCAT master station, the EtherCAT master station is used to form an EtherCAT master-slave system with multiple EtherCAT slave stations, the EtherCAT master station includes a first network port and a second network port, the first network port includes a first sending network port and a first receiving network port, the second network port includes a second sending network port and a second receiving network port, the multiple EtherCAT slave stations are connected one by one to form a slave station link, the first sending network port is connected to the first EtherCAT slave station at the first end of the slave station link, the second EtherCAT slave station at the second end of the slave station link is connected to the second receiving network port, the first sending network port, the slave station link and the second receiving network port form a first network link; the second sending network port is connected to the second EtherCAT slave station at the second end of the slave station link, the first EtherCAT slave station at the first end of the slave station link is connected to the first receiving network port, the second sending network port, the slave station link and the first receiving network form a second network link; The device comprises: A first enable response module, configured to receive a first enable signal, and detect a first network port state and a second network port state in response to the first enable signal, wherein the first network port state is a communication connection state between the first network port and the first EtherCAT slave station, and the second network port state is a communication connection state between the second network port and the second EtherCAT slave station; A first transceiver control module, used for controlling the first sending network port to send data to the first EtherCAT slave station and receiving corresponding data through the first receiving network port or the second receiving network port when the first network port status and the second network port status are both in a connected state; A second transceiver control module is used for forwarding the data to the second sending network port in the EtherCAT master station when the second receiving network port receives corresponding data, and sending the data to the second EtherCAT slave station through the second sending network port, and receiving the data through the first receiving network port; A quantity counting module, used for counting a first quantity of data packets received by the first receiving network port and a second quantity of data packets received by the second receiving network port; The first working mode determination module is used to determine a redundant transmission mode according to a comparison result of the first quantity and the second quantity, and to send and receive data according to the redundant transmission mode.
10. A dual-port redundant EtherCAT master station data transmission device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
11. A storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to perform the method according to any one of claims 1-8 when executed by a processor.
Citation Information
Patent Citations
Microgrid inverter carrier wave phase-shifting synchronization system and carrier wave phase-shifting synchronization method
CN106067848A
Communication method and device
CN114788401A
FPGA-based Ethercat annular dual-redundancy link switching method and system
CN115442218A
EtherCAT master station redundancy architecture system based on adaptive control
CN220173264U
Slave device, control method of slave device, information processing program and recording medium
US20170264455A1
Cited By
EtherCAT master station topology dynamic control system based on FPGA
CN120658618A
FPGA-based ethercat master station topology dynamic control system
CN120658618B
EtherCAT slave station port identification and topology diagnosis system and method
CN120811819A