Industrial protocol conversion gateway and protocol conversion method based on block chain

Through the industrial protocol conversion gateway based on blockchain, it solves the problem of large and complex protocols between industrial field devices, realizes the conversion of Siemens S7 and Modbus TCP protocols to OPC DA protocols and blockchain integration, and improves the reliability of data. and traceability, simplifying the protocol conversion process and reducing costs.

CN118540386APending Publication Date: 2024-08-23NAT INST OF INTELLIGENT ROBOTICS SHENYANG CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310152433.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

The communication protocols between industrial field devices are diverse, complex, and difficult to unify, which leads to difficulties in data integration on the blockchain, especially when ensuring information reliability and traceability.

Method used

Adopting an industrial protocol conversion gateway based on blockchain, through the configuration file reading module, logic control module, Siemens S7 protocol analysis module, Modbus TCP protocol analysis module, OPC DA Client protocol analysis module, human-computer interaction module, and data uplink module And the blockchain data reading module realizes the conversion of Siemens S7 and Modbus TCP protocols to the OPC DA protocol and the interaction with the blockchain. It is developed using Python language and runs on the Linux operating system.

Benefits of technology

It realizes data interaction and blockchain integration between industrial field devices, improves data reliability and traceability, reduces system development and maintenance costs, simplifies the protocol conversion process, and improves work efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540386A
    Figure CN118540386A
Patent Text Reader

Abstract

The invention relates to an industrial protocol conversion gateway based on a block chain and a protocol conversion method. A configuration file reading module, a Siemens S7 protocol analysis module, a Modbus TCP protocol analysis module, an OPC DA Client protocol analysis module, a man-machine interaction module, a logic control module, a data uplink module and a block chain data reading module cooperate with one another to complete protocol bidirectional conversion in an industrial field, and control of field equipment by data uplink and a block chain. All the modules are developed by adopting a Python language. Compared with the existing technical scheme, the method is simple to implement and good in portability; bidirectional data exchange between the block chain and a Siemens S7 series PLC and equipment such as a PLC, an instrument and an actuator supporting a Modbus TCP protocol through an OPC DA protocol mode can be realized in combination with an intelligent contract, and realization of various application scenes serving intelligent manufacturing, such as data chaining and digital twinning, is supported.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial control, and in particular to an industrial protocol conversion gateway and a protocol conversion method based on blockchain. Background Art

[0002] With the development of new generation information technology, more and more equipment in factories need to process a large amount of information while completing their original functions. Therefore, they need to have information interfaces so that they can meet the needs of intelligent functions such as fault analysis, maintenance, equipment management, and remote monitoring. For the sake of security and problem tracing, the above information needs to be reliable and traceable. Blockchain has the characteristics of decentralization, time series data, collective maintenance, programmability, and security and trustworthiness. It is an effective way to solve the reliability and traceability of information. Compared with the civilian Internet, the protocols followed by communication between devices in industrial field applications are diverse, diverse, complex, and difficult to unify. This state is difficult to change for a long time. Therefore, it is necessary to develop a method that is simple to use and can complete the conversion of mainstream industrial protocols to support the realization of various application scenarios such as data chaining and digital twins that serve intelligent manufacturing. Summary of the invention

[0003] To solve the above problems, the Siemens S7 communication protocol and Modbus TCP communication protocol are adopted in the field of industrial control to make them widely supported, and the data exchange standard of the OPC DA software system is adopted to make it more functional. At the same time, blockchain technology is used to ensure the reliability and traceability of data, and the conversion of these two typical industrial protocols to the OPC DA protocol and the interaction with the blockchain are achieved, which effectively solves the problem of integrating field control systems to blockchain data.

[0004] The technical solution adopted by the present invention is: an industrial protocol conversion gateway based on blockchain, including the following program modules:

[0005] The configuration file reading module is used to read the configuration parameters of the upper computer that have been pre-mapped in the form of key-value pairs and send them to the logic control module;

[0006] The logic control module is used to realize the initialization of the human-computer interaction module and each protocol analysis module and the data transmission control of the communication process according to the key-value pair parameters;

[0007] Siemens S7 protocol parsing module, used to connect to Siemens PLC devices on site and read and write data based on python-snap7 library;

[0008] Modbus TCP protocol parsing module, used to connect to on-site Modbus TCP devices and implement data read and write operations based on the modbus_tk library;

[0009] OPC DA Client protocol parsing module, based on OpenOPC library, is used as a proxy node Client to achieve connection with OPC Server and data reading and writing operations;

[0010] The human-computer interaction module is used to display the data in the configuration file, the anomalies in the program running process or the status of the interaction process in a visual way; it is also used to receive the user's input instructions and pass the data to the logic control module for it to perform the corresponding operation;

[0011] The data uplink module is used to realize the operation of uplinking the converted device operation execution information according to the preset information;

[0012] The blockchain data reading module is used to search the blockchain according to the configuration information, read the relevant information, and forward the information to the OPC DA Client protocol parsing module after verifying the data.

[0013] The on-site Modbus TCP equipment includes a PLC, an instrument, and an actuator that are located at the on-site production equipment end and support the Modbus TCP protocol.

[0014] The modules are run in the same process, and the execution of other modules is scheduled by the logic control module.

[0015] The configuration parameters for which mapping relationships are pre-established in the form of key-value pairs include:

[0016] The configuration fields of the Siemens S7 protocol include the device's IP address, rack number, slot number, area corresponding to the variable, DB block number, and read and write locations;

[0017] The configuration fields of the Modbus TCP protocol include the device's IP address, port number, function code, device address, register number, data length, and data type encoding;

[0018] OPC DA protocol configuration fields: including the IP address connected to the OPC Server, connection name, tag value, read and write properties, and associated device variable index;

[0019] Configuration fields for data on-chain and blockchain data reading: including blockchain network ID and user's private key.

[0020] The logic control module also includes a buffer area for storing message data read from the industrial field device.

[0021] The logic control module is used to complete external communication, data format conversion, validity verification, exception handling, and log recording according to the internal state.

[0022] The blockchain data reading module is used to read the corresponding OPC DA protocol data from the blockchain according to the configuration information; it is also used to verify the credibility of the data after obtaining the data from the blockchain.

[0023] The gateway is implemented by programming in Python language.

[0024] The gateway runs on Windows or Linux operating system, the hardware carrier is an industrial computer, a server or an embedded all-in-one computer, and has a USB port, an HDMI port, an Ethernet port, a WIFI antenna interface and a power interface.

[0025] A blockchain-based industrial protocol conversion method comprises the following steps:

[0026] Step 1: Load the configuration file data with a mapping relationship pre-established in the form of key-value pairs in the host computer;

[0027] Step 2: Initialize the human-computer interaction module and each protocol analysis module according to the key-value pair parameters;

[0028] Step 3: Based on the python-snap7 library, realize the connection with the Siemens PLC equipment on site and the data reading and writing operations;

[0029] Step 4: Based on the modbus_tk library, realize the connection with the on-site Modbus TCP device and the data reading and writing operations;

[0030] Step 5: Based on the configuration information, read the latest data related to the device under the gateway from the blockchain and verify the data;

[0031] Step 6: Based on the OpenOPC library, the client acts as a proxy node to connect to the OPC Server and perform data read and write operations;

[0032] Step 7: The logic control module updates its data buffer in real time to read data from the field equipment; and converts the data in the Siemens S7 protocol and Modbus TCP protocol format into the OPC DA protocol format and writes it to the OPC Server, and uploads the data to the chain according to the configuration information;

[0033] Step 8: Display the data in the configuration file, the abnormalities during program operation, or the status of the interactive process in real time through a visual interface; and receive input instructions from the user or the host computer.

[0034] The present invention has the following beneficial effects and advantages:

[0035] 1. The present invention is developed based on Python language, which makes the present invention simple to implement and has good portability.

[0036] 2. The present invention aims at the requirements of the most commonly used Siemens S7 series PLCs and devices supporting the Modbus TCP protocol in industrial sites to interact with the outside world for data, and realizes the conversion of the above two protocols to the OPC DA protocol. The third-party software system can quickly obtain the operating status and control data of the field equipment in a standard OPC form through this method, realizing the integration of OT to IT without the need to understand complex industrial communication protocols.

[0037] 3. Aiming at the demand for data reliability and traceability in industrial production, the present invention realizes the interaction of OPC DA protocol data to blockchain, and utilizes the characteristics of blockchain itself to achieve the requirements of data reliability and traceability, thereby reducing the cost of system development and maintenance.

[0038] 4. The present invention adopts a configuration file in JSON format to assist users in completing dynamic modification of content. Users only need to modify the IP address, data point, area to which the data point belongs, or corresponding register of the target connection device in the configuration file according to the existing format requirements to quickly implement new applications. In addition, IT technicians can automatically generate or modify configuration files in batches, which can greatly improve work efficiency.

[0039] 5. The present invention runs on the Linux operating system in the form of software, has no specific requirements for the hardware carrier on which it runs, and can be applied to various scenarios with different performance requirements and environmental requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 It is a schematic diagram of the hardware structure of the gateway of the present invention;

[0041] Figure 2 It is a schematic diagram of the operation flow of the blockchain data reading module of the gateway of the present invention;

[0042] Figure 3 It is a schematic diagram of the operation flow of the gateway of the present invention. DETAILED DESCRIPTION

[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation method of the present invention is described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the invention, so the present invention is not limited by the specific implementation disclosed below.

[0044] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0045] A blockchain-based industrial protocol conversion method is implemented in Python and can run on the Linux operating system. The hardware carrier can be an industrial computer, server or embedded all-in-one machine. If it is placed in a harsh environment at the industrial site, special protection design is required. Generally speaking, the hardware carrier should include a housing, a computer motherboard, a processor, a memory, and a power supply. The housing has a USB port, an HDMI port, an Ethernet port, a WIFI antenna interface, and a power interface.

[0046] like Figure 1 As shown, an industrial protocol conversion method based on blockchain includes a configuration file reading module, a Siemens S7 protocol parsing module, a Modbus TCP protocol parsing module, an OPC DA Client protocol parsing module, a human-computer interaction module, a logic control module, a data chain module and a blockchain data reading module in software implementation. Each module is developed using Python language. The logic control module schedules the execution of other modules according to its internal state machine. Each module is encapsulated as a class, and the data interaction is completed through the attributes and methods of the class. Each module runs in the same process, and the execution of other modules is scheduled by the logic control module.

[0047] The configuration file reading module loads the configuration file in JSON format in the root directory of the main program, reads the key-value pair parameters, reads each field in the configuration file into the program, and forms the data type of the dictionary in Python. For the Siemens S7 protocol, the fields include the device's IP address, rack number, slot number, area corresponding to the variable (input, output, intermediate variable, DB block), DB block sequence number, and read and write location. For the Modbus TCP protocol, the fields include the device's IP address, port number, function code, device address, register number, data length, and data type encoding. For the OPC DA protocol, the fields include the IP address of the OPC Server to be connected, the connection name, tag value, read and write attributes, and the associated device variable index. For blockchain configuration, the fields include the blockchain network ID and the user's private key.

[0048] The human-computer interaction module uses a graphical method to display the data in the configuration file. During the program operation, it also displays the abnormalities that occur or the status of the interaction process, and accepts the user's input, passes the data to the logic control module, and performs the corresponding operation. It is used to display the information during the software operation process, and when an error occurs, it prompts the error type and adjusts the program operation process according to the input instructions of the technician.

[0049] The Siemens S7 protocol parsing module is based on the python-snap7 library in Python to complete the connection and data reading and writing operations with the Siemens S7 series PLC; the operation process is as follows: according to the information read from the configuration file, the corresponding device is connected. If the connection is successful, the relevant variables are read or written in a loop according to the set scan cycle until the operation stops. If the connection fails and there is still no success after a certain number of retries, the error status is recorded.

[0050] The Modbus TCP protocol parsing module is based on the modbus_tk library in Python to complete the connection and data reading and writing operations with PLCs, instruments, actuators and other devices that support the ModbusTCP protocol; the operation process is similar to the Siemens S7 protocol parsing module.

[0051] OPC DA Client protocol parsing module: Based on the OpenOPC library in Python, it acts as a client to complete the connection with the OPC Server and data reading and writing operations.

[0052] The logic control module controls the operation process of the above five modules as a whole, completes the initialization of the human-computer interaction module and each protocol analysis module according to the configuration parameters, and controls the subsequent operation process; at the same time, it completes the communication with the external, data format conversion, validity verification, exception handling, log recording and other functions according to the internal state machine.

[0053] The data uploading module uploads the field equipment data that has been processed and converted into the OPC DA protocol to the chain.

[0054] The blockchain data reading module will read the OPC DA protocol format data from the blockchain and perform a credibility check. After the check passes, the data will be transmitted to the OPC DA Client protocol parsing module.

[0055] like Figure 2As shown, the software operation flow of executing this method is as follows: after loading all configuration parameters, execute the Siemens S7 protocol parsing module and the Modbus TCP protocol parsing module. During the first execution, since there is no valid data in the data buffer output to the device, the write parameter operation is skipped, otherwise the changed data in the buffer is written to the device. Then execute the read parameter operation. After all the read parameter operations are completed, the newly obtained data is refreshed into the device input data buffer; then execute the OPC DA protocol parsing module, write all updated device input data to the tag corresponding to the OPC Server through the OPC write parameter instruction, and execute the data chain module at the same time, thereby realizing the reporting and chaining of device data, and at the same time read back the tag value set as the read attribute, and write it to the device output data buffer, waiting for the next execution cycle to write to the device; finally, update the display on the human-computer interaction interface, respond to user input, and enter the next cycle.

[0056] like Figure 3 As shown in the figure, the software operation process of executing the blockchain data reading module is as follows: read the new blocks generated by the blockchain from the last execution of the module to the current execution of the module, and then filter the data whose transaction object is the preset user from the filtered blocks again. Then verify the filtered data. If the verification passes, the data is sent to the OPC DA Client module and then ends; if the verification fails, the data that failed the verification is recorded and the program is paused, waiting for the user to process and then continue to execute.

[0057] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any simple modification, change and equivalent structural change made to the above embodiment based on the technical essence of the present invention still falls within the protection scope of the technical solution of the present invention.

Claims

1. An industrial protocol conversion gateway based on blockchain, characterized in that: Includes the following program modules: The configuration file reading module is used to read the configuration parameters of the upper computer that have been pre-mapped in the form of key-value pairs and send them to the logic control module; The logic control module is used to realize the initialization of the human-computer interaction module and each protocol analysis module and the data transmission control of the communication process according to the key-value pair parameters; Siemens S7 protocol parsing module, used to connect to Siemens PLC devices on site and read and write data based on python-snap7 library; Modbus TCP protocol parsing module, used to connect to on-site Modbus TCP devices and implement data read and write operations based on the modbus_tk library; OPC DA Client protocol parsing module, based on OpenOPC library, is used as a proxy node Client to achieve connection with OPC Server and data read and write operations; The human-computer interaction module is used to display the data in the configuration file, the anomalies in the program running process or the status of the interaction process in a visual way; it is also used to receive the user's input instructions and pass the data to the logic control module for it to perform the corresponding operation; The data uplink module is used to realize the operation of uplinking the converted device operation execution information according to the preset information; The blockchain data reading module is used to search the blockchain according to the configuration information, read the relevant information, and forward the information to the OPC DA Client protocol parsing module after verifying the data.

2. According to the blockchain-based industrial protocol conversion gateway of claim 1, it is characterized in that: The on-site Modbus TCP equipment includes a PLC, an instrument, and an actuator that are located at the on-site production equipment end and support the Modbus TCP protocol.

3. According to the blockchain-based industrial protocol conversion gateway of claim 1, it is characterized in that: The modules are run in the same process, and the execution of other modules is scheduled by the logic control module.

4. According to the blockchain-based industrial protocol conversion gateway of claim 1, it is characterized in that: The configuration parameters for which mapping relationships are pre-established in the form of key-value pairs include: The configuration fields of the Siemens S7 protocol include the device's IP address, rack number, slot number, area corresponding to the variable, DB block number, and read and write locations; The configuration fields of the Modbus TCP protocol include the device's IP address, port number, function code, device address, register number, data length, and data type encoding; OPC DA protocol configuration fields: including the IP address connected to the OPC Server, connection name, tag value, read and write properties, and associated device variable index; Configuration fields for data on-chain and blockchain data reading: including blockchain network ID and user's private key.

5. According to the blockchain-based industrial protocol conversion gateway of claim 1, it is characterized in that: The logic control module also includes a buffer area for storing message data read from the industrial field device.

6. According to the blockchain-based industrial protocol conversion gateway of claim 1, it is characterized in that: The logic control module is used to complete external communication, data format conversion, validity verification, exception handling, and log recording according to the internal state.

7. According to claim 1, an industrial protocol conversion gateway based on blockchain is characterized in that: The blockchain data reading module is used to read the corresponding OPC DA protocol data from the blockchain according to the configuration information; it is also used to verify the credibility of the data after obtaining the data from the blockchain.

8. According to the blockchain-based industrial protocol conversion gateway of claim 1, it is characterized in that: The gateway is implemented by programming in Python language.

9. According to the blockchain-based industrial protocol conversion gateway of claim 1, it is characterized in that: The gateway runs on Windows or Linux operating system, the hardware carrier is an industrial computer, a server or an embedded all-in-one computer, and has a USB port, an HDMI port, an Ethernet port, a WIFI antenna interface and a power interface.

10. A blockchain-based industrial protocol conversion method, characterized in that: The following steps are involved: Step 1: Load the configuration file data with a mapping relationship pre-established in the form of key-value pairs in the host computer; Step 2: Initialize the human-computer interaction module and each protocol analysis module according to the key-value pair parameters; Step 3: Based on the python-snap7 library, realize the connection with the Siemens PLC equipment on site and the data reading and writing operations; Step 4: Based on the modbus_tk library, realize the connection with the on-site Modbus TCP device and the data reading and writing operations; Step 5: Based on the configuration information, read the latest data related to the device under the gateway from the blockchain and verify the data; Step 6: Based on the OpenOPC library, the client acts as a proxy node to connect to the OPC Server and perform data read and write operations; Step 7: The logic control module updates its data buffer in real time to read data from the field equipment; and converts the data in the Siemens S7 protocol and Modbus TCP protocol format into the OPC DA protocol format and writes it to the OPC Server, and uploads the data to the chain according to the configuration information; Step 8: Display the data in the configuration file, the abnormalities during program operation, or the status of the interactive process in real time through a visual interface; and receive input instructions from the user or the host computer.

Citation Information

Cited By

  • Port hoisting cluster intelligent data acquisition method and terminal

    CN120143725A