Data interaction method, device, system and equipment for multi-node device transmission

Through shared memory and direct memory access mechanisms, EtherCAT master station devices and multiple slave stations achieve high-speed parallel communication, solving the data interaction efficiency problem of traditional control card architecture under high load, improving the real-time performance and communication efficiency of the system, and making it suitable for collaborative control scenarios of complex multi-node devices.

CN120675835BActive Publication Date: 2025-11-18SHENZHEN XINYICHANG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511171707.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-21
Publication Date
2025-11-18
Estimated Expiration
2045-08-21

AI Technical Summary

Technical Problem

Existing automated control systems struggle to maintain stable and low-latency control cycles under high loads. Traditional motion control cards have fixed architectures, making it difficult to handle the parallel data interaction requirements in complex scenarios. Furthermore, data transmission between the host computer and the control card suffers from efficiency bottlenecks, affecting system response speed and real-time control capabilities.

Method used

By using shared memory and direct memory access mechanisms, high-speed parallel communication and efficient data interaction between EtherCAT master devices and multiple slave devices are achieved. This includes parsing host computer instructions and constructing EtherCAT communication frames in shared memory, sending them to multiple slave devices in parallel, and using direct memory access mechanisms to quickly transmit feedback data to the host computer, avoiding resource consumption and response delays.

Benefits of technology

It significantly improves the system's real-time performance and control response capabilities, reduces transmission latency, increases bus bandwidth utilization and overall communication efficiency, and enhances the data collaboration capabilities between system modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120675835B_ABST
    Figure CN120675835B_ABST
Patent Text Reader

Abstract

The application is suitable for the field of motion control technology, and provides a data interaction method, device, system and equipment for multi-node equipment transmission, which is applied to an EtherCAT master station equipment. The data interaction method for multi-node equipment transmission comprises the following steps: receiving a control instruction from an upper computer through a host communication interface, analyzing the control instruction, and storing the analyzed instruction data into a shared memory; constructing an EtherCAT communication frame based on the instruction data in the shared memory, and sending the EtherCAT communication frame to a plurality of slave station equipments in parallel; receiving data frames returned by the plurality of slave station equipments, and writing the data frames into the shared memory; and transmitting the data frames in the shared memory to a mapping space of the host communication interface in a direct memory access mode, so as to realize real-time access by the upper computer. The above scheme realizes efficient data interaction between the EtherCAT master station equipment and the multi-node slave stations, and significantly improves the control response capability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of motion control technology, and in particular relates to a data interaction method, apparatus, system and device for multi-node device transmission. Background Technology

[0002] Existing automated control systems generally rely on network-based motion control cards to achieve unified control of multi-axis devices, typically using industrial bus protocols such as Modbus, PROFIBUS, CANopen, and EtherCAT for master-slave communication. Among these protocols, EtherCAT is widely used in industrial applications requiring multi-node, precision collaborative control due to its high-speed transmission capabilities and high-precision synchronization characteristics. The control card, acting as the master device, needs to send control data to multiple slave nodes and wait for status information from the slaves. However, in actual system operation, as the number of connected slaves increases, the overall communication path lengthens, and the latency in data frame transmission and return accumulates. Furthermore, because the bus communication cycle must balance data volume and protocol logic processing time, the system struggles to maintain a stable and low-latency control cycle under high load. Most traditional motion control cards have fixed architectures, typically supporting only a single master communication mode, making it difficult to handle the parallel data interaction requirements of complex scenarios. Simultaneously, limited by interface structure and processing capabilities, data transmission between the host computer and the control card suffers from efficiency bottlenecks, hindering high-speed command interaction and feedback, thus affecting system response speed and real-time control capabilities. Summary of the Invention

[0003] In view of this, embodiments of this application provide a data interaction method, apparatus, system and device for multi-node device transmission. Through shared memory and direct memory access mechanisms, high-speed parallel communication and efficient data interaction between EtherCAT master station device and multiple node slave stations are realized, significantly improving the real-time performance and control response capability of the system.

[0004] A first aspect of this application provides a data interaction method for multi-node device transmission, applied to an EtherCAT master station device, wherein the EtherCAT master station device is connected to a host computer via a host communication interface, and the data interaction method for multi-node device transmission includes:

[0005] The system receives control commands from the host computer through the host communication interface, parses the control commands, and stores the parsed command data in shared memory.

[0006] EtherCAT communication frames are constructed based on the instruction data in the shared memory and sent in parallel to the corresponding multiple slave devices.

[0007] Receive data frames returned by the plurality of slave devices and write the data frames into the shared memory;

[0008] Data frames in the shared memory are transmitted to the mapping space of the host communication interface via direct memory access, so that the host computer can access them in real time.

[0009] The data interaction method for multi-node device transmission provided in this application receives and parses host computer control commands through the host communication interface and writes the parsing results into shared memory. This avoids resource consumption and response delays caused by frequent interruptions or data copying in traditional methods, thus improving command processing efficiency. Subsequently, an EtherCAT communication frame is constructed based on the command data in the shared memory and sent to multiple slave devices in parallel through multiple master stations. Compared with the traditional single-master serial communication structure, this effectively reduces transmission latency and improves bus bandwidth utilization. After receiving the data frames returned by the slave devices, they are uniformly written into the shared memory, facilitating unified processing and status analysis by subsequent modules and enhancing the data collaboration capability between system modules. Finally, the feedback data in the shared memory is transmitted at high speed to the mapping space of the host communication interface using the direct memory access (DMA) mechanism, enabling data to be quickly uploaded to the host computer without consuming CPU resources, further improving overall communication efficiency and system response speed.

[0010] In one possible implementation, the EtherCAT master station device includes an instruction control and system data feedback module. The module receives control instructions from the host computer via the host communication interface, parses the control instructions, and stores the parsed instructions in shared memory, including:

[0011] The instruction control and system data feedback module reads the control instructions sent by the host computer through the host communication interface;

[0012] The control commands are parsed to determine the command type and command module;

[0013] According to the instruction type and the instruction module, the parsed instruction data is written into the corresponding storage area of ​​the shared memory, so as to wake up the instruction module to retrieve instruction data from the shared memory through software interrupt.

[0014] In one possible implementation, the instruction module is at least one of a motion planning module and a network bus module; the data interaction method for multi-node device transmission further includes:

[0015] If the instruction type is a motion instruction, then the instruction module is determined to be the motion planning module;

[0016] If the instruction type is a communication instruction, then the instruction module is determined to be the network bus module.

[0017] In one possible implementation, the instruction data is stored in a first storage area based on the instruction type, the first storage area corresponding to the motion planning module; the step of constructing an EtherCAT communication frame based on the instruction data in the shared memory and sending it in parallel to multiple corresponding slave devices includes:

[0018] The motion planning module reads instruction data from the first storage area in the shared memory, generates target motion data for motion control, and writes the target motion data back to the second storage area in the shared memory.

[0019] The target motion data is read from the second storage area in the shared memory through the network bus module, and the target motion data is encapsulated into an EtherCAT communication frame based on the EtherCAT protocol.

[0020] The network bus module sends the EtherCAT communication frames to multiple corresponding slave devices through multiple parallel coprocessors.

[0021] In one possible implementation, the data frame includes real-time feedback data and non-real-time feedback data; the step of transmitting the data frame in shared memory to the host communication interface mapping space via direct memory access for real-time access by the host computer includes:

[0022] The instruction control and system data feedback module sends the real-time feedback data in the shared memory to the mapping space of the host communication interface through a periodic feedback channel, so that the host computer can access it in real time; and / or

[0023] The instruction control and system data feedback module performs an active scan to determine whether the non-real-time feedback data exists in the shared memory.

[0024] If the non-real-time feedback data exists, it is sent to the mapping space of the host communication interface through the non-periodic feedback channel for the host computer to access in real time.

[0025] A second aspect of this application provides a data interaction method for multi-node device transmission, applied to a host computer, wherein the host computer is connected to an EtherCAT master station device through a host communication interface, and the data interaction method for multi-node device transmission includes:

[0026] The system generates control commands and sends them to the EtherCAT master station device via the host communication interface.

[0027] The data frames returned by multiple slave devices and uploaded by the EtherCAT master device via direct memory access are obtained in real time from the mapping space of the host communication interface.

[0028] The acquired data frames are parsed to obtain the real-time status information of the multiple slave devices.

[0029] A third aspect of this application provides a data interaction method for multi-node device transmission, applied to a slave device connected to an EtherCAT master device; the data interaction method for multi-node device transmission includes:

[0030] Receive EtherCAT communication frames sent in parallel by the EtherCAT master station device, and parse the EtherCAT communication frames to obtain instruction data;

[0031] Execute the corresponding action according to the instruction data, and construct a data frame from the device status and execution result data after the corresponding action is executed;

[0032] The data frame is sent back to the EtherCAT master station device via the EtherCAT protocol.

[0033] A fourth aspect of this application provides a data interaction device for multi-node device transmission, configured on an EtherCAT master station device, wherein the EtherCAT master station device is connected to a host computer via a host communication interface, and the data interaction device for multi-node device transmission includes:

[0034] The instruction receiving module receives control instructions from the host computer through the host communication interface, parses the control instructions, and stores the parsed instruction data in shared memory.

[0035] The sending module is used to construct EtherCAT communication frames based on the instruction data in the shared memory and send them in parallel to multiple corresponding slave devices;

[0036] A memory writing module is used to receive data frames returned by the plurality of slave devices and write the data frames into the shared memory;

[0037] The data transmission module is used to transmit data frames in the shared memory to the mapping space of the host communication interface via direct memory access, so that the host computer can access them in real time.

[0038] A fifth aspect of this application provides a data interaction system for multi-node device transmission, the data interaction system for multi-node device transmission includes a host computer, an EtherCAT master station device, and multiple slave station devices; the EtherCAT master station device is connected to the host computer through a host communication interface, and the multiple slave station devices are connected to the EtherCAT master station device;

[0039] The host computer is used to generate control commands and send them to the EtherCAT master station device through the host communication interface; it also acquires data frames returned by multiple slave devices uploaded by the EtherCAT master station device through direct memory access from the mapping space of the host communication interface in real time; and it parses the acquired data frames to obtain the real-time status information of the multiple slave devices.

[0040] The EtherCAT master station device is configured to receive control commands from the host computer via the host communication interface, parse the control commands, and store the parsed command data in shared memory; construct EtherCAT communication frames based on the command data in the shared memory, and send them in parallel to multiple corresponding slave devices; receive data frames returned by the multiple slave devices, and write the data frames into the shared memory; and transmit the data frames in the shared memory to the mapping space of the host communication interface via direct memory access for real-time access by the host computer.

[0041] The slave device is configured to receive EtherCAT communication frames sent in parallel by the EtherCAT master device, parse the EtherCAT communication frames to obtain instruction data, execute corresponding actions according to the instruction data, and construct a data frame from the device status and execution result data after executing the corresponding actions; and send the data frame back to the EtherCAT master device via the EtherCAT protocol.

[0042] A sixth aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in the first aspect above, or the steps of the method described in the second aspect above, or the steps of the method described in the third aspect above.

[0043] A seventh aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above, or the steps of the method described in the second aspect above, or the steps of the method described in the third aspect above.

[0044] An eighth aspect of this application provides a computer program product that, when run on an electronic device, causes the electronic device to perform the steps of the method described in the first aspect, or the steps of the method described in the second aspect, or the steps of the method described in the third aspect. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is a schematic diagram of the structure of a data interaction system for multi-node device transmission provided in an embodiment of this application;

[0047] Figure 2 This is a schematic diagram of another data interaction system for multi-node device transmission provided in an embodiment of this application;

[0048] Figure 3 This is a flowchart illustrating a data interaction method for multi-node device transmission provided in an embodiment of this application;

[0049] Figure 4 This is a flowchart illustrating another data interaction method for multi-node device transmission provided in an embodiment of this application;

[0050] Figure 5 This is a flowchart illustrating another data interaction method for multi-node device transmission provided in an embodiment of this application;

[0051] Figure 6 This is a schematic diagram of the structure of a data interaction device for multi-node device transmission provided in an embodiment of this application;

[0052] Figure 7 This is a schematic diagram of another data interaction device for multi-node device transmission provided in an embodiment of this application;

[0053] Figure 8 This is a schematic diagram of another data interaction device for multi-node device transmission provided in the embodiments of this application;

[0054] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0055] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0056] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.

[0057] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0058] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."

[0059] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0060] It should be understood that the sequence number of each step in this embodiment does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.

[0061] Existing automated control systems generally rely on network-based motion control cards to achieve unified control of multi-axis devices, typically using industrial bus protocols such as Modbus, PROFIBUS, CANopen, and EtherCAT for master-slave communication. Among these protocols, EtherCAT is widely used in industrial applications requiring multi-node, precision collaborative control due to its high-speed transmission capabilities and high-precision synchronization characteristics. The control card, acting as the master device, needs to send control data to multiple slave nodes and wait for status information from the slaves. However, in actual system operation, as the number of connected slaves increases, the overall communication path lengthens, and the latency in data frame transmission and return accumulates. Furthermore, because the bus communication cycle must balance data volume and protocol logic processing time, the system struggles to maintain a stable and low-latency control cycle under high load. Most traditional motion control cards have fixed architectures, typically supporting only a single master communication mode, making it difficult to handle the parallel data interaction requirements of complex scenarios. Simultaneously, limited by interface structure and processing capabilities, data transmission between the host computer and the control card suffers from efficiency bottlenecks, hindering high-speed command interaction and feedback, thus affecting system response speed and real-time control capabilities.

[0062] To address the aforementioned issues, this application provides a data interaction method, apparatus, system, and device for multi-node device transmission. It can receive and parse host computer control commands through the host communication interface and write the parsing results into shared memory, avoiding resource consumption and response delays caused by frequent interruptions or data copying in traditional methods, thus improving command processing efficiency. Subsequently, an EtherCAT communication frame is constructed based on the command data in the shared memory and sent in parallel to multiple slave devices via multiple master stations. Compared to the traditional single-master serial communication structure, this effectively reduces transmission latency and improves bus bandwidth utilization. After receiving data frames returned by slave devices, they are uniformly written into shared memory for unified processing and status analysis by subsequent modules, enhancing data collaboration capabilities between system modules. Finally, the feedback data in shared memory is rapidly transmitted to the mapping space of the host communication interface using a direct memory access (DMA) mechanism, enabling data to be quickly uploaded to the host computer without consuming CPU resources, further improving overall communication efficiency and system response speed.

[0063] The following description, with reference to the accompanying drawings, details the data interaction method, apparatus, system, device, storage medium, and computer program for multi-node device transmission provided in the embodiments of this application.

[0064] Figure 1This illustration shows a schematic diagram of a data interaction system for multi-node device transmission according to an embodiment of this application. The system includes a host computer, an EtherCAT master station, and multiple slave stations. The EtherCAT master station connects to the host computer via a host communication interface and to the multiple slave stations via multiple parallel EtherCAT communication links. For example, the EtherCAT master station can interact with the host computer via a PCIe high-speed communication interface. The PCIe interface employs memory mapping technology to ensure high-speed and low-latency data transmission.

[0065] In this embodiment, the host computer first generates control commands and sends them to the EtherCAT master device via the host communication interface. The EtherCAT master device receives the control commands from the host computer via the host communication interface, parses the commands, and stores the parsed command data in shared memory. Based on the command data in shared memory, it constructs EtherCAT communication frames and sends them in parallel to multiple corresponding slave devices. The multiple slave devices receive the EtherCAT communication frames sent in parallel by the EtherCAT master device, parse the EtherCAT communication frames to obtain command data, execute corresponding actions according to the command data, and construct data frames from the device status and execution results after executing the corresponding actions. The data frames are then sent back to the EtherCAT master device via the EtherCAT protocol.

[0066] Secondly, the EtherCAT master device receives data frames returned by multiple slave devices and writes the data frames into shared memory; it then transmits the data frames in shared memory to the mapping space of the host communication interface through direct memory access.

[0067] Finally, the host computer obtains data frames returned by multiple slave devices uploaded by the EtherCAT master device via direct memory access (DMA) in real time from the mapping space of the host communication interface; it parses the obtained data frames to obtain the real-time status information of multiple slave devices, thus completing the entire data interaction process.

[0068] Specifically, in this data interaction system, the modular design of the EtherCAT master station device has enabled the optimization of the entire process from the distribution of host computer instructions, generation of motion data, construction and transmission of communication frames, feedback data transmission from slave stations, to real-time access to host computer data. This effectively solves the technical problems of high data latency and low communication efficiency in the traditional EtherCAT single master station architecture when dealing with a large number of node devices, and significantly improves the data processing capability and control accuracy of the automation system.

[0069] It should be noted that, in one possible implementation, the EtherCAT master station device may further include an instruction control and system data feedback module, a motion planning module, and a network bus module, with the modules achieving efficient data interaction through shared memory.

[0070] Specifically, see Figure 2 The illustrated embodiment of this application provides a schematic diagram of another data interaction system for multi-node device transmission. The EtherCAT master station device may further include an instruction control and system data feedback module, a motion planning module, and a network bus module. The network bus module contains multiple (only four are shown in the figure) completely independent and parallel-transmitting EtherCAT master station devices. Each master station device includes an EtherCAT data processing unit and a coprocessor. Each coprocessor actually contains two completely independent sub-coprocessors, used for sending and receiving network data respectively, specifically named Coprocessor 1 (for network sending) and Coprocessor 2 (for network receiving).

[0071] The instruction control and system data feedback module is equipped with a PC instruction control layer, a system periodic feedback layer, and a system aperiodic feedback layer. Through a three-layer time-division multiplexing DMA transfer mechanism, it enables reading and writing of the PCIe interface mapped memory, achieving 100% PCIe communication utilization and near-zero communication processing overhead.

[0072] Specifically: The PC instruction control layer is used to receive and parse control instructions from the host computer, and distribute the parsed instruction data to the network bus module and motion planning module through shared memory. Among them, the motion-related instruction data is processed by waking up the motion planning module in real time through software interrupt; the communication-related instruction data is processed by waking up the network bus module.

[0073] The system's periodic feedback layer uses shared memory and DMA mechanisms to periodically transfer motion data generated by the motion planning module and network data from the network bus module to the PCIe interface mapped memory area.

[0074] The system's non-periodic feedback layer actively scans shared memory to determine if non-real-time data exists. If it does, the non-real-time data is transferred to the PCIe interface mapped memory region via DMA.

[0075] In the motion planning module, upon receiving a software interruption notification, network data from the network bus module is obtained through shared memory. This data is then combined with the parsed instructions to plan the motion trajectory. Once the planning is complete, the motion planning data is rewritten into the shared memory.

[0076] In the network bus module, each EtherCAT data processing unit first obtains the motion-planned data through shared memory and performs master station logic processing. The processed network data is then transmitted to coprocessor 1 via shared memory for network data transmission. Coprocessor 2 receives the network data returned by the slave devices and sends the received data back to the EtherCAT data processing unit for processing. The processed data is then written back to shared memory for the motion planning module and the instruction control and system data feedback module to obtain with zero overhead.

[0077] Through the design of the above modular structure and data processing flow, this embodiment effectively realizes efficient parallel processing and real-time data interaction within the EtherCAT master station device, significantly reduces system communication latency, improves data transmission efficiency and overall control performance, and is especially suitable for collaborative control scenarios of complex multi-node devices.

[0078] See Figure 3 This illustration shows a flowchart of a data interaction method for multi-node device transmission provided in an embodiment of this application. This data interaction method is applied to the EtherCAT master station device in the aforementioned data interaction system. Figure 3 As shown, the method may include the following steps:

[0079] Step 301: Receive control commands from the host computer through the host communication interface, parse the control commands, and store the parsed command data in shared memory.

[0080] The host communication interface refers to the physical channel for data exchange between the host computer and the main station device. Specifically, it can be implemented using a PCIe or USB 3.0 interface to achieve high-speed data transmission and reduce the delay in command issuance and feedback.

[0081] Shared memory refers to a common storage area accessible to different modules within the EtherCAT master station device. Specifically, it can be implemented using dual-port RAM or memory mapping technology to eliminate multiple copies during data transfer between modules and improve instruction parsing and forwarding efficiency.

[0082] In this embodiment, the EtherCAT master station receives control commands sent by the host computer through the host communication interface. Upon receiving the commands, the master station parses them and extracts key information. The parsed command data is stored in shared memory. This method avoids frequent data copying operations and improves data processing efficiency.

[0083] For example, the EtherCAT master station device is equipped with a high-speed host communication interface, such as a PCIe interface, for data interaction with a host computer. The master station device integrates a multi-core processor and a large-capacity shared memory. When the host computer needs to control a slave device, it sends control commands to the EtherCAT master station device through the host communication interface. After receiving the command, the EtherCAT master station device uses a dedicated command parsing module to parse it. The parsing process includes identifying the command type, extracting the target slave address, and parsing specific control parameters. After parsing, the command data is written to a designated area of ​​the shared memory.

[0084] It should be noted that different types of instruction data are typically written to different areas of shared memory.

[0085] In one possible implementation, the EtherCAT master station device includes a command control and system data feedback module, which receives control commands from a host computer via a host communication interface, parses the control commands, and stores the parsed commands in shared memory, including:

[0086] The instruction control and system data feedback module reads the control instructions sent by the host computer through the host communication interface;

[0087] The control commands are parsed to determine the command type and command module;

[0088] Based on the instruction type and instruction module, the parsed instruction data is written to the corresponding storage area of ​​shared memory, so that the instruction module can be woken up by a software interrupt to retrieve instruction data from shared memory.

[0089] In this embodiment, the instruction control and system data feedback module is provided with a PC instruction control layer, a system periodic feedback layer and a system aperiodic feedback layer, and transmits different types of data through a three-layer time-division multiplexing DMA transmission mechanism.

[0090] Specifically, the control instructions are parsed to determine the instruction type and module. This can be achieved through instruction type identification, which involves parsing the identifier field in the instruction header. For example, the identifier field is 4 bytes long and may include the corresponding instruction module encoding information. The shared memory storage area can be divided according to modules, for example, into a first storage area and a second storage area, each corresponding to a different instruction module. Finally, a software interrupt is used to wake up the instruction module and retrieve instruction data from the corresponding storage area in the shared memory.

[0091] For example, the control commands sent by the host computer are first intercepted by the command control and system data feedback module, and then parsed by the hardware accelerator to extract the command module encoding information from the command header identifier field. After parsing, the command data is written to the dedicated storage area of ​​the corresponding module according to the preset address mapping table. For example, motion commands are written to the first storage area of ​​the motion planning module. When the data writing operation is completed, the hardware trigger automatically sets the completion flag bit of the storage area, triggering an interrupt signal with a priority of Level-1. The awakened motion planning module directly accesses the first storage area through the memory controller to obtain the motion commands.

[0092] During this process, the storage areas of different modules are physically separated through a memory isolation mechanism to prevent out-of-bounds data access. For example, the network bus module can only access the address range starting at 0x2000 when reading data, while the motion planning module's access permissions are restricted to the address range 0x1000. This mechanism effectively eliminates the risk of data contention between modules, allowing multiple modules to process instruction data in their respective dedicated storage areas in parallel, increasing the overall instruction processing throughput to over 5000 instructions per second.

[0093] In the data interaction system provided in this application, the instruction module can refer to at least one of a motion planning module and a network bus module; in the process of identifying the instruction module, the specific identification action can be: if the instruction type is a motion instruction, then the instruction module is determined to be a motion planning module; if the instruction type is a communication instruction, then the instruction module is determined to be a network bus module.

[0094] Step 302: Construct an EtherCAT communication frame based on the instruction data in the shared memory and send it in parallel to the corresponding multiple slave devices.

[0095] Parallel transmission to multiple corresponding slave devices refers to distributing communication frames to different slave devices simultaneously. This can be achieved using a multi-channel coprocessor or independent communication channels to reduce waiting time on the bus transmission path and avoid the accumulation of delays caused by serial transmission of data frames.

[0096] In this embodiment, the EtherCAT master device constructs EtherCAT communication frames based on instruction data in shared memory. Each communication frame contains instruction information and the address of the target slave device. After construction, the EtherCAT master device simultaneously sends these communication frames to the corresponding slave devices through multiple parallel communication channels. This parallel transmission mechanism significantly reduces data transmission time.

[0097] For example, the data processing unit of the EtherCAT master device reads instruction data from shared memory and constructs communication frames according to the EtherCAT protocol specification. Each communication frame includes fields such as a frame header, the target slave address, and instruction data. The constructed communication frames are distributed to multiple parallel coprocessors. The sub-coprocessors within the coprocessors, used for sending data, simultaneously send the communication frames to their respective slave devices.

[0098] In one possible implementation, if the instruction data is a motion instruction, it is stored in a first storage area based on the instruction type, and the first storage area corresponds to the motion planning module; constructing an EtherCAT communication frame based on the instruction data in shared memory and sending it in parallel to multiple corresponding slave devices may include:

[0099] The motion planning module reads instruction data from the first storage area in shared memory, generates target motion data for motion control, and writes the target motion data back to the second storage area in shared memory.

[0100] The target motion data is read from the second storage area in the shared memory through the network bus module, and the target motion data is encapsulated into EtherCAT communication frames based on the EtherCAT protocol.

[0101] The EtherCAT communication frames are sent to multiple corresponding slave devices via multiple parallel coprocessors through the network bus module.

[0102] The correspondence between the first storage area and the motion planning module can be achieved through memory address mapping or software interrupt mechanisms. For example, the first storage area can be designated as a dedicated storage area for the motion planning module. The generation process of target motion data may include coordinate transformation, velocity planning, etc., such as converting Cartesian coordinates into joint angle data. The second storage area can be designated as a dedicated storage area for the network bus module.

[0103] The parallel distribution of multiple coprocessors in the network bus module can adopt a multi-threaded scheduling mechanism. Each thread corresponds to one coprocessor instance. The number of coprocessors can maintain a 1:1 or 1:N ratio with the number of slave devices. For example, four coprocessors can be configured to manage eight slave devices.

[0104] Specifically, after the motion planning module reads the raw instruction data from the first storage area, it performs kinematic calculations to generate target motion data, such as converting the trajectory instructions of the robotic arm end effector issued by the host computer into position instructions for each joint axis. The generated target motion data is written to the second storage area. The network bus module obtains the target motion data from the second storage area through polling or event triggering, and encapsulates it into a data frame structure conforming to the EtherCAT protocol, such as adding command code and slave address information to the data frame header. The encapsulated communication frame is distributed to multiple coprocessors, each coprocessor independently managing the communication timing of its corresponding slave device, for example, using time-division multiplexing to complete the data transmission of 8 slaves within a 1ms communication cycle. Through the decoupling design of motion control and communication processing, the raw instruction parsing and protocol encapsulation operations are separated and executed by different modules, avoiding blocking of the data processing link. At the same time, the parallel distribution mechanism of the coprocessors improves the communication bandwidth utilization by more than 30%. In a test scenario with 8 slave devices, the end-to-end communication latency is reduced from 2.1ms in the traditional single-threaded mode to 0.8ms.

[0105] Through the above technical solution, this application achieves decoupling of motion control logic and bus communication logic, improving data processing efficiency. The motion planning module focuses on trajectory generation, while the network bus module is responsible for the encapsulation and transmission of communication frames. Each module has a clearly defined responsibility, reducing system complexity. Simultaneously, multiple parallel coprocessors are used to process communication frames, fully leveraging the parallel processing capabilities of hardware resources and reducing transmission latency. This hierarchical processing and parallel communication mechanism effectively improves the system's real-time performance and communication efficiency, making it suitable for industrial applications requiring multi-node, high-precision control.

[0106] Step 303: Receive data frames returned by multiple slave devices and write the data frames into shared memory.

[0107] In this embodiment, the slave device receives and executes instructions, then encapsulates the execution result and device status information into a return data frame and sends it back to the EtherCAT master device. Upon receiving the returned data frame, the EtherCAT master device writes it to a specific area of ​​shared memory.

[0108] The data frame may contain information such as slave device ID, execution status, and sensor data.

[0109] In one possible implementation, the data frame includes real-time feedback data and non-real-time feedback data, and different DMA channels can be used to transmit different data to the host computer.

[0110] Step 304: The data frames in the shared memory are transmitted to the mapping space of the host communication interface through direct memory access, so that the host computer can access them in real time.

[0111] Direct memory access (DMI) refers to a data transfer mechanism that does not involve the CPU. It can be implemented using a DMA channel controller to reduce CPU load and shorten the data transfer time from shared memory to the host interface mapping space.

[0112] In this embodiment, the DMA channel controller of the EtherCAT master station is configured to periodically scan the data area in shared memory. When a new data frame is detected, the DMA channel controller automatically transmits the data to the mapping space of the host communication interface without CPU intervention. The host computer can directly read the latest slave device data by accessing the mapping space, enabling real-time monitoring and control of the production line.

[0113] In one possible implementation, the data frame includes real-time feedback data and non-real-time feedback data; the data frame in shared memory is transmitted to the host communication interface mapping space via direct memory access for real-time access by the host computer, including:

[0114] The instruction control and system data feedback module transmits real-time feedback data from shared memory to the mapped space of the host communication interface via a periodic feedback channel for real-time access by the host computer; and / or

[0115] Active scanning is performed through the instruction control and system data feedback module to determine whether non-real-time feedback data exists in the shared memory;

[0116] If non-real-time feedback data exists, it is sent to the mapping space of the host communication interface through the non-periodic feedback channel for the host computer to access in real time.

[0117] Specifically, during data frame transmission, real-time feedback data is transmitted at fixed time intervals through a periodic feedback channel, ensuring that the host computer acquires critical information such as motion control parameters within a predetermined period. Non-real-time feedback data is detected through an active scanning mechanism. When the device logs or abnormal information stored in shared memory reach a threshold, non-periodic channel transmission is triggered. The periodic channel transmission process is driven by a hardware timer, directly reading the contents of the real-time data area in shared memory and writing them to the mapped space; the transmission process requires no software intervention. The non-periodic channel transmission is triggered by the scan results; DMA transmission is initiated after valid data is detected, and the flag is reset after the transmission is complete. By separating the transmission channels, the transmission paths of real-time and non-real-time data are independent, avoiding delays caused by data contention. Simultaneously, the on-demand transmission mechanism for non-real-time data reduces the continuous occupation of bus bandwidth, allowing system resources to be allocated more efficiently to real-time tasks.

[0118] exist Figure 3In the embodiment corresponding to the flowchart shown, the host communication interface receives and parses the upper computer control commands, and writes the parsing results into shared memory. This avoids the resource consumption and response delay caused by frequent interruptions or data copying in the traditional method, thus improving command processing efficiency. Subsequently, EtherCAT communication frames are constructed based on the command data in shared memory and sent to multiple slave devices in parallel through multiple master stations. Compared with the traditional single-master serial communication structure, this effectively reduces transmission latency and improves bus bandwidth utilization. After receiving the data frames returned by the slave devices, they are uniformly written into shared memory, which facilitates unified processing and status analysis by subsequent modules, enhancing the data collaboration capability between system modules. Finally, the direct memory access (DMA) mechanism is used to transmit the feedback data in shared memory to the mapping space of the host communication interface at high speed, enabling data to be quickly uploaded to the upper computer without consuming CPU resources, further improving overall communication efficiency and system response speed.

[0119] See Figure 4 This illustration shows a flowchart of another data interaction method for multi-node device transmission provided in an embodiment of this application; this data interaction method is applied to the host computer in the above-mentioned data interaction system, such as... Figure 4 As shown, the method may include the following steps:

[0120] Step 401: Generate control commands and send them to the EtherCAT master station device through the host communication interface.

[0121] Step 402: In real time, obtain the data frames returned by multiple slave devices that are uploaded by the EtherCAT master device through direct memory access from the mapping space of the host communication interface.

[0122] Step 403: Parse the acquired data frames to obtain real-time status information of multiple slave devices.

[0123] The data interaction method provided in this embodiment will be described in detail below with reference to steps 401 to 403 above.

[0124] The generation of control commands can be dynamically configured based on the requirements of the host computer application layer, such as motion control commands or device status query commands. The host communication interface uses a PCIe or USB 3.0 interface, and its mapping space establishes a physical connection with the shared memory of the EtherCAT master station device through memory address mapping. Direct memory access uses a DMA channel controller to achieve batch data transmission, with a transmission rate exceeding 5Gbps. Real-time acquisition of data frames is achieved through a hardware interrupt triggering mechanism, with interrupt response time controlled within 1μs. The data parsing process adopts a multi-threaded parallel processing mechanism, with each thread corresponding to a data parsing task for one slave device; the number of threads can be dynamically expanded according to the number of slave devices.

[0125] In this embodiment, the control command is directly written to the PC command control layer of the EtherCAT master device through the transmission queue of the host communication interface. Then, the EtherCAT master device transmits multiple slave device data frames stored in shared memory to the mapping space of the host communication interface via the DMA channel. The host computer accesses this space in real time through memory read operations. Data frame parsing uses a pre-set EtherCAT protocol parsing template, loading corresponding data field extraction rules for different slave device types. During data acquisition, the host computer polls the status register of the mapping space to determine data validity, and immediately starts the parsing thread when new data arrives at the flag bit. This process avoids the encapsulation and decapsulation operations of traditional protocol stacks, reducing data access latency.

[0126] For example, the host computer parses the acquired data frames to obtain real-time status information of multiple slave devices. For instance, the host computer can extract status parameters such as position, speed, current, and temperature of each slave device from the data frames according to predefined data structures and protocol formats. The parsing process can employ parallel processing technology to process data from multiple slave devices simultaneously, further improving data processing efficiency.

[0127] Through the above technical solution, this application achieves efficient data interaction between the host computer and the EtherCAT master station. By employing direct memory access for data transmission, the overhead of multiple data copies and protocol stack processing in traditional methods is avoided, significantly reducing data transmission latency. Simultaneously, by acquiring data in real time through memory mapping, the host computer can quickly access the latest slave device status information, improving the system's real-time performance. Furthermore, the use of parallel data processing technology enables the host computer to efficiently parse data from multiple slave devices, adapting to the data processing needs of complex multi-node scenarios. This method not only improves the response speed of the control system but also enhances the system's ability to process large-scale node data, laying the foundation for achieving high-precision, high-real-time industrial control.

[0128] See Figure 5 This illustration shows a flowchart of another data interaction method for multi-node device transmission provided in an embodiment of this application; this data interaction method is applied to slave devices in the above-mentioned data interaction system, such as... Figure 5 As shown, the method may include the following steps:

[0129] Step 501: Receive EtherCAT communication frames sent in parallel by the EtherCAT master station device, and parse the EtherCAT communication frames to obtain instruction data.

[0130] Step 502: Execute the corresponding action according to the instruction data, and construct a data frame from the device status and execution result data after the corresponding action is executed.

[0131] Step 503: Send the data frame back to the EtherCAT master device via the EtherCAT protocol.

[0132] The data interaction method provided in this embodiment will be described in detail below with reference to steps 501 to 503 above.

[0133] The parsing of communication frames can be achieved through hardware acceleration modules, such as using dedicated parsing chips or FPGA logic units to decompose communication frames in real time and extract instruction types and parameters. During instruction execution, the action triggering mechanism can be based on priority queues or interrupt response modes. For example, motion control instructions can trigger servo drive actions first, and status acquisition instructions can trigger sensor data reading. The construction of data frames can be based on a preset format template, filling device status parameters and execution results bit by bit into a fixed-length frame structure. For example, motor speed, temperature value, and error code can be encapsulated as 32-bit fields.

[0134] Specifically, when the EtherCAT master device sends a communication frame through a parallel channel, the slave device's physical layer interface receives the data stream and transmits it to the parsing module. After identifying the frame header identifier, the parsing module extracts the instruction code and data payload, such as separating the speed setpoint and acceleration parameters from the frame structure. The execution module calls the corresponding control algorithm based on the instruction code, for example, inputting the speed parameters into a PID controller to generate a PWM signal to drive the motor. After the action is completed, the status acquisition unit reads the encoder feedback position and current sensor data, and generates a data frame containing a timestamp and checksum through the data encapsulation unit. The data frame is transmitted to the EtherCAT master device through the EtherCAT protocol stack's send queue, for example, inserting the feedback data into the reserved segment of the downlink frame in the next communication cycle.

[0135] Therefore, the slave devices achieve deterministic latency in command response and status feedback through hardware-accelerated parsing and hierarchical execution mechanisms. Structured encapsulation of data frames and protocol stack optimization ensure that feedback information is transmitted back in real-time within the downlink frames of the EtherCAT master device, forming a closed-loop control link. For example, command parsing, motor position adjustment, and feedback data encapsulation are completed within a 1ms communication cycle, enabling the EtherCAT master device to obtain the slave status in the next cycle and maintain the synchronization accuracy of multiple nodes.

[0136] Through the above technical solution, this application achieves rapid response and accurate execution of commands issued by the master station to EtherCAT slave devices. Slave devices can efficiently parse communication frames, accurately execute command actions, and promptly report device status and execution results. This mechanism significantly improves the master station's real-time control capability over multi-node devices, reduces status feedback latency, and lowers the possibility of execution errors.

[0137] See Figure 6 The diagram shows a schematic of a data interaction device for multi-node device transmission provided in an embodiment of this application; for ease of explanation, only the parts related to the embodiments of this application are shown.

[0138] The data interaction device 600 for multi-node device transmission is configured on the EtherCAT master station device, which is connected to the host computer through the host communication interface.

[0139] In this embodiment of the application, the data interaction device 600 for multi-node device transmission includes:

[0140] The instruction receiving module 601 receives control instructions from the host computer through the host communication interface, parses the control instructions, and stores the parsed instruction data in shared memory.

[0141] The sending module 602 is used to construct EtherCAT communication frames based on instruction data in shared memory and send them in parallel to multiple corresponding slave devices.

[0142] The memory writing module 603 is used to receive data frames returned by multiple slave devices and write the data frames into shared memory;

[0143] The data transmission module 604 is used to transmit data frames in shared memory to the mapping space of the host communication interface via direct memory access, so that the host computer can access them in real time.

[0144] In this embodiment of the application, the EtherCAT master station device further includes a command control and system data feedback module. Correspondingly, the command receiving module 601 may further include:

[0145] The reading submodule is used to read control commands sent by the host computer through the host communication interface by the instruction control and system data feedback module.

[0146] The parsing submodule is used to parse control instructions and determine the instruction type and instruction module;

[0147] The wake-up submodule is used to write the parsed instruction data into the corresponding storage area of ​​shared memory according to the instruction type and instruction module, so as to wake up the instruction module to retrieve instruction data from shared memory through software interrupt.

[0148] In this embodiment, the instruction module is at least one of a motion planning module and a network bus module, and the data interaction device 600 for multi-node device transmission further includes:

[0149] The first judgment submodule is used to determine that the instruction module is the motion planning module if the instruction type is a motion instruction.

[0150] The second judgment submodule is used to determine that the instruction module is a network bus module if the instruction type is a communication instruction.

[0151] In this embodiment, instruction data is stored in a first storage area based on instruction type. The first storage area corresponds to the motion planning module, and the sending module 602 may specifically include:

[0152] The generation submodule is used to read instruction data from the first storage area in shared memory through the motion planning module, generate target motion data for motion control, and write the target motion data back to the second storage area in shared memory.

[0153] The encapsulation submodule is used to read target motion data from the second storage area in shared memory through the network bus module, and encapsulate the target motion data into EtherCAT communication frames based on the EtherCAT protocol.

[0154] The distribution submodule is used to distribute EtherCAT communication frames to multiple corresponding slave devices through multiple parallel coprocessors via the network bus module.

[0155] In this embodiment, the data frame includes real-time feedback data and non-real-time feedback data; the data transmission module 604 may specifically include:

[0156] The first channel transmission submodule is used to send real-time feedback data from shared memory to the mapped space of the host communication interface through a periodic feedback channel via the instruction control and system data feedback module, so that the host computer can access it in real time; and / or

[0157] The scanning submodule is used to perform active scanning through instruction control and system data feedback modules to determine whether non-real-time feedback data exists in shared memory.

[0158] The second channel transmission submodule is used to send non-real-time feedback data to the mapping space of the host communication interface through the non-periodic feedback channel if non-real-time feedback data exists, so that the host computer can access it in real time.

[0159] The data interaction device 600 for multi-node device transmission provided in this application embodiment can be applied to the data interaction method for multi-node device transmission provided in the foregoing embodiment. For details, please refer to the description of the data interaction method for multi-node device transmission provided in the above embodiment, which will not be repeated here.

[0160] See Figure 7 This illustration shows a schematic diagram of another data interaction device for multi-node device transmission provided in an embodiment of this application; for ease of explanation, only the parts related to the embodiments of this application are shown.

[0161] Another data interaction device 700 for multi-node device transmission is applied to the host computer, which connects to the EtherCAT master station device through the host communication interface.

[0162] Another data interaction device 700 for multi-node device transmission includes:

[0163] The instruction generation module 701 is used to generate control instructions and send them to the EtherCAT master station device through the host communication interface.

[0164] The data frame acquisition module 702 is used to acquire data frames returned by multiple slave devices that are uploaded by the EtherCAT master device through direct memory access in real time from the mapping space of the host communication interface.

[0165] The status acquisition module 703 is used to parse the acquired data frames to obtain real-time status information of multiple slave devices.

[0166] The data interaction device 700 for multi-node device transmission provided in this application embodiment can be applied to the data interaction method for multi-node device transmission provided in the foregoing embodiment. For details, please refer to the description of the data interaction method for multi-node device transmission provided in the above embodiment, which will not be repeated here.

[0167] See Figure 8 This illustration shows a schematic diagram of another data interaction device for multi-node device transmission provided in an embodiment of this application; for ease of explanation, only the parts related to the embodiments of this application are shown.

[0168] Another data interaction device 800 for multi-node device transmission is applied to a slave device, which is connected to an EtherCAT master device.

[0169] Another data interaction device 800 for multi-node device transmission includes:

[0170] The communication frame parsing module 801 is used to receive EtherCAT communication frames sent in parallel by the EtherCAT master station device, and to parse the EtherCAT communication frames to obtain instruction data.

[0171] The data frame construction module 802 is used to execute corresponding actions according to instruction data, and to construct a data frame from the device status and execution result data after executing the corresponding actions.

[0172] The data frame sending module 803 is used to send data frames back to the EtherCAT master station device via the EtherCAT protocol.

[0173] The data interaction device 800 for multi-node device transmission provided in this application embodiment can be applied to the data interaction method for multi-node device transmission provided in the foregoing embodiment. For details, please refer to the description of the data interaction method for multi-node device transmission provided in the above embodiment, which will not be repeated here.

[0174] Figure 9 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 9 As shown, the electronic device 900 of this embodiment includes: at least one processor 910 ( Figure 9 (Only one is shown in the diagram) a processor, a memory 920, and a computer program 921 stored in the memory 920 and executable on the at least one processor 910, wherein the processor 910 executes the computer program 921 to implement the steps described in the above-described data interaction method embodiment for multi-node device transmission.

[0175] The electronic device 900 may be a server, a physical server, or a computing device, etc. This electronic device may include, but is not limited to, a processor 910 and a memory 920. Those skilled in the art will understand that... Figure 9 This is merely an example of electronic device 900 and does not constitute a limitation on electronic device 900. It may include more or fewer components than shown, or combine certain components, or use different components.

[0176] The processor 910 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0177] In some embodiments, the memory 920 may be an internal storage unit of the electronic device 900, such as a hard disk or memory of the electronic device 900. In other embodiments, the memory 920 may be an external storage device of the electronic device 900, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 900. Furthermore, the memory 920 may include both internal and external storage units of the electronic device 900. The memory 920 is used to store the operating system, applications, boot loader, data, and other programs, such as the program code of the computer program. The memory 920 can also be used to temporarily store data that has been output or will be output.

[0178] In specific implementations, the processor 910, memory 920, and computer program 921 described in the embodiments of this application can execute the embodiments of the image acquisition method of this application, which will not be repeated here.

[0179] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0180] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0181] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0182] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0183] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0184] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0185] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0186] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the various method embodiments described above.

[0187] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A data interaction method for multi-node device transmission, characterized in that, This method is applied to an EtherCAT master station device, which connects to a host computer via a host communication interface. The EtherCAT master station device includes a command control and system data feedback module. The data interaction method for multi-node device transmission includes: The system receives control commands from the host computer through the host communication interface, parses the control commands, and stores the parsed command data in shared memory. EtherCAT communication frames are constructed based on the instruction data in the shared memory and sent in parallel to the corresponding multiple slave devices. Receive data frames returned by the plurality of slave devices and write the data frames into the shared memory; The data frames in the shared memory are transmitted to the mapping space of the host communication interface through direct memory access, so that the host computer can access them in real time. The data frame includes real-time feedback data and non-real-time feedback data; the step of transmitting the data frame in the shared memory to the host communication interface mapping space via direct memory access for real-time access by the host computer includes: The instruction control and system data feedback module sends the real-time feedback data in the shared memory to the mapping space of the host communication interface through a periodic feedback channel, so that the host computer can access it in real time; and / or The instruction control and system data feedback module performs an active scan to determine whether the non-real-time feedback data exists in the shared memory. If the non-real-time feedback data exists, it is sent to the mapping space of the host communication interface through the non-periodic feedback channel for the host computer to access in real time.

2. The data interaction method for multi-node device transmission as described in claim 1, characterized in that, The step of receiving control commands from the host computer through the host communication interface, parsing the control commands, and storing the parsed commands in shared memory includes: The instruction control and system data feedback module reads the control instructions sent by the host computer through the host communication interface; The control commands are parsed to determine the command type and command module; According to the instruction type and the instruction module, the parsed instruction data is written into the corresponding storage area of ​​the shared memory, so as to wake up the instruction module to retrieve instruction data from the shared memory through software interrupt.

3. The data interaction method for multi-node device transmission as described in claim 2, characterized in that, The instruction module is at least one of a motion planning module and a network bus module; the data interaction method for multi-node device transmission further includes: If the instruction type is a motion instruction, then the instruction module is determined to be the motion planning module; If the instruction type is a communication instruction, then the instruction module is determined to be the network bus module.

4. The data interaction method for multi-node device transmission as described in claim 3, characterized in that, The instruction data is stored in a first storage area based on the instruction type, and the first storage area corresponds to the motion planning module; the step of constructing an EtherCAT communication frame based on the instruction data in the shared memory and sending it in parallel to the corresponding multiple slave devices includes: The motion planning module reads instruction data from the first storage area in the shared memory, generates target motion data for motion control, and writes the target motion data back to the second storage area in the shared memory. The target motion data is read from the second storage area in the shared memory through the network bus module, and the target motion data is encapsulated into an EtherCAT communication frame based on the EtherCAT protocol. The network bus module sends the EtherCAT communication frames to the corresponding slave devices through multiple parallel coprocessors.

5. A data interaction method for multi-node device transmission, characterized in that, The method is applied to a host computer, which connects to an EtherCAT master station device via a host communication interface. The EtherCAT master station device includes a command control and system data feedback module. The data interaction method for multi-node device transmission includes: The system generates control commands and sends them to the EtherCAT master station device via the host communication interface. The data frames returned by multiple slave devices and uploaded by the EtherCAT master device via direct memory access are obtained in real time from the mapping space of the host communication interface. The acquired data frames are parsed to obtain the real-time status information of the multiple slave devices; The data frames include real-time feedback data and non-real-time feedback data; the data frames returned by multiple slave devices uploaded by the EtherCAT master device via direct memory access include: The EtherCAT master station device, through the command control and system data feedback module, sends real-time feedback data from the shared memory to the mapping space of the host communication interface via a periodic feedback channel; and / or The EtherCAT master station device actively scans the shared memory through the command control and system data feedback module to determine whether the non-real-time feedback data exists. If the non-real-time feedback data exists, it is sent to the mapping space of the host communication interface through the non-periodic feedback channel.

6. A data interaction method for multi-node device transmission, characterized in that, The method is applied to slave devices, which are connected to EtherCAT master devices, the EtherCAT master devices including command control and system data feedback modules; the data interaction method for multi-node device transmission includes: Receive EtherCAT communication frames sent in parallel by the EtherCAT master station device, and parse the EtherCAT communication frames to obtain instruction data; Execute the corresponding action according to the instruction data, and construct a data frame from the device status and execution result data after the corresponding action is executed; The data frame is sent back to the EtherCAT master device via the EtherCAT protocol, so that the EtherCAT master device can upload the data frame to the mapping space of the host communication interface via direct memory access. The data frame includes real-time feedback data and non-real-time feedback data. The EtherCAT master station device uploads the data frame to the mapping space of the host communication interface via direct memory access, including: The EtherCAT master station device, through the command control and system data feedback module, sends real-time feedback data from the shared memory to the mapping space of the host communication interface via a periodic feedback channel; and / or The EtherCAT master station device actively scans the shared memory through the command control and system data feedback module to determine whether the non-real-time feedback data exists. If the non-real-time feedback data exists, it is sent to the mapping space of the host communication interface through the non-periodic feedback channel.

7. A data interaction device for multi-node device transmission, characterized in that, Configured on an EtherCAT master station device, the EtherCAT master station device is connected to a host computer via a host communication interface. The EtherCAT master station device includes a command control and system data feedback module. The data interaction device for multi-node device transmission includes: The instruction receiving module receives control instructions from the host computer through the host communication interface, parses the control instructions, and stores the parsed instruction data in shared memory. The sending module is used to construct EtherCAT communication frames based on the instruction data in the shared memory and send them in parallel to multiple corresponding slave devices; A memory writing module is used to receive data frames returned by the plurality of slave devices and write the data frames into the shared memory; The data transmission module is used to transmit data frames in the shared memory to the mapping space of the host communication interface via direct memory access, so that the host computer can access them in real time. The data frame includes real-time feedback data and non-real-time feedback data; the data transmission module includes: The first channel transmission submodule is used to send real-time feedback data in the shared memory to the mapping space of the host communication interface through the periodic feedback channel via the instruction control and system data feedback module, so that the host computer can access it in real time; and / or The scanning submodule is used to perform an active scan through the instruction control and system data feedback module to determine whether the non-real-time feedback data exists in the shared memory. The second channel transmission submodule is used to send the non-real-time feedback data to the mapping space of the host communication interface through the non-periodic feedback channel if such non-real-time feedback data exists, so that the host computer can access it in real time.

8. A data interaction system for multi-node device transmission, characterized in that, The data interaction system for multi-node device transmission includes a host computer, an EtherCAT master station device, and multiple slave station devices; the EtherCAT master station device is connected to the host computer through a host communication interface, and the multiple slave station devices are connected to the EtherCAT master station device; the EtherCAT master station device includes an instruction control and system data feedback module. The host computer is used to generate control commands and send them to the EtherCAT master station device through the host communication interface; it also acquires data frames returned by multiple slave devices uploaded by the EtherCAT master station device through direct memory access from the mapping space of the host communication interface in real time; and it parses the acquired data frames to obtain the real-time status information of the multiple slave devices. The EtherCAT master station device is used to receive control commands from the host computer through the host communication interface, parse the control commands, and store the parsed command data in shared memory; EtherCAT communication frames are constructed based on the instruction data in the shared memory and sent in parallel to the corresponding multiple slave devices. Receive data frames returned by the plurality of slave devices and write the data frames into the shared memory; The data frames in the shared memory are transmitted to the mapping space of the host communication interface through direct memory access, so that the host computer can access them in real time. The slave device is configured to receive EtherCAT communication frames sent in parallel by the EtherCAT master device, parse the EtherCAT communication frames to obtain instruction data, execute corresponding actions according to the instruction data, and construct a data frame from the device status and execution result data after executing the corresponding actions; and send the data frame back to the EtherCAT master device via the EtherCAT protocol. The data frame includes real-time feedback data and non-real-time feedback data; the step of transmitting the data frame in the shared memory to the host communication interface mapping space via direct memory access for real-time access by the host computer includes: The instruction control and system data feedback module sends the real-time feedback data in the shared memory to the mapping space of the host communication interface through a periodic feedback channel, so that the host computer can access it in real time; and / or The instruction control and system data feedback module performs an active scan to determine whether the non-real-time feedback data exists in the shared memory. If the non-real-time feedback data exists, it is sent to the mapping space of the host communication interface through the non-periodic feedback channel for the host computer to access in real time.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as claimed in any one of claims 1 to 4, or the steps of the method as claimed in claim 5, or the steps of the method as claimed in claim 6.

Citation Information

Patent Citations

  • Equipment IO communication method and system, equipment, storage medium and product

    CN118311907A

  • Data transmission method and device, controller and data transmission system

    CN119402310A