Data interaction method and related device
By maintaining a static data structure framework at the protocol level and dynamically managing resources at the runtime level, the configuration contradictions caused by the dynamic changes in the coupler and input/output module topology are resolved. This enables flexible configuration of input/output modules and topology scalability, thereby improving communication efficiency and system reliability.
Patent Information
- Application Number
- CN202511885648.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, the dynamic changes in the topology of the coupler and input/output modules lead to a contradiction between the static and fixed data framework required by the main station and the dynamic and variable actual data needs of the coupler, making it difficult to achieve flexible configuration of input/output modules and topology scalability.
At the protocol level, a maximum, static data structure framework oriented towards the main station is maintained, and at the runtime level, resources within this framework are dynamically managed and used. By reserving the maximum address space for the parameter configuration area of the input/output modules, the configuration parameters are dynamically adjusted to achieve flexible configuration of the input/output modules.
It enables flexible configuration of input/output modules and scalability of topology, supports arbitrary hot-swapping and combination of input/output modules, and improves communication efficiency and system reliability.
Smart Images

Figure CN121680208A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automation control technology, and more specifically, to a data interaction method and related apparatus. Background Technology
[0002] In industrial automation systems, upper-level controllers (such as programmable logic controllers (PLCs)) can communicate with field sensors, actuators, and other input / output modules in real time or periodically via couplers. The communication protocol between the upper-level controller and the coupler typically uses Ethernet protocols such as EtherCAT or EtherNet / IP.
[0003] However, efficient communication based on Ethernet protocols such as EtherCAT and EtherNet / IP largely relies on the coupler's static, predefined device description file, which describes the topology of the input / output modules connected to the coupler. But as an intelligent gateway, the topology of the input / output modules connected to the coupler can change dynamically, creating a fundamental contradiction: the master station requires a static, fixed data framework, while the coupler's actual data needs are dynamic and variable. Therefore, how to achieve flexible configuration of input / output modules and improve the topology scalability has become an urgent problem to be solved. Summary of the Invention
[0004] Based on the defects and shortcomings of the prior art, this application proposes a data interaction method and related apparatus, which can solve the problem of how to achieve flexible configuration of back-end input / output modules in the prior art.
[0005] According to a first aspect of this application, a data interaction method is provided, applied to a coupler in an automated control system, the coupler being used to connect a target communication protocol master station and an input / output module in the automated control system; The method includes: The system receives the first configuration parameters of the target input / output module sent by the target communication protocol master station; wherein the data length of the configuration parameters of the input / output module sent by the target communication protocol master station is uniformly aligned to the target data length based on the address space size of the configuration object dictionary of the input / output module in the device description file of the coupler. The actual data length of the configuration parameters of the target input / output module is determined according to the preset configuration table; wherein, the preset configuration table includes relevant information of the input / output modules in the automated control system; Based on the actual data length of the configuration parameters of the target input / output module, the first configuration parameters are parsed to obtain the second configuration parameters that the target input / output module can recognize, and the second configuration parameters are sent to the target input / output module.
[0006] According to a second aspect of this application, a data interaction device is provided, which is applied to a coupler in an automated control system, the coupler being used to connect a target communication protocol master station and an input / output module in the automated control system; The device includes: The receiving module is used to receive the first configuration parameters of the target input / output module sent by the target communication protocol master station; wherein, the data length of the configuration parameters of the input / output module sent by the target communication protocol master station is uniformly aligned to the target data length based on the address space size of the configuration object dictionary of the input / output module in the device description file of the coupler; The determining module is used to determine the actual data length of the configuration parameters of the target input / output module according to a preset configuration table; wherein, the preset configuration table includes relevant information of the input / output modules in the automated control system; The processing module is configured to parse the first configuration parameter according to the actual data length of the configuration parameter of the target input / output module, obtain the second configuration parameter that the target input / output module can recognize, and send the second configuration parameter to the target input / output module.
[0007] According to a third aspect of this application, an electronic device is provided, comprising: a memory and a processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the data interaction method as described in the first aspect by running a program in the memory.
[0008] According to a fourth aspect of this application, a storage medium is provided that stores a computer program, which, when executed by a processor, implements the data interaction method as described in the first aspect.
[0009] According to a fifth aspect of this application, a computer program product or computer program is provided, the computer program product including the computer program, wherein a processor executing the computer program implements the steps in the data interaction method as described in the first aspect. Optionally, the computer program may be stored on a readable storage medium of a computer device or in the cloud; the processor of the computer device reads the computer program from the readable storage medium or the cloud.
[0010] In the technical solution provided in this application, by reserving the maximum address space for the parameter configuration area of the input / output module and describing it according to the maximum address space in the device description file of the coupler, and by enabling the master station to send configuration parameters with the same data length, the coupler can receive any type of data sent by the master station. This also means that the type of input / output module in the same slot is no longer limited by the length of the configuration parameters, and the type of input / output module in the same slot can be changed, thereby realizing flexible configuration of the backend input / output module. Attached Figure Description
[0011] Figure 1 This is one of the structural schematic diagrams of an automated control system provided in the embodiments of this application.
[0012] Figure 2 This is a second schematic diagram of an automated control system provided in an embodiment of this application.
[0013] Figure 3 This is a schematic diagram of the data flow in an automated control system provided in an embodiment of this application.
[0014] Figure 4 This is a flowchart illustrating a data interaction method provided in an embodiment of this application.
[0015] Figure 5 The third schematic diagram of the structure of the automated control system provided in the embodiments of this application.
[0016] Figure 6 The flowchart illustrates the parameter configuration logic processing provided in the embodiments of this application.
[0017] Figure 7 This is a diagram illustrating the interaction between the log module and other modules provided in this embodiment of the application.
[0018] Figure 8 This is a block diagram of a data interaction device provided in an embodiment of this application.
[0019] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0021] Application Overview In industrial automation systems, upper-level controllers can communicate with field sensors, actuators, and other input / output modules in real time or periodically via couplers. The communication protocol between the upper-level controller and the coupler typically uses Ethernet protocols such as EtherCAT or EtherNet / IP.
[0022] However, efficient communication based on protocols such as EtherCAT and EtherNet / IP largely relies on the coupler's static, predefined device description files, which describe the topology of the input / output modules connected to the coupler. For example, in the EtherCAT protocol, the EtherCAT master (i.e., the upper-level controller) obtains the complete blueprint of the EtherCAT slave (i.e., the coupler) through the ESI (EtherCAT Slave Information) file during network initialization. This blueprint includes all object dictionary entries and process data mappings for the input / output modules. Based on this, the EtherCAT master configures the Synchronization Manager (SM) and allocates a fixed memory buffer. Subsequent periodic communication is then performed with extremely high efficiency within this fixed framework. Similarly, in the EtherNet / IP protocol, the standard EtherNet / IP protocol relies on the coupler's static Electronic Data Sheet (EDS) file for network configuration. During initialization, the EtherNet / IP master (i.e., the upper-level controller) parses the slave device's data structure through the predefined EDS file. Its process data is typically mapped to a fixed-length, linearly arranged data area.
[0023] However, as a smart gateway, the topology of the input / output modules connected to the back end of the coupler can be dynamically changed. For example, the number can be dynamically changed, with users able to connect 1 to 64 input / output modules; the type can also be dynamically changed, with each slot able to accommodate different types of modules such as DI (digital input), DO (digital output), AI (analog input), AO (analog output), and temperature modules; and the order can also be dynamically changed, with the installation order of each type of input / output module being arbitrary, and the input / output data length and structure of each type of input / output module being quite different, causing the overall process data length and structure of the coupler to dynamically change with the topology.
[0024] This creates a fundamental contradiction: the main station requires a static, fixed data framework, while the coupler's actual data needs are dynamic and variable. Therefore, how to achieve flexible configuration of input / output modules and improve the topology's scalability becomes an urgent problem to be solved.
[0025] Therefore, this application provides a solution whose core idea is to maintain a large, static data structure framework oriented towards the main station at the protocol level; and to dynamically manage and use some or all of the resources within the framework at the runtime level, as described below.
[0026] Exemplary methods This application provides a data interaction method applied to couplers in an automated control system. For example... Figure 1 As shown, this coupler is used to bridge the target communication protocol master station in an automated control system with at least one input / output module (i.e., I / O module). The coupler and the input / output module are connected via a custom backplane bus. This custom backplane bus can also be replaced by fieldbus protocols such as CANopen, Modbus, or DeviceNet.
[0027] The target communication protocol master station described here can control the input / output modules via a coupler, such as configuring the parameters of the input / output modules. The coupler, acting as a target communication protocol slave station, communicates with the master station, and the two can communicate based on a preset protocol. The target communication protocol master station can be an EtherCAT master station, a PROFINET master station, or a master station for other communication protocols (such as EtherNet / IP). The coupler, acting as a target communication protocol slave station, communicates with the master station, and the two can communicate based on the target communication protocol.
[0028] In this embodiment of the application, the I / O system composed of input / output modules can be a distributed I / O system.
[0029] The coupler in this embodiment can be based on a high-performance microcontroller unit (MCU). Hardware-wise, it integrates a target communication protocol slave controller (such as an EtherCAT slave controller (ESC)), a dual-port PHY, a secondary bus (i.e., backplane bus) driver circuit, and peripheral interfaces. Software-wise, it adopts an architecture where dual protocol stacks (such as an EtherCAT slave protocol stack and a self-developed backplane bus protocol stack) work collaboratively, and intelligent management is achieved through application layer services. Simultaneously, it can be used through… Figure 2 The configuration software in the local control device (i.e., the host computer) manages parameters, performs communication, and queries diagnostic status. Optionally, a heterogeneous architecture of FPGA+MCU can be used to replace the pure MCU architecture to improve the coupler's processing performance.
[0030] Taking the target communication protocol as EtherCAT as an example, the data flow between the various structures in this automated control system can be as follows: Figure 3As shown, the master EtherCAT bus system and the slave EtherCAT bus system communicate via the EtherCAT protocol. The slave EtherCAT bus system communicates with the coupler firmware subsystem (i.e., the APP layer), the coupler firmware subsystem communicates with the master backplane bus subsystem within the coupler, the master backplane bus subsystem communicates with the slave backplane bus subsystems within the backplane via the backplane bus, and the slave backplane bus subsystems within the backplane communicate with the I / O module firmware system. Furthermore, the configuration software in the local control device can communicate with the coupler firmware subsystem. In this configuration, the coupler acts as the master of the backplane bus system, while the backplane acts as the slave.
[0031] In this diagram, the EtherCAT bus system (master station) is the EtherCAT master station. The EtherCAT bus system (slave station), coupler firmware subsystem (APP), and backplane bus subsystem (master station) are couplers. The backplane bus subsystem (slave station) is a backplane, which contains the backplane bus and input / output modules. The I / O module firmware subsystem is an input / output module.
[0032] The method is described in detail below through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0033] like Figure 4 As shown, the method may include steps 401 to 403, as described below: Step 401: Receive the first configuration parameters of the target input / output module sent by the target communication protocol master station.
[0034] The data length of the configuration parameters of the input / output modules sent by the target communication protocol master station is uniformly aligned to the target data length, based on the address space size of the configuration object dictionary of the input / output modules in the coupler's device description file.
[0035] Different types of input / output modules have different configuration parameter data lengths. In related technologies, the device description file of the coupler is described according to the actual data length of the configuration parameters. However, this makes it difficult to flexibly configure the I / O module topology because the types of input / output modules in the same slot cannot be changed.
[0036] In this embodiment, the address space size description of the configuration object dictionary for each input / output module in the coupler's device description file (such as an ESI file) is the maximum address space. That is, this embodiment reserves a maximum address space for the configuration parameter area of each input / output module. The configuration object dictionary described here is used to store the configuration parameters of the input / output modules to enable the configuration parameters to take effect.
[0037] The maximum address space can be set based on the maximum data length of the configuration parameters for different types of input / output modules. For example, if the maximum data length of the configuration parameters is 4 bytes, then the maximum address space can be greater than or equal to 4 bytes. As shown in Table 1, for the input / output module in slot 1, 0x8000 to 0x803F in the configuration object dictionary are the allocation area for configuration parameters, and the configuration parameters issued by the master station can be placed in this area to take effect. In related technologies, the address space of each area in the configuration object dictionary is set according to the actual size of the corresponding configuration parameters, while in this embodiment, the address space of each area is reserved according to the maximum address space.
[0038] Table 1 The master station can, according to its configuration, write values to the corresponding sub-indexes of the allocated object (0x1C12 / 0x1C13) through Service Data Objects (SDOs), activating the required mapping objects (e.g., if slots 1 and 2 are used, then sub-indexes 2 and 3 are configured), thereby establishing a static mapping relationship desired by the master station. Each slot corresponds to one sub-index.
[0039] Step 402: Determine the actual data length of the configuration parameters of the target input / output module according to the preset configuration table.
[0040] In this embodiment of the application, the coupler also stores a preset configuration table, which includes relevant information about the input / output modules in the automated control system, such as the type of the input / output module and the actual data length of each configuration parameter corresponding to the input / output module.
[0041] The coupler can determine the actual data length of the configuration parameters of the target input / output module based on this preset configuration table.
[0042] Step 403: Based on the actual data length of the configuration parameters of the target input / output module, parse the first configuration parameter to obtain the second configuration parameter that the target input / output module can recognize, and send the second configuration parameter to the target input / output module.
[0043] In this embodiment, the target communication protocol master station can write configuration parameters to a specific area (e.g., parameter area 0x8n00 of slot n) in the coupler object dictionary through the write service in Service DataObjects. After receiving the parameters sent by the target communication protocol master station, the protocol stack in the coupler actively notifies the coupler application layer through a pre-registered callback function (e.g., AppDeviceParamManageConfig) and transmits key information, such as the parameter source (master station / host computer), the target slot bitmap, and the original parameter data. The target slot bitmap mentioned here refers to the slot bitmap of the target input / output module to be configured.
[0044] The coupler application layer determines the actual data length of the configuration parameters for the target input / output module based on an internally maintained preset configuration table. Based on this, it parses the tiling data sent from the master station into second configuration parameters recognizable by the target input / output module. Then, it sends the second configuration parameters to the target input / output module to complete the parameter configuration.
[0045] In this embodiment, a large, static data structure framework oriented towards the master station is maintained at the protocol level. From the master station's perspective, it always sees a standard slave station with standard behavior and a static device description file, requiring no special processing. At the runtime level, some or all resources within this framework can be dynamically managed and used. The coupler backend supports arbitrary hot-swapping and combination of input / output modules, enabling better flexible configuration of backend input / output modules and resolving the inherent contradiction between the static object dictionary required by standard communication protocols and the dynamic topology of backend input / output modules.
[0046] Optionally, in this embodiment, the coupler can also acquire the parameter configuration results of the target input / output module and feed them back to the target communication protocol master station. Based on this, the target communication protocol master station can determine whether the parameter configuration command was executed correctly. If it fails, the target communication protocol master station can decide to retry or report an error, thus ensuring the determinism of the system and forming a reliable configuration closed loop.
[0047] For example, after receiving the configuration parameters, the target input / output module performs a write operation and returns the execution result (success / failure and error code) to the coupler via a backplane bus response frame. The backplane protocol stack receives the response and returns the result to the APP layer. The APP layer aggregates the download results from all slots and, through the interface provided by the protocol stack, feeds back the configuration result to the EtherCAT master station.
[0048] In some alternative embodiments, after configuring the parameters of the target input / output module, the method may further include: With the target verification function disabled, periodic data of arbitrary length is sent to the target communication protocol master station.
[0049] The arbitrary length of periodic data mentioned here refers to the total length of all periodic data.
[0050] During runtime, the coupler application layer can scan the backplane bus to obtain the topology of the actual input / output modules and dynamically calculate the total required input / output data length. The protocol stack in the coupler obtains this dynamic length by calling the interface provided by the application layer and communicates with the target communication protocol master station.
[0051] The target verification function described here is used to verify whether the total data length of the mapping object definition of all enabled input / output modules is consistent with the pre-configured data length. Periodic data refers to the periodic data generated by the enabled input / output modules.
[0052] The protocol stack of a standard target communication protocol slave (such as an EtherCAT slave) strictly verifies whether the length configured in the manager channel matches the total data length defined for all active mapping objects. When the topology of the backend input / output modules changes (e.g., the type of some input / output modules changes), the total data length will also change, causing the verification to fail.
[0053] Therefore, this verification can be disabled, which allows the protocol stack to allow the SM data length configured by the master station to be inconsistent with the total length defined in the object dictionary, thus removing obstacles for dynamic length data communication.
[0054] Alternatively, this verification can be disabled by modifying the code generated by SSC (Simulink Embedded Coder).
[0055] In some alternative embodiments, the coupler includes a shared data buffer for storing coupler data and input / output module data.
[0056] Within this shared data buffer, all data can be arranged tightly in the order of "coupler data + slot 1 data + ... + slot 64 data". Here, slot 1 data represents the data from the input / output modules located in slot 1, and slot 64 data represents the data from the input / output modules located in slot 64.
[0057] In this embodiment of the application, the coupler protocol stack can obtain the starting address of the shared data buffer through the application layer interface. Based on the starting address, the protocol stack can directly read or write data in this shared data buffer.
[0058] The application layer can store input / output module data in the shared data buffer according to the actual input / output module topology for the protocol stack to read; or parse the data written by the protocol stack to the shared data buffer and distribute it to each specific input / output module.
[0059] In related technologies, data buffers need to be configured for different objects. For example, a data buffer is configured for the target communication protocol, a data buffer is configured for the backplane bus, and a data buffer is configured for the local control device. The same data needs to be copied multiple times when it is transmitted between the protocol stack and the application layer, which increases the communication latency. However, in the embodiments of this application, by setting up the shared data buffer, all interactive data is stored in this area, which can reduce the number of data copies, thereby reducing the latency of the data forwarding path, improving communication efficiency, and meeting the stringent real-time requirements of industrial control.
[0060] In some alternative embodiments, the coupler can enable reliable distribution of configuration parameters.
[0061] The coupler's APP layer can call the backplane bus protocol stack to send configuration parameters. The backplane protocol stack assembles the configuration parameter data passed from the APP layer into configuration command frames defined by the backplane bus communication protocol according to the slots. The backplane protocol stack then sends the configuration command frames to the target input / output modules, i.e., the input / output modules that need parameter configuration, via the backplane bus.
[0062] Optionally, the parameter delivery mode of the coupler may include: initialization delivery mode (i.e., full delivery mode) and online delivery mode (i.e., incremental delivery mode).
[0063] The full deployment mode means that when the system starts up or detects a significant change in the topology of the input / output modules (such as the similarity between the new topology and the previous topology being lower than a preset value (such as 10%, 20%)), the parameters of the input / output modules in all valid slots can be configured all at once.
[0064] Incremental configuration mode refers to configuring parameters only for individual or partial input / output modules whose parameters change while the system is running, thus avoiding affecting the use of the entire input / output system.
[0065] Therefore, the aforementioned step of sending the first configuration parameter to the second input / output module for parameter configuration may include: When the automated control system is in the startup state or the topology of the input / output module changes more than the preset value, the configuration parameters of the second input / output module are sent out in full download mode.
[0066] When the automated control system is in operation, the configuration parameters of the second input / output module are sent using the incremental download mode.
[0067] In some alternative embodiments, such as Figure 2 As shown, the automated control system also includes local control devices.
[0068] The configuration software in this local control device is a host computer application tool running on a Windows / Linux system. It can be connected to the coupler via USB or Ethernet to provide users with a graphical system configuration and monitoring interface.
[0069] The configuration software has the following functions: (1) Topology discovery and display: The configuration software can automatically scan and intuitively display the I / O types, slots and statuses connected on the backplane bus.
[0070] (2) Parameter configuration: The configuration software can provide users with graphical forms to edit, download, upload, save and compare the parameters of the coupler itself and each I / O module.
[0071] (3) Data monitoring: The configuration software can display the input / output data values of the I / O module in real time and supports the data forcing function for debugging.
[0072] (4) Diagnosis and Logs: The configuration software can provide a diagnostic information display, allowing users to query the coupler’s real-time diagnostic data and historical log files.
[0073] (5) Firmware upgrade: The configuration software can provide an interface for upgrading the firmware of the coupler and I / O module.
[0074] (6) Interaction with the Coupler: The configuration software can communicate with the coupler using a proprietary application layer protocol based on USB. This protocol encapsulates commands such as "read / write parameters", "read / write data", "read logs", and "firmware upgrade". The configuration software application module within the coupler is responsible for parsing and executing these commands and acts as a router for interacting with modules such as the protocol stack, configuration management, and diagnostics.
[0075] The configuration software can play the following roles in the system: (1) Offline configuration: During the system integration phase, engineers can use configuration software to pre-configure all I / O modules independently of the target communication protocol master station.
[0076] (2) Online monitoring and maintenance: When the system is running, maintenance personnel can connect to the configuration software to perform real-time monitoring, parameter fine-tuning, log downloading and firmware upgrade without interfering with the normal control of the target communication protocol master station.
[0077] (3) Complementary configuration with the target communication protocol master station: It forms two complementary configuration paths with the target communication protocol master station, which meet the needs of different scenarios.
[0078] Optionally, the configuration software can also be integrated into the target communication protocol master station software, and all configuration and monitoring operations can be performed through the target communication protocol link.
[0079] In this embodiment, both the target communication protocol master station and the local control device can send configuration parameters to the input / output module. The target communication protocol master station can interact with the coupler acting as a slave station through a specific non-periodic write service, passing the configuration parameters to the slave station's specific object instance data area. The local control device interacts with the coupler's application layer through specific service commands, passing the configuration parameters to the slave station's specific object instance data area. Therefore, the automated control system can include multiple configuration sources, and all multiple configuration sources can configure parameters for the same input / output module.
[0080] To avoid configuration conflicts, for example, if the local control device first configures the parameters of input / output module A, and then the coupler receives the configuration parameters of the target communication protocol master station for input / output module A, but at this time input / output module A needs to continue to work based on the parameters configured by the local control device, then to avoid such problems, it can be set that only one configuration source is effective at the same time, that is, only the configuration parameters issued by one configuration source can be effective. Therefore, in this embodiment, the coupler can verify whether the target configuration source corresponding to the first configuration parameter is the same as the currently set effective configuration source, as described below.
[0081] After receiving the first configuration parameters of the target input / output module sent by the target communication protocol master station in step 401, the method may further include steps A1 to A3: Step A1: Verify whether the target configuration source of the first configuration parameter is the same as the currently set effective configuration source.
[0082] Among them, the target configuration source and the effective configuration source are one of the target communication protocol master station and the local control device.
[0083] Step A2: If the target configuration source of the first configuration parameter is different from the currently set effective configuration source, confirm that the target configuration source is invalid and send feedback information to the target configuration source.
[0084] The feedback information is used to indicate that the configuration is invalid.
[0085] Step A3: If the target configuration source of the second configuration parameter is the same as the currently set effective configuration source, confirm that the target configuration source is valid.
[0086] If the target configuration source corresponding to the first configuration parameter is the same as the currently set effective configuration source, then the target configuration source is confirmed to be valid, and step 402 can be continued. Conversely, if the target configuration source corresponding to the configuration parameter is different from the currently set effective configuration source, then the target configuration source is confirmed to be invalid, the configuration parameter is discarded, and error codes and other feedback information are returned to the target configuration source of the first configuration parameter, thereby avoiding configuration confusion and further improving the reliability and consistency of configuration parameter transmission.
[0087] The coupler APP layer can maintain a global configuration activation source flag to indicate the currently effective configuration source. Optionally, this global configuration activation source flag can be set through the configuration software in the local control device. For example, the flag can be set to "1" to indicate that the local control device is effective, or it can be set to "0" to indicate that the target communication protocol master station is effective.
[0088] In this embodiment of the application, for application scenarios with multiple configuration sources, an effective configuration source can be set. After receiving the configuration parameters, the coupler can verify the target configuration source corresponding to the configuration parameters to determine whether it is an effective configuration source. If it is not an effective configuration source, the configuration parameter can be ignored, thereby avoiding configuration conflicts and confusion.
[0089] In some alternative embodiments, to avoid configuration errors during parameter configuration, such as mismatch between configuration parameters and input / output modules, after receiving the first configuration parameters of the target input / output module sent by the target communication protocol master station in step 401, the method may further include steps B1 to B3, as described below: Step B1: Verify whether the identification information of the input / output modules in the first configuration parameter matches the identification information of the input / output modules in the automated control system.
[0090] Step B2: If the identification information of the input / output module in the first configuration parameter does not match the identification information of the input / output module in the automation control system, it is determined that the first configuration parameter is incorrect.
[0091] Step B3: If the identification information of the input / output module in the first configuration parameter matches the identification information of the input / output module in the automated control system, the first configuration parameter is determined to be accurate.
[0092] In this embodiment, the coupler can extract the unique identifier information of the corresponding target input / output module from the first configuration parameter, and then match it with the unique identifier information of the input / output modules in the actual physical slot to determine whether the target input / output module is the same as the input / output module in the actual physical slot. If the unique identifier information of the target input / output module is the same as the unique identifier information of one of the input / output modules in the actual physical slot, the match is successful, and the first configuration parameter is considered accurate; conversely, if the unique identifier information of the target input / output module is different from the unique identifier information of any input / output module in the actual physical slot, the match fails, the first configuration parameter is considered incorrect, and the first configuration parameter can be ignored. This improves the reliability and consistency of the configuration parameter transmission process.
[0093] Specifically, the coupler APP layer can parse the implicit unique identifier of the target input / output module from the received first configuration parameter, and then strictly compare it with the actual physical topology information (i.e., the input / output module information in the physical slot) obtained by scanning the backplane bus. Only when the unique identifier of the input / output module existing in the current physical slot completely matches the target input / output module is the first configuration parameter considered accurate and valid; otherwise, the first configuration parameter will be considered invalid and ignored.
[0094] In some alternative embodiments, such as Figure 5 As shown, the coupler APP layer has a configuration parameter management module, which enables configuration parameter management. This module can include coupler parameters, backplane master station parameters, protocol parameters, input / output parameters, etc.
[0095] like Figure 6 As shown, after receiving the parameter configuration command from the target control device, the configuration parameter management module can determine whether it is in a configuration idle state. If it is in a configuration busy state, i.e., in the process of parameter configuration, it waits until it reaches a configuration idle state. If it is in a configuration idle state, it verifies the received configuration parameters. After the configuration parameters are verified, the module sequentially looks up the data in the table according to the slot index. During this process, it can perform operations such as copying and saving configuration parameters, updating the slot flag ulConfigValidBit, and updating the number of configurations ucConfigCount. After the data parsing is completed, the configuration parameters are downloaded (i.e., configuration parameter distribution). After the download is completed, the variable value of the configuration flag ucConfigFlag is updated. This configuration flag is used to indicate whether the download was successful. When the download is successful, the variable value of the configuration flag can be set to 1; when the download fails, the variable value of the configuration flag can be set to 0.
[0096] In some alternative embodiments, after obtaining the second configuration parameters recognizable by the target input / output module, the method may further include steps C1 to C2, as described below: Step C1: Save the second configuration parameters of the target input / output module.
[0097] Step C2: If the target input / output module is detected to be replaced by a new input / output module of the same type, configure the new input / output module based on the saved second configuration parameters.
[0098] In this embodiment, the coupler can save the second configuration parameters. When the corresponding target input / output module needs to be replaced with a new input / output module of the same type due to failure or other reasons, the saved second configuration parameters can be called to configure the new input / output module. This allows the input / output module to have hot-swappable characteristics after downloading the configuration parameters once, and newly inserted modules can be put into operation without reconfiguration.
[0099] In related technologies, diagnostic information of automated control systems is scattered across various input / output modules and couplers, lacking an easy mechanism for collection, summarization, and reporting. System status monitoring is incomplete, making it difficult to achieve rapid positioning and predictive dimensions. Therefore, the embodiments of this application provide the following solutions, as described below.
[0100] In some alternative embodiments, the coupler is equipped with a diagnostic system that can diagnose the coupler itself and the input / output modules at the back end, so as to detect and resolve problems in a timely manner and thus stop losses in time.
[0101] Accordingly, the method may also include steps D1 to D3, as described below: Step D1: Diagnose the first diagnostic item and the second diagnostic item using the diagnostic system.
[0102] The first diagnostic item mentioned here refers to items that require periodic diagnosis, while the second diagnostic item refers to items that are not subject to periodic diagnosis.
[0103] Optionally, the first diagnostic item may include, but is not limited to, at least one of the following: software task execution status in the coupler, protocol stack link status, power monitoring of input / output modules, whether the actual scanned input / output modules match the configuration information sent by the master station, and validity diagnosis of output / output module data.
[0104] Optionally, the second diagnostic item may include, but is not limited to, at least one of the following: coupler power monitoring, coupler temperature monitoring, backplane bus communication diagnostics, and configuration parameter diagnostics.
[0105] The diagnostic system in this application embodiment can realize multi-level diagnostic data acquisition and generation, as described below: (1) Hardware layer diagnostics, used to monitor the health status of the coupler itself in real time, specifically including the following diagnostic contents: Power supply monitoring: The system power supply and field power supply voltage are acquired through an analog-to-digital converter (ADC) to determine whether there is undervoltage or overvoltage. The system power supply mentioned here includes the input / output module power supply (corresponding to "Power Supply Monitoring of Input / Output Modules" in the first diagnostic item) and the coupler's own power supply (corresponding to "Power Supply Monitoring of Couplers" in the first diagnostic item).
[0106] Temperature monitoring: The internal temperature of the coupler is obtained through a temperature sensor to prevent overheating faults (corresponding to "coupler temperature monitoring" in the second diagnostic item).
[0107] Watchdog monitoring: Monitors the execution of software tasks in the coupler and detects infinite loops or blockages (corresponding to "Execution of software tasks in the coupler" in the first diagnostic item).
[0108] (2) Communication layer diagnostics, specifically including the following diagnostic contents: Protocol communication diagnostics: Real-time monitoring of the target communication protocol stack link status (Link Up / Down) (corresponding to "Protocol Stack Link Status" in the first diagnostic item).
[0109] Backplane bus communication diagnostics: Count the number of successful / failed communications for each input / output module, monitor bus load and bit error rate, and determine whether a module is offline or has timed out (corresponding to "backplane bus communication diagnostics" in the first diagnostic item).
[0110] (3) Application layer diagnostics, specifically including the following diagnostic contents: Topology consistency diagnosis: Compare whether the actual scanned input / output modules match the configuration information issued by the master station (corresponding to "whether the actual scanned input / output modules match the configuration information issued by the master station" in the first diagnostic item).
[0111] Configuration parameter diagnosis: Verify the legality and validity of configuration parameters (corresponding to "Configuration parameter diagnosis" in the second diagnosis item).
[0112] Data validity diagnosis: Check the reasonableness of input / output data, such as measurement range, etc. (corresponding to "output / output module data validity diagnosis" in the first diagnostic item).
[0113] Step D2: Periodically send the diagnostic results of the first diagnostic item to the target control device.
[0114] In this embodiment, the diagnostic results of diagnostic content requiring periodic diagnosis can be periodically sent to the target control device so that the target control device can make timely system-level decisions. The target control device mentioned here may include, but is not limited to, at least one of the following: a target communication protocol device, or a local control device.
[0115] Specifically, the diagnostic system can encode the most critical diagnostic information (such as power failure, communication failure, module offline, etc.) in the form of bits, arrange them closely in the process data, and send them to the target control device in real time with each cycle message.
[0116] Step D3: Store the diagnostic results of the second diagnostic item in the target area for querying by the target control device.
[0117] In this embodiment, diagnostic results for diagnostic content that does not require periodic diagnostics can be stored locally for the target control device to access and view at any time. For non-periodic diagnostic information, more detailed diagnostic data can be provided, such as precise voltage values, temperature values, communication error counters, and detailed module status. This information can be stored in a specific object dictionary, and the target control device can query it at any time through the Service Data Objects (SDO) service.
[0118] Optionally, the diagnostic system can also adopt different strategies for different levels of diagnostic events, progressing from "record only" to "alarm" and then to "trigger a safe state".
[0119] The diagnostic system described in this embodiment provides comprehensive and multi-dimensional diagnostic methods, ranging from real-time bits to detailed data, from periodic reporting to non-periodic queries, and from on-site indications to remote log analysis. This greatly improves the maintainability and reliability of the system, laying the foundation for predictive maintenance. Furthermore, the system monitors more comprehensively and provides more centralized fault information, enabling timely detection and rapid location of faults and problems.
[0120] In some alternative embodiments, the coupler also has logging and management functions, as described below.
[0121] like Figure 7 As shown, the initialization module, protocol stack adaptation module, diagnostic system, parameter configuration management module, backplane master station application module, and configuration software in the local control device in the coupler can all write logs to the log module in the coupler.
[0122] Each log record generated by the logging module includes a millisecond-level timestamp, execution code, and extended code, and uses a compact binary format to efficiently utilize storage space. These logs are used to record critical events during system operation, such as power-on, power-off, parameter modifications, topology changes, module failures, communication interruptions, and firmware upgrade start / end.
[0123] When these logs are cached, they are first written to a circular queue in Random Access Memory (RAM) to avoid loss due to write latency to Flash Memory. Furthermore, the system periodically stores the cached logs into specific sectors of external Flash memory on an hourly basis, or when important events occur, using a circular overwrite strategy for persistent storage. Optionally, newer types of memory such as FRAM or MRAM can be used to replace Flash Memory to improve read and write speeds.
[0124] Maintenance personnel can connect the coupler through the configuration software in the local control device to read log data for a specified time or range for post-event analysis and fault tracing.
[0125] In some optional embodiments, the coupler is also equipped with multiple indicator lights, which use different flashing patterns and colors to intuitively convey the system status to the field operator and realize human-machine interaction instructions.
[0126] These multiple indicator lights include, but are not limited to: the first indicator light, the second indicator light (error indicator light, also known as the ERR light), and the third indicator light (system fault indicator light, also known as the SF light).
[0127] The first indicator light is the running indicator light, also known as the RUN light, which is used to indicate the Ethernet communication status. For example, a solid light indicates normal communication; rapid flashing indicates a communication failure; and the indicator light being off indicates a communication interruption.
[0128] The second indicator light is the error indicator, also known as the ERR light; the third indicator light is the system fault indicator, also known as the SF light. The second indicator light indicates a hardware fault, and the third indicator light indicates a software fault. For example, a lit second indicator light indicates a hardware fault such as a power supply or temperature fault; a lit third indicator light indicates a module communication fault.
[0129] In summary, the data interaction method provided in this application maintains a large, static data structure framework oriented towards the master station at the protocol level, while dynamically managing and using some or all of the resources within this framework at the runtime level, thereby enabling flexible configuration of input / output modules. Furthermore, in this application embodiment, multi-level verification (such as configuration conflict and topology consistency) ensures that parameters are accurately and consistently sent to the target input / output modules. Further, this application embodiment also provides a multi-layered, unified, and aggregated diagnostic system, achieving system status visualization and precise positioning, significantly improving system availability. Moreover, the configuration software in the local control device complements the configuration of the target communication protocol master station, enhancing the system's configurability and maintainability. In conclusion, the overall solution provided in this application embodiment has high reliability, high flexibility, and ease of maintenance, making it suitable for industrial automation scenarios with extremely high real-time and reliability requirements.
[0130] Exemplary device Accordingly, embodiments of this application also provide a data interaction device applied to a coupler in an automated control system. For example... Figure 1 As shown, this coupler is used to bridge the target communication protocol master station in an automated control system with at least one input / output module (i.e., I / O module). The coupler and the input / output module are connected via a backplane bus.
[0131] The target communication protocol master station described here can control the input / output modules, such as configuring their parameters. The coupler, acting as a target communication protocol slave station, communicates with this master station, and the two can communicate based on a bus protocol. The target communication protocol master station can be an EtherCAT master station, and the coupler can be an EtherCAT slave station.
[0132] like Figure 8 As shown, the device may include: The receiving module 801 is used to receive the first configuration parameters of the target input / output module sent by the target communication protocol master station.
[0133] The data length of the configuration parameters of the input / output modules sent by the target communication protocol master station is uniformly aligned to the target data length based on the address space size of the configuration object dictionary of the input / output modules in the device description file of the coupler.
[0134] The determination module 802 is used to determine the actual data length of the configuration parameters of the target input / output module according to a preset configuration table.
[0135] The preset configuration table includes relevant information about the input / output modules in the automated control system.
[0136] The processing module 803 is used to parse the first configuration parameter according to the actual data length of the configuration parameter of the target input / output module, obtain the second configuration parameter that the target input / output module can recognize, and send the second configuration parameter to the target input / output module.
[0137] In some alternative embodiments, the apparatus may further include: The data transmission module is used to send periodic data of arbitrary length to the target communication protocol master station when the target verification function is disabled.
[0138] The target verification function is used to verify whether the total length of the data defined in the mapping object of all enabled input / output modules is consistent with the pre-configured data length; the periodic data is the periodic data generated by the enabled input / output modules.
[0139] In some alternative embodiments, the application layer of the coupler is provided with a shared data buffer for storing coupler data and input / output module data.
[0140] The coupler's protocol stack reads or writes data directly to the shared data buffer based on the starting address of the shared data buffer. The application layer in the coupler stores input / output module data in the shared data buffer according to the topology of the input / output modules for the protocol stack to read; or distributes data written by the protocol stack to the shared data buffer to the corresponding input / output modules.
[0141] In some alternative embodiments, the automated control system further includes a local control device connected to the coupler, which has the function of sending configuration parameters to the input / output module through the coupler.
[0142] The device may further include: The verification module is used to verify whether the target configuration source of the first configuration parameter is the same as the currently set effective configuration source.
[0143] The target configuration source and the effective configuration source are either the target communication protocol master station or the local control device.
[0144] The first confirmation module is used to confirm that the target configuration source is invalid and send feedback information to the target configuration source if the target configuration source of the first configuration parameter is different from the currently set effective configuration source.
[0145] The feedback information is used to indicate that the configuration is invalid.
[0146] The second confirmation module is used to confirm that the target configuration source is valid if the target configuration source of the first configuration parameter is the same as the currently set effective configuration source.
[0147] In some alternative embodiments, the apparatus may further include: A save module is used to save the second configuration parameters of the target input / output module.
[0148] The parameter configuration module is used to configure the new input / output module based on the saved second configuration parameters when the target input / output module is detected to be replaced by a new input / output module of the same type.
[0149] In some alternative embodiments, the coupler is provided with a diagnostic system.
[0150] The device may further include: A diagnostic module is used to diagnose a first diagnostic item and a second diagnostic item through the diagnostic system.
[0151] The first diagnostic item is the content that requires periodic diagnosis; the second diagnostic item is the content that is not periodic diagnosis.
[0152] The sending module is used to periodically send the diagnostic results of the first diagnostic item to the target communication protocol master station.
[0153] The storage module is used to store the diagnostic results of the second diagnostic item in the target area for querying by the target communication protocol master station.
[0154] In some optional embodiments, the first diagnostic item includes at least one of the following: software task execution status in the coupler, protocol stack link status, power monitoring of input / output modules, whether the actual scanned input / output modules match the configuration information issued by the master station, and validity diagnosis of output / output module data.
[0155] The second diagnostic item includes at least one of the following: power monitoring of the coupler, temperature monitoring of the coupler, backplane bus communication diagnostics, and configuration parameter diagnostics; the backplane bus is a bus used to connect the coupler and the input / output module.
[0156] The data interaction device provided in this embodiment belongs to the same application concept as the data interaction method provided in the above embodiments of this application. It can execute the data interaction method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment can be found in the specific processing content of the data interaction method provided in the above embodiments of this application, and will not be repeated here.
[0157] Exemplary electronic devices This application also provides an electronic device, such as... Figure 9 As shown, the electronic device includes a memory 900 and a processor 910.
[0158] The memory 900 is connected to the processor 910 and is used to store programs.
[0159] The processor 910 is used to implement the data interaction method in the above embodiments by running the program stored in the memory 900.
[0160] Specifically, the aforementioned electronic device may also include: a communication interface 920, an input device 930, an output device 940, and a bus 950.
[0161] The processor 910, memory 900, communication interface 920, input device 930, and output device 940 are interconnected via a bus. Among them: Bus 950 may include a pathway for transmitting information between various components of a computer system.
[0162] The processor 910 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0163] The processor 910 may include a main processor, as well as a baseband chip, modem, etc.
[0164] The memory 900 stores a program that executes the technical solution of this invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 900 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0165] Input device 930 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0166] Output device 940 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0167] The communication interface 920 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0168] The processor 910 executes the program stored in the memory 900 and calls other devices, which can be used to implement the various steps of the data interaction method provided in the above embodiments of this application.
[0169] Exemplary computer program products and storage media In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the data interaction method described in the embodiments of this application.
[0170] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0171] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0172] Furthermore, embodiments of this application may also be storage media storing a computer program, which is executed by a processor of the steps in the data interaction method described in the embodiments of this application.
[0173] Furthermore, embodiments of this application may also be chips, which include processors and data interfaces. The processor reads instructions stored in the memory through the data interface to execute the steps in the data interaction method described in the embodiments of this application.
Claims
1. A data interaction method, characterized in that, A coupler applied to an automation control system, the coupler being used to connect a target communication protocol master station and an input / output module in the automation control system; The method comprises: receiving first configuration parameters of a target input / output module sent by the target communication protocol master station; wherein the data length of the configuration parameters of the input / output module sent by the target communication protocol master station is uniformly aligned to a target data length based on the address space size of a configuration object dictionary of the input / output module in a device description file of the coupler; determining the actual data length of the configuration parameters of the target input / output module according to a preset configuration table; wherein the preset configuration table comprises relevant information of the input / output module in the automation control system; parsing the first configuration parameters according to the actual data length of the configuration parameters of the target input / output module to obtain second configuration parameters recognizable by the target input / output module, and sending the second configuration parameters to the target input / output module.
2. The data interaction method of claim 1, wherein, After completing the parameter configuration of the target input / output module, the method further comprises: in the case of closing a target verification function, sending periodic data of an arbitrary length to the target communication protocol master station; wherein the target verification function is used to verify whether the total data length defined by the mapping object of all enabled input / output modules is consistent with the preconfigured data length; the periodic data is periodic data generated by the started input / output module.
3. The data interaction method of claim 1, wherein, A shared data buffer is arranged in the application layer of the coupler, and the shared data buffer is used to store coupler data and input / output module data; The protocol stack of the coupler directly reads or writes data in the shared data buffer based on the first address of the shared data buffer; The application layer in the coupler stores input / output module data to the shared data buffer according to the topology of the input / output module, so as to be read by the protocol stack; or distributes the data written by the protocol stack in the shared data buffer to the corresponding input / output module.
4. The data interaction method of claim 1, wherein, The automation control system further comprises a local control device connected with the coupler, and having the function of sending configuration parameters to the input / output module through the coupler; After receiving the first configuration parameters of the target input / output module sent by the target communication protocol master station, the method further comprises: verifying whether the target configuration source of the first configuration parameters is the same as the currently set effective configuration source; wherein the target configuration source and the effective configuration source are one of the target communication protocol master station and the local control device; in the case that the target configuration source of the first configuration parameters is different from the currently set effective configuration source, confirming that the target configuration source is invalid, and sending feedback information to the target configuration source; wherein the feedback information is used to indicate that the configuration is invalid; in the case that the target configuration source of the first configuration parameters is the same as the currently set effective configuration source, confirming that the target configuration source is valid.
5. The data interaction method of claim 1, wherein, After the second configuration parameter recognizable by the target input / output module is obtained, the method further comprises: saving the second configuration parameter of the target input / output module; in the case of detecting that the target input / output module is replaced by a new input / output module of the same type, configuring the new input / output module based on the saved second configuration parameter.
6. The data interaction method of claim 1, wherein, The coupling device is provided with a diagnostic system, and the method further comprises: diagnosing a first diagnostic item and a second diagnostic item through the diagnostic system; wherein the first diagnostic item is a content that needs periodic diagnosis; and the second diagnostic item is a content that is not periodically diagnosed; periodically sending a diagnosis result of the first diagnostic item to the target communication protocol master station; storing a diagnosis result of the second diagnostic item in a target area for the target communication protocol master station to query.
7. The data interaction method of claim 6, wherein, The first diagnostic item comprises at least one of the following: software task execution in the coupling device, protocol stack link state, power supply monitoring of the input / output module, whether the actually scanned input / output module matches the configuration information issued by the master station, and validity diagnosis of output / input module data; The second diagnostic item comprises at least one of the following: power supply monitoring of the coupling device, temperature monitoring of the coupling device, backplane bus communication diagnosis, and configuration parameter diagnosis; the backplane bus is a bus used to connect the coupling device and the input / output module.
8. A data interaction device, characterized by A coupling device applied to an automatic control system, the coupling device being used to connect a target communication protocol master station and an input / output module in the automatic control system; The device comprises: a receiving module configured to receive a first configuration parameter of a target input / output module sent by the target communication protocol master station; wherein the data length of the configuration parameter of the input / output module sent by the target communication protocol master station is uniformly aligned to a target data length based on the address space size of a configuration object dictionary of the input / output module in a device description file of the coupling device; a determining module configured to determine an actual data length of the configuration parameter of the target input / output module according to a preset configuration table; wherein the preset configuration table comprises related information of the input / output module in the automatic control system; a processing module configured to parse the first configuration parameter according to the actual data length of the configuration parameter of the target input / output module, obtain a second configuration parameter recognizable by the target input / output module, and send the second configuration parameter to the target input / output module.
9. An electronic device, comprising: comprise: a memory and a processor; the memory is connected with the processor and is used to store programs; the processor is used to realize the data interaction method of any one of claims 1 to 7 by running the programs in the memory.
10. A computer program product, characterised in that, The computer program product has a computer program stored thereon, and the computer program, when run by a processor, realizes the data interaction method of any one of claims 1 to 7.
Citation Information
Patent Citations
Gateway module configuration method and device
CN118713962A
Programmable Logic Controller with embedded Intelligent Web Server
US20030204560A1
Cited By
A host computer communication method supporting a multi-protocol coupler
CN122204979A
