Ethercat to profinet dynamic redundancy transmission method, system and storage medium

By using the EtherCAT to Profinet dynamic redundancy transmission method, the problems of insufficient transmission and topology limitations of industrial bus protocols in high-speed and high-reliability scenarios are solved, realizing high-speed and reliable industrial network transmission, supporting flexible expansion and equipment replacement without downtime, and improving the system's adaptability and transmission stability.

CN120729668BActive Publication Date: 2026-01-09SHENZHEN JUST MOTION CONTROL ELECTROMECHANICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511221201.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2026-01-09
Estimated Expiration
2045-08-29

AI Technical Summary

Technical Problem

Existing industrial bus protocols suffer from problems such as insufficient transmission rate, susceptibility to electromagnetic interference, limited communication distance, topology limitations, and inflexible protocol conversion in high-speed and high-reliability scenarios, leading to performance degradation of industrial networks in complex environments.

Method used

The method employs a dynamic redundancy transmission approach from EtherCAT to Profinet. By parsing data frames through the EtherCAT protocol controller and combining it with the dynamic priority scheduling of the central processing unit, it achieves efficient mapping and conversion between EtherCAT and Profinet protocols, supports high-speed transmission, and realizes redundant switching of faulty ports through a link status determination mechanism based on feedback instructions. It also integrates magnetic coupling isolation and TVS surge protection mechanisms to ensure zero transmission interruption.

Benefits of technology

It improves the reliability and flexibility of industrial networks, supports high-speed transmission, ensures that equipment replacement can be done without downtime, reduces network overhead and development complexity, and enhances system adaptability and transmission stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120729668B_ABST
    Figure CN120729668B_ABST
Patent Text Reader

Abstract

The application provides a dynamic redundancy transmission method and system based on EtherCAT to Profinet and a storage medium, wherein data frames are parsed by an EtherCAT protocol controller, operation priorities are determined according to operation instructions, operation instructions are stored in corresponding interrupt storage areas or polling storage areas according to the operation priorities, a second instruction is extracted based on the priority according to a preset instruction extraction mechanism, is mapped and converted into a corresponding Profinet protocol data frame, and a redundancy transmission port is started when it is judged that a link is abnormal based on a link state of a feedback instruction of the Profinet protocol data frame. The application realizes double-zone storage of instructions, preferentially processes key instructions, and meets real-time requirements of instructions, and solves the double bottleneck of bandwidth and reliability of an industrial network through a protocol mapping table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial gateways, and more specifically, to a dynamic redundant transmission method, system, and storage medium based on EtherCAT to Profinet. Background Technology

[0002] In the field of industrial automation, the reliability and transmission efficiency of real-time communication networks directly affect the performance of production systems. Currently, EtherCAT, RS485, and CANOPEN bus protocols are widely used for device interconnection in industrial settings. However, these technologies have shortcomings in high-speed, high-reliability scenarios. Traditional buses (such as RS485 and CANOPEN) have a transmission rate limit of only 10Mbps, which is insufficient to meet the real-time data requirements of hundreds of megabits / gigabits in scenarios such as robot control and high-speed production lines, resulting in high control command latency and decreased synchronization accuracy. RS485 is susceptible to electromagnetic interference during long-distance transmission, leading to an increased bit error rate. CANOPEN's communication distance is limited to within 40 meters and only supports half-duplex communication, making it unsuitable for complex industrial environments. Traditional buses must strictly adhere to linear or tree topologies, making it difficult to support flexible networking methods such as star and ring topologies, resulting in complex wiring and poor scalability. Furthermore, most gateways only support single protocol conversion, such as EtherCAT to RS485, and cannot seamlessly integrate high-performance industrial Ethernet protocols such as Profinet and EtherNet / IP, thus restricting the openness of device interconnection.

[0003] There is an urgent need for a high-speed, highly reliable, and flexibly scalable dynamic redundancy transmission technology. Summary of the Invention

[0004] In view of the above problems, the purpose of this invention is to provide a dynamic redundant transmission method, system, and storage medium based on EtherCAT to Profinet. By parsing data frames through an EtherCAT protocol controller and combining dynamic priority scheduling of the central processing unit, efficient mapping and conversion between EtherCAT and Profinet protocols is achieved, supporting high-speed transmission. A link status determination mechanism based on feedback instructions enables redundant switching of faulty ports, and unacknowledged data is cached in a common storage area to ensure zero transmission interruption. Furthermore, magnetic coupling isolation and TVS surge protection mechanisms are integrated to suppress electromagnetic interference in industrial environments, while supporting hot-swapping and automatic configuration, allowing equipment replacement without downtime; thereby improving the reliability of industrial networks.

[0005] The first aspect of this invention provides a dynamic redundancy transmission method based on EtherCAT to Profinet, the method comprising:

[0006] The first protocol data frame is obtained by receiving and converting data from the first protocol transceiver.

[0007] The first instruction is obtained by parsing the first protocol data frame based on the first protocol controller;

[0008] Based on the first instruction, determine the first priority;

[0009] Determine whether the first priority exceeds the priority threshold;

[0010] If so, the first instruction is written to the interrupt storage area;

[0011] If not, then write the first instruction to the polling memory area;

[0012] The second instruction is extracted from the interrupt storage area or the polling storage area;

[0013] Based on the preset mapping rule table, the second protocol data frame is obtained according to the second instruction;

[0014] In response to a feedback instruction in the second protocol data frame;

[0015] If a link anomaly is detected based on the feedback instruction, a redundant transmission port is activated.

[0016] This plan also includes:

[0017] Based on the opcode field, the first instruction is extracted to obtain the first opcode;

[0018] Based on a preset priority mapping table, the first priority is obtained according to the opcode field;

[0019] Determine whether the first priority exceeds the priority threshold;

[0020] If so, then based on the first priority, the interrupt priority information is determined and added to the end of the first instruction, and stored together in the interrupt storage area;

[0021] If not, insert it at the tail of the first-in-first-out queue in the polling storage area.

[0022] In this solution, the step of extracting the second instruction from the interrupt storage area or polling storage area specifically involves:

[0023] Determine whether the interrupt storage area is empty;

[0024] If not, then according to the interrupt priority, the second instruction is extracted sequentially in descending order;

[0025] If so, determine whether the polling storage area is empty;

[0026] If not, then the second instruction is obtained from the head of the first-in-first-out queue;

[0027] If so, then set the second instruction to the preset heartbeat instruction.

[0028] In this scheme, the process of obtaining the second protocol data frame based on the preset mapping rule table and the second instruction specifically involves:

[0029] Based on the opcode field, the second instruction is extracted to obtain the second opcode;

[0030] Based on the preset mapping rule table, the first device address is obtained according to the second opcode;

[0031] Determine whether the second opcode is an output opcode;

[0032] If so, then a second protocol data frame is generated based on the first device address;

[0033] If not, then determine the first data volume according to the second opcode;

[0034] Based on the feedback storage area, the first storage address is obtained according to the first data volume;

[0035] A second protocol data frame is generated based on the first device address and the first storage address.

[0036] In this solution, the step of activating redundant transmission ports when a link anomaly is determined based on the feedback instruction specifically includes:

[0037] Determine whether the feedback instruction has been received within the preset feedback time;

[0038] If not, it is marked as data loss. When the data is lost for a preset number of consecutive times, the current port is disabled and the backup port is activated.

[0039] If so, the receiving time is recorded. When the average receiving time within the preset window exceeds the time threshold, the system switches to the backup port.

[0040] This plan also includes:

[0041] After parsing the first protocol data frame, the system determines whether the transmission process of the first instruction is correct based on a preset CRC check.

[0042] If so, add a timestamp to the first instruction;

[0043] After receiving the feedback instruction from the second protocol data frame, an integrity check is performed based on the hash value carried by the feedback instruction;

[0044] If the hash values ​​do not match, the second protocol data frame is resent.

[0045] A second aspect of the present invention provides a dynamic redundancy transmission system based on EtherCAT to Profinet, including a dynamic redundancy transmission method program based on EtherCAT to Profinet. When the EtherCAT to Profinet dynamic redundancy transmission method program is executed by the processor, it performs the following steps:

[0046] The first protocol data frame is obtained by receiving and converting data from the first protocol transceiver.

[0047] The first instruction is obtained by parsing the first protocol data frame based on the first protocol controller;

[0048] Based on the first instruction, determine the first priority;

[0049] Determine whether the first priority exceeds the priority threshold;

[0050] If so, the first instruction is written to the interrupt storage area;

[0051] If not, then write the first instruction to the polling memory area;

[0052] The second instruction is extracted from the interrupt storage area or the polling storage area;

[0053] Based on the preset mapping rule table, the second protocol data frame is obtained according to the second instruction;

[0054] In response to a feedback instruction in the second protocol data frame;

[0055] If a link anomaly is detected based on the feedback instruction, a redundant transmission port is activated.

[0056] This plan also includes:

[0057] Based on the opcode field, the first instruction is extracted to obtain the first opcode;

[0058] Based on a preset priority mapping table, the first priority is obtained according to the opcode field;

[0059] Determine whether the first priority exceeds the priority threshold;

[0060] If so, then based on the first priority, the interrupt priority information is determined and added to the end of the first instruction, and stored together in the interrupt storage area;

[0061] If not, insert it at the tail of the first-in-first-out queue in the polling storage area.

[0062] In this solution, the step of extracting the second instruction from the interrupt storage area or polling storage area specifically involves:

[0063] Determine whether the interrupt storage area is empty;

[0064] If not, then according to the interrupt priority, the second instruction is extracted sequentially in descending order;

[0065] If so, determine whether the polling storage area is empty;

[0066] If not, then the second instruction is obtained from the head of the first-in-first-out queue;

[0067] If so, then set the second instruction to the preset heartbeat instruction.

[0068] A third aspect of the present invention provides a computer-readable storage medium comprising a dynamic redundancy transmission method program based on EtherCAT to Profinet, wherein when the dynamic redundancy transmission method program based on EtherCAT to Profinet is executed by a processor, it implements the steps of the dynamic redundancy transmission method based on EtherCAT to Profinet as described in any of the preceding claims.

[0069] This invention provides a dynamic redundant transmission method, system, and storage medium based on EtherCAT to Profinet. The method involves parsing data frames using an EtherCAT protocol controller and determining operation priorities based on operation instructions. According to the operation priorities, the operation instructions are stored in the corresponding interrupt storage area or polling storage area. Based on a preset instruction extraction mechanism, a second instruction is extracted based on priority and mapped to the corresponding Profinet protocol data frame. Based on the link status of the feedback instructions in the Profinet protocol data frame, if a link anomaly is detected, a redundant transmission port is activated. This invention utilizes dual-zone instruction storage to prioritize critical instructions, meeting real-time requirements. Furthermore, it addresses the dual bottlenecks of bandwidth and reliability in industrial networks through a protocol mapping table. Attached Figure Description

[0070] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope.

[0071] Figure 1 A topology diagram based on EtherCAT to Profinet is shown;

[0072] Figure 2 A flowchart of a dynamic redundancy transmission method based on EtherCAT to Profinet according to the present invention is shown;

[0073] Figure 3A flowchart illustrating the priority mechanism provided in an embodiment of the present invention is shown.

[0074] Figure 4 This diagram illustrates a flowchart of extracting a second instruction according to an embodiment of the present invention;

[0075] Figure 5 A block diagram of a dynamic redundant transmission system based on EtherCAT to Profinet according to the present invention is shown. Detailed Implementation

[0076] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0077] Unless otherwise defined, all terms (including technical and scientific terms) used in embodiments of this invention shall have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in a common dictionary shall be interpreted as having a meaning consistent with their meaning in the context of the relevant art, and not as being interpreted in an idealized or highly formalized sense, unless expressly defined in this embodiment of the invention.

[0078] The terms "first," "second," and similar words used in the embodiments of this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "an," "a," or "the" do not indicate a quantity limitation, but rather indicate the presence of at least one. Similarly, terms such as "including" or "comprising" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The steps preceding or following the steps in the method of the embodiments of this invention are not necessarily performed precisely in sequence. Instead, various steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from these processes.

[0079] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0080] Figure 1A topology diagram based on EtherCAT to Profinet is shown. (See diagram below.) Figure 1 As shown:

[0081] The first protocol transceiver 101 is an EtherCAT protocol transceiver, which converts the transmitted and received data into electrical signals that conform to the EtherCAT physical layer specifications, and at the same time isolates and protects the EtherCAT protocol control circuit.

[0082] The first protocol controller 102 is an EtherCAT protocol controller, responsible for monitoring and managing the bus, sending or receiving data, and encoding or decoding data frames.

[0083] The common storage area 103 includes an interrupt storage area, a polling storage area, and a feedback storage area, and performs data reading and writing through a standard communication bus;

[0084] The first communication controller 104 is a Profinet master communication controller, responsible for monitoring and managing the Profinet bus, sending or receiving data, encoding or decoding data frames, converting the transmitted and received data into electrical signals that conform to the physical layer of the Profinet protocol, and isolating and protecting the Profinet protocol control circuit.

[0085] like Figure 2 As shown, the first aspect of this invention discloses a dynamic redundancy transmission method based on EtherCAT to Profinet, the method comprising:

[0086] S202, the first protocol data frame is obtained by receiving and converting data from the first protocol transceiver;

[0087] S204, based on the first protocol controller parsing the first protocol data frame, a first instruction is obtained;

[0088] S206, Determine the first priority according to the first instruction;

[0089] S208, determine whether the first priority exceeds the priority threshold;

[0090] S210, if so, then write the first instruction into the interrupt storage area;

[0091] S212, if not, then write the first instruction into the polling memory area;

[0092] S214, extract the second instruction based on the interrupt storage area or polling storage area;

[0093] S216, Based on the preset mapping rule table, the second protocol data frame is obtained according to the second instruction;

[0094] S218, responding to the feedback instruction of the second protocol data frame;

[0095] S220, if the link is determined to be abnormal according to the feedback instruction, the redundant transmission port is activated.

[0096] It should be noted that the first protocol data frame is EtherCAT protocol data; the first instruction is a parsed EtherCAT instruction; the second instruction is an instruction that needs to be converted to Profinet; and the second protocol data frame is EtherCAT protocol data.

[0097] In this embodiment, the EtherCAT transceiver first receives the raw electrical signal transmitted from the industrial bus, filters out electromagnetic interference using a built-in magnetic coupling isolation circuit, and converts it into a digital signal. The EtherCAT protocol controller parses the data frame structure, removes the frame header and checksum, and extracts the device control command as the first command. The central processing unit queries a preset priority mapping table based on the opcode field in the command. If a high-priority command is identified, a hardware interrupt is triggered and the command is written to a dedicated buffer queue in the interrupt storage area to ensure immediate response. If a low-priority command is identified, it is inserted into the tail of the first-in-first-out queue in the polling storage area to wait for sequential processing. The system first scans the interrupt storage area, extracts commands in descending priority order, processes the polling queue, and then converts the extracted second command into a protocol format using the EtherCAT-Profinet field mapping table to generate a Profinet data frame for transmission. If no feedback is received within a preset time or an abnormal transmission delay is detected, a link failure is determined, the current port is immediately disabled, and a backup fiber optic port is activated. This embodiment employs a dual-level storage strategy to ensure priority processing of high real-time instructions and avoid motion control blocking; furthermore, it achieves zero-configuration conversion based on a protocol field mapping table, reducing development complexity; and it also reduces network overhead by using feedback-triggered redundant switching to replace periodic detection.

[0098] Figure 3 A flowchart illustrating the priority mechanism provided by an embodiment of the present invention is shown.

[0099] According to embodiments of the present invention, such as Figure 3 As shown, it also includes:

[0100] S302, Based on the opcode field, extract the first instruction to obtain the first opcode;

[0101] S304, Based on the preset priority mapping table, the first priority is obtained according to the opcode field;

[0102] S306, determine whether the first priority exceeds the priority threshold;

[0103] S308, if so, then based on the first priority, determine the interrupt priority information, which is used to add to the end of the first instruction and store them together in the interrupt storage area;

[0104] S310, if not, insert into the tail of the first-in-first-out queue of the polling memory area.

[0105] It should be noted that the first opcode is a unique code for the control operation. This embodiment provides a priority determination mechanism. The central processing unit parses the opcode field of the first instruction and matches the instruction type based on a preset priority mapping table. As one implementation, motion control instructions are assigned a high priority level of 3, safety signals are assigned level 2, and status queries are assigned level 1. If the priority is ≥ level 2, an interrupt flag INT_LEVEL2 is added to the instruction and appended to the end of the instruction, and written to the corresponding LEVEL2 partition of the interrupt storage area; the high priority partition has exclusive processing rights. If the priority is < level 2, the instruction is inserted into the end of the first-in-first-out queue of the polling storage area. The interrupt flag contains a timestamp and priority code to ensure that interrupt processing is performed in the order of the flags; the polling queue only processes in batches when the central processing unit is idle, avoiding low-priority tasks blocking the real-time control flow. This embodiment automatically classifies priorities through opcodes, eliminating the need for manual configuration and significantly improving the system's adaptability; in addition, the interrupt flag is appended to the storage to retain the context, ensuring instruction integrity.

[0106] Figure 4 A flowchart illustrating an embodiment of the present invention for extracting a second instruction is shown.

[0107] According to embodiments of the present invention, such as Figure 4 As shown, the step of retrieving the second instruction from the interrupt storage area or polling storage area specifically involves:

[0108] S402, determine whether the interrupt storage area is empty;

[0109] S404, if not, then according to the interrupt priority, the second instruction is extracted sequentially in descending order;

[0110] S406, if so, determine whether the polling storage area is empty;

[0111] S408, if not, then extract the second instruction based on the head of the first-in-first-out queue;

[0112] S410, if so, then set the second instruction to the preset heartbeat instruction.

[0113] It should be noted that this embodiment provides a second instruction extraction mechanism. In this embodiment, the central processing unit scans the interrupt memory area at fixed intervals. If a non-empty state is detected, instructions are extracted from high to low priority according to the interrupt flag, with instructions of the same priority being processed in a first-in-first-out (FIFO) order based on timestamps. If the interrupt memory area is empty, the FIFO queue of the polling memory area is checked, and the instruction to be processed is extracted from the head of the queue. When both memory areas are empty, the system automatically generates a Profinet heartbeat instruction. As one implementation, the heartbeat instruction has a device address of 0xFFFF and an empty data field, and is sent through a backup port to maintain the link's active state and prevent the port from mistakenly judging the device as offline. After the extracted instructions are handed over to the protocol conversion module, the corresponding memory area location is cleared and the memory space is released. This design ensures that high real-time instructions are processed first, while the heartbeat keep-alive mechanism enhances system availability and avoids unexpected interruptions of the communication link.

[0114] According to an embodiment of the present invention, obtaining the second protocol data frame based on the second instruction according to the preset mapping rule table specifically involves:

[0115] Based on the opcode field, the second instruction is extracted to obtain the second opcode;

[0116] Based on the preset mapping rule table, the first device address is obtained according to the second opcode;

[0117] Determine whether the second opcode is an output opcode;

[0118] If so, then a second protocol data frame is generated based on the first device address;

[0119] If not, then determine the first data volume according to the second opcode;

[0120] Based on the feedback storage area, the first storage address is obtained according to the first data volume;

[0121] A second protocol data frame is generated based on the first device address and the first storage address.

[0122] It should be noted that this embodiment provides a process for generating a second protocol data frame. In this embodiment, the opcode field of the second instruction is parsed, a preset EtherCAT-Profinet mapping rule table is queried, and the target Profinet device address is determined. As one implementation, the opcode field 0xA002 corresponds to port IO-Device2. If the opcode is an output type, such as a motor output control operation, a Profinet output frame is directly constructed and filled with data values. If it is an input type, such as a sensor data reading operation, the amount of data to be read is determined according to the opcode, a temporary cache space is allocated in the dynamic allocation area of ​​the feedback storage area, and the starting address and data length are recorded. For input instructions, the generated Profinet input frame contains the target device address and a cache address pointer; when the port feeds back data, the result is written to the designated cache area according to the pointer within the frame for subsequent use by the central processing unit. This embodiment reduces data copying through address pointer passing and optimizes resource utilization through dynamic memory allocation.

[0123] According to an embodiment of the present invention, the step of activating a redundant transmission port when a link anomaly is determined based on the feedback instruction specifically includes:

[0124] Determine whether the feedback instruction has been received within the preset feedback time;

[0125] If not, it is marked as data loss. When the data is lost for a preset number of consecutive times, the current port is disabled and the backup port is activated.

[0126] If so, the receiving time is recorded. When the average receiving time within the preset window exceeds the time threshold, the system switches to the backup port.

[0127] It should be noted that this embodiment provides a redundant port switching mechanism. In this embodiment, a timer is started after sending a Profinet data frame. If no acknowledgment frame is received from the port within a preset time, a data loss is marked. When the number of consecutive data losses reaches a threshold, it is determined that the link is interrupted, the current faulty port is immediately disabled, and the physical layer backup port is activated. If an acknowledgment frame is received but the latency fluctuation is significant, the average transmission latency within the sliding window is calculated. When the average latency exceeds a safety threshold, a port switch is actively triggered, and the path table is updated. During the switchover process, unacknowledged data frames temporarily stored in the redundant queue of the public storage area are retransmitted through the new port. This embodiment combines packet loss statistics and latency analysis to achieve dual-dimensional fault determination, avoid false switching caused by momentary jitter, and improve transmission stability.

[0128] According to an embodiment of the present invention, it further includes:

[0129] After parsing the first protocol data frame, the system determines whether the transmission process of the first instruction is correct based on a preset CRC check.

[0130] If so, add a timestamp to the first instruction;

[0131] After receiving the feedback instruction from the second protocol data frame, an integrity check is performed based on the hash value carried by the feedback instruction;

[0132] If the hash values ​​do not match, the second protocol data frame is resent.

[0133] It should be noted that this embodiment provides a data transmission correctness verification process. In this embodiment, after parsing the original data frame, the EtherCAT protocol controller performs a CRC cyclic redundancy check. If the check fails, the data is discarded and a retransmission request is sent to the slave station. If the check passes, a high-precision timestamp is added to record the reception time. After receiving the feedback instruction, the Profinet communication controller performs a hash match based on the hash value at the end of the frame. If there is no match, the original data frame is retrieved from the historical cache in the common storage area and retransmitted. If the retransmission still fails, a redundant port switching mechanism is triggered. This dual-end verification mechanism ensures integrity from both transmission error and data tampering perspectives.

[0134] It is worth mentioning that it also includes:

[0135] If a surge fault is detected, the TVS diode clamping is triggered;

[0136] The drive magnetic coupler isolator disconnects the electrical connection of the faulty port;

[0137] Record the duration of the fault. If the duration exceeds a preset time threshold, switch to the redundant power supply module.

[0138] It should be noted that this embodiment provides a hardware fault isolation mechanism. A voltage sensor monitors the port level in real time. When a surge overvoltage is detected, a TVS diode clamps the voltage to a safe range within nanoseconds; simultaneously, a magnetic coupling isolator is triggered to disconnect the electrical connection of the faulty port. The system records the fault duration; if it exceeds a preset threshold, a power relay is driven to switch to a redundant power module. The background displays the faulty port isolation status and power switching progress in real time, and maintenance personnel can remotely reset it. This embodiment achieves physical isolation and energy redundancy for electrical faults, forming a hardware-level protection closed loop.

[0139] It is worth mentioning that a hot-swap mechanism is also included, specifically:

[0140] In response to a port access request, a second device address is set according to the port IP address;

[0141] Based on the preset device configuration template, the mapping rule table is updated according to the second device address.

[0142] It should be noted that this embodiment provides a port hot-plug mechanism. In this embodiment, when a new device is connected to a physical port, the Profinet DCP protocol automatically broadcasts a device discovery request; the gateway allocates an idle IP address and marks the port as "pending configuration". The central processing unit loads a pre-stored device configuration template, which includes an EtherCAT slave address mapping table, communication parameters, etc., and updates the global protocol mapping rule table according to the new IP address. The configuration information is synchronized to the device's local storage area, establishing a Profinet IO real-time data channel. This embodiment ensures device parameter consistency through configuration templates, reduces human error, and ensures zero interruption in the production chain.

[0143] Figure 5 A block diagram of a dynamic redundant transmission system based on EtherCAT to Profinet according to the present invention is shown.

[0144] like Figure 5 As shown, the second aspect of the present invention discloses a dynamic redundancy transmission system 5 based on EtherCAT to Profinet, including a memory 51 and a processor 52. The memory includes a dynamic redundancy transmission method program based on EtherCAT to Profinet. When the EtherCAT to Profinet dynamic redundancy transmission method program is executed by the processor, it performs the following steps:

[0145] The first protocol data frame is obtained by receiving and converting data from the first protocol transceiver.

[0146] The first instruction is obtained by parsing the first protocol data frame based on the first protocol controller;

[0147] Based on the first instruction, determine the first priority;

[0148] Determine whether the first priority exceeds the priority threshold;

[0149] If so, the first instruction is written to the interrupt storage area;

[0150] If not, then write the first instruction to the polling memory area;

[0151] The second instruction is extracted from the interrupt storage area or the polling storage area;

[0152] Based on the preset mapping rule table, the second protocol data frame is obtained according to the second instruction;

[0153] In response to a feedback instruction in the second protocol data frame;

[0154] If a link anomaly is detected based on the feedback instruction, a redundant transmission port is activated.

[0155] It should be noted that the first protocol data frame is EtherCAT protocol data; the first instruction is a parsed EtherCAT instruction; the second instruction is an instruction that needs to be converted to Profinet; and the second protocol data frame is EtherCAT protocol data.

[0156] In this embodiment, the EtherCAT transceiver first receives the raw electrical signal transmitted from the industrial bus, filters out electromagnetic interference using a built-in magnetic coupling isolation circuit, and converts it into a digital signal. The EtherCAT protocol controller parses the data frame structure, removes the frame header and checksum, and extracts the device control command as the first command. The central processing unit queries a preset priority mapping table based on the opcode field in the command. If a high-priority command is identified, a hardware interrupt is triggered and the command is written to a dedicated buffer queue in the interrupt storage area to ensure immediate response. If a low-priority command is identified, it is inserted into the tail of the first-in-first-out queue in the polling storage area to wait for sequential processing. The system first scans the interrupt storage area, extracts commands in descending priority order, processes the polling queue, and then converts the extracted second command into a protocol format using the EtherCAT-Profinet field mapping table to generate a Profinet data frame for transmission. If no feedback is received within a preset time or an abnormal transmission delay is detected, a link failure is determined, the current port is immediately disabled, and a backup fiber optic port is activated. This embodiment employs a dual-level storage strategy to ensure priority processing of high real-time instructions and avoid motion control blocking; furthermore, it achieves zero-configuration conversion based on a protocol field mapping table, reducing development complexity; and it also reduces network overhead by using feedback-triggered redundant switching to replace periodic detection.

[0157] According to an embodiment of the present invention, it further includes:

[0158] Based on the opcode field, the first instruction is extracted to obtain the first opcode;

[0159] Based on a preset priority mapping table, the first priority is obtained according to the opcode field;

[0160] Determine whether the first priority exceeds the priority threshold;

[0161] If so, then based on the first priority, the interrupt priority information is determined and added to the end of the first instruction, and stored together in the interrupt storage area;

[0162] If not, insert it at the tail of the first-in-first-out queue in the polling storage area.

[0163] It should be noted that the first opcode is a unique code for the control operation. This embodiment provides a priority determination mechanism. The central processing unit parses the opcode field of the first instruction and matches the instruction type based on a preset priority mapping table. As one implementation, motion control instructions are assigned a high priority level of 3, safety signals are assigned level 2, and status queries are assigned level 1. If the priority is ≥ level 2, an interrupt flag INT_LEVEL2 is added to the instruction and appended to the end of the instruction, and written to the corresponding LEVEL2 partition of the interrupt storage area; the high priority partition has exclusive processing rights. If the priority is < level 2, the instruction is inserted into the end of the first-in-first-out queue of the polling storage area. The interrupt flag contains a timestamp and priority code to ensure that interrupt processing is performed in the order of the flags; the polling queue only processes in batches when the central processing unit is idle, avoiding low-priority tasks blocking the real-time control flow. This embodiment automatically classifies priorities through opcodes, eliminating the need for manual configuration and significantly improving the system's adaptability; in addition, the interrupt flag is appended to the storage to retain the context, ensuring instruction integrity.

[0164] According to an embodiment of the present invention, the step of extracting the second instruction from the interrupt storage area or the polling storage area specifically includes:

[0165] Determine whether the interrupt storage area is empty;

[0166] If not, then according to the interrupt priority, the second instruction is extracted sequentially in descending order;

[0167] If so, determine whether the polling storage area is empty;

[0168] If not, then the second instruction is obtained from the head of the first-in-first-out queue;

[0169] If so, then set the second instruction to the preset heartbeat instruction.

[0170] It should be noted that this embodiment provides a second instruction extraction mechanism. In this embodiment, the central processing unit scans the interrupt memory area at fixed intervals. If a non-empty state is detected, instructions are extracted from high to low priority according to the interrupt flag, with instructions of the same priority being processed in a first-in-first-out (FIFO) order based on timestamps. If the interrupt memory area is empty, the FIFO queue of the polling memory area is checked, and the instruction to be processed is extracted from the head of the queue. When both memory areas are empty, the system automatically generates a Profinet heartbeat instruction. As one implementation, the heartbeat instruction has a device address of 0xFFFF and an empty data field, and is sent through a backup port to maintain the link's active state and prevent the port from mistakenly judging the device as offline. After the extracted instructions are handed over to the protocol conversion module, the corresponding memory area location is cleared and the memory space is released. This design ensures that high real-time instructions are processed first, while the heartbeat keep-alive mechanism enhances system availability and avoids unexpected interruptions of the communication link.

[0171] According to an embodiment of the present invention, obtaining the second protocol data frame based on the second instruction according to the preset mapping rule table specifically involves:

[0172] Based on the opcode field, the second instruction is extracted to obtain the second opcode;

[0173] Based on the preset mapping rule table, the first device address is obtained according to the second opcode;

[0174] Determine whether the second opcode is an output opcode;

[0175] If so, then a second protocol data frame is generated based on the first device address;

[0176] If not, then determine the first data volume according to the second opcode;

[0177] Based on the feedback storage area, the first storage address is obtained according to the first data volume;

[0178] A second protocol data frame is generated based on the first device address and the first storage address.

[0179] It should be noted that this embodiment provides a process for generating a second protocol data frame. In this embodiment, the opcode field of the second instruction is parsed, a preset EtherCAT-Profinet mapping rule table is queried, and the target Profinet device address is determined. As one implementation, the opcode field 0xA002 corresponds to port IO-Device2. If the opcode is an output type, such as a motor output control operation, a Profinet output frame is directly constructed and filled with data values. If it is an input type, such as a sensor data reading operation, the amount of data to be read is determined according to the opcode, a temporary cache space is allocated in the dynamic allocation area of ​​the feedback storage area, and the starting address and data length are recorded. For input instructions, the generated Profinet input frame contains the target device address and a cache address pointer; when the port feeds back data, the result is written to the designated cache area according to the pointer within the frame for subsequent use by the central processing unit. This embodiment reduces data copying through address pointer passing and optimizes resource utilization through dynamic memory allocation.

[0180] According to an embodiment of the present invention, the step of activating a redundant transmission port when a link anomaly is determined based on the feedback instruction specifically includes:

[0181] Determine whether the feedback instruction has been received within the preset feedback time;

[0182] If not, it is marked as data loss. When the data is lost for a preset number of consecutive times, the current port is disabled and the backup port is activated.

[0183] If so, the receiving time is recorded. When the average receiving time within the preset window exceeds the time threshold, the system switches to the backup port.

[0184] It should be noted that this embodiment provides a redundant port switching mechanism. In this embodiment, a timer is started after sending a Profinet data frame. If no acknowledgment frame is received from the port within a preset time, a data loss is marked. When the number of consecutive data losses reaches a threshold, it is determined that the link is interrupted, the current faulty port is immediately disabled, and the physical layer backup port is activated. If an acknowledgment frame is received but the latency fluctuation is significant, the average transmission latency within the sliding window is calculated. When the average latency exceeds a safety threshold, a port switch is actively triggered, and the path table is updated. During the switchover process, unacknowledged data frames temporarily stored in the redundant queue of the public storage area are retransmitted through the new port. This embodiment combines packet loss statistics and latency analysis to achieve dual-dimensional fault determination, avoid false switching caused by momentary jitter, and improve transmission stability.

[0185] According to an embodiment of the present invention, it further includes:

[0186] After parsing the first protocol data frame, the system determines whether the transmission process of the first instruction is correct based on a preset CRC check.

[0187] If so, add a timestamp to the first instruction;

[0188] After receiving the feedback instruction from the second protocol data frame, an integrity check is performed based on the hash value carried by the feedback instruction;

[0189] If the hash values ​​do not match, the second protocol data frame is resent.

[0190] It should be noted that this embodiment provides a data transmission correctness verification process. In this embodiment, after parsing the original data frame, the EtherCAT protocol controller performs a CRC cyclic redundancy check. If the check fails, the data is discarded and a retransmission request is sent to the slave station. If the check passes, a high-precision timestamp is added to record the reception time. After receiving the feedback instruction, the Profinet communication controller performs a hash match based on the hash value at the end of the frame. If there is no match, the original data frame is retrieved from the historical cache in the common storage area and retransmitted. If the retransmission still fails, a redundant port switching mechanism is triggered. This dual-end verification mechanism ensures integrity from both transmission error and data tampering perspectives.

[0191] It is worth mentioning that it also includes:

[0192] If a surge fault is detected, the TVS diode clamping is triggered;

[0193] The drive magnetic coupler isolator disconnects the electrical connection of the faulty port;

[0194] Record the duration of the fault. If the duration exceeds a preset time threshold, switch to the redundant power supply module.

[0195] It should be noted that this embodiment provides a hardware fault isolation mechanism. A voltage sensor monitors the port level in real time. When a surge overvoltage is detected, a TVS diode clamps the voltage to a safe range within nanoseconds; simultaneously, a magnetic coupling isolator is triggered to disconnect the electrical connection of the faulty port. The system records the fault duration; if it exceeds a preset threshold, a power relay is driven to switch to a redundant power module. The background displays the faulty port isolation status and power switching progress in real time, and maintenance personnel can remotely reset it. This embodiment achieves physical isolation and energy redundancy for electrical faults, forming a hardware-level protection closed loop.

[0196] It is worth mentioning that a hot-swap mechanism is also included, specifically:

[0197] In response to a port access request, a second device address is set according to the port IP address;

[0198] Based on the preset device configuration template, the mapping rule table is updated according to the second device address.

[0199] It should be noted that this embodiment provides a port hot-plug mechanism. In this embodiment, when a new device is connected to a physical port, the Profinet DCP protocol automatically broadcasts a device discovery request; the gateway allocates an idle IP address and marks the port as "pending configuration". The central processing unit loads a pre-stored device configuration template, which includes an EtherCAT slave address mapping table, communication parameters, etc., and updates the global protocol mapping rule table according to the new IP address. The configuration information is synchronized to the device's local storage area, establishing a Profinet IO real-time data channel. This embodiment ensures device parameter consistency through configuration templates, reduces human error, and ensures zero interruption in the production chain.

[0200] A third aspect of the present invention provides a computer-readable storage medium comprising a dynamic redundancy transmission method program based on EtherCAT to Profinet, wherein when the dynamic redundancy transmission method program based on EtherCAT to Profinet is executed by a processor, it implements the steps of the dynamic redundancy transmission method based on EtherCAT to Profinet as described in any of the preceding claims.

[0201] In summary, this invention provides a dynamic redundant transmission method, system, and storage medium based on EtherCAT to Profinet conversion. The method involves parsing data frames using an EtherCAT protocol controller and determining operation priorities based on operation instructions. According to the operation priorities, the operation instructions are stored in the corresponding interrupt storage area or polling storage area. Based on a preset instruction extraction mechanism, a second instruction is extracted based on priority and mapped to the corresponding Profinet protocol data frame. Based on the link status of the feedback instructions in the Profinet protocol data frame, if a link anomaly is detected, the redundant transmission port is activated. This invention utilizes dual-zone instruction storage to prioritize critical instructions, meeting real-time requirements. Furthermore, it addresses the dual bottlenecks of bandwidth and reliability in industrial networks through a protocol mapping table.

[0202] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0203] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A dynamic redundancy transmission method based on EtherCAT to Profinet, characterized in that, The method includes: The first protocol data frame is obtained by receiving and converting data from the first protocol transceiver. The first instruction is obtained by parsing the first protocol data frame based on the first protocol controller; Based on the first instruction, determine the first priority; Determine whether the first priority exceeds the priority threshold; If so, the first instruction is written to the interrupt storage area; If not, then write the first instruction to the polling memory area; The second instruction is extracted from the interrupt storage area or the polling storage area; Based on the preset mapping rule table, the second protocol data frame is obtained according to the second instruction; In response to a feedback instruction in the second protocol data frame; If a link anomaly is detected based on the feedback instruction, a redundant transmission port is activated.

2. The dynamic redundancy transmission method based on EtherCAT to Profinet according to claim 1, characterized in that, Also includes: Based on the opcode field, the first instruction is extracted to obtain the first opcode; Based on a preset priority mapping table, the first priority is obtained according to the opcode field; Determine whether the first priority exceeds the priority threshold; If so, then based on the first priority, the interrupt priority information is determined and added to the end of the first instruction, and stored together in the interrupt storage area; If not, insert it at the tail of the first-in-first-out queue in the polling storage area.

3. The dynamic redundancy transmission method based on EtherCAT to Profinet according to claim 2, characterized in that, The step of extracting the second instruction from the interrupt storage area or polling storage area specifically involves: Determine whether the interrupt storage area is empty; If not, then according to the interrupt priority, the second instruction is extracted sequentially in descending order; If so, determine whether the polling storage area is empty; If not, then the second instruction is obtained from the head of the first-in-first-out queue; If so, then set the second instruction to the preset heartbeat instruction.

4. The dynamic redundancy transmission method based on EtherCAT to Profinet according to claim 1, characterized in that, The second protocol data frame is obtained based on the preset mapping rule table and according to the second instruction, specifically as follows: Based on the opcode field, the second instruction is extracted to obtain the second opcode; Based on the preset mapping rule table, the first device address is obtained according to the second opcode; Determine whether the second opcode is an output opcode; If so, then a second protocol data frame is generated based on the first device address; If not, then determine the first data volume according to the second opcode; Based on the feedback storage area, the first storage address is obtained according to the first data volume; A second protocol data frame is generated based on the first device address and the first storage address.

5. The dynamic redundancy transmission method based on EtherCAT to Profinet according to claim 1, characterized in that, When a link anomaly is determined based on the feedback instruction, the redundant transmission port is activated, specifically including: Determine whether the feedback instruction has been received within the preset feedback time; If not, it is marked as data loss. When the data is lost for a preset number of consecutive times, the current port is disabled and the backup port is activated. If so, the receiving time is recorded. When the average receiving time within the preset window exceeds the time threshold, the system switches to the backup port.

6. The dynamic redundancy transmission method based on EtherCAT to Profinet according to claim 1, characterized in that, Also includes: After parsing the first protocol data frame, the system determines whether the transmission process of the first instruction is correct based on a preset CRC check. If so, add a timestamp to the first instruction; After receiving the feedback instruction from the second protocol data frame, an integrity check is performed based on the hash value carried by the feedback instruction; If the hash values ​​do not match, the second protocol data frame is resent.

7. A dynamic redundancy transmission system based on EtherCAT to Profinet, characterized in that, The system includes a memory and a processor. The memory includes a program for a dynamic redundancy transfer method based on EtherCAT to Profinet. When the processor executes the program for the dynamic redundancy transfer method based on EtherCAT to Profinet, it performs the following steps: The first protocol data frame is obtained by receiving and converting data from the first protocol transceiver. The first instruction is obtained by parsing the first protocol data frame based on the first protocol controller; Based on the first instruction, determine the first priority; Determine whether the first priority exceeds the priority threshold; If so, the first instruction is written to the interrupt storage area; If not, then write the first instruction to the polling memory area; The second instruction is extracted from the interrupt storage area or the polling storage area; Based on the preset mapping rule table, the second protocol data frame is obtained according to the second instruction; In response to a feedback instruction in the second protocol data frame; If a link anomaly is detected based on the feedback instruction, a redundant transmission port is activated.

8. A dynamic redundancy transmission system based on EtherCAT to Profinet according to claim 7, characterized in that, Also includes: Based on the opcode field, the first instruction is extracted to obtain the first opcode; Based on a preset priority mapping table, the first priority is obtained according to the opcode field; Determine whether the first priority exceeds the priority threshold; If so, then based on the first priority, the interrupt priority information is determined and added to the end of the first instruction, and stored together in the interrupt storage area; If not, insert it at the tail of the first-in-first-out queue in the polling storage area.

9. A dynamic redundancy transmission system based on EtherCAT to Profinet according to claim 8, characterized in that, The step of extracting the second instruction from the interrupt storage area or polling storage area specifically involves: Determine whether the interrupt storage area is empty; If not, then according to the interrupt priority, the second instruction is extracted sequentially in descending order; If so, determine whether the polling storage area is empty; If not, then the second instruction is obtained from the head of the first-in-first-out queue; If so, then set the second instruction to the preset heartbeat instruction.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer-readable storage medium includes a dynamic redundancy transmission method program based on EtherCAT to Profinet. When the EtherCAT to Profinet dynamic redundancy transmission method program is executed by a processor, it implements the steps of the dynamic redundancy transmission method based on EtherCAT to Profinet as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • TCP-to-EtherCAT gateway with high real-time performance and high reliability

    CN118740552A

  • Fuzzy dynamic scheduling data communication detection system based on virtual-real interaction scene

    CN120186238A