Industrial Ethernet communication methods, devices, computer equipment and storage media
By retransmitting interactive messages and obtaining the synchronization manager status in industrial Ethernet communication, the protocol stack logic deadlock problem is solved, communication stability and synchronization accuracy are improved, and the equipment fault self-healing time is reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-09
- Publication Date
- 2026-05-26
AI Technical Summary
Current industrial Ethernet communication mechanisms may suffer from protocol stack logic deadlock, especially under electromagnetic interference in complex industrial environments, leading to communication instability.
When the master station and slave station are conducting non-periodic data interaction, if physical frame loss occurs, the master station will resend the interaction message and after the cumulative number reaches a preset threshold, obtain the synchronization manager status of the target slave station and restore communication based on the status; monitor the number of consecutive frame loss in the initialization configuration sequence, stop the transmission delay calculation and rescan the topology.
It improves the communication recovery capability of the master station and slave station under harsh working conditions, avoids logical interlocking, ensures communication stability and synchronization accuracy, and reduces equipment failure self-healing time and maintenance costs.
Smart Images

Figure CN122093205A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial Ethernet technology, and in particular to an industrial Ethernet communication method, apparatus, computer equipment, and storage medium. Background Technology
[0002] Industrial Ethernet is widely used in high-end industrial automation equipment due to its high real-time performance and topology flexibility. In terms of communication mechanisms, it achieves real-time control interaction between the master and slave stations through periodic process data objects (PDOs), completes non-periodic parameter configuration using service data objects (SDOs), and relies on a distributed clock (DC) synchronization mechanism to ensure that all slave stations maintain high-precision time synchronization with the master station.
[0003] However, in complex industrial environments, current communication mechanisms may suffer from protocol stack logic deadlock issues. Summary of the Invention
[0004] Therefore, it is necessary to provide an industrial Ethernet communication method, apparatus, computer equipment, and storage medium that can solve the problem of protocol stack logic deadlock that may exist in the current communication mechanism, in order to address the above-mentioned technical problems.
[0005] Firstly, this application provides an industrial Ethernet communication method applied to a master station, comprising:
[0006] During the non-periodic data interaction between the master station and the slave station, if physical frame loss occurs, the interaction message is retransmitted to the target slave station where the physical frame loss occurred, and the cumulative number of times the interaction message is retransmitted is obtained.
[0007] If the cumulative number of times reaches a preset threshold, obtain the synchronization manager status of the target slave station;
[0008] Based on the state of the synchronization manager, communication between the master station and the target slave station is restored.
[0009] In one embodiment, the synchronization manager state includes a mailbox output state and a mailbox input state; the step of restoring communication between the master station and the target slave station based on the synchronization manager state includes:
[0010] Based on the values of the mailbox output status and the mailbox input status, communication between the master station and the target slave station is restored.
[0011] In one embodiment, restoring communication between the master station and the target slave station based on the values of the mailbox output status and the mailbox input status includes:
[0012] If both the mailbox output status value and the mailbox input status value are full, a preset reset command is sent to the target slave station; the reset command is used to instruct the target slave station to reset the target slave station's synchronization manager;
[0013] If the value of the mailbox output status or the value of the mailbox input status is not full, then based on the measures corresponding to the response timeout error, the communication between the master station and the target slave station is restored.
[0014] In one embodiment, obtaining the cumulative number of times the interaction message is retransmitted includes:
[0015] After retransmitting the interaction message to the target slave station, the value of the retransmission counter is incremented by one;
[0016] Based on the value of the retransmission counter, the cumulative number of times the interaction message has been retransmitted is obtained.
[0017] In one embodiment, obtaining the synchronization manager status of the target slave station when the cumulative number of times reaches a preset threshold includes:
[0018] When the cumulative number of times reaches a preset threshold, a read command is sent to the target slave station; the read command is used to instruct the target slave station to send the synchronization manager status to the master station.
[0019] Secondly, this application provides an industrial Ethernet communication method applied to a target slave station experiencing physical frame loss, comprising:
[0020] During the non-periodic data interaction between the master station and the slave station, the master station retransmits the interaction message.
[0021] The synchronization manager status is sent to the master station; the synchronization manager status is sent by the target slave station to the master station when the cumulative number of retransmissions of the interaction message reaches a preset threshold, and the master station is used to restore communication between the master station and the target slave station based on the synchronization manager status.
[0022] In one embodiment, sending the synchronization manager status to the master station includes:
[0023] Receive a read command sent by the master station; the read command is sent by the master station when the cumulative number of reads reaches a preset threshold.
[0024] Based on the read command, the synchronization manager status is sent to the master station.
[0025] Thirdly, this application provides an industrial Ethernet communication method applied to a master station, including:
[0026] During the execution of the initialization configuration sequence, the number of consecutive data frame losses during link transmission is monitored;
[0027] If the number of consecutive data losses exceeds the second preset threshold, the current transmission delay calculation process is terminated.
[0028] In one embodiment, the method further includes:
[0029] Trigger a bus topology rescan command to re-identify the slave station until a complete configuration sequence without consecutive frame drops is obtained.
[0030] Fourthly, this application also provides an industrial Ethernet communication device for use in a master station, comprising:
[0031] The retransmission module is used to retransmit the interaction message to the target slave station where the physical frame loss occurred during the non-periodic data interaction between the master station and the slave station, and to obtain the cumulative number of times the interaction message has been retransmitted.
[0032] The acquisition module is used to acquire the synchronization manager status of the target slave station when the cumulative number of times reaches a preset threshold.
[0033] The recovery module is used to restore communication between the master station and the target slave station based on the state of the synchronization manager.
[0034] Fifthly, this application also provides an industrial Ethernet communication device for a target slave station experiencing physical frame loss, the device comprising:
[0035] The receiving module is used to receive the retransmitted interaction messages from the master station during the non-periodic data interaction between the master station and the slave station.
[0036] The sending module is used to send the synchronization manager status to the master station; the synchronization manager status is sent by the target slave station to the master station when the cumulative number of retransmissions of the interaction message reaches a preset threshold, and the master station is used to restore communication between the master station and the target slave station based on the synchronization manager status.
[0037] Sixthly, this application also provides an industrial Ethernet communication device for use as a master station, the device comprising:
[0038] The monitoring module is used to monitor the number of consecutive data frame losses during link transmission during the execution of the initialization configuration sequence.
[0039] The termination module is used to terminate the current transmission delay calculation process if the number of consecutive data losses exceeds a second preset threshold.
[0040] In a seventh aspect, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in any one of the first to third aspects.
[0041] Eighthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first to third aspects.
[0042] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any one of the first to third aspects.
[0043] In the aforementioned industrial Ethernet communication method, apparatus, computer equipment, and storage medium, if physical frame loss occurs during non-periodic data interaction between the master station and the slave station, the master station can simultaneously retransmit the interaction message to the target slave station where the physical frame loss occurred and obtain the cumulative number of retransmitted interaction messages. This allows the master station to obtain the synchronization manager state of the target slave station when the cumulative number of retransmitted interaction messages reaches a preset threshold. Based on the synchronization manager state of the target slave station, communication between the master station and the target slave station can be restored, instead of blindly and continuously sending interaction messages to the target slave station. This avoids the input / output synchronization manager state machine inside the target slave station becoming logically interlocked due to blindly and continuously sending interaction messages, ensuring the communication recovery capability of the master station and the target slave station under harsh operating conditions and significantly improving the stability of the target slave station in highly interfered industrial environments. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is an application environment diagram of an industrial Ethernet communication method in one embodiment;
[0046] Figure 2This is a flowchart illustrating an industrial Ethernet communication method in one embodiment;
[0047] Figure 3 This is a flowchart illustrating an industrial Ethernet communication method in one embodiment;
[0048] Figure 4 This is a flowchart illustrating an industrial Ethernet communication method in one embodiment;
[0049] Figure 5 This is a structural block diagram of an industrial Ethernet communication device in one embodiment;
[0050] Figure 6 This is a structural block diagram of an industrial Ethernet communication device in one embodiment;
[0051] Figure 7 This is a structural block diagram of an industrial Ethernet communication device in one embodiment;
[0052] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0055] The industrial Ethernet communication method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, master station 102 communicates with slave station 104 via a network. Master station 102 can be, but is not limited to, a programmable logic controller (PLC), industrial controller, etc. Master station 102 is responsible for initiating communication commands, configuring slave station parameters, and synchronizing the global clock. Slave station 104 includes sensors, actuators, servo motors, etc., receiving control commands from the master station and uploading its own status data. Real-time control interaction between master station 102 and slave station 104 is achieved using Process Data Objects (PDOs), and non-periodic configuration interaction is achieved using Service Data Objects (SDOs). All slave stations must maintain high-precision time synchronization with the master station through a distributed clock (DC).
[0056] In one exemplary embodiment, such as Figure 2 As shown, an industrial Ethernet communication method is provided, which can be applied to... Figure 1 Taking the main site in China as an example, the explanation includes the following steps:
[0057] S201: During the non-periodic data interaction between the master station and the slave station, if physical frame loss occurs, the interaction message is retransmitted to the target slave station where the physical frame loss occurred, and the cumulative number of retransmissions of the interaction message is obtained.
[0058] In the process of aperiodic data interaction between the industrial Ethernet master and slave, the master constructs an SDO interaction message (containing the parameters to be configured and the object index) and sends it to the slave via the downlink. The EtherCAT Slave Controller (ESC) receives the interaction message, stores it in the buffer of the SyncManager (SM), and switches the SM state from idle to data ready. However, electromagnetic interference in the industrial field can cause physical layer frame loss. Even if the master sends an SDO interaction message, the frame may be lost in transmission, and the slave ESC may not receive the interaction message sent by the master. In this embodiment, the slave that did not receive the interaction message sent by the master is referred to as the target slave. For example, if the master sends an interaction message but physical frame loss occurs when it reaches slave 2, then slave 2 can be referred to as the target slave.
[0059] As an optional implementation, in industrial Ethernet communication, the master station sends an SDO interaction message, and the slave station, upon receiving the SDO interaction message, needs to return an SDO response message, i.e., a return packet. In this embodiment, if the master station does not receive an SDO response message from the slave station within a preset time period, the slave station can be identified as the target slave station where physical frame loss occurred.
[0060] In this embodiment, after the master station identifies the target slave station where physical frame loss has occurred, it will retransmit the interaction message to the target slave station. As an optional implementation, after retransmitting the interaction message to the target slave station, the master station can increment the value of the retransmission counter to accumulate the number of retransmissions of the interaction message. Then, the master station can obtain the cumulative number of retransmissions of the interaction message based on the value of the retransmission counter.
[0061] S202: If the cumulative number of times reaches a preset threshold, obtain the synchronization manager status of the target slave station.
[0062] In Industrial Ethernet, the synchronization manager status of the target slave is a set of register statuses inside the slave's ESC, used to indicate whether the SM (synchronization manager) is currently working properly, whether there is data transmission, and whether an error has occurred.
[0063] In this embodiment, when the cumulative number of times the master station retransmits interaction messages reaches a preset threshold, the master station will stop retransmitting interaction messages to the target slave station and obtain the synchronization manager status of the target slave station. As an example, the preset threshold can be 10 times, 12 times, 15 times, etc. This embodiment does not limit the specific value of the preset threshold.
[0064] S203, based on the synchronization manager status, restores communication between the master station and the target slave station.
[0065] In this embodiment, the master station can determine the specific reason for the communication anomaly between the master station and the target slave station based on the synchronization manager status of the target slave station. Then, it executes the corresponding recovery strategy according to different anomaly states to restore communication between the master station and the target slave station. For example, if the synchronization manager status determines that the reason for the communication anomaly between the master station and the target slave station is configuration loss, the master station can restore communication between the master station and the target slave station by reconfiguring the SM parameters (address, length, type) of the target slave station. If the synchronization manager status determines that the reason for the communication anomaly between the master station and the target slave station is SM error status setting, the master station can read the specific error code, reconfigure the correct SM length or address, clear the ESC error flag, and re-establish communication to restore communication between the master station and the target slave station.
[0066] In the aforementioned industrial Ethernet communication method, if physical frame loss occurs during the non-periodic data interaction between the master station and the slave station, the master station can simultaneously retransmit the interaction message to the target slave station where the physical frame loss occurred and obtain the cumulative number of retransmitted interaction messages. This allows the master station to obtain the synchronization manager state of the target slave station when the cumulative number of retransmitted interaction messages reaches a preset threshold. Based on the synchronization manager state of the target slave station, communication between the master station and the target slave station can be restored, instead of blindly and continuously sending interaction messages to the target slave station. This avoids the blind and continuous sending of interaction messages to the target slave station, which could cause the input / output synchronization manager state machine inside the target slave station to fall into logical interlocking. This ensures the communication recovery capability of the master station and the target slave station under harsh operating conditions and significantly improves the stability of the target slave station in highly interfered industrial environments.
[0067] In an exemplary embodiment, the synchronization manager state includes mailbox output state and mailbox input state; S203 includes:
[0068] Step A: Restore communication between the master station and the target slave station based on the values of the mailbox output status and the mailbox input status.
[0069] In this embodiment, the synchronization manager status of the target slave station includes mailbox output status and mailbox input status.
[0070] As an optional implementation, in this embodiment, if both the mailbox output status value and the mailbox input status value are full, a preset reset command can be sent to the target slave station. This reset command is used to instruct the target slave station to reset its synchronization manager and clear the Buffer Full flag. Then, the Process Data Interface (PDI) program detects the status change, reinitializes the mailbox handshake sequence, and restores synchronization between the PDI and the master station.
[0071] As an alternative implementation, in this embodiment, if the mailbox output status value or mailbox input status value is not full, the master station will restore communication between the master station and the target slave station based on the measures corresponding to the timeout error. It is understood that if the mailbox output status value or mailbox input status value is not full, it indicates that the target slave station's mailbox buffer is not full of data. Therefore, communication between the master station and the target slave station can be restored by retransmitting messages to resolve occasional frame drops, resetting the status / reconfiguring the SM to resolve ESC configuration / status anomalies, and waking up the PDI / soft reset to resolve program / communication layer deadlocks.
[0072] In this embodiment, based on the values of the mailbox output status and the mailbox input status, the cause of physical frame loss at the target slave station can be accurately determined. Therefore, measures corresponding to the cause of physical frame loss can be taken to restore communication between the master station and the target slave station, ensuring the communication recovery capability of the master station and the target slave station under adverse working conditions.
[0073] This embodiment will explain the detailed process of the master station obtaining the synchronization manager status of the target slave station. In an exemplary embodiment, S202 above includes: when the cumulative number of times reaches a preset threshold, sending a read instruction to the target slave station; the read instruction is used to instruct the target slave station to send the synchronization manager status to the master station.
[0074] In this embodiment, when the cumulative number of times the master station retransmits interactive messages to the target slave station reaches a preset threshold, the master station can send a read command to the target slave station. The read command instructs the target slave station to send its synchronization manager status to the master station, so that the master station can obtain the synchronization manager status of the target slave station.
[0075] In this embodiment, when the cumulative number of times the master station retransmits interactive messages to the target slave station reaches a preset threshold, a read command is sent to the target slave station. This read command instructs the target slave station to send its synchronization manager status to the master station, enabling the master station to obtain the synchronization manager status of the target slave station in a timely manner, thus ensuring the timeliness of the master station's acquisition of the target slave station's synchronization manager status.
[0076] In one exemplary embodiment, such as Figure 3 As shown, an industrial Ethernet communication method is provided, which can be applied to... Figure 1 Taking a target slave station where physical frame loss occurs as an example, the explanation includes the following steps:
[0077] S301 receives retransmitted interaction messages from the master station during non-periodic data interaction between the master station and the slave station.
[0078] In the process of aperiodic data interaction between the industrial Ethernet master and slave, the master constructs an SDO interaction message (containing the parameters to be configured and the object index) and sends it to the slave via the downlink. The EtherCAT Slave Controller (ESC) receives the interaction message, stores it in the buffer of the SyncManager (SM), and switches the SM state from idle to data ready. However, electromagnetic interference in the industrial environment can cause physical layer frame loss. Even if the master sends an SDO interaction message, the frame may be lost in transmission, and the slave ESC may not receive the interaction message sent by the master. In this embodiment, the slave that did not receive the interaction message sent by the master is referred to as the target slave. For example, if the master sends an interaction message but physical frame loss occurs when it reaches slave 2, then slave 2 can be referred to as the target slave.
[0079] As an optional implementation, in industrial Ethernet communication, the master station sends an SDO interaction message, and the slave station, upon receiving the SDO interaction message, needs to return an SDO response message, i.e., a return packet. In this embodiment, if the master station does not receive an SDO response message from the slave station within a preset time period, the slave station can be identified as the target slave station where physical frame loss occurred.
[0080] In this embodiment, after the master station determines the target slave station that has experienced physical frame loss, it will resend the interaction message to the target slave station, and the target slave station will receive the resent interaction message from the master station.
[0081] S302, Send the synchronization manager status to the master station; the synchronization manager status is sent by the target slave station to the master station when the cumulative number of retransmissions of interaction messages reaches a preset threshold. The master station uses the synchronization manager status to restore communication between the master station and the target slave station.
[0082] As an optional implementation, after the master station retransmits the interaction message to the target slave station, it can increment the retransmission counter to accumulate the number of retransmissions. The master station can then obtain the cumulative number of retransmissions based on the retransmission counter value. In this embodiment, when the cumulative number of retransmissions reaches a preset threshold, the target slave station sends its synchronization manager status to the master station. The master station will then restore communication between the master station and the target slave station based on the target slave station's synchronization manager status.
[0083] In Industrial Ethernet, the synchronization manager status of the target slave is a set of register statuses inside the slave's ESC, used to indicate whether the SM (synchronization manager) is currently working properly, whether there is data transmission, and whether an error has occurred.
[0084] In this embodiment, when the cumulative number of times the master station retransmits interaction messages reaches a preset threshold, the master station will stop retransmitting interaction messages to the target slave station and obtain the synchronization manager status of the target slave station. As an example, the preset threshold can be 10 times, 12 times, 15 times, etc. This embodiment does not limit the specific value of the preset threshold.
[0085] As an optional implementation, the master station can send a read command to the target slave station when the cumulative number of retransmissions of interactive messages reaches a preset threshold. After receiving the read command, the target slave station will send its synchronization manager status to the master station based on the read command, so that the master station can obtain the synchronization manager status of the target slave station and restore communication between the master station and the target slave station based on the synchronization manager status of the target slave station.
[0086] In the aforementioned industrial Ethernet communication method, during the non-periodic data interaction between the master station and the slave station, if the target slave station experiences physical frame loss, the master station can retransmit the interaction message to the target slave station. Simultaneously, the master station can also acquire the cumulative number of retransmitted interaction messages. When the cumulative number of retransmitted interaction messages reaches a preset threshold, the target slave station can send its synchronization manager status to the master station. This allows the master station to restore communication between the master station and the target slave station based on the target slave station's synchronization manager status, rather than blindly and continuously sending interaction messages. This avoids the input / output synchronization manager state machine inside the target slave station becoming logically interlocked due to blindly and continuously sending interaction messages, ensuring the communication recovery capability of the master station and the target slave station under harsh operating conditions and significantly improving the stability of the target slave station in highly interfering industrial environments.
[0087] In some scenarios, during the initialization phase of industrial Ethernet (including sequences such as writing station addresses, reading status, reading configuration, and allocating SII), the master station needs to recursively calculate the transmission delay of each slave station to establish a globally unified clock for the industrial Ethernet. If consecutive frame drops occur during this critical sequence, it will lead to severe distortion of delay measurement data. A synchronization clock established based on erroneous data will cause asynchronous actions by slave stations, motor noise, and even equipment damage. Therefore, if... Figure 4 As shown in the embodiments of this application, an industrial Ethernet communication method is also provided, which is applied to... Figure 1 Taking the main site in China as an example, the explanation includes the following steps:
[0088] S401 monitors the number of consecutive data frame losses during link transmission during the execution of the initialization configuration sequence.
[0089] First, it's important to note that in Industrial Ethernet, the master station can read the register in the slave station's ESC (Electronic Time Register) that records the time required for data to travel from one port to another. This information is used to calculate the link transmission delay between slave stations, preparing for the establishment of a synchronization system where all slave stations in the entire Industrial Ethernet network share the same high-precision time. However, when reading the port delay register, the master station sends a large number of high-frequency, short-frame, high-priority EtherCAT command messages specifically for measuring network link delay and internal port delay within the slave stations. These messages are highly sensitive to noise; encountering electromagnetic interference (EMI), poor grounding, or signal reflection can lead to CRC errors or signal distortion, causing multiple consecutive frames to be discarded by the slave station.
[0090] In this embodiment, during the execution of the initialization configuration sequence (including but not limited to instructions such as APWR write address, FPRD read status, FPRD read configuration, and port latency measurement), the master station will activate a real-time frame loss rate monitoring mechanism to monitor the number of consecutive data frame losses during link transmission.
[0091] S402, if the number of consecutive data loss exceeds the second preset threshold, then the current transmission delay calculation process is terminated.
[0092] In this embodiment, if the master station determines that the number of consecutive data frame losses during link transmission exceeds a second preset threshold, it determines that the currently acquired topology parameters are unreliable. At this time, the calculated delay value is very likely to have a huge deviation, and the current transmission delay calculation process can be stopped. For example, the current recursive calculation of transmission delay (Propagation Delay) can be stopped immediately to prevent abnormal data from being written into the master station clock model.
[0093] Furthermore, as an optional implementation, the master station can mark the current bus topology status as abnormal, trigger a bus topology rescan command, and re-identify slave stations one by one from the physical ports until a complete configuration sequence without consecutive frame drops is obtained, ensuring multi-axis synchronization accuracy.
[0094] The above process will be explained with a complete example below:
[0095] Assuming the master station sequentially sends configuration frames such as APWR(0x0010)->FPRD(0x0130)->FPRD(0x0000), during the reading of the port delay register (0x0900 / 0x0910), interference causes multiple consecutive frame losses. The master station detects that the consecutive frame losses exceed a set threshold and determines that the calculated delay value is likely to have a significant deviation. The master station will intercept the erroneous delay data, not applying it to the slave station's 0x0980 system time offset register, and trigger a bus topology rescan instruction to re-enumerate the topology, re-identifying slave stations one by one from the physical ports until a complete configuration sequence without consecutive frame losses is obtained. Through this process, no manual power-off restart is required, achieving millisecond-level fault self-healing and reducing the cost of master station downtime maintenance.
[0096] In this embodiment, during the execution of the initialization configuration sequence by the master station, the number of consecutive data frame loss during link transmission is monitored. When the number of consecutive loss exceeds a second preset threshold, the current transmission delay calculation process is stopped, avoiding system clock drift caused by dirty data in the initialization phase and ensuring high-precision synchronization performance of motion control.
[0097] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0098] Based on the same inventive concept, this application also provides an industrial Ethernet communication device for implementing the industrial Ethernet communication method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more industrial Ethernet communication device embodiments provided below can be found in the limitations of the industrial Ethernet communication method described above, and will not be repeated here.
[0099] In one exemplary embodiment, such as Figure 5As shown, an industrial Ethernet communication device is provided for use in a master station, comprising: a retransmission module, an acquisition module, and a recovery module, wherein:
[0100] The retransmission module is used to retransmit the interaction message to the target slave station where the physical frame loss occurred during non-periodic data interaction between the master station and the slave station, and to obtain the cumulative number of retransmissions of the interaction message.
[0101] The acquisition module is used to acquire the synchronization manager status of the target slave station when the cumulative number of times reaches a preset threshold.
[0102] The recovery module is used to restore communication between the master station and the target slave station based on the synchronization manager status.
[0103] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0104] Based on the above embodiments, optionally, the synchronization manager state includes a mailbox output state and a mailbox input state; the recovery module includes: a recovery unit, wherein:
[0105] The recovery unit is used to restore communication between the master station and the target slave station based on the values of the mailbox output status and the mailbox input status.
[0106] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0107] Based on the above embodiments, optionally, the recovery unit is specifically used to send a preset reset command to the target slave station if both the mailbox output status value and the mailbox input status value are full; the reset command is used to instruct the target slave station to reset the target slave station's synchronization manager; if the mailbox output status value or the mailbox input status value is not full, the communication between the master station and the target slave station is restored based on the measures corresponding to the response timeout error.
[0108] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0109] Based on the above embodiments, optionally, the above retransmission module includes: a counting unit and an acquisition unit, wherein:
[0110] The counting unit is used to increment the retransmission counter value by one after retransmitting the interactive message to the target slave station.
[0111] The acquisition unit is used to obtain the cumulative number of retransmissions of interactive messages based on the value of the retransmission counter.
[0112] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0113] Based on the above embodiments, optionally, the acquisition module includes: a sending unit, wherein:
[0114] The sending unit is used to send a read command to the target slave station when the cumulative number of reads reaches a preset threshold; the read command is used to instruct the target slave station to send the synchronization manager status to the master station.
[0115] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0116] In one exemplary embodiment, such as Figure 6 As shown, an industrial Ethernet communication device is provided, applied to a target slave station experiencing physical frame loss, comprising: a receiving module and a transmitting module, wherein:
[0117] The receiving module is used to receive retransmitted interaction messages from the master station during non-periodic data interaction between the master station and the slave station.
[0118] The sending module is used to send the synchronization manager status to the master station. The synchronization manager status is sent by the target slave station to the master station when the cumulative number of retransmissions of interaction messages reaches a preset threshold. The master station uses the synchronization manager status to restore communication between the master station and the target slave station.
[0119] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0120] Based on the above embodiments, optionally, the above transmitting module includes: a receiving unit and a transmitting unit, wherein:
[0121] The receiving unit is used to receive read commands sent by the master station; the read command is sent by the master station when the cumulative number of reads reaches a preset threshold.
[0122] The sending unit is used to send the synchronization manager status to the master station based on the read command.
[0123] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0124] In one exemplary embodiment, such as Figure 7 As shown, an industrial Ethernet communication device is provided for use in a master station, comprising: a monitoring module and a stop module, wherein:
[0125] The monitoring module is used to monitor the number of consecutive data frame losses during link transmission during the execution of the initialization configuration sequence.
[0126] The abort module is used to terminate the current transmission delay calculation process if the number of consecutive data loss exceeds a second preset threshold.
[0127] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0128] Based on the above embodiments, optionally, the device further includes: a trigger module, wherein:
[0129] The trigger module is used to trigger the bus topology rescan command to re-identify slave stations until a complete configuration sequence without consecutive frame drops is obtained.
[0130] The industrial Ethernet communication device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, so it will not be described again here.
[0131] Each module in the aforementioned industrial Ethernet communication device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0132] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores the cumulative number of retransmitted interactive messages. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an industrial Ethernet communication method.
[0133] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0134] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0135] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0136] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0137] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0138] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0139] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An industrial Ethernet communication method, characterized in that, Applied to the main station, the method includes: During the non-periodic data interaction between the master station and the slave station, if physical frame loss occurs, the interaction message is retransmitted to the target slave station where the physical frame loss occurred, and the cumulative number of times the interaction message is retransmitted is obtained. If the cumulative number of times reaches a preset threshold, obtain the synchronization manager status of the target slave station; Based on the state of the synchronization manager, communication between the master station and the target slave station is restored.
2. The method according to claim 1, characterized in that, The synchronization manager status includes mailbox output status and mailbox input status; the step of restoring communication between the master station and the target slave station based on the synchronization manager status includes: Based on the values of the mailbox output status and the mailbox input status, communication between the master station and the target slave station is restored.
3. The method according to claim 2, characterized in that, The step of restoring communication between the master station and the target slave station based on the values of the mailbox output status and the mailbox input status includes: If both the mailbox output status value and the mailbox input status value are full, a preset reset command is sent to the target slave station; the reset command is used to instruct the target slave station to reset the target slave station's synchronization manager; If the value of the mailbox output status or the value of the mailbox input status is not full, then based on the measures corresponding to the response timeout error, the communication between the master station and the target slave station is restored.
4. The method according to any one of claims 1 to 3, characterized in that, The step of obtaining the cumulative number of times the interaction message is retransmitted includes: After retransmitting the interaction message to the target slave station, the value of the retransmission counter is incremented by one; Based on the value of the retransmission counter, the cumulative number of times the interaction message has been retransmitted is obtained.
5. The method according to any one of claims 1 to 3, characterized in that, When the cumulative number of occurrences reaches a preset threshold, obtaining the synchronization manager status of the target slave station includes: When the cumulative number of times reaches a preset threshold, a read command is sent to the target slave station; the read command is used to instruct the target slave station to send the synchronization manager status to the master station.
6. An industrial Ethernet communication method, characterized in that, Applied to a target slave station where physical frame loss occurs, the method includes: During the non-periodic data interaction between the master station and the slave station, the master station retransmits the interaction message. The synchronization manager status is sent to the master station; the synchronization manager status is sent by the target slave station to the master station when the cumulative number of retransmissions of the interaction message reaches a preset threshold, and the master station is used to restore communication between the master station and the target slave station based on the synchronization manager status.
7. The method according to claim 6, characterized in that, Sending the synchronization manager status to the master station includes: Receive a read command sent by the master station; the read command is sent by the master station when the cumulative number of reads reaches a preset threshold. Based on the read command, the synchronization manager status is sent to the master station.
8. An industrial Ethernet communication method, characterized in that, Applied to the main station, the method includes: During the execution of the initialization configuration sequence, the number of consecutive data frame losses during link transmission is monitored; If the number of consecutive data losses exceeds the second preset threshold, the current transmission delay calculation process is terminated.
9. The method according to claim 8, characterized in that, The method further includes: Trigger a bus topology rescan command to re-identify the slave station until a complete configuration sequence without consecutive frame drops is obtained.
10. An industrial Ethernet communication device, characterized in that, Applied to the main station, the device includes: The retransmission module is used to retransmit the interaction message to the target slave station where the physical frame loss occurred during the non-periodic data interaction between the master station and the slave station, and to obtain the cumulative number of times the interaction message has been retransmitted. The acquisition module is used to acquire the synchronization manager status of the target slave station when the cumulative number of times reaches a preset threshold. The recovery module is used to restore communication between the master station and the target slave station based on the state of the synchronization manager.
11. An industrial Ethernet communication device, characterized in that, The apparatus, applied to a target slave station where physical frame loss occurs, includes: The receiving module is used to receive the retransmitted interaction messages from the master station during the non-periodic data interaction between the master station and the slave station. The sending module is used to send the synchronization manager status to the master station; the synchronization manager status is sent by the target slave station to the master station when the cumulative number of retransmissions of the interaction message reaches a preset threshold, and the master station is used to restore communication between the master station and the target slave station based on the synchronization manager status.
12. An industrial Ethernet communication device, characterized in that, Applied to the main station, the device includes: The monitoring module is used to monitor the number of consecutive data frame losses during link transmission during the execution of the initialization configuration sequence. The termination module is used to terminate the current transmission delay calculation process if the number of consecutive data losses exceeds a second preset threshold.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.