An integrated gateway and its application method, system, electronic device and storage medium
By integrating the gateway design, FPGA and MCU are used to realize the data mapping and latency control of Profibus DP and Modbus RTU protocols, which solves the problem that existing communication gateways cannot exchange data efficiently and transparently, and provides a solution with low latency, high reliability and convenient configuration.
Patent Information
- Application Number
- CN202611214331.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-11
- Publication Date
- 2026-11-10
AI Technical Summary
Existing Profibus DP and Modbus RTU protocol communication gateways cannot achieve bidirectional, efficient, and transparent data exchange, and lack low latency, high reliability, and ease of configuration, as well as strong compatibility.
Design an integrated gateway that includes a Profibus DP interface, a Modbus RTU interface, an FPGA, an MCU, and a memory. Data mapping and latency control are achieved through the FPGA's buffer management area and parsing engine, and parameter configuration and communication status monitoring are performed in conjunction with a configuration management interface module.
It enables low-latency, high-reliability data exchange between the DP master station and the RTU slave station, features convenient configuration management and strong compatibility, and supports bidirectional transparent data transmission.
Smart Images

Figure CN123074867A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation communication technology, and in particular to an integrated gateway and its application methods, systems, electronic devices and storage media. Background Technology
[0002] In industrial automation production scenarios, fieldbus technology is the core support for realizing data transmission and control command interaction between devices. Among them, Profibus DP (Decentralized Periphery) fieldbus, with its high-speed and deterministic communication characteristics, is widely used in main control systems composed of PLCs and distributed I / O devices; while Modbus RTU protocol, due to its advantages of simple structure, strong openness, and low cost, is widely used in various intelligent instruments, power monitoring equipment, frequency converters, and other terminal devices.
[0003] Profibus DP and Modbus RTU differ fundamentally in their communication mechanisms, data encapsulation formats, addressing methods, and physical layer interfaces, making direct data communication impossible between devices using these two protocols. Specifically: Profibus DP employs a token-passing mechanism, supports a hybrid mode of periodic polling and event-driven processing, defines device I / O structures through GSD (General Station Description) files, and transmits data based on Profidata format input / output byte blocks; Modbus RTU, on the other hand, uses a master / slave request-response mechanism, accesses data using function codes and register addresses, primarily employs RS-485 interfaces at the physical layer, and encapsulates data in PDU (Protocol Data Unit) structures. Due to these significant differences at the physical, data link, and application layers, direct communication between the two protocols is impossible.
[0004] The existing communication gateways for the two types of buses can only achieve the effect of not interfering with each other during operation by setting multiple protocol interfaces through single protocol switching. They cannot perform bidirectional, efficient, and transparent data exchange, nor can they simultaneously possess the characteristics of low latency, high reliability, convenient configuration, and strong compatibility. Summary of the Invention
[0005] In view of this, in order to solve the problem that existing communication gateways cannot perform bidirectional, efficient and transparent data exchange, nor can they simultaneously possess the characteristics of low latency, high reliability, convenient configuration and strong compatibility, the present invention provides an integrated gateway and its application method, system, electronic device and storage medium.
[0006] In a first aspect, an integrated gateway is provided for communication between a DP master station and an RTU slave station, comprising: a Profibus DP interface connected to the DP master station, a Modbus RTU interface connected to the RTU slave station, an FPGA connected between the Profibus DP interface and the Modbus RTU interface, an MCU connected to the FPGA, and a memory and configuration management interface module connected to both ends of the MCU. Configure the management interface module to perform bidirectional serial parameter configuration, mapping table editing, communication status monitoring, and communication firmware upgrades between the DP master station and the RTU slave station; The memory is used to store the serial parameter configuration files, mapping tables, device parameters, and historical monitoring data of the DP master station and RTU slave station; MCU is used to control the configuration management interface module and memory; FPGA, used to control the Profibus DP interface and Modbus RTU interface; The Profibus DP interface is used to receive read and write requests from the DP master station, send them to the processor, and execute the mapping instructions issued by the processor. The Modbus RTU interface is used to receive read and write requests from RTU slaves, send them to the processor, and execute the mapping instructions issued by the processor.
[0007] In one possible embodiment, the FPGA includes: At least two buffer management areas are used between the DP master station and the RTU slave station. As a data address, they store the write request data of the DP master station according to the instructions of the mapping table, realizing the mapping of data to the RTU slave station. They are also used as response data areas, storing the read request RTU data returned by the RTU slave station according to the instructions of the mapping table, realizing the mapping of RTU data to the DP master station when the DP master station initiates a read request.
[0008] In one possible embodiment, the buffer management area includes: The parsing engine is used to generate a sequence of read and write instructions from the DP master station to the RTU slave station based on the entries in the mapping table, and to set the delay time from the DP master station to the RTU slave station. The mapping table is used to map the correspondence, storage location, word writing order, data type, and triggering conditions of read and write request data.
[0009] In one possible embodiment, the configuration management interface module includes: an RJ45 connector, an interface protection circuit, and an RS232 transceiver connected via pin signal lines; the RS232 transceiver is connected to the MCU via pin signal lines.
[0010] In one possible embodiment, the Profibus DP interface includes: an interface protection circuit, an RS485 transceiver circuit, and a DP slave protocol chip; The Modbus RTU interface includes: RS485 transceiver circuit and interface protection circuit.
[0011] Secondly, an integrated gateway application method is provided for mapping data from the DP master station to the RTU slave station, including: Obtain write request data sent from the DP master station to the RTU slave station; The write request data is parsed and written to the cache management area according to the pre-loaded configuration file and mapping table; When the parsing engine confirms a change in the cache management area, it generates a mapping instruction containing the write request data and sends it to the RTU slave.
[0012] Thirdly, an integrated gateway application method is provided for mapping data from RTU slave stations to DP master stations, including: Based on the pre-loaded configuration file and mapping table, the RTU data sent by the RTU slave station is stored in the cache management area; When the DP master station issues a read request for the corresponding RTU data, it is determined whether the cache management area is within the preset response period; If the parsing engine confirms a change in the cache management area within the preset response period, it packages the read request RTU data stored in the cache management area and sends it back to the DP master station. If it does not respond within the preset response period, it polls each RTU slave station and generates a mapping instruction containing the read request RTU data after the RTU slave station responds, and sends it back to the DP master station.
[0013] Fourthly, an application system integrating a gateway is provided, including: The processor is used to acquire and parse the write request data sent from the DP master station to the RTU slave station during data downlink, and write the write request data to the cache management area according to the pre-loaded configuration file and mapping table; when the parsing engine confirms the change in the cache management area, it is used to generate a mapping instruction containing the write request data and send it to the RTU slave station. The processor is also used to store the RTU data sent by the RTU slave in the cache management area according to the pre-loaded configuration file and mapping table when the data is uplinked; when the DP master sends a read request for the corresponding RTU data, if the cache management area is within the preset response period and the parsing engine confirms the change in the cache management area, the processor packages the read request RTU data stored in the cache management area and sends it back to the DP master; if it is not within the preset response period, the processor polls each RTU slave and generates a mapping instruction containing the read request RTU data after the RTU slave responds, and sends it back to the DP master.
[0014] Fifthly, an electronic device is provided, comprising: a processor and a memory, the processor being configured to execute an application program of an integrated gateway stored in the memory to implement the application method of the integrated gateway as claimed in the claims.
[0015] In a sixth aspect, a storage medium is provided that stores one or more programs, which can be executed by one or more processors to implement the application method of the integrated gateway as described in the claims.
[0016] This invention provides an integrated gateway comprising: a Profibus DP interface connected to a DP master station, a Modbus RTU interface connected to an RTU slave station, an FPGA and an MCU connected between the Profibus DP interface and the Modbus RTU interface, and a configuration management interface module connected to both ends of the MCU for bidirectional serial parameter configuration, mapping table editing, communication status monitoring, and communication firmware upgrades between the DP master station and the RTU slave station; a memory storing serial parameter configuration files, mapping tables, device parameters, and historical monitoring data of the DP master station and the RTU slave station; the MCU controlling the configuration management interface module and the memory; the FPGA controlling the Profibus DP interface and the Modbus RTU interface; the Profibus DP interface receiving read / write requests from the DP master station and sending them to the processor, executing mapping instructions issued by the processor; and the Modbus RTU interface receiving read / write requests from the RTU slave station and sending them to the processor, executing mapping instructions issued by the processor. This provides an integrated gateway with low latency, high reliability, convenient configuration, and strong compatibility, enabling bidirectional, efficient, and transparent data exchange. Attached Figure Description
[0017] The accompanying drawings, which form part of this specification, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings: Figure 1 A structural diagram of an integrated gateway provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a configuration management interface module provided in an embodiment of the present invention; Figure 3 A flowchart illustrating an embodiment of an application method for an integrated gateway provided by the present invention; Figure 4 A flowchart illustrating an embodiment of another application method for an integrated gateway provided by the present invention; Figure 5 A flowchart illustrating another embodiment of the application method of an integrated gateway provided by the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.
[0019] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this invention is for describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.
[0020] See Figure 1 This is a structural diagram of an integrated gateway provided in an embodiment of the present invention. The integrated gateway of the present invention can be used for communication between a DP master station and an RTU slave station. Figure 1 As shown, the DP master here mainly refers to DP devices using the Profibus DP protocol as their fieldbus outside the integrated gateway, such as PLCs. The RTU slave refers to RTU devices using the Modbus RTU protocol as their fieldbus outside the integrated gateway, such as the RTU itself. Both DP and RTU devices are devices with serial communication interfaces and support the corresponding protocols. Examples include frequency converters, servo drives, smart meters, weighing sensors, transmitters, remote I / O modules, multi-functional power meters, and DC power supplies. This integrated gateway can be applied to scenarios such as semiconductor and precision manufacturing, new energy power plants, and pharmaceutical and process industries.
[0021] In one embodiment, such as Figure 1 As shown, the integrated gateway may include: a Profibus DP interface connected to the DP master station, a Modbus RTU interface connected to the RTU slave station, an FPGA connected between the Profibus DP interface and the Modbus RTU interface, an MCU connected to the FPGA, and memory and configuration management interface modules connected to both ends of the MCU. The FPGA and MCU are used as central processing units. The MCU can be a high-performance 32-bit microcontroller, GigaDevice GD32F450ZIT6, with a Cortex-M4 architecture. The FPGA can be a Unisoc PGL22G-6IFBG256. Communication between the FPGA and the FPGA can be achieved using QSPI for data exchange.
[0022] The configuration management interface module allows for bidirectional serial parameter configuration, mapping table editing, communication status monitoring, and communication firmware upgrades between the DP master and RTU slave stations. (See also...) Figure 2 This is a structural diagram of a configuration management interface module provided in an embodiment of the present invention, as shown below. Figure 2 As shown, it may include: an RJ45 connector, an interface protection circuit, and an RS232 transceiver connected via pin signal lines; the RS232 transceiver is connected to the MCU via pin signal lines.
[0023] Here, the RJ45 connector, as a physical interface, is usually a network port socket with a built-in transformer. It mainly serves to isolate and couple signals, preventing high-voltage surges on the network cable from directly damaging the internal circuitry.
[0024] Interface protection is crucial in industrial environments. It typically includes components such as surge protectors and ESD suppressors to ensure stable communication in complex electromagnetic environments and prevent damage to backend circuitry from hot-swapping or lightning surges.
[0025] Transceiver: also known as Ethernet PHY chip. It can convert differential analog signals transmitted from RJ45, such as gigabit / hundred-megabit differential pairs, into digital signals that can be processed by the MCU, and acts as a bridge between the physical layer and the MAC layer.
[0026] The serial parameters here may include, but are not limited to: slave address, baud rate, etc.
[0027] Figure 2 In this configuration, the RJ45 connector transmits and configures the receive data signal via pin 4 (Cfg_RXD) and the transmit data signal via pin 5 (Cfg_TXD). The RS232 transceiver can be a Silergy TPT3232E-SO3R. The MCU can be a GigaDevice GD32F450ZIT6. Therefore, in serial communication, the TXD signal line is used for data transmission, and the RXD signal line is used for data reception. A GND signal line can also be added for ground level reference.
[0028] The memory can be used to store serial parameter configuration files, mapping tables, device parameters, and historical monitoring data for the DP master and RTU slave stations. The memory can be non-volatile memory, such as EEPROM, and can be a Shanghai Belling BL24C64A-PARC.
[0029] MCU can be used to control configuration management interface modules and memory.
[0030] FPGA can be used to control Profibus DP interface and Modbus RTU interface.
[0031] The PROFIBUS DP interface can be used to receive read and write requests from the DP master station, send them to the processor, and execute mapping instructions issued by the processor. In other words, it accesses the corresponding data area according to the mapping rules of the internal mapping table. The external hardware of the PROFIBUS DP interface module can consist of interface protection circuitry and RS485 transceiver circuitry. The RS485 transceiver can be a Silergy TPT481L1-SO1R, and the DP slave protocol chip can be a Zhongke Bowei APC3 protocol chip.
[0032] The Modbus RTU interface can be used to receive read and write requests from RTU slaves, send them to the processor, and execute mapping instructions issued by the processor. It also acts as a Modbus RTU master, connecting and communicating with one or more lower-level Modbus RTU slaves, responsible for sending read and write commands to the slaves according to a preset polling strategy and parsing the slaves' responses. The external hardware of the Modbus RTU interface module can consist of RS485 transceiver circuitry and interface protection circuitry; the RS485 transceiver can be a Silergy TPT481L1-SO1R.
[0033] This mapping table can be used to map the correspondence, storage location, word writing order, data type, and triggering conditions of read and write request data. Furthermore, this mapping table supports online editing and dynamic loading. Users can modify the mapping relationship through the configuration and management interface module. Modified configurations take effect without restarting the device, or new configurations can be made effective at the start of the next communication cycle via security commands.
[0034] For example, the corresponding response from the RTU slave station can be found in the mapping table based on the read / write request data sent by the DP master station, thus establishing a data correspondence. The data types of historical requests and responses can be set in separate storage locations within the memory, and these storage locations can be recorded and mapped to their corresponding data types.
[0035] Furthermore, it can establish data analysis rules regarding byte order, parsing frequency, and other aspects. It can also determine the mapping order based on the urgency of data requests.
[0036] It can also trigger the information extraction function when similar read / write requests occur, such as loading the corresponding response data from the memory when similar read / write requests occur.
[0037] Furthermore, the FPGA may include at least two buffer management areas between the DP master and the RTU slave. One serves as a data address area, storing write request data from the DP master according to the mapping table, thus mapping data to the RTU slave. The other serves as a response data area, storing read request RTU data returned by the RTU slave according to the mapping table, thus mapping RTU data to the DP master when the DP master initiates a read request. This module defines at least two independent, dynamically configurable mapping areas.
[0038] It should be noted that this buffer management area physically resides within the FPGA. Leveraging its hardware parallelism and dual-port data buffering capabilities with shared access, it provides a high-speed, conflict-free data exchange channel for the DP side, RTU side, and MCU side. The MCU, on the other hand, is responsible for logically accessing this buffer management area, reading and writing data via the PROFIBUS DP interface, and performing tasks such as protocol exchange and dynamic configuration management of mapping tables. This fully utilizes the advantages of the FPGA in high-speed data transport and the MCU in complex logic processing.
[0039] The buffer management area includes: a parsing engine, which generates a sequence of read and write instructions from the DP master to the RTU slave based on entries in the mapping table, and can set the delay time from the DP master to the RTU slave.
[0040] In one embodiment, when the write request data from the DP master is mapped to the RTU slave, it can be used as a buffer management area (Q area) for the data address. When the Profibus DP master writes data into this area, it will be read by the parsing engine (instruction parsing and scheduling engine) and converted into the corresponding Modbus RTU write mapping instruction according to the pre-stored mapping table. For example, writing a single coil, writing multiple registers, etc., and then sent to the RTU slave by the Modbus RTU interface.
[0041] Furthermore, read request data sent by the DP master can be mapped back to the DP master by the RTU slaves. In this case, the buffer management area serves as the response data area (I area). Data read from each RTU slave via the Modbus RTU interface, such as read register values, is filled into the corresponding positions in this area according to the mapping table. The Profibus DP master can then read data from this area during the next poll to obtain the latest field device status.
[0042] The integrated gateway may also include a diagnostic and alarm module. This module continuously monitors parameters such as the physical link status, communication message error rate, and timeout count on both sides of the Profibus DP and Modbus RTU. When an anomaly is detected, it issues alarm information through indicator lights, displays, or network packets on the configuration and management interface module, and stores the fault log as historical diagnostic data in the memory.
[0043] Specifically, engineers can use a laptop connected via an RJ45 connector and a network cable to view real-time communication status and diagnostic logs, and modify mapping tables. For example, they can add a data point mapping for a newly connected Modbus thermometer and hygrometer. After saving, the new mapping configuration takes effect immediately without interrupting production. Understandably, when your computer connects through the configuration and management interface module, the MCU is responsible for parsing the received configuration commands, such as modifying the mapping table or upgrading the firmware, updating internal serial parameters, and also packaging diagnostic data and sending it back to memory.
[0044] See Figure 3 This is a flowchart illustrating an embodiment of an integrated gateway application method provided by the present invention. This process is applied to the mapping of data from the DP master station to the RTU slave station, such as... Figure 3 As shown, it may include: Step 101: Obtain the write request data sent from the DP master station to the RTU slave station.
[0045] Step 102: Parse the write request data and write the write request data to the cache management area according to the pre-loaded configuration file and mapping table.
[0046] Step 103: When the parsing engine confirms the change in the cache management area, it generates a mapping instruction containing write request data and sends it to the RTU slave station.
[0047] The following is a unified explanation of steps 101 to 103: In one embodiment, this can be understood in conjunction with the buffer management area of the aforementioned shared access dual-port data buffer attribute. See also Figure 4 The flowchart below illustrates another embodiment of the application method of an integrated gateway provided by the present invention. Figure 4 As shown, before executing the steps, the integrated gateway can be powered on and initialized. Then, the configuration file and mapping table are loaded from memory via the IIC communication protocol. This enables the Profibus DP interface to establish a DP communication relationship with the upstream DP master station. The Modbus RTU interface can initialize the serial port according to the configured serial parameters.
[0048] After that, as Figure 4As shown, steps 101 to 103 involve downlink data transfer from the master station to the slave DP master station. A write request is initiated to the output mapping area (Q area) of the integrated gateway via the Profibus DP interface, for example, to set the speed of a frequency converter. The processor parses the request and writes the data to the specified location in the DP->Modbus (Q area) buffer management area. The parsing engine detects a change in the data in this area and immediately, or in the next scheduling cycle, generates a Modbus RTU write register command for the RTU slave station and sends it out through the Modbus RTU interface module to complete the control of the field device.
[0049] In addition to data downlink, data uplink is also possible. See [link / reference] Figure 5 The flowchart below illustrates another embodiment of the application method of an integrated gateway provided by the present invention. Figure 5 As shown, this process is applied to the mapping of data from the RTU slave station to the DP master station and may include: Step 201: Based on the pre-loaded configuration file and mapping table, store the RTU data sent by the RTU slave station in the cache management area.
[0050] Step 202: When the DP master station issues a read request for the corresponding RTU data, determine whether the cache management area is within the preset response period, and generate a mapping instruction based on the selected response form, and reply to the DP master station.
[0051] The process of determining whether the cache management area is within the preset response period and selecting the form of response may include: if it is within the preset response period, the parsing engine confirms the change in the cache management area, then packages the read request RTU data stored in the cache management area and replies to the DP master station; if it is not within the preset response period, it polls each RTU slave station, and after the RTU slave station responds, generates a mapping instruction containing the read request RTU data and replies to the DP master station.
[0052] In one embodiment, the upstream DP master station initiates a read request for the input area (I area) of the integrated gateway via the Profibus DP interface. For example... Figure 4 As shown, after receiving a request, the gateway's processor checks the Modbus->DP mapping area (I area) in the buffer management zone. If it determines that the data in this area has expired according to the pre-set refresh cycle, the parsing engine will organize Modbus RTU read commands sequentially according to the order and frequency defined in the mapping table. It will poll each RTU slave station through the Modbus RTU interface module, that is, poll for the content of the corresponding read request, such as real-time temperature or current values. After the RTU slave station responds, the parsing engine updates the data to the corresponding position in the mapping area, and then the processor packages the latest mapping area data and sends it back to the DP master station via the ModbusRTU interface.
[0053] This invention provides an integrated gateway comprising: a Profibus DP interface connected to a DP master station, a Modbus RTU interface connected to an RTU slave station, an FPGA and an MCU connected between the Profibus DP interface and the Modbus RTU interface, and a configuration management interface module connected to both ends of the MCU for bidirectional serial parameter configuration, mapping table editing, communication status monitoring, and communication firmware upgrades between the DP master station and the RTU slave station; a memory storing serial parameter configuration files, mapping tables, device parameters, and historical monitoring data of the DP master station and the RTU slave station; the MCU controlling the configuration management interface module and the memory; the FPGA controlling the Profibus DP interface and the Modbus RTU interface; the Profibus DP interface receiving read / write requests from the DP master station and sending them to the processor, executing mapping instructions issued by the processor; and the Modbus RTU interface receiving read / write requests from the RTU slave station and sending them to the processor, executing mapping instructions issued by the processor. This provides an integrated gateway with low latency, high reliability, convenient configuration, and strong compatibility, enabling bidirectional, efficient, and transparent data exchange.
[0054] An application system for an integrated gateway, provided in an embodiment of the present invention, is executable by a processor and includes: The processor is used to acquire and parse the write request data sent from the DP master station to the RTU slave station during data downlink, and write the write request data to the cache management area according to the pre-loaded configuration file and mapping table; when the parsing engine confirms the change in the cache management area, it is used to generate a mapping instruction containing the write request data and send it to the RTU slave station. The processor is also used to store the RTU data sent by the RTU slave in the cache management area according to the pre-loaded configuration file and mapping table when the data is uplinked; when the DP master sends a read request for the corresponding RTU data, if the cache management area is within the preset response period and the parsing engine confirms the change in the cache management area, the processor packages the read request RTU data stored in the cache management area and sends it back to the DP master; if it is not within the preset response period, the processor polls each RTU slave and generates a mapping instruction containing the read request RTU data after the RTU slave responds, and sends it back to the DP master.
[0055] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 6The illustrated electronic device includes at least one processor, memory, at least one network interface, and other user interfaces. The various components within the electronic device are coupled together via a bus system. It is understood that the bus system is used to enable communication and connection between these components. In addition to a data bus, the bus system also includes a power bus, a control bus, and a status signal bus.
[0056] The user interface may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0057] It is understood that the memory in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memories described herein are intended to include, but are not limited to, these and any other suitable types of memory.
[0058] In some implementations, the memory stores elements such as executable units or data structures, or subsets thereof, or extended sets thereof: operating systems and applications.
[0059] The operating system includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application programs include various applications, such as media players and browsers, used to implement various application functions. The program implementing the method of this invention can be included in the application programs.
[0060] In this embodiment of the invention, by calling a program or instruction stored in the memory, specifically a program or instruction stored in an application program, the processor executes the method steps provided in each method embodiment, including, for example: Obtain write request data sent from the DP master station to the RTU slave station; The write request data is parsed and written to the cache management area according to the pre-loaded configuration file and mapping table; When the parsing engine confirms a change in the cache management area, it generates a mapping instruction containing the write request data and sends it to the RTU slave.
[0061] Alternatively, the method steps provided in each method embodiment may be performed, including, for example: Based on the pre-loaded configuration file and mapping table, the RTU data sent by the RTU slave station is stored in the cache management area; When the DP master station issues a read request for the corresponding RTU data, it is determined whether the cache management area is within the preset response period; If the parsing engine confirms a change in the cache management area within the preset response period, it packages the read request RTU data stored in the cache management area and sends it back to the DP master station. If it does not respond within the preset response period, it polls each RTU slave station and generates a mapping instruction containing the read request RTU data after the RTU slave station responds, and sends it back to the DP master station.
[0062] The methods provided in the above embodiments of the present invention can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a 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. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0063] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0064] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0065] The electronic device provided in this embodiment may be as follows: Figure 6 The electronic device shown can perform the following: Figures 3-5 All steps of the application method of the integrated gateway, thereby achieving Figures 3-5 For details on the technical effects of the integrated gateway application method, please refer to [link / reference]. Figures 3-5 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0066] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.
[0067] When one or more programs in the storage medium can be executed by one or more processors to implement the above-described application method of an integrated gateway executed on the electronic device side.
[0068] The processor is used to execute the application program of the integrated gateway stored in the memory to implement the following steps of the integrated gateway application method executed on the electronic device side: Obtain write request data sent from the DP master station to the RTU slave station; The write request data is parsed and written to the cache management area according to the pre-loaded configuration file and mapping table; When the parsing engine confirms a change in the cache management area, it generates a mapping instruction containing the write request data and sends it to the RTU slave.
[0069] Alternatively, follow these steps to implement the application method of another integrated gateway: Based on the pre-loaded configuration file and mapping table, the RTU data sent by the RTU slave station is stored in the cache management area; When the DP master station issues a read request for the corresponding RTU data, it is determined whether the cache management area is within the preset response period; If the parsing engine confirms a change in the cache management area within the preset response period, it packages the read request RTU data stored in the cache management area and sends it back to the DP master station. If it does not respond within the preset response period, it polls each RTU slave station and generates a mapping instruction containing the read request RTU data after the RTU slave station responds, and sends it back to the DP master station.
[0070] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative in all respects and are not the only ones. All modifications within the scope of this invention or its equivalents are included in this invention.
[0071] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0072] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0075] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. An integrated gateway for communication between a DP master station and an RTU slave station, comprising: The Profibus DP interface connected to the DP master station, the Modbus RTU interface connected to the RTU slave station, the FPGA connected between the Profibus DP interface and the Modbus RTU interface, the MCU connected to the FPGA, and the memory and configuration management interface modules connected to both ends of the MCU. Configure the management interface module to perform bidirectional serial parameter configuration, mapping table editing, communication status monitoring, and communication firmware upgrades between the DP master station and the RTU slave station; The memory is used to store the serial parameter configuration files, mapping tables, device parameters, and historical monitoring data of the DP master station and RTU slave station; MCU is used to control the configuration management interface module and memory; FPGA, used to control the Profibus DP interface and Modbus RTU interface; The Profibus DP interface is used to receive read and write requests from the DP master station, send them to the processor, and execute the mapping instructions issued by the processor. The Modbus RTU interface is used to receive read and write requests from RTU slaves, send them to the processor, and execute the mapping instructions issued by the processor.
2. The integrated gateway according to claim 1, characterized in that, The FPGA includes: At least two buffer management areas are used between the DP master station and the RTU slave station. As a data address, they store the write request data of the DP master station according to the instructions of the mapping table, realizing the mapping of data to the RTU slave station. They are also used as response data areas, storing the read request RTU data returned by the RTU slave station according to the instructions of the mapping table, realizing the mapping of RTU data to the DP master station when the DP master station initiates a read request.
3. The integrated gateway according to claim 2, characterized in that, The buffer management area includes: The parsing engine is used to generate a sequence of read and write instructions from the DP master station to the RTU slave station based on the entries in the mapping table, and to set the delay time from the DP master station to the RTU slave station. The mapping table is used to map the correspondence, storage location, word writing order, data type, and triggering conditions of read and write request data.
4. The integrated gateway according to claim 1, characterized in that, The configuration management interface module includes: an RJ45 connector, an interface protection circuit, and an RS232 transceiver connected via pin signal lines; the RS232 transceiver is connected to the MCU via pin signal lines.
5. The integrated gateway according to claim 1, characterized in that, The Profibus DP interface includes: an interface protection circuit, an RS485 transceiver circuit, and a DP slave protocol chip. The Modbus RTU interface includes: RS485 transceiver circuit and interface protection circuit.
6. An application method for an integrated gateway, used for mapping data from a DP master station to an RTU slave station, characterized in that, include: Obtain write request data sent from the DP master station to the RTU slave station; The write request data is parsed and written to the cache management area according to the pre-loaded configuration file and mapping table; When the parsing engine confirms a change in the cache management area, it generates a mapping instruction containing the write request data and sends it to the RTU slave.
7. An application method for an integrated gateway, used for mapping data from an RTU slave station to a DP master station, characterized in that, include: Based on the pre-loaded configuration file and mapping table, the RTU data sent by the RTU slave station is stored in the cache management area; When the DP master station issues a read request for the corresponding RTU data, it is determined whether the cache management area is within the preset response period; If the parsing engine confirms changes in the cache management area within the preset response period, it will package the read request RTU data stored in the cache management area and send it back to the DP main station. If the response is not within the preset response period, poll each RTU slave station, and after the RTU slave station responds, generate a mapping instruction containing the read request RTU data and reply to the DP master station.
8. An application system integrating a gateway, characterized in that, include: The processor is used to acquire and parse the write request data sent from the DP master station to the RTU slave station during data downlink, and write the write request data to the cache management area according to the pre-loaded configuration file and mapping table. This is used to generate a mapping instruction containing the write request data and send it to the RTU slave when the parsing engine confirms a change in the cache management area; The processor is also used to store the RTU data sent by the RTU slave station into the cache management area according to the pre-loaded configuration file and mapping table when the data is uplinked; when the DP master station issues a read request for the corresponding RTU data, if the cache management area is within the preset response period and the parsing engine confirms the change of the cache management area, the processor packages the read request RTU data stored in the cache management area and replies to the DP master station. If the response is not within the preset response period, poll each RTU slave station, and after the RTU slave station responds, generate a mapping instruction containing the read request RTU data and reply to the DP master station.
9. An electronic device, characterized in that, include: A processor and a memory, the processor being configured to execute an application program of the integrated gateway stored in the memory to implement the application method of the integrated gateway as described in any one of claims 6 to 7.
10. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the application method of the integrated gateway as described in any one of claims 6 to 7.
