CN111092812A - High-reliability gateway device based on MODBUS-Mqtt protocol - Google Patents

High-reliability gateway device based on MODBUS-Mqtt protocol Download PDF

Info

Publication number
CN111092812A
CN111092812A CN201911150901.8A CN201911150901A CN111092812A CN 111092812 A CN111092812 A CN 111092812A CN 201911150901 A CN201911150901 A CN 201911150901A CN 111092812 A CN111092812 A CN 111092812A
Authority
CN
China
Prior art keywords
module
data
modbus
interface
single chip
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911150901.8A
Other languages
Chinese (zh)
Inventor
岑健
杨继松
伍银波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Polytechnic Normal University
Original Assignee
Guangdong Polytechnic Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Polytechnic Normal University filed Critical Guangdong Polytechnic Normal University
Priority to CN201911150901.8A priority Critical patent/CN111092812A/en
Publication of CN111092812A publication Critical patent/CN111092812A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/03Protecting confidentiality, e.g. by encryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/16Gateway arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Communication Control (AREA)

Abstract

The invention relates to a high-reliability gateway device based on MODBUS-Mqtt protocol, which is characterized by comprising a main control singlechip, a network communication module, an RJ-45 interface, a wifi module, an RS485 interface, a photoelectric isolation module and a power module, wherein the main control singlechip is used for realizing the function of converting ModBUS-Mqtt protocol and controlling the communication transmission function; the photoelectric isolation module, the wifi module, the network communication module, the RS485 interface and the power supply module are all connected with and controlled by the master control single chip microcomputer in a coordinated manner; after receiving the data, the main control single chip computer performs data frame processing, data encryption and MQTT/ModBus protocol conversion, and then performs remote transmission and application processing on the data packets. The invention has the characteristics of strong anti-interference capability, high performance, easy operation, high safety and the like.

Description

High-reliability gateway device based on MODBUS-Mqtt protocol
Technical Field
The invention relates to a high-reliability gateway device based on MODBUS-Mqtt protocol, which is mainly suitable for a data transfer gateway with anti-interference and high safety of a sludge drying system.
Background
With the development of science and technology, the application of technologies such as the internet of things, big data, cloud platforms, artificial intelligence and the like is increasingly wide. The data collected by the sensor needs to be correspondingly analyzed and processed in the industrial equipment, and even a mathematical model is established, so that remote monitoring and intelligent management are realized. These advanced techniques have no doubt been able to significantly reduce labor costs and improve work efficiency. For example, aiming at the severe working environment of sludge treatment equipment, industrial intelligence is adopted to control and manage the equipment. The real-time data acquired by the equipment can be accurately operated, the running state of the equipment can be monitored, and some safety problems can be predicted. The processes can not be independent of data acquisition and processing, and when a huge data set is faced, the traditional industrial electronics are difficult to be intelligentized under the condition of not depending on the internet, big data and a cloud platform.
Disclosure of Invention
The invention provides a high-reliability gateway device based on MODBUS-Mqtt protocol, which is mainly suitable for an anti-interference and high-safety data transfer gateway of a sludge drying system and aims to solve the problems that most of the traditional industrial equipment and low-power-consumption wireless sensor equipment can only be communicated with the local and can not be accessed to the Internet, and meanwhile, the equipment is easily interfered by the outside world and is low in safety.
In order to achieve the aim, the invention discloses a high-reliability gateway device based on MODBUS-Mqtt protocol, which mainly comprises a main control single chip microcomputer for realizing ModBUS-Mqtt protocol conversion function and controlling communication transmission function, a network communication module and an RJ-45 interface for communicating with a network, a wifi module for communicating with a local area network, an RS485 interface for transmitting data butt joint with a data concentrator, an optoelectronic isolation module for inhibiting sharp pulse and various noise interferences, and a power supply module for supplying power to the main control single chip microcomputer; the photoelectric isolation module, the wifi module, the network communication module, the RS485 interface and the power supply module are all connected with and controlled by the master control single chip microcomputer in a coordinated manner; and after receiving the data butted by the RS485 interface, the master control single chip microcomputer carries out data frame processing, data encryption and MQTT/ModBus protocol conversion, and then carries out remote transmission and application processing on the data packet.
Preferably, the master control singlechip is also electrically connected with a power isolation module for voltage stabilization and noise reduction.
The invention has the following advantages and effects: 1. the system can work normally in a noisy environment for treating sludge, and has strong anti-interference capability; 2. the intelligence degree is high, and the safety is high; 3. simple operation, easy deployment and installation.
Drawings
FIG. 1 is a schematic diagram of the construction of the apparatus of the present invention;
FIG. 2 is a circuit schematic of EN28J60 of the device of the present invention;
FIG. 3 is a circuit diagram of the opto-electronic isolation module of the apparatus of the present invention;
FIG. 4 is a general software design diagram of the apparatus of the present invention;
FIG. 5 is a flow chart of the primary data processing algorithm of the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but the present invention is not limited thereto.
Referring to fig. 1 to 5, the high-reliability gateway device based on the MODBUS-to-Mqtt protocol in the embodiment of the present invention mainly includes a main control single chip 1 for implementing the MODBUS-to-Mqtt protocol function and controlling the communication transmission function, a network communication module and an RJ-45 interface 2 for communicating with a network, a wifi module 3 for communicating with a local area network, an RS485 interface 4 for interfacing with a data concentrator for transmitting data, an optoelectronic isolation module 5 for suppressing sharp pulses and various noise interferences, a power isolation module 6 for stabilizing voltage and reducing noise, and a power module for providing power to the main control single chip; the photoelectric isolation module 5, the wifi module 3, the network communication module, the RS485 interface 4, the power supply module and the power supply isolation module 6 are all connected with and controlled by the master control single chip microcomputer in a coordinated manner; the main control single chip microcomputer 1 firstly carries out data frame processing, data encryption and MQTT/ModBus protocol conversion after receiving data butted by the RS485 interface, and then carries out remote transmission and application processing on the data packet.
Referring to fig. 1 to 5, the optoelectronic isolation module LTV-816S has a function of cutting off an interference signal from entering a subsequent circuit, and is used for effectively suppressing sharp pulses and various noise interferences; the wifi module ESP8266 is used for wireless transmission of Mqtt protocol or TCP/UDP protocol and the like, and can also be used as a local area network server to provide hot spot connection; the network communication module ENC28J60 supports RJ-45 to be inserted into a network cable to access a public network for data transmission; the 4G module EC20 supports various protocols including Mqtt protocol, supports LTE, UMTS and GSM/GPRS networks, has the maximum uplink rate of 50Mbps and the maximum downlink rate of 100Mbps, and has the function of transmitting a large amount of data; and the RS485 interface module is used for receiving data from the data concentrator. The power module is provided with a 220V mains supply input circuit which comprises a safety capacitor, an inductive filter and other devices, so that EMI is reduced, and pure electric power is supplied to the system as far as possible. The 5V conversion circuit and the 3.3V conversion circuit convert the filtered alternating current 220V into 5V and 3.3V and provide the 5V and 3.3V to each component. The master control single chip microcomputer is responsible for overall normal operation of the whole system, is used for converting the ModBus protocol into the Mqtt protocol and transmitting data to the cloud end through the communication module.
As shown in fig. 1, the power supply module and the power isolation module of the invention provide stable working power supply for the main control single chip and other modules. The RS485 interface, the photoelectric isolation module and the master control single chip microcomputer complete the collection of original data, and in addition, the master control single chip microcomputer converts data transmitted by the ModBus protocol into data of the Mqtt protocol. The wifi module or the 4G module uploads the data frame converted by the main control single chip microcomputer to the cloud server, and wireless data uploading and wireless communication are achieved. And the network communication module connected with the main control singlechip realizes the communication of a wired network through an Ethernet interface RJ-45.
As shown in fig. 2, in this embodiment, the EN28J60 provides an ethernet interface for the master single chip, and data can be transmitted through the differential signal input pins TPIN +, TPIN-and the differential signal output pins TPOUT +, TPOUT-in the chip. The ENC28J60 is an independent Ethernet controller with a standard Serial Peripheral Interface (SPI), which can be used as an Ethernet interface of any single chip microcomputer equipped with an SPI communication interface, conforms to all specifications of IEEE802.3, limits an incoming data packet by adopting a series of packet filtering mechanisms, and provides an internal DMA module to realize rapid data throughput and IP verification and calculation supported by hardware, wherein SO is a data output pin of the SPI interface, SI is a data input pin of the SPI interface, SCK is a clock input pin of the SPI interface, and CS is a chip selection input pin of the SPI interface. The communication with the host controller is realized by the interrupt pin INT and the SPI interface pins SO and SI, and the data transmission rate is up to 10 Mb/s. The LED display device comprises an LED indicator lamp, an LEDA driving pin, an LEDB driving pin and an LED DB driving pin, wherein the two special pins of the LEDA driving pin and the LEDB driving pin are used for connecting the LED indicator lamp and indicating the network activity state.
As shown in fig. 3, in the circuit connection diagram of the optoelectronic isolation module of this embodiment, data passing through the data concentrator passes through data pins 485_ B and 485_ a of the SP485S chip and is isolated by the optoelectronic isolation chip LTV-816S, interference of a rear-stage circuit is cut off, the data is transmitted to a data receiving pin MUC _ RXD _485 of the master control single chip microcomputer RS485, and meanwhile, communication can be performed through an RS485 data transmitting pin MCU _ TXD _485, where MCU _ RE _485 is an enable pin of the SP485 chip. The design of the module improves the anti-interference capability of the device on hardware.
As shown in fig. 4, the overall software design of the present invention can be divided into three layers according to functions: an access layer, a processing layer and an application layer. The access layer uploads data acquired by the sensing equipment through a ModBus serial link; the processing layer comprises data frame processing, data encryption and Mqtt/ModBus protocol conversion; the application layer includes remote transmission of data packets and application processing.
As shown in fig. 5, the main data processing algorithm flow chart of the present invention first initializes the serial port of the main control single chip, and the device performs timeout detection. And then, a set state machine is entered to call a data frame acquisition module to perform message analysis on the ModBus response frame of the lower computer, and after the data frame is determined to be correct, the data is stored and encrypted, so that the safety of the data is improved.
Wherein the format of the response frame is: [ device number ] [ function code ] [ byte number N ] [ read value x1]. [ read value xn ] [ CRC high 8 bit ] [ CRC low 8 bit ]. ] first, whether the address byte of the slave machine received first is correct or not is judged, namely, each slave machine has a serial number which is realized through a hardware circuit; secondly, judging the reading and writing modes of the function codes corresponding to the received bytes, then judging whether the received bytes are consistent with the byte numbers of the request frame, and then performing CRC calculation comparison on the data, wherein the correct frame passes through the identification function.
CRC check algorithm:
(1) loading a 16-bit CRC register with 0XFFF, i.e., all 1's;
(2) XOR the first 8-bit byte of the message with the low byte of the 16-bit CRC register, and storing the result in the CRC register;
(3) right shifting the CRC register by one bit, filling zero in the high bit, extracting and detecting the low bit number;
(4) if the low position is 0: repeating the step (3); if the low position is 1: the register is XOR'd with 0XA 0001;
(5) repeating (3) and (4) until 8 displacements are completed;
(6) repeating the step 2-5 for the next byte in the message to know that all messages are processed;
(7) the final value in the CRC register is the CRC value;
(8) the CRC high and low bytes are exchanged and attached to the end of the message.
The RSA asymmetric encryption optimization algorithm encrypts the data extracted from the message: firstly, a packaged RSA algorithm is imported, and real-time data is encrypted to obtain a public key and a private key.
a. Setting a public key storage function;
b. setting a private key storage function; (ii) a
(9) And encrypting the data to be encrypted by using a public key.
Therefore, the optimized asymmetric encryption algorithm is utilized to ensure the data security of the interaction between the terminal equipment and the server.
The data transfer gateway with high safety and strong anti-interference capability replaces the traditional data transfer gateway, solves the problem that the traditional gateway cannot adapt to severe environments with large noise, more vibration and the like, and simultaneously encrypts data to improve the safety of the system. The invention has the characteristics of strong anti-interference capability, high performance, easy operation, high safety and the like.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (2)

1. A high reliability gateway device based on MODBUS changes Mqtt agreement which characterized in that: the device mainly comprises a main control single chip microcomputer for realizing the function of converting ModBus into Mqtt protocol and controlling communication transmission function, a network communication module and an RJ-45 interface for communicating with a network, a wifi module for communicating with a local area network, an RS485 interface for transmitting data butt joint with a data concentrator, a photoelectric isolation module for inhibiting sharp pulse and various noise interferences, and a power supply module for supplying power to the main control single chip microcomputer; the photoelectric isolation module, the wifi module, the network communication module, the RS485 interface and the power supply module are all connected with and controlled by the master control single chip microcomputer in a coordinated manner; and after receiving the data butted by the RS485 interface, the master control single chip microcomputer carries out data frame processing, data encryption and MQTT/ModBus protocol conversion, and then carries out remote transmission and application processing on the data packet.
2. The high-reliability gateway device based on MODBUS to Mqtt protocol according to claim 1, wherein the main control single chip is further electrically connected with a power isolation module for voltage stabilization and noise reduction.
CN201911150901.8A 2019-11-21 2019-11-21 High-reliability gateway device based on MODBUS-Mqtt protocol Pending CN111092812A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911150901.8A CN111092812A (en) 2019-11-21 2019-11-21 High-reliability gateway device based on MODBUS-Mqtt protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911150901.8A CN111092812A (en) 2019-11-21 2019-11-21 High-reliability gateway device based on MODBUS-Mqtt protocol

Publications (1)

Publication Number Publication Date
CN111092812A true CN111092812A (en) 2020-05-01

Family

ID=70393698

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911150901.8A Pending CN111092812A (en) 2019-11-21 2019-11-21 High-reliability gateway device based on MODBUS-Mqtt protocol

Country Status (1)

Country Link
CN (1) CN111092812A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726419A (en) * 2020-06-29 2020-09-29 广东技术师范大学 Sludge dryer model system based on Internet of things
CN113280851A (en) * 2021-01-23 2021-08-20 广东技术师范大学 Multifunctional test terminal for sludge dryer
CN114679501A (en) * 2022-03-10 2022-06-28 慧之安信息技术股份有限公司 Cloud gateway implementation method and device for MODBUS-MQTT protocol

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1798907B1 (en) * 2005-12-15 2012-04-04 Claber S.P.A. Centralised irrigation automation system for a building provided with local computer network with standard network protocol
CN107332736A (en) * 2017-07-06 2017-11-07 苏州工业园区服务外包职业学院 Automation cluster detecting system based on ModBus agreements
CN107835152A (en) * 2017-09-29 2018-03-23 浙江德塔森特数据技术有限公司 A kind of data processing method for miniature data center
CN109981435A (en) * 2019-04-02 2019-07-05 中安智联未来有限公司 Turn MQTT gateway and communication system based on CAN-ModBus
CN211959240U (en) * 2019-11-21 2020-11-17 广东技术师范大学 High-reliability gateway device based on MODBUS-Mqtt protocol

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1798907B1 (en) * 2005-12-15 2012-04-04 Claber S.P.A. Centralised irrigation automation system for a building provided with local computer network with standard network protocol
CN107332736A (en) * 2017-07-06 2017-11-07 苏州工业园区服务外包职业学院 Automation cluster detecting system based on ModBus agreements
CN107835152A (en) * 2017-09-29 2018-03-23 浙江德塔森特数据技术有限公司 A kind of data processing method for miniature data center
CN109981435A (en) * 2019-04-02 2019-07-05 中安智联未来有限公司 Turn MQTT gateway and communication system based on CAN-ModBus
CN211959240U (en) * 2019-11-21 2020-11-17 广东技术师范大学 High-reliability gateway device based on MODBUS-Mqtt protocol

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李华龙;欧阳名三;朱成杰;谢苗苗;: "具有本安接口的多协议转换器的研究", 矿山机械, no. 06, 20 March 2010 (2010-03-20) *
胡存;骆德汉;童怀;: "基于Modbus与MQTT融合工业能耗网关系统设计", 物联网技术, no. 04, 20 April 2019 (2019-04-20) *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111726419A (en) * 2020-06-29 2020-09-29 广东技术师范大学 Sludge dryer model system based on Internet of things
CN111726419B (en) * 2020-06-29 2021-08-06 广东技术师范大学 Sludge dryer model system based on Internet of things
CN113280851A (en) * 2021-01-23 2021-08-20 广东技术师范大学 Multifunctional test terminal for sludge dryer
CN114679501A (en) * 2022-03-10 2022-06-28 慧之安信息技术股份有限公司 Cloud gateway implementation method and device for MODBUS-MQTT protocol
CN114679501B (en) * 2022-03-10 2023-01-10 慧之安信息技术股份有限公司 Cloud gateway implementation method and device for MODBUS-MQTT protocol

Similar Documents

Publication Publication Date Title
CN111092812A (en) High-reliability gateway device based on MODBUS-Mqtt protocol
CN106131056B (en) Industrial wireless adapter and working method thereof
CN103139059B (en) Gateway is resolved in Coal Mine Electromechanical Equipment data acquisition
CN211043537U (en) Substation equipment state monitoring system based on ubiquitous power internet of things
CN107831702B (en) A kind of synchronous serial signal acquisition and control device based on gigabit Ethernet
CN105427571A (en) Binary channel communication remote meter reading monitoring and analysis system
CN110648437A (en) Entrance guard management system based on LoRa thing networking
CN103024042A (en) Avionics full duplex switched Ethernet (AFDX) terminal protocol stack, and data receiving and sending method thereof
CN211959240U (en) High-reliability gateway device based on MODBUS-Mqtt protocol
CN107872271B (en) Public network communication repeater based on LoRa technology and communication method
CN107918375A (en) A kind of equipment high in the clouds monitoring management system
CN202720766U (en) Intelligent sensor platform based on mobile network
CN113347586A (en) Distributed multi-terminal communication system based on Lora and industrial Internet of things
CN106006271A (en) Single chip microcomputer driving MODEM internet-surfing transmission method and related intelligent elevator remote monitoring system
CN202870525U (en) Networked data acquisition apparatus applied to changing environment
CN202889381U (en) Home gateway supporting wireless sensor network
CN108648433A (en) A kind of multimode data Transmission system for electric wind scene
CN202696609U (en) Optical fiber concentrator
CN208367901U (en) A kind of multimode data Transmission system for electric wind scene
CN111935254A (en) Remote peer-to-peer transparent transmission debugging system
CN212211033U (en) Intelligent gateway for power cable state diagnosis system
CN104009957A (en) Ethernet communication method and device based on serial port
CN211702042U (en) High-safety quantum communication exchange system
CN204390030U (en) A kind of engineering machinery vehicle burglary-resisting system applying ZigBee adapter
CN106710189A (en) Monitoring data acquisition and transmission device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination