CN111884915A - Method for improving efficiency of acquiring modbus equipment by gateway - Google Patents

Method for improving efficiency of acquiring modbus equipment by gateway Download PDF

Info

Publication number
CN111884915A
CN111884915A CN202010690219.4A CN202010690219A CN111884915A CN 111884915 A CN111884915 A CN 111884915A CN 202010690219 A CN202010690219 A CN 202010690219A CN 111884915 A CN111884915 A CN 111884915A
Authority
CN
China
Prior art keywords
monitoring point
data
gateway
address
modbus
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
CN202010690219.4A
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.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi 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 Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN202010690219.4A priority Critical patent/CN111884915A/en
Publication of CN111884915A publication Critical patent/CN111884915A/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40228Modbus

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method for improving efficiency of acquiring modbus equipment by a gateway. The invention improves the information acquisition efficiency by sequencing and resetting the continuous units. The modbus device in the invention has stack number, register address and data type. The gateway stores information for the corresponding modbus device, setting each register address and data unit as a monitoring point. The monitoring points are sorted from small to large according to the addresses of the registers. The read address and the length of the read data are reset at address intervals. The gateway establishes a corresponding modbus frame to be issued, the equipment replies, data are matched into a corresponding monitoring point, and then data information of the monitoring point is reported to the cloud platform.

Description

Method for improving efficiency of acquiring modbus equipment by gateway
Technical Field
The invention relates to the technical field of communication of the Internet of things, in particular to a method for acquiring information of equipment and improving information acquisition efficiency through a modbus protocol based on a gateway of a 4G, WiFi and Ethernet networking mode.
Background
Modbus was developed by MODICON in 1979 and is an industry field bus protocol standard. The company Schneider introduced the Modbus protocol based on Ethernet TCP/IP in 1996: ModbusTCP. The Modbus protocol is an application layer message transmission protocol and comprises three message types of ASCII, RTU and TCP. The standard Modbus protocol physical layer interface comprises RS232, RS422, RS485 and an Ethernet interface, and adopts a master/slave mode for communication. When the traditional gateway reads data by adopting a modbus protocol, polling of the data is carried out on each monitoring point. All need establish corresponding modbus frame and issue to corresponding equipment, add serial ports communication rate limited, and adopt the realization mode of a reply in the modbus agreement, there is the latency of answering in the middle of, when there are a plurality of discontinuous monitoring points, a monitoring point goes the polling, the inefficiency of reading. When the polling is too slow, the real-time information reported by the gateway also becomes slow, so that an error occurs between the information on the cloud platform and the actual information of the equipment, and a part of information is lost.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method for acquiring gateway data to solve the problems and deficiencies in the background art.
The technical problem solved by the invention is realized by adopting the following technical scheme:
a method for improving efficiency of collecting modbus devices by a gateway comprises the following steps:
step 1, the gateway and the equipment are correspondingly connected, and the gateway is connected to the cloud platform.
And 2, acquiring the stack number and the register address of the device to be read by the gateway. And determining the type of data needing to be read in each address, and recording the address information and the type of the read data in the monitoring point.
And 3, arranging the information of the monitoring points from small to large according to the sequence of the addresses, and storing the information in a linked list mode. And detecting whether the arranged monitoring points are continuous or not, wherein the continuous definition is that the address difference is less than 3, and the judgment of continuity can be carried out. The difference of the addresses can be regulated.
And 4, determining a starting monitoring point and an ending monitoring point. The initial monitoring point is the first monitoring point after the discontinuity; the termination monitoring point is the last consecutive monitoring point. And acquiring the length and the type of data to be read from the starting monitoring point to the ending monitoring point.
And 5, establishing a relevant modbus frame by starting the address in the monitoring node and the data length and the data type acquired in the step 4, and issuing the modbus frame to the corresponding node.
And 6, matching the information returned by the node according to the information from the starting monitoring point to the ending monitoring point, and reporting the matched data to the cloud platform.
Compared with the prior art, the invention has the beneficial effects that: through the adjustment of the monitoring points, continuous reading operation is performed, the reading times and the corresponding waiting time are reduced, and the efficiency of acquiring node information by the gateway is improved.
Drawings
FIG. 1: a system structure diagram;
FIG. 2: a single monitoring point illustration;
FIG. 3: sequencing a read-through explanatory diagram by the monitoring points;
FIG. 4: modbus frame format diagram.
Detailed Description
The following detailed description of the preferred embodiments of the present invention, taken in conjunction with the accompanying drawings, will make the advantages and features of the invention more readily understandable by those skilled in the art, and thus will more clearly define the scope of the invention.
The invention utilizes the modbus continuous reading function to change the reading of single data into the continuous rule for finding the data, sets different intervals and reads the data in the corresponding address. Matching the data and reporting to the cloud platform
The implementation of the invention comprises the following steps:
referring to fig. 1, in step 1, the gateway has a networking mode of 4G, WIFI and ethernet, connects to a corresponding cloud platform, and reports the collected information of the device to the cloud platform. And the gateway serial port is connected with the serial port of the equipment, and the adopted communication mode is a modbus communication protocol to obtain the stack number of the equipment.
Referring to fig. 2 and fig. 3, step 2, building corresponding monitoring points, where one monitoring point stores the address of the register, the information of the data type, and the information of the reported data unit. The address and data type of the register identify what the gateway needs to read. And reporting the data unit information, storing the data returned by the equipment, and reporting the data to the cloud platform by the gateway. And adding a plurality of monitoring points into the gateway, and storing the information of the monitoring points by the gateway.
And 3, sequencing the corresponding monitoring points from small to large according to the addresses, and setting a continuous data interval as 3. It is first necessary to determine the starting monitoring point and then the ending monitoring point. 4001 no other monitoring points before the monitoring point are determined as the starting monitoring point, 4002 is less than 4001 and is determined as continuous, 4005 is less than 4002 and is equal to 3 and is determined as continuous, 4006 is less than 4005 and is less than 3 and is determined as continuous, 4008 is less than 4006 and is determined as continuous, 4012 is greater than 4008 and is determined as discontinuous, and 4008 is set as the ending monitoring point. The following monitoring points repeat the above method to find the next starting monitoring point and the next ending monitoring point.
And 4, polling data, and determining a modbus frame format through the data from the starting monitoring point to the ending monitoring point. And acquiring a starting address from the starting monitoring point, and then accumulating the data types of each monitoring point from the starting monitoring point to the ending monitoring point to acquire the length of the data to be read.
Referring to fig. 4, in step 5, a corresponding modbus frame is established, the corresponding frame format is adopted, the device address is a stack number, the function code is a read function code 0x03, the start address and the data length are the data acquired in step 4, the data are sent through the serial port, and the device waits for a reply.
And 6, matching the returned information with the monitoring points, intercepting corresponding data according to the data type of each monitoring point of the read information, and filling the corresponding monitoring point data unit with the intercepted corresponding data.
And the gateway reports the data unit of each monitoring point to the cloud platform.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent structures or equivalent flow transformations made by using the contents of the specification and the drawings, or applied directly or indirectly to other related technical fields, are included in the scope of the present invention.

Claims (2)

1. A method for improving efficiency of a gateway in collecting modbus devices is characterized by comprising the following steps:
step 1, a gateway and equipment are correspondingly connected, and the gateway is connected to a cloud platform;
step 2, acquiring the stack number and the register address of the device to be read by the gateway; determining the type of data to be read in each address, and recording the address information and the type of the read data in a monitoring point;
step 3, arranging the information of the monitoring points from small to large according to the sequence of addresses, and storing the information in a linked list mode; detecting the arranged monitoring points to judge whether the monitoring points are continuous or not, and judging that the monitoring points are continuous when the address difference is smaller than a set threshold;
step 4, determining an initial monitoring point and a termination monitoring point; the initial monitoring point is the first monitoring point after the discontinuity, and the termination monitoring point is the last continuous monitoring point; acquiring the length and the type of data to be read from an initial monitoring point to a final monitoring point;
step 5, establishing a relevant modbus frame through the address in the initial monitoring node and the data length and the data type obtained in the step 4, and issuing the modbus frame to the corresponding node;
and 6, matching the information returned by the node according to the information from the starting monitoring point to the ending monitoring point, and reporting the matched data to the cloud platform.
2. The method of improving efficiency of a gateway collecting modbus devices of claim 1, wherein: the RTU format of the modbus frame comprises a device address bit, a function code bit, a start address bit, a data length bit and a CRC check bit, wherein the function code bit is related to the threshold value.
CN202010690219.4A 2020-07-17 2020-07-17 Method for improving efficiency of acquiring modbus equipment by gateway Pending CN111884915A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010690219.4A CN111884915A (en) 2020-07-17 2020-07-17 Method for improving efficiency of acquiring modbus equipment by gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010690219.4A CN111884915A (en) 2020-07-17 2020-07-17 Method for improving efficiency of acquiring modbus equipment by gateway

Publications (1)

Publication Number Publication Date
CN111884915A true CN111884915A (en) 2020-11-03

Family

ID=73155735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010690219.4A Pending CN111884915A (en) 2020-07-17 2020-07-17 Method for improving efficiency of acquiring modbus equipment by gateway

Country Status (1)

Country Link
CN (1) CN111884915A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113194038A (en) * 2021-04-06 2021-07-30 重庆芯力源科技有限公司 Data forwarding method of intelligent edge gateway
CN113938500A (en) * 2021-09-07 2022-01-14 中建三局智能技术有限公司 RS 485-based Modbus protocol packaging method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739328A (en) * 2009-12-16 2010-06-16 台安科技(无锡)有限公司 Method for enhancing speed of PC in monitoring singlechip through ModBus protocol
CN101977167A (en) * 2010-10-25 2011-02-16 深圳市兆讯达科技实业有限公司 Gateway communication protocol conversion method for wireless sensor network access Modbus bus
CN104407983A (en) * 2014-12-02 2015-03-11 上海电器科学研究院 Modbus address remapping method used for electric quantity module
CN104993913A (en) * 2015-07-20 2015-10-21 曾永泉 Reliable communication method under unstable communication link environment
CN105278918A (en) * 2015-10-15 2016-01-27 珠海格力电器股份有限公司 Reading method of register and register using reading method
CN107590099A (en) * 2017-08-31 2018-01-16 深圳市共济科技股份有限公司 A kind of more main frames access method, expanding unit and the storage medium of slave
CN108667807A (en) * 2018-04-11 2018-10-16 华南师范大学 A kind of protocol self-adapting method and system based on monitoring cloud platform and gateway
CN109450756A (en) * 2018-10-18 2019-03-08 南京海桐环境科技有限公司 A kind of ModbusRTU signal procedure based on SIMATIC S7-200 SMART

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101739328A (en) * 2009-12-16 2010-06-16 台安科技(无锡)有限公司 Method for enhancing speed of PC in monitoring singlechip through ModBus protocol
CN101977167A (en) * 2010-10-25 2011-02-16 深圳市兆讯达科技实业有限公司 Gateway communication protocol conversion method for wireless sensor network access Modbus bus
CN104407983A (en) * 2014-12-02 2015-03-11 上海电器科学研究院 Modbus address remapping method used for electric quantity module
CN104993913A (en) * 2015-07-20 2015-10-21 曾永泉 Reliable communication method under unstable communication link environment
CN105278918A (en) * 2015-10-15 2016-01-27 珠海格力电器股份有限公司 Reading method of register and register using reading method
CN107590099A (en) * 2017-08-31 2018-01-16 深圳市共济科技股份有限公司 A kind of more main frames access method, expanding unit and the storage medium of slave
CN108667807A (en) * 2018-04-11 2018-10-16 华南师范大学 A kind of protocol self-adapting method and system based on monitoring cloud platform and gateway
CN109450756A (en) * 2018-10-18 2019-03-08 南京海桐环境科技有限公司 A kind of ModbusRTU signal procedure based on SIMATIC S7-200 SMART

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
孔亚广等: "基于Modbus的蜂企生产信息化实现", 《中国蜂业》 *
武亚奇等: "协议宏在分布式供能***中的应用", 《自动化仪表》 *
潘洪跃: "Modbus协议在质量流量计组态软件中的应用", 《电脑知识与技术》 *
胡文翔等: "面向RS-485控制网络的Modbus协议扩展及应用", 《自动化仪表》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113194038A (en) * 2021-04-06 2021-07-30 重庆芯力源科技有限公司 Data forwarding method of intelligent edge gateway
CN113938500A (en) * 2021-09-07 2022-01-14 中建三局智能技术有限公司 RS 485-based Modbus protocol packaging method
CN113938500B (en) * 2021-09-07 2024-03-22 中建三局智能技术有限公司 Modbus protocol packet method based on RS485

Similar Documents

Publication Publication Date Title
CN106155014B (en) Industry internet field layer wideband bus real-time implementation method
CN103326901B (en) A kind of power system broadband network performance test methods and system
CN108696297B (en) Equipment state detection method and device in power line communication network
CN106209542B (en) Industry internet field layer wideband bus architecture system
CN111884915A (en) Method for improving efficiency of acquiring modbus equipment by gateway
CN105187283A (en) Industrial control network slave station communication method and device based on EtherCAT protocol
CN103546467A (en) Method for transmitting Modbus RTU protocol on TCP/IP network
CN109451019B (en) High-concurrency acquisition method for industrial real-time data
CN110650066B (en) Bus communication detection system based on embedded type and reliability detection method thereof
CN112419701B (en) Telecontrol equipment data abnormity judgment method, telecontrol equipment data abnormity judgment device, telecontrol equipment data abnormity judgment equipment and storage medium
CN105632385B (en) A kind of LED display blind-spot detection method and its detection device
CN115657646B (en) Test method and device of CAN controller
CN111413902A (en) Bridge monitoring communication method and acquisition system based on Can bus
CN101267444B (en) For the means of communication between the control point in supervisory control system and Surveillance center
CN105141483A (en) Multi-node network minimum communication interval measurement method based on CAN bus
CN115514682A (en) Data transmission method, device, equipment and storage medium
CN105357093B (en) A kind of bus termination equipment communication protocol automatic identification conversion equipment and control method
CN103915899A (en) Autonomous networking structure and method for electric power automatic terminals
CN103023701B (en) The analytical method of performance parameter and device in network management system
CN113114667B (en) Terminal communication configuration system, method, device and medium
CN107171440B (en) System for collecting electrical data of switch cabinet by intelligent transformer terminal and collecting method thereof
CN110517471A (en) Collecting method and data collector based on LoRaWAN
Fang et al. Research and Implementation of Collision Detection Based on Modbus Protocol.
CN117319529B (en) Message analysis method and device applied to vehicle end, electronic equipment and storage medium
CN115100843B (en) Method, system and equipment for testing communication reliability of intelligent electric energy meter

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201103