Data interaction method, device, system and equipment for multi-node equipment transmission
Through shared memory and direct memory access mechanisms, high-speed parallel communication is achieved between the EtherCAT master device and multi-node slaves, solving the problems of low data interaction efficiency and high latency under high load in the traditional control card architecture, and improving the real-time performance and communication efficiency of the system.
Patent Information
- Application Number
- CN202511171707.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-08-21
AI Technical Summary
Existing automation control systems have difficulty maintaining a stable and low-latency control cycle under high load conditions. Traditional motion control cards have a fixed architecture and are unable to cope with the parallel data interaction requirements in complex scenarios. In addition, the data transmission efficiency bottleneck between the host computer and the control card affects the system response speed and real-time control capabilities.
Through shared memory and direct memory access mechanisms, high-speed parallel communication and efficient data interaction are achieved between the EtherCAT master device and multi-node slaves. This includes parsing host computer instructions in shared memory and constructing EtherCAT communication frames, sending them in parallel to the slave devices, receiving and writing data frames into the shared memory, and transmitting the data frames to the mapping space of the host communication interface through the direct memory access mechanism.
It significantly improves the system's real-time performance and control response capabilities, reduces transmission delays, improves bus bandwidth utilization and overall communication efficiency, and enhances data collaboration capabilities between system modules.
Smart Images

Figure CN120675835A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of motion control technology, and in particular relates to a data interaction method, device, system and equipment for multi-node device transmission. Background Art
[0002] Existing automation control systems generally rely on network-based motion control cards to achieve unified control of multi-axis equipment. These cards typically implement master-slave communication via industrial bus protocols such as Modbus, PROFIBUS, CANopen, and EtherCAT. Among these protocols, EtherCAT is widely used in industrial applications requiring multi-node, precision coordinated control due to its high-speed transmission capabilities and high-precision synchronization. As the master device, the control card must send control data to multiple slave nodes and await status information from these slaves. However, in actual system operation, as the number of connected slaves increases, the overall communication path becomes longer, and delays accumulate during data frame transmission and return. Furthermore, because the bus communication cycle must balance data volume and protocol logic processing time, the system struggles to maintain a stable, low-latency control cycle under high load. Most traditional motion control cards have a fixed architecture and typically only support single-master communication mode, making them incapable of handling the parallel data exchange requirements of complex scenarios. Furthermore, data transmission between the host computer and the control card faces efficiency bottlenecks due to limited interface structure and processing power, making high-speed command exchange and feedback difficult, impacting system responsiveness and real-time control capabilities. Summary of the Invention
[0003] In view of this, the embodiments of the present application provide a data interaction method, apparatus, system and equipment for multi-node device transmission, which realizes high-speed parallel communication and efficient data interaction between the EtherCAT master station device and multi-node slave stations through shared memory and direct memory access mechanism, significantly improving the real-time performance and control response capability of the system.
[0004] A first aspect of an embodiment of the present application provides a data interaction method for multi-node device transmission, which is applied to an EtherCAT master station device, wherein the EtherCAT master station device is connected to a host computer via a host communication interface. The data interaction method for multi-node device transmission includes: receiving control instructions from the host computer through the host communication interface, parsing the control instructions, and storing the parsed instruction data in a shared memory; Constructing an EtherCAT communication frame based on the instruction data in the shared memory, and sending the frame to the corresponding multiple slave devices in parallel; receiving data frames returned by the plurality of slave station devices, and writing 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 by direct memory access so as to be accessed by the host computer in real time.
[0005] The data interaction method for multi-node device transmission provided in the present application receives and parses the host computer control instructions through the host communication interface, and writes the parsed results into the shared memory, avoiding the resource occupation and response delay caused by frequent interruptions or data copying in the traditional method, and improving the instruction processing efficiency; then, an EtherCAT communication frame is constructed based on the instruction data in the shared memory, and is sent to multiple slave devices in parallel through multiple master stations. Compared with the traditional single-master serial communication structure, it effectively reduces the transmission delay and improves the bus bandwidth utilization; after receiving the data frame returned by the slave device, it is uniformly written into the shared memory, which facilitates the unified processing and status analysis of subsequent modules, and enhances the data collaboration capability between system modules; finally, the direct memory access (DMA) mechanism is used to transmit the feedback data in the shared memory to the mapping space of the host communication interface at high speed, so that the data can be quickly uploaded to the host computer without occupying CPU resources, further improving the overall communication efficiency and system response speed.
[0006] In one possible implementation, the EtherCAT master device includes an instruction control and system data feedback module, which receives control instructions from the host computer through the host communication interface, parses the control instructions, and stores the parsed instructions in a shared memory, including: The instruction control and system data feedback module reads the control instruction sent by the host computer through the host communication interface; Parsing the control instruction to determine the instruction type and instruction module; The parsed instruction data are written into corresponding storage areas of the shared memory according to the instruction type and the instruction module, so as to wake up the instruction module to obtain the instruction data from the shared memory in a software interrupt manner.
[0007] In a possible implementation, the instruction module is at least one of a motion planning module and a network bus module; and the data interaction method for multi-node device transmission further includes: If the instruction type is a motion instruction, determining that the instruction module is the motion planning module; If the instruction type is a communication instruction, it is determined that the instruction module is the network bus module.
[0008] In one possible implementation, 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; and the EtherCAT communication frame is constructed based on the instruction data in the shared memory and sent in parallel to the corresponding multiple slave devices, including: Reading instruction data from a first storage area in the shared memory through the motion planning module, generating target motion data for motion control, and writing the target motion data back to a second storage area in the shared memory; Reading the target motion data from the second storage area in the shared memory through the network bus module, and encapsulating the target motion data into an EtherCAT communication frame based on the EtherCAT protocol; The EtherCAT communication frame is sent to corresponding multiple slave devices through multiple parallel coprocessors via the network bus module.
[0009] In one possible implementation, the data frame includes real-time feedback data and non-real-time feedback data; and transmitting the data frame in the shared memory to the host communication interface mapping space by direct memory access for real-time access by the host computer includes: The command 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 for real-time access by the host computer; and / or Actively scanning through the instruction control and system data feedback module to determine whether the non-real-time feedback data exists in the shared memory; If the non-real-time feedback data exists, the non-real-time feedback data is sent to the mapping space of the host communication interface through the non-periodic feedback channel for real-time access by the host computer.
[0010] A second aspect of an embodiment of the present application provides a data interaction method for multi-node device transmission, which is applied to a host computer, wherein the host computer is connected to an EtherCAT master station device via a host communication interface. The data interaction method for multi-node device transmission includes: Generate control instructions and send them to the EtherCAT master device through the host communication interface; Acquire in real time from the mapping space of the host communication interface the data frames returned by the plurality of slave devices uploaded by the EtherCAT master device via direct memory access; The acquired data frame is parsed to obtain real-time status information of the multiple slave devices.
[0011] A third aspect of an embodiment of the present application provides a data interaction method for multi-node device transmission, which is applied to a slave device connected to the EtherCAT master device. The data interaction method for multi-node device transmission includes: Receiving EtherCAT communication frames sent in parallel by the EtherCAT master station device, and parsing the EtherCAT communication frames to obtain instruction data; Execute a corresponding action according to the instruction data, and construct the device status and execution result data after executing the corresponding action into a data frame; The data frame is sent back to the EtherCAT master device via the EtherCAT protocol.
[0012] A fourth aspect of the present application provides a data interaction device for multi-node device transmission, which is configured in an EtherCAT master device, wherein the EtherCAT master device is connected to a host computer via a host communication interface, and the data interaction device for multi-node device transmission includes: An 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 a shared memory; A sending module is used to 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; A memory writing module, configured to receive data frames returned by the plurality of slave station devices and write the data frames into the shared memory; The data transmission module is used to transmit the data frames in the shared memory to the mapping space of the host communication interface through direct memory access so as to provide real-time access to the host computer.
[0013] A fifth aspect of the embodiments of the present application provides a data interaction system for multi-node device transmission, the data interaction system for multi-node device transmission comprising a host computer, an EtherCAT master device, and a plurality of slave devices; the EtherCAT master device is connected to the host computer via a host communication interface, and the plurality of slave devices are connected to the EtherCAT master device; The host computer is configured to generate a control instruction and send the control instruction to the EtherCAT master device via the host communication interface; obtain data frames returned by multiple slave devices uploaded by the EtherCAT master device via direct memory access in real time from the mapping space of the host communication interface; and parse the obtained data frames to obtain real-time status information of the multiple slave devices; The EtherCAT master device is configured to receive control instructions from the host computer through the host communication interface, parse the control instructions, and store the parsed instruction data in a shared memory; construct an EtherCAT communication frame based on the instruction data in the shared memory, and send the frame in parallel to the corresponding multiple 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 through direct memory access for real-time access by the host computer; The slave device is used to receive the EtherCAT communication frame sent in parallel by the EtherCAT master device, parse the EtherCAT communication frame to obtain instruction data; perform corresponding actions according to the instruction data, and construct the device status and execution result data after performing the corresponding action into a data frame; and send the data frame back to the EtherCAT master device through the EtherCAT protocol.
[0014] The sixth aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the computer program, the steps of the method described in the first aspect are implemented, or the steps of the method described in the second aspect are implemented, or the steps of the method described in the third aspect are implemented.
[0015] The seventh aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the method described in the first aspect above, or implements the steps of the method described in the second aspect above, or implements the steps of the method described in the third aspect above.
[0016] An eighth aspect of an embodiment of the present application provides a computer program product, which, when run on an electronic device, enables the electronic device to execute 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1This is a structural diagram of a data interaction system for multi-node device transmission provided by an embodiment of the present application; Figure 2 This is a structural diagram of another data interaction system for multi-node device transmission provided by an embodiment of the present application; Figure 3 This is a flow chart of a data interaction method for multi-node device transmission provided by an embodiment of the present application; Figure 4 This is a flow chart of another data interaction method for multi-node device transmission provided by an embodiment of the present application; Figure 5 1 is a flow chart of another data interaction method for multi-node device transmission provided in an embodiment of the present application; Figure 6 This is a structural diagram of a data interaction device for multi-node device transmission provided by an embodiment of the present application; Figure 7 This is a structural diagram of another data interaction device for multi-node device transmission provided by an embodiment of the present application; Figure 8 This is a structural diagram of another data interaction device for multi-node device transmission provided by an embodiment of the present application; Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0020] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0021] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0022] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0023] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0024] It should be understood that the size of the serial numbers of each step in this embodiment does not mean 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 the embodiment of this application.
[0025] Existing automation control systems generally rely on network-based motion control cards to achieve unified control of multi-axis equipment. These cards typically implement master-slave communication via industrial bus protocols such as Modbus, PROFIBUS, CANopen, and EtherCAT. Among these protocols, EtherCAT is widely used in industrial applications requiring multi-node, precision coordinated control due to its high-speed transmission capabilities and high-precision synchronization. As the master device, the control card must send control data to multiple slave nodes and await status information from these slaves. However, in actual system operation, as the number of connected slaves increases, the overall communication path becomes longer, and delays accumulate during data frame transmission and return. Furthermore, because the bus communication cycle must balance data volume and protocol logic processing time, the system struggles to maintain a stable, low-latency control cycle under high load. Most traditional motion control cards have a fixed architecture and typically only support single-master communication mode, making them incapable of handling the parallel data exchange requirements of complex scenarios. Furthermore, data transmission between the host computer and the control card faces efficiency bottlenecks due to limited interface structure and processing power, making high-speed command exchange and feedback difficult, impacting system responsiveness and real-time control capabilities.
[0026] In order to solve the above problems, the embodiments of the present application provide a data interaction method, device, system and equipment for multi-node device transmission, which can receive and parse the host computer control instructions through the host communication interface, and write the parsing results into the shared memory, avoiding the resource occupation and response delay caused by frequent interruptions or data copying in the traditional method, and improving the instruction processing efficiency; then, construct an EtherCAT communication frame based on the instruction data in the shared memory, and send it to multiple slave devices in parallel through multiple master stations. Compared with the traditional single-master serial communication structure, it effectively reduces the transmission delay and improves the bus bandwidth utilization; after receiving the data frame returned by the slave device, it is uniformly written into the shared memory, which facilitates the unified processing and status analysis of subsequent modules, and enhances the data collaboration capability between system modules; finally, the direct memory access (DMA) mechanism is used to transmit the feedback data in the shared memory to the mapping space of the host communication interface at high speed, so that the data can be quickly uploaded to the host computer without occupying CPU resources, further improving the overall communication efficiency and system response speed.
[0027] The following describes in detail with reference to the accompanying drawings the data interaction method, apparatus, system, device, storage medium, and computer program for multi-node device transmission provided by the embodiments of the present application.
[0028] Figure 1 A schematic diagram of the structure of a data interaction system for multi-node device transmission provided by an embodiment of the present application is shown. The data interaction system for multi-node device transmission includes a host computer, an EtherCAT master device, and multiple slave devices. The EtherCAT master device is connected to the host computer via a host communication interface and is connected to the multiple slave devices via multiple parallel EtherCAT communication links. For example, the EtherCAT master device can exchange data with the host computer via a PCIE high-speed communication interface. The PCIE interface uses memory mapping technology to ensure high-speed data transmission and low latency.
[0029] In an embodiment of the present application, the host computer first generates a control instruction and sends it to the EtherCAT master device through the host communication interface. The EtherCAT master device receives the control instruction from the host computer through the host communication interface, parses the control instruction, and stores the parsed instruction data in the shared memory; constructs an EtherCAT communication frame based on the instruction data in the shared memory and sends it in parallel to the corresponding multiple slave devices. Multiple slave devices receive the EtherCAT communication frames sent in parallel by the EtherCAT master device, parse the EtherCAT communication frames, and obtain instruction data; perform corresponding actions according to the instruction data, and construct the device status and execution result data after executing the corresponding action into a data frame; and send the data frame back to the EtherCAT master device through the EtherCAT protocol.
[0030] Secondly, the EtherCAT master device receives data frames returned by multiple slave devices and writes the data frames into shared memory; it transfers the data frames in the shared memory to the mapping space of the host communication interface through direct memory access.
[0031] Finally, the host computer obtains data frames returned by multiple slave devices uploaded by the EtherCAT master device through direct memory access (DMA) in real time from the mapping space of the host communication interface; it parses the obtained data frames to obtain real-time status information of multiple slave devices to complete the entire data interaction process.
[0032] Specifically, in this data interaction system, through the internal modular design of the EtherCAT master station device, the entire process is optimized from host computer command distribution, motion data generation, communication frame construction and transmission, slave station feedback data back to real-time access to host computer data. This effectively solves the technical problems of high data latency and low communication efficiency of the traditional EtherCAT single master station architecture when processing large-scale node devices, and significantly improves the data processing capability and control accuracy of the automation system.
[0033] It should be noted that, in a possible implementation, the EtherCAT master device may further include a command control and system data feedback module, a motion planning module, and a network bus module, and efficient data interaction is achieved between the modules through shared memory.
[0034] Specifically, see Figure 2 The schematic diagram of the structure of another data interaction system for multi-node device transmission provided by an embodiment of the present application is shown, wherein the EtherCAT master station device may further include a command control and system data feedback module, a motion planning module and a network bus module. The network bus module includes multiple (only four are shown in the figure) completely independent and parallel-transmitting EtherCAT master station devices, each of which includes an EtherCAT data processing unit and a coprocessor. Each coprocessor actually contains two completely independent sub-coprocessors, which are used for sending and receiving network data respectively, and can be specifically named coprocessor 1 (for network sending) and coprocessor 2 (for network receiving).
[0035] In the instruction control and system data feedback module, a PC instruction control layer, a system periodic feedback layer, and a system aperiodic feedback layer are set up. Through a three-layer time-division multiplexing DMA transmission mechanism, the reading and writing of the PCIE interface mapped memory are realized, achieving 100% PCIE communication utilization and close to zero communication processing overhead.
[0036] 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. The instruction data related to motion is used to wake up the motion planning module in real time for processing through software interrupts; the instruction data related to communication wakes up the network bus module for processing.
[0037] The system's periodic feedback layer uses shared memory and DMA mechanism to periodically transfer the motion data generated by the motion planning module and the network data of the network bus module to the PCIE interface mapped memory area.
[0038] The system's non-periodic feedback layer actively scans the shared memory to determine whether there is non-real-time data. If so, it transfers the non-real-time data to the PCIE interface mapped memory area via DMA.
[0039] In the motion planning module, after receiving the software interrupt notification, the network data from the network bus module is obtained through the shared memory, and the motion trajectory is planned in combination with the parsed instructions. After the planning is completed, the motion planning data is rewritten into the shared memory.
[0040] In the network bus module, each EtherCAT data processing unit first obtains the data after motion planning through shared memory and performs master station logic processing. The processed network data is transmitted to coprocessor 1 through shared memory for network data transmission; coprocessor 2 receives the network data returned by the slave device and transmits the received data back to the EtherCAT data processing unit for processing. The processed data is then written into the shared memory for zero-overhead acquisition by the motion planning module and the instruction control and system data feedback module.
[0041] Through the design of the above-mentioned 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 particularly suitable for collaborative control scenarios of complex multi-node devices.
[0042] See also Figure 3 , shows a flow chart of a data interaction method for multi-node device transmission provided by an embodiment of the present application, the data interaction method is applied to the EtherCAT master station device in the above-mentioned data interaction system, such as Figure 3 As shown, the method may include the following steps: Step 301: Receive control instructions from a host computer through a host communication interface, parse the control instructions, and store the parsed instruction data in a shared memory.
[0043] Among them, the host communication interface refers to the physical channel for data exchange between the host computer and the master station device. It can be implemented using a PCIE or USB3.0 interface to achieve high-speed data transmission and reduce the delay in command issuance and feedback.
[0044] Among them, shared memory refers to the public storage area that can be accessed by different modules within the EtherCAT master station device. It can be implemented using dual-port RAM or memory mapping technology to eliminate multiple copies when transferring data between modules and improve the efficiency of instruction parsing and forwarding.
[0045] In the embodiments of the present application, an EtherCAT master device receives control commands from a host computer via a host communication interface. Upon receiving the command, the master device parses it and extracts key information. The parsed command data is stored in shared memory, which avoids frequent data copying and improves data processing efficiency.
[0046] For example, an EtherCAT master device is equipped with a high-speed host communication interface, such as a PCIe interface, for data exchange with a host computer. The master device integrates a multi-core processor and large-capacity shared memory. When the host computer needs to control a slave device, it sends a control command to the EtherCAT master device via the host communication interface. After receiving the command, the EtherCAT master 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 is complete, the command data is written to a designated area of shared memory.
[0047] It should be noted that different types of instruction data are usually written into different areas of the shared memory.
[0048] In one possible implementation, the EtherCAT master device includes a command control and system data feedback module, which receives control commands from a host computer through a host communication interface, parses the control commands, and stores the parsed commands in a shared memory, including: The command control and system data feedback module reads the control command sent by the host computer through the host communication interface; Parse the control instructions to determine the instruction type and instruction module; The parsed instruction data are written into the corresponding storage area of the shared memory according to the instruction type and instruction module, so as to wake up the instruction module to obtain the instruction data from the shared memory through software interruption.
[0049] In an embodiment of the present application, a PC instruction control layer, a system periodic feedback layer and a system aperiodic feedback layer are set in the instruction control and system data feedback module, and different types of data are transmitted through a three-layer time-division multiplexing DMA transmission mechanism.
[0050] Specifically, parsing the control instruction to determine the instruction type and instruction module can be achieved through instruction type identification. Instruction type identification can be achieved by parsing the identification field in the instruction header. For example, the identification field is 4 bytes long and can include the corresponding instruction module encoding information. The storage area of the shared memory can be divided according to the module, for example, into a first storage area and a second storage area, each corresponding to the two instruction modules. Finally, through a software interrupt, the instruction module is awakened to obtain the instruction data from the corresponding storage area of the shared memory.
[0051] For example, the control instructions sent by the host computer are first intercepted by the instruction control and system data feedback module, and the protocol is parsed by the hardware accelerator to extract the instruction module encoding information in the instruction header identification field. After the parsing is completed, the instruction data is written to the dedicated storage area of the corresponding module according to the preset address mapping table. For example, the motion instruction is 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 of the storage area, triggering an interrupt signal with a priority level of Level-1. The awakened motion planning module directly accesses the first storage area through the memory controller to obtain the motion instruction.
[0052] During this process, the storage areas of different modules are physically separated through a memory isolation mechanism to prevent cross-boundary data access. For example, the network bus module can only access the address segment starting at 0x2000 when reading data, while the motion planning module's access rights are restricted to the address segment 0x1000. This mechanism effectively eliminates the risk of data contention between modules, allowing multiple modules to process instruction data from their dedicated storage areas in parallel, increasing overall instruction processing throughput to over 5,000 instructions per second.
[0053] In the data interaction system provided in the present application, the instruction module may refer to at least one of the motion planning module and the network bus module; in the process of identifying the instruction module, the specific identification action may be: if the instruction type is a motion instruction, the instruction module is determined to be a motion planning module; if the instruction type is a communication instruction, the instruction module is determined to be a network bus module.
[0054] Step 302: construct an EtherCAT communication frame based on the instruction data in the shared memory, and send it to the corresponding multiple slave devices in parallel.
[0055] Among them, parallel sending to corresponding multiple slave devices means distributing communication frames to different slave devices at the same time, which can be achieved by using a multi-channel coprocessor or an independent communication channel to reduce the waiting time on the bus transmission path and avoid the accumulation of delays caused by serial sending of data frames.
[0056] In an embodiment of the present application, an EtherCAT master device constructs an EtherCAT communication frame based on the command data in shared memory. The communication frame contains the command information and the address of the target slave device. Once constructed, the EtherCAT master device simultaneously sends these communication frames to the corresponding slave devices via multiple parallel communication channels. This parallel transmission mechanism significantly reduces data transmission time.
[0057] For example, the data processing unit of an EtherCAT master device reads command 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 command data. The constructed communication frames are distributed to multiple parallel coprocessors. The sub-coprocessors within the coprocessors, which are used to send data, simultaneously send communication frames to their corresponding slave devices.
[0058] In one possible implementation, if the instruction data is a motion instruction, 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; constructing an EtherCAT communication frame based on the instruction data in the shared memory and sending the frame to the corresponding multiple slave devices in parallel may include: Reading instruction data from a first storage area in the shared memory through a motion planning module, generating target motion data for motion control, and writing the target motion data back to a second storage area in the shared memory; Reading target motion data from a second storage area in the shared memory through a network bus module, and encapsulating the target motion data into an EtherCAT communication frame based on the EtherCAT protocol; The EtherCAT communication frames are sent to the corresponding multiple slave devices through multiple parallel coprocessors via the network bus module.
[0059] The correspondence between the first storage area and the motion planning module can be implemented through memory address mapping or a software interrupt mechanism. For example, the first storage area can be set as a dedicated storage area for the motion planning module. The process of generating target motion data can include coordinate conversion and velocity planning, such as converting Cartesian coordinates into joint angle data. The second storage area can be set as a dedicated storage area for the network bus module.
[0060] Among them, the parallel distribution of multiple coprocessors in the network bus module can adopt a multi-threaded scheduling mechanism, each thread corresponds to a coprocessor instance, and the number of coprocessors can maintain a 1:1 or 1:N ratio with the number of slave devices. For example, 4 coprocessors are configured to manage 8 slave devices.
[0061] Specifically, after the motion planning module reads raw command data from the first storage area, it performs kinematic calculations to generate target motion data. For example, it converts the robot arm's end-of-arm trajectory instructions issued by the host computer into position instructions for each joint axis. The generated target motion data is then written to the second storage area. The network bus module retrieves the target motion data from the second storage area through polling or event triggering and encapsulates it into a data frame structure that conforms to the EtherCAT protocol, for example, by adding a command code and slave address information to the frame header. The encapsulated communication frames are distributed to multiple coprocessors, each of which independently manages the communication timing for its corresponding slave devices. For example, time-division multiplexing can be used to transmit data to eight slaves within a 1ms communication cycle. By decoupling motion control and communication processing, raw command parsing and protocol encapsulation are separated into separate modules, avoiding congestion in the data processing chain. Furthermore, the coprocessor's parallel distribution mechanism improves communication bandwidth utilization by over 30%. In a test scenario with eight slave devices, end-to-end communication latency was reduced from 2.1ms in a traditional single-threaded mode to 0.8ms.
[0062] Through the above technical solution, this application realizes the decoupling of motion control logic and bus communication logic, and improves data processing efficiency. The motion planning module focuses on trajectory generation, and the network bus module is responsible for the encapsulation and transmission of communication frames. The responsibilities of each module are clear, which reduces the complexity of the system. At the same time, multiple parallel coprocessors are used to process communication frames, which fully utilizes the parallel processing capabilities of hardware resources and reduces the transmission delay of communication frames. This layered processing and parallel communication mechanism effectively improves the real-time performance and communication efficiency of the system, making it suitable for industrial application scenarios with multi-node and high-precision control.
[0063] Step 303: Receive data frames returned by multiple slave devices and write the data frames into a shared memory.
[0064] In the embodiment of the present application, the slave device receives and executes the instruction, then encapsulates the execution result and device status information into a return data frame and sends it back to the EtherCAT master device. After receiving the return data frame, the EtherCAT master device writes it to a specific area of the shared memory.
[0065] The data frame may include information such as slave device ID, execution status, and sensor data.
[0066] In a possible implementation, the data frame includes real-time feedback data and non-real-time feedback data, and different DMA channels may be used to transmit different data to the host computer.
[0067] Step 304: The data frame in the shared memory is transferred to the mapping space of the host communication interface by direct memory access, so as to be accessed by the host computer in real time.
[0068] Among them, the direct memory access method refers to a data transmission mechanism without the participation of the CPU. It can be implemented using a DMA channel controller to reduce the CPU load and shorten the data transmission time from the shared memory to the host interface mapping space.
[0069] In this embodiment of the present application, the DMA channel controller of the EtherCAT master device is configured to periodically scan the data area in the shared memory. When a new data frame is detected, the DMA channel controller automatically transfers the data to the mapped space of the host communication interface without CPU intervention. By accessing the mapped space, the host computer can directly read the latest slave device data, enabling real-time monitoring and control of the production line.
[0070] In one possible implementation, a data frame includes real-time feedback data and non-real-time feedback data; and 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 command 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 the periodic feedback channel for real-time access by the host computer; and / or Actively scan the command control and system data feedback modules to determine whether there is non-real-time feedback data in the shared memory; If there is non-real-time feedback data, the non-real-time feedback data is sent to the mapping space of the host communication interface through the non-periodic feedback channel for real-time access by the host computer.
[0071] Specifically, during data frame transmission, real-time feedback data is transmitted at fixed intervals via a periodic feedback channel, ensuring that the host computer obtains key 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 log or exception information stored in shared memory reaches a threshold, transmission via the aperiodic channel is triggered. The transmission process of the periodic channel is driven by a hardware timer, which directly reads the contents of the real-time data area in shared memory and writes to the mapped space. The transmission process requires no software intervention. Transmission via the aperiodic channel is triggered by the scanning results. DMA transfer is initiated after valid data is detected, and the flag is reset after the transfer 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. Furthermore, the on-demand transmission mechanism for non-real-time data reduces the continuous occupation of bus bandwidth, allowing system resources to be more efficiently allocated to real-time tasks.
[0072] exist Figure 3 In the embodiment corresponding to the flow diagram shown, the host computer control instructions are received and parsed through the host communication interface, and the parsed results are written to the shared memory, avoiding resource occupation and response delays caused by frequent interruptions or data copying in traditional methods, and improving the instruction processing efficiency; then, an EtherCAT communication frame is constructed based on the instruction 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 the transmission delay and improves the bus bandwidth utilization; after receiving the data frame returned by the slave device, it is uniformly written to the shared memory, which facilitates unified processing and status analysis by subsequent modules, and enhances the data collaboration capability between system modules; finally, the direct memory access (DMA) mechanism is used to transfer the feedback data in the shared memory to the mapping space of the host communication interface at high speed, so that the data can be quickly uploaded to the host computer without occupying CPU resources, further improving the overall communication efficiency and system response speed.
[0073] See also Figure 4 , shows a flow chart of another data interaction method for multi-node device transmission provided by an embodiment of the present application; the 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: Step 401: Generate a control instruction and send it to the EtherCAT master device through the host communication interface.
[0074] Step 402: Acquire data frames returned by multiple slave devices uploaded by the EtherCAT master device via direct memory access in real time from the mapping space of the host communication interface.
[0075] Step 403: parse the acquired data frame to obtain real-time status information of multiple slave devices.
[0076] The data interaction method provided by this embodiment is described in detail below with respect to the above steps 401 to 403.
[0077] Control instruction generation can be dynamically configured based on the needs of the host computer application layer, such as motion control instructions or device status query instructions. The host communication interface is implemented using a PCIE or USB 3.0 interface, whose mapping space establishes a physical connection to the shared memory of the EtherCAT master device through memory address mapping. Direct memory access uses a DMA channel controller to achieve batch data transfer, with transmission rates exceeding 5Gbps. Real-time acquisition of data frames is achieved through a hardware interrupt trigger mechanism, with interrupt response time controlled within 1μs. The data parsing process utilizes a multi-threaded parallel processing mechanism, with each thread corresponding to a data parsing task for a slave device. The number of threads can be dynamically expanded based on the number of slave devices. In an embodiment of the present application, the control instruction is directly written into the PC instruction control layer of the EtherCAT master device through the send queue of the host communication interface. Then, the EtherCAT master device transmits multiple slave device data frames stored in the shared memory to the mapping space of the host communication interface through the DMA channel, and the host computer accesses the space in real time through the memory read operation. The data frame is parsed using a preset EtherCAT protocol parsing template, and the corresponding data field extraction rules are loaded for different slave device types. During the data acquisition process, the host computer judges the validity of the data by polling the status register of the mapping space, and immediately starts the parsing thread when it detects that new data has arrived at the flag bit. This process avoids the encapsulation and decapsulation operations of the traditional protocol stack and reduces data access delay.
[0078] For example, the host computer parses the acquired data frames to obtain real-time status information for multiple slave devices. For example, the host computer can extract status parameters such as the position, speed, current, and temperature of each slave device from the data frames based on a predefined data structure and protocol format. The parsing process can utilize parallel processing technology to simultaneously process data from multiple slave devices, further improving data processing efficiency.
[0079] Through the above technical solution, the present application realizes efficient data interaction between the host computer and the EtherCAT master device. Since direct memory access is used to transmit data, the overhead of multiple data copies and protocol stack processing in traditional methods is avoided, and the data transmission delay is significantly reduced. At the same time, by acquiring data in real time through memory mapping, the host computer can quickly access the latest slave device status information, improving the real-time performance of the system. In addition, the use of parallel data processing technology enables the host computer to efficiently parse data from multiple slave devices, adapting to the data processing requirements in 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 and high-real-time industrial control.
[0080] See also Figure 5 , shows a flow chart of another data interaction method for multi-node device transmission provided by an embodiment of the present application; the data interaction method is applied to the slave device in the above data interaction system, such as Figure 5 As shown, the method may include the following steps: Step 501: receiving an EtherCAT communication frame sent in parallel by an EtherCAT master device, and parsing the EtherCAT communication frame to obtain instruction data.
[0081] Step 502: Execute a corresponding action according to the instruction data, and construct the device state after executing the corresponding action and the execution result data into a data frame.
[0082] Step 503: Send the data frame back to the EtherCAT master device via the EtherCAT protocol.
[0083] The data interaction method provided by this embodiment is described in detail below with respect to the above steps 501 to 503.
[0084] Communication frame parsing can be implemented through a hardware acceleration module, such as a dedicated parsing chip or FPGA logic unit, which performs real-time disassembly of communication frames to extract instruction types and parameters. During instruction execution, action triggering can be based on a priority queue or interrupt response mode. For example, motion control instructions prioritize servo drive actions, while status acquisition instructions trigger sensor data readings. Data frames can be constructed based on a preset format template, bit-filling device status parameters and execution results into a fixed-length frame structure. For example, motor speed, temperature, and error codes can be encapsulated as 32-bit fields.
[0085] Specifically, when the EtherCAT master device sends a communication frame through a parallel channel, the physical layer interface of the slave device receives the data stream and transmits it to the parsing module. After the parsing module identifies the frame header identifier, it extracts the instruction code and data payload, such as separating the speed setting value and acceleration parameters from the frame structure. The execution module calls the corresponding control algorithm according to the instruction code, such as inputting the speed parameter into the PID controller to generate a PWM signal to drive the motor. After the action is completed, the state 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 send queue of the EtherCAT protocol stack, for example, the feedback data is inserted into the reserved segment of the downlink frame in the next communication cycle.
[0086] As a result, slave devices achieve deterministic latency for command responses and status feedback through hardware-accelerated parsing and a layered execution mechanism. Structured data frame encapsulation and protocol stack optimization ensure real-time transmission of feedback information in downlink frames from the EtherCAT master, 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 to obtain slave status in the next cycle and maintain synchronization accuracy across multiple nodes.
[0087] Through the above technical solution, this application achieves rapid response and precise execution of EtherCAT slave devices to commands issued by the master. Slave devices can efficiently parse communication frames, accurately execute command actions, and promptly provide feedback on device status and execution results. This mechanism significantly improves the master's ability to control multi-node devices in real time, reduces status feedback latency, and reduces the possibility of execution errors.
[0088] See also Figure 6 , shows a structural diagram of a data interaction device for multi-node device transmission provided by an embodiment of the present application; for ease of explanation, only the parts related to the embodiment of the present application are shown.
[0089] The data interaction device 600 for multi-node device transmission is configured in an EtherCAT master station device, and the EtherCAT master station device is connected to a host computer via a host communication interface.
[0090] In an embodiment of the present application, a data interaction apparatus 600 for multi-node device transmission includes: 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 the shared memory; The sending module 602 is used to 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; The memory writing module 603 is used to receive data frames returned by multiple slave devices and write the data frames into the shared memory; The data transmission module 604 is used to transmit the data frames in the shared memory to the mapping space of the host communication interface through direct memory access so as to provide real-time access to the host computer.
[0091] In the embodiment of the present application, the EtherCAT master device further includes a command control and system data feedback module. Correspondingly, the command receiving module 601 may further include: The reading submodule is used for the instruction control and system data feedback module to read the control instructions sent by the host computer through the host communication interface; The parsing submodule is used to parse the control instructions and determine the instruction type and instruction module; The wake-up submodule is used to write the parsed instruction data into the corresponding storage area of the shared memory according to the instruction type and instruction module, so as to wake up the instruction module to obtain the instruction data from the shared memory through software interruption.
[0092] In the embodiment of the present application, 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: A first judgment submodule is used to determine that the instruction module is a motion planning module if the instruction type is a motion instruction; The second judgment submodule is configured to determine that the instruction module is a network bus module if the instruction type is a communication instruction.
[0093] In the embodiment of the present application, the instruction data is stored in the first storage area based on the instruction type. The first storage area corresponds to the motion planning module. The sending module 602 may specifically include: a generating submodule, configured to read instruction data from a first storage area in the shared memory through a motion planning module, generate target motion data for motion control, and write the target motion data back to a second storage area in the shared memory; an encapsulation submodule, configured to read target motion data from a second storage area in the shared memory through the network bus module, and encapsulate the target motion data into an EtherCAT communication frame based on the EtherCAT protocol; The sending submodule is used to send the EtherCAT communication frame to the corresponding multiple slave devices through multiple parallel coprocessors via the network bus module.
[0094] In the embodiment of the present application, the data frame includes real-time feedback data and non-real-time feedback data; the data transmission module 604 may specifically include: The first channel transmission submodule is used to send the real-time feedback data in the shared memory to the mapping space of the host communication interface through the periodic feedback channel through the instruction control and system data feedback module, so as to provide real-time access to the host computer; and / or The scanning submodule is used to actively scan through the instruction control and system data feedback module to determine whether there is non-real-time feedback data 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 there is non-real-time feedback data, so as to provide real-time access to the host computer.
[0095] The data interaction device 600 for multi-node device transmission provided in an embodiment of the present application can be applied to a data interaction method for multi-node device transmission provided in the aforementioned embodiment. For details, please refer to the description of a data interaction method for multi-node device transmission provided in the aforementioned embodiment, which will not be repeated here.
[0096] See also Figure 7 , shows a structural schematic diagram of another data interaction device for multi-node device transmission provided by an embodiment of the present application; for ease of explanation, only the parts related to the embodiment of the present application are shown.
[0097] Another data interaction device 700 for multi-node device transmission is applied to a host computer, which is connected to an EtherCAT master station device via a host communication interface.
[0098] Another data interaction device 700 for multi-node device transmission includes: The command generation module 701 is used to generate control commands and send them to the EtherCAT master device through the host communication interface; The data frame acquisition module 702 is used to acquire data frames returned by multiple slave devices uploaded by the EtherCAT master device through direct memory access in real time from the mapping space of the host communication interface; The status acquisition module 703 is used to parse the acquired data frames to obtain real-time status information of multiple slave devices.
[0099] Another data interaction device 700 for multi-node device transmission provided in an embodiment of the present application can be applied to another data interaction method for multi-node device transmission provided in the aforementioned embodiment. For details, please refer to the description of another data interaction method for multi-node device transmission provided in the aforementioned embodiment, which will not be repeated here.
[0100] See also Figure 8, shows a structural schematic diagram of another data interaction device for multi-node device transmission provided by an embodiment of the present application; for ease of explanation, only the parts related to the embodiment of the present application are shown.
[0101] Another data interaction device 800 for multi-node device transmission is applied to a slave device, which is connected to an EtherCAT master device.
[0102] Another data interaction device 800 for multi-node device transmission includes: The communication frame parsing module 801 is used to receive the EtherCAT communication frames sent in parallel by the EtherCAT master station device, and parse the EtherCAT communication frames to obtain instruction data; The data frame construction module 802 is used to execute the corresponding action according to the instruction data, and construct the device status and execution result data after executing the corresponding action into a data frame; The data frame sending module 803 is used to send the data frame back to the EtherCAT master device through the EtherCAT protocol.
[0103] The data interaction device 800 for another multi-node device transmission provided in an embodiment of the present application can be applied to another data interaction method for multi-node device transmission provided in the aforementioned embodiment. For details, please refer to the description of another data interaction method for multi-node device transmission provided in the aforementioned embodiment, which will not be repeated here.
[0104] Figure 9 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. 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 figure) a processor, a memory 920, and a computer program 921 stored in the memory 920 and executable on the at least one processor 910. When the processor 910 executes the computer program 921, the steps in the above-mentioned embodiment of the data interaction method for multi-node device transmission are implemented.
[0105] The electronic device 900 may be a server, a physical server, a computing device, etc. The electronic device may include, but is not limited to, a processor 910 and a memory 920. It will be understood by those skilled in the art that Figure 9 This is merely an example of the electronic device 900 and does not constitute a limitation on the electronic device 900 . The electronic device 900 may include more or fewer components than shown in the figure, or may combine certain components, or may include different components.
[0106] The processor 910 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.
[0107] In some embodiments, the memory 920 may be an internal storage unit of the electronic device 900, such as a hard drive or memory of the electronic device 900. In other embodiments, the memory 920 may also be an external storage device of the electronic device 900, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. equipped on the electronic device 900. Furthermore, the memory 920 may include both an internal storage unit of the electronic device 900 and an external storage device. The memory 920 is used to store an operating system, application programs, a boot loader, data, and other programs, such as the program code of the computer program. The memory 920 may also be used to temporarily store data that has been output or is about to be output.
[0108] In a specific implementation, the processor 910, memory 920, and computer program 921 described in the embodiments of the present application can execute the embodiments of the image acquisition method of the present application, which will not be repeated here.
[0109] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by 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 embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0110] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0111] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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.
[0112] In the embodiments provided in the present 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 schematic. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0113] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0114] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0115] If the integrated module / unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the process steps in the above-mentioned method embodiments by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content of the computer-readable medium can be appropriately increased or decreased based on the requirements of legislation and patent practice in a jurisdiction. For example, in some jurisdictions, based on legislation and patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0116] The present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed through a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing.
[0117] The above embodiments are intended only to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they may still modify the technical solutions described in the above embodiments or replace some of the technical features therein with equivalents; and such modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application and should be included within the scope of protection of the present application.
Claims
1. A data interaction method for multi-node device transmission, characterized in that: Applied to an EtherCAT master device, the EtherCAT master device is connected to a host computer via a host communication interface, and the data interaction method for multi-node device transmission includes: receiving control instructions from the host computer through the host communication interface, parsing the control instructions, and storing the parsed instruction data in a shared memory; Constructing an EtherCAT communication frame based on the instruction data in the shared memory, and sending the frame to the corresponding multiple slave devices in parallel; receiving data frames returned by the plurality of slave station devices, and writing 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 by direct memory access so as to be accessed by the host computer in real time.
2. The data interaction method for multi-node device transmission according to claim 1, characterized in that: The EtherCAT master station device includes an instruction control and system data feedback module, which receives control instructions from the host computer through the host communication interface, parses the control instructions, and stores the parsed instructions in the shared memory, including: The instruction control and system data feedback module reads the control instruction sent by the host computer through the host communication interface; Parsing the control instruction to determine the instruction type and instruction module; The parsed instruction data are written into corresponding storage areas of the shared memory according to the instruction type and the instruction module, so as to wake up the instruction module to obtain the instruction data from the shared memory in a software interrupt manner.
3. The data interaction method for multi-node device transmission according to 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 also includes: If the instruction type is a motion instruction, determining that the instruction module is the motion planning module; If the instruction type is a communication instruction, it is determined that the instruction module is the network bus module.
4. The data interaction method for multi-node device transmission according to 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 EtherCAT communication frame is constructed based on the instruction data in the shared memory and sent in parallel to the corresponding multiple slave devices, including: Reading instruction data from a first storage area in the shared memory through the motion planning module, generating target motion data for motion control, and writing the target motion data back to a second storage area in the shared memory; Reading the target motion data from the second storage area in the shared memory through the network bus module, and encapsulating the target motion data into an EtherCAT communication frame based on the EtherCAT protocol; The EtherCAT communication frame is sent to corresponding multiple slave devices through multiple parallel coprocessors via the network bus module.
5. The data interaction method for multi-node device transmission according to claim 2, characterized in that: The data frame includes real-time feedback data and non-real-time feedback data; the data frame in the shared memory is transmitted to the host communication interface mapping space by direct memory access for real-time access by the host computer, including: The command 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 for real-time access by the host computer; and / or Actively scanning through the instruction control and system data feedback module to determine whether the non-real-time feedback data exists in the shared memory; If the non-real-time feedback data exists, the non-real-time feedback data is sent to the mapping space of the host communication interface through the non-periodic feedback channel for real-time access by the host computer.
6. A data interaction method for multi-node device transmission, characterized in that: Applied to a host computer, the host computer is connected to an EtherCAT master device via a host communication interface; the data interaction method for multi-node device transmission includes: Generate control instructions and send them to the EtherCAT master device through the host communication interface; Acquire in real time from the mapping space of the host communication interface the data frames returned by the plurality of slave devices uploaded by the EtherCAT master device via direct memory access; The acquired data frame is parsed to obtain real-time status information of the multiple slave devices.
7. A data interaction method for multi-node device transmission, characterized in that: Applied to a slave device, the slave device is connected to an EtherCAT master device; the data interaction method for multi-node device transmission includes: Receiving EtherCAT communication frames sent in parallel by the EtherCAT master station device, and parsing the EtherCAT communication frames to obtain instruction data; Execute a corresponding action according to the instruction data, and construct the device status and execution result data after executing the corresponding action into a data frame; The data frame is sent back to the EtherCAT master device via the EtherCAT protocol.
8. A data interaction device for multi-node device transmission, characterized in that: Configured in an EtherCAT master station device, 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: An 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 a shared memory; A sending module is used to 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; A memory writing module, configured to receive data frames returned by the plurality of slave station devices and write the data frames into the shared memory; The data transmission module is used to transmit the data frames in the shared memory to the mapping space of the host communication interface through direct memory access so as to provide real-time access to the host computer.
9. 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 host computer is configured to generate a control instruction and send the control instruction to the EtherCAT master device via the host communication interface; obtain data frames returned by multiple slave devices uploaded by the EtherCAT master device via direct memory access in real time from the mapping space of the host communication interface; and parse the obtained data frames to obtain real-time status information of the multiple slave devices; The EtherCAT master device is configured to receive control instructions from the host computer through the host communication interface, parse the control instructions, and store the parsed instruction data in a shared memory; Constructing an EtherCAT communication frame based on the instruction data in the shared memory, and sending the frame to the corresponding multiple slave devices in parallel; receiving data frames returned by the plurality of slave station devices, and writing the data frames into the shared memory; The data frames in the shared memory are transferred to the mapping space of the host communication interface by direct memory access so as to be accessed by the host computer in real time; The slave device is used to receive the EtherCAT communication frame sent in parallel by the EtherCAT master device, parse the EtherCAT communication frame to obtain instruction data; perform corresponding actions according to the instruction data, and construct the device status and execution result data after performing the corresponding action into a data frame; and send the data frame back to the EtherCAT master device through the EtherCAT protocol.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the processor implements the steps of the method according to any one of claims 1 to 5, or implements the steps of the method according to claim 6, or implements the steps of the method according to claim 7.
Citation Information
Patent Citations
EtherCAT slave station and slave station synchronous communication method, control system, equipment and storage medium
CN110166335A
Equipment IO communication method and system, equipment, storage medium and product
CN118311907A
Data transmission method and device, controller and data transmission system
CN119402310A
Testing system
WO2024183093A1
Cited By
Servo driver
CN122292988A