CN110336792B - Method for analyzing communication protocol of universal flowmeter - Google Patents

Method for analyzing communication protocol of universal flowmeter Download PDF

Info

Publication number
CN110336792B
CN110336792B CN201910496138.8A CN201910496138A CN110336792B CN 110336792 B CN110336792 B CN 110336792B CN 201910496138 A CN201910496138 A CN 201910496138A CN 110336792 B CN110336792 B CN 110336792B
Authority
CN
China
Prior art keywords
data
flowmeter
data acquisition
communication protocol
length
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.)
Active
Application number
CN201910496138.8A
Other languages
Chinese (zh)
Other versions
CN110336792A (en
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.)
Zhejiang Tancy Instrument Science & Technology Co ltd
Goldcard Smart Group Co Ltd
Original Assignee
Goldcard Smart Group Co Ltd
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 Goldcard Smart Group Co Ltd filed Critical Goldcard Smart Group Co Ltd
Priority to CN201910496138.8A priority Critical patent/CN110336792B/en
Publication of CN110336792A publication Critical patent/CN110336792A/en
Application granted granted Critical
Publication of CN110336792B publication Critical patent/CN110336792B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
    • 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/22Parsing or analysis of headers
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention relates to the field of communication, in particular to an analysis method of a communication protocol of a universal flowmeter, which comprises the following steps: the upper computer loads a communication protocol for the flowmeter according to the communication protocol of the flowmeter; the upper computer formulates a data acquisition instruction of the acquisition unit according to the sampling requirement: when n types of data need to be sampled and are discontinuous in the address code of the flow meter, n data acquisition instructions need to be formulated; the collector sends a data collection instruction to the flowmeter; and the flowmeter analyzes the data acquisition instruction after receiving the data acquisition instruction and returns a data feedback instruction to the collector. The invention has the beneficial effects that: the data acquisition instruction of the collector is formulated by the upper computer according to the communication protocol of the flowmeter and the sampling requirement, the collector sends the data acquisition instruction to the flowmeter, the flowmeter analyzes the data acquisition instruction after receiving the data acquisition instruction, and finally the analysis of the communication protocol and the interaction of data are realized.

Description

Method for analyzing communication protocol of universal flowmeter
Technical Field
The invention relates to the field of data acquisition and communication, in particular to a method for analyzing a communication protocol of a universal flowmeter.
Background
At present, a collector of a gas meter mainly collects data of a flowmeter, the collected data comprise working condition cumulant, standard condition cumulant, working condition instantaneous flow, standard condition instantaneous flow, temperature, pressure, flowmeter electric quantity, fault states and the like, communication modes for obtaining the data are mainly 485 communication, but communication protocols of different manufacturers for 485 communication are different, so that communication protocols of different manufacturers need to be integrated into the collector for flowmeters of different manufacturers.
At present, dozens of flowmeter manufacturers exist in the market, software cost and hardware cost are required to be increased when each flowmeter protocol is integrated, corresponding testing and production processes, after-sales maintenance flows and the like are required to be modified, and enterprise maintenance cost and secondary popularization of products are increased invisibly. Due to continuous popularization of the market, more flow meter protocols may be required to be added frequently, development resources are wasted, and labor cost is increased.
Disclosure of Invention
In order to solve the above problems, the present invention provides a method for analyzing a communication protocol of a universal flow meter.
A method for analyzing a communication protocol of a universal flowmeter comprises the following steps:
the upper computer loads a communication protocol for the flowmeter according to the communication protocol of the flowmeter;
the upper computer formulates a data acquisition instruction of the acquisition device according to sampling requirements: when n types of data need to be sampled and are discontinuous in the address code of the flow meter, n data acquisition instructions need to be formulated;
the collector sends a data acquisition instruction to the flowmeter;
and the flowmeter analyzes the data acquisition instruction after receiving the data acquisition instruction and returns a data feedback instruction to the collector.
Preferably, the data acquisition instruction includes: the type and format of the data to be collected; the data feedback instruction comprises: the data type and data format to be fed back.
Preferably, the data categories to be collected include: a sub machine number; the data format to be collected comprises: the starting position of the sub-phone number, the length of the sub-phone number and whether the sub-phone number needs to be checked.
Preferably, the data categories to be collected include: a function code; the data format to be collected comprises: the starting position of the function code, the length of the function code and whether the function code needs to be checked.
Preferably, the categories of the data to be collected include: a data start address; the data format to be collected comprises: the starting location of the data start address, the length of the data start address and whether a check of the data start address is required.
Preferably, the data categories to be collected include: the length of the data; the data format to be collected comprises: the start position of the data length, the length of the data length, and whether the data length needs to be checked.
Preferably, the data categories to be collected include: checking mode; the data format to be collected comprises: the starting position of the verification mode, the length of the verification mode and whether the verification mode needs to be verified.
Preferably, the data categories to be fed back include: data content; the data format to be fed back comprises: the start position of the data content, the length of the data content and whether the data content needs to be collated.
Preferably, the method further comprises the following steps:
and calculating the time after the collector sends the data acquisition instruction, and if the time exceeds a time threshold, sending the data acquisition instruction to the flowmeter by the collector again.
Preferably, the method further comprises the following steps:
and if the times of sending the data acquisition instructions by the collector are more than the time threshold value, the collector does not send the data acquisition instructions to the flowmeter any more.
The invention has the beneficial effects that:
1. a data acquisition instruction of the collector is formulated by the upper computer according to a communication protocol of the flowmeter and a sampling requirement, the collector sends the data acquisition instruction to the flowmeter, the flowmeter analyzes the data acquisition instruction after receiving the data acquisition instruction, and finally the analysis of the communication protocol and the interaction of data are realized;
2. the upper computer stores different communication protocols, and can realize the loading of different flow meter protocols aiming at the flow meters with different communication protocols;
3. the upper computer completes configuration of the interactive parameters of the flow meter and the collector, so that the testing process is simplified, and the production cost is reduced.
Drawings
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart illustrating a method for parsing a universal flow meter communication protocol according to an embodiment of the invention;
fig. 2 is a schematic flowchart of step S5 in a method for parsing a universal flowmeter communication protocol according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating step S6 in a method for parsing a universal flow meter communication protocol according to an embodiment of the present invention.
Detailed Description
The technical solutions of the present invention will be further described below with reference to the accompanying drawings, but the present invention is not limited to these embodiments.
The basic idea of this embodiment is to formulate the data acquisition instruction of collector through the host computer according to flowmeter communication protocol and sampling requirement, and the collector sends the data acquisition instruction to the flowmeter, and the flowmeter analyzes it after receiving the data acquisition instruction, finally realizes communication protocol's analysis, the interaction of data.
Based on the above idea, the present invention provides a method for analyzing a universal flow meter communication protocol, as shown in fig. 1, including:
s1: the upper computer loads a communication protocol for the flowmeter according to the communication protocol of the flowmeter;
s2: the upper computer formulates a data acquisition instruction of the acquisition unit according to the sampling requirement: when n types of data need to be sampled and are discontinuous in the address code of the flow meter, n data acquisition instructions need to be formulated;
s3: the collector sends a data acquisition instruction to the flowmeter;
s4: and the flowmeter analyzes the data acquisition instruction after receiving the data acquisition instruction, and returns a data feedback instruction to the collector.
When the flowmeter is in production, the adopted communication protocol is marked. Therefore, depending on the communication protocol of the flow meter, the host computer may select the same communication protocol from the stored communication protocols. And if the upper computer does not store the same communication protocol, importing the same communication protocol. The method does not need to realize the introduction of various different communication protocols into the collector, but has the targeted introduction according to the communication protocol of the flow meter, and the process is realized by the upper computer, so the operation is simple.
According to the sampling requirement, namely the type of data to be sampled, if one type of data needs to be sampled, only one data acquisition instruction needs to be formulated to carry out instruction interaction once. When n types of data need to be sampled and are separated and discontinuous in the address code of the flow meter, n data acquisition instructions need to be formulated to perform instruction interaction once.
The collector is used for introducing a data acquisition instruction through the upper computer and simultaneously comprises a communication protocol of the flowmeter. The collector sends the data acquisition instruction to the flowmeter, the flowmeter analyzes the data acquisition instruction after receiving the data acquisition instruction, the data type and the data format required to be acquired by the collector are determined, the data type and the data format required to be fed back by the flowmeter are also determined, and finally the analysis of a communication protocol and the data interaction are realized.
In one embodiment, the data categories to be collected include: a sub machine number; the data format to be collected comprises: the starting position of the sub-phone number, the length of the sub-phone number and whether the sub-phone number needs to be checked.
In one embodiment, the data categories to be collected include: a function code; the data format to be collected comprises: the starting position of the function code, the length of the function code and whether the function code needs to be checked.
In one embodiment, the data categories to be collected include: a data start address; the data format to be collected comprises: the starting location of the data start address, the length of the data start address and whether a check of the data start address is required.
In one embodiment, the data categories to be collected include: the length of the data; the data format to be collected comprises: the start position of the data length, the length of the data length, and whether the data length needs to be checked.
In one embodiment, the data categories to be collected include: checking mode; the data format to be collected comprises: the starting position of the verification mode, the length of the verification mode and whether the verification mode needs to be verified.
It should be noted that the number of the slave units, the function code, the start address of the data, the length of the data, and the verification method in the data acquisition command do not need to be arranged in a specific order, and the data types may be arranged randomly. Meanwhile, all data acquisition instructions do not need a sub-machine number, a function code, a data starting address, a data length and a verification mode, and the sub-machine number, the function code, the data starting address, the data length and the verification mode can be selected according to actual requirements.
In an embodiment, the data categories to be fed back include: a sub machine number; the data format to be fed back comprises: the starting position of the slave number, the length of the slave number and whether the slave number needs to be checked.
In an embodiment, the data categories to be fed back include: a function code; the data format to be fed back comprises: the starting position of the function code, the length of the function code and whether the function code needs to be checked.
In an embodiment, the data categories to be fed back include: data content; the data format to be fed back comprises: the start position of the data content, the length of the data content and whether the data content needs to be collated.
In an embodiment, the data categories to be fed back include: checking mode; the data format to be fed back comprises: the starting position of the verification mode, the length of the verification mode and whether the verification mode needs to be verified.
The flowmeter determines a data feedback instruction required to be fed back according to the received data acquisition instruction, the data type and the data format to be fed back by the data feedback instruction correspond to the data type and the data format to be acquired in the data acquisition instruction, and the arrangement sequence of the data type and the data format also corresponds to the data type and the data format to be acquired in the data acquisition instruction.
The flowmeter analyzes the data acquisition command after receiving the data acquisition command, and determines the initial position of the submachine number, the length of the submachine number and whether the submachine number needs to be checked; determining the initial position of the function code, the length of the function code and whether the function code needs to be checked; determining the initial position of the verification mode, the length of the verification mode and whether the verification mode needs to be verified; and determining the starting position of the verification mode, the length of the verification mode and whether the verification mode needs to be verified. After the analysis, the flowmeter and the collector can carry out communication and data interaction according to a set communication protocol and an interaction instruction.
In an embodiment, as shown in fig. 2, a method for parsing a universal flow meter communication protocol further includes:
s5: and calculating the time after the collector sends the data acquisition instruction, and if the time exceeds a time threshold, sending the data acquisition instruction to the flowmeter by the collector again.
After the collector sends the data acquisition instruction, the collector may be affected by a transmission signal or an equipment fault, so that the flowmeter does not receive the data acquisition instruction or does not send a data feedback instruction after receiving the data acquisition instruction.
As a preferred example of the foregoing embodiment, as shown in fig. 3, the method for parsing a universal flow meter communication protocol further includes:
s6: and if the times of sending the data acquisition instructions by the collector are greater than the time threshold value, the collector does not send the data acquisition instructions to the flowmeter any more.
If the collector sends a data acquisition instruction for many times and still does not receive a data feedback instruction sent by the flowmeter, which may be the reason that the flowmeter fails, and the like, therefore, when the number of times that the collector sends the data acquisition instruction is greater than the number threshold, the collector does not send the data acquisition instruction to the flowmeter any more.
Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.

Claims (9)

1. A method for analyzing a communication protocol of a universal flowmeter is characterized by comprising the following steps:
the upper computer loads a communication protocol for the flowmeter according to the communication protocol of the flowmeter;
the upper computer formulates a data acquisition instruction of the acquisition unit according to the sampling requirement: when n types of data need to be sampled and are discontinuous in the address code of the flow meter, n data acquisition instructions need to be formulated;
the collector sends a data acquisition instruction to the flowmeter;
the flowmeter analyzes the data acquisition instruction after receiving the data acquisition instruction, and returns a data feedback instruction to the collector;
the data acquisition instructions include: the type and format of the data to be collected; the data feedback instruction comprises: the data type and data format to be fed back.
2. The method according to claim 1, wherein the data types to be collected include: a sub machine number; the data format to be collected comprises: the starting position of the sub-phone number, the length of the sub-phone number and whether the sub-phone number needs to be checked.
3. The method according to claim 1, wherein the data types to be collected include: a function code; the data format to be collected comprises: the starting position of the function code, the length of the function code and whether the function code needs to be checked.
4. The method according to claim 1, wherein the data types to be collected include: a data start address; the data format to be collected comprises: the starting location of the data start address, the length of the data start address and whether a check of the data start address is required.
5. The method for parsing a universal flowmeter communication protocol according to claim 1, wherein the categories of data to be collected include: the length of the data; the data format to be collected comprises: the start position of the data length, the length of the data length, and whether the data length needs to be checked.
6. The method according to claim 1, wherein the data types to be collected include: checking mode; the data format to be collected comprises: the starting position of the checking mode, the length of the checking mode and whether the checking mode needs to be checked.
7. The method according to claim 1, wherein the data category to be fed back comprises: data content; the data format to be fed back comprises: the start position of the data content, the length of the data content and whether the data content needs to be collated.
8. The method for parsing universal flowmeter communication protocol according to claim 1, further comprising:
and calculating the time after the collector sends the data acquisition instruction, and if the time exceeds a time threshold, sending the data acquisition instruction to the flowmeter by the collector again.
9. The method for parsing a universal flowmeter communication protocol as claimed in claim 8, further comprising:
and if the times of sending the data acquisition instructions by the collector are greater than the time threshold value, the collector does not send the data acquisition instructions to the flowmeter any more.
CN201910496138.8A 2019-06-10 2019-06-10 Method for analyzing communication protocol of universal flowmeter Active CN110336792B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910496138.8A CN110336792B (en) 2019-06-10 2019-06-10 Method for analyzing communication protocol of universal flowmeter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910496138.8A CN110336792B (en) 2019-06-10 2019-06-10 Method for analyzing communication protocol of universal flowmeter

Publications (2)

Publication Number Publication Date
CN110336792A CN110336792A (en) 2019-10-15
CN110336792B true CN110336792B (en) 2023-02-28

Family

ID=68140863

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910496138.8A Active CN110336792B (en) 2019-06-10 2019-06-10 Method for analyzing communication protocol of universal flowmeter

Country Status (1)

Country Link
CN (1) CN110336792B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692303A (en) * 2009-09-29 2010-04-07 深圳市科陆电子科技股份有限公司 Method for acquiring power utilization data of large customer power utilization management terminals
JP2013182391A (en) * 2012-03-01 2013-09-12 Azbil Corp Device controller
CN103684803A (en) * 2013-12-11 2014-03-26 中国联合网络通信集团有限公司 Flow collecting device and system and method for directional flow accounting
CN205787737U (en) * 2016-05-25 2016-12-07 重庆市工程管理有限公司 Water consumption for heavy construction monitors system
CN108712447A (en) * 2018-06-27 2018-10-26 金卡智能集团股份有限公司 A kind of data acquisition parsing plate and method adapting to industrial flow meter
CN208271374U (en) * 2018-06-25 2018-12-21 株洲新奥燃气有限公司 A kind of gas facility intelligent telemetering controller

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8219214B1 (en) * 2008-03-18 2012-07-10 Mimlitz James E Supervisory control and data acquisition protocol converter
KR101152629B1 (en) * 2012-02-02 2012-06-04 한국환경공단 Sewer flowmeter data collecting apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101692303A (en) * 2009-09-29 2010-04-07 深圳市科陆电子科技股份有限公司 Method for acquiring power utilization data of large customer power utilization management terminals
JP2013182391A (en) * 2012-03-01 2013-09-12 Azbil Corp Device controller
CN103684803A (en) * 2013-12-11 2014-03-26 中国联合网络通信集团有限公司 Flow collecting device and system and method for directional flow accounting
CN205787737U (en) * 2016-05-25 2016-12-07 重庆市工程管理有限公司 Water consumption for heavy construction monitors system
CN208271374U (en) * 2018-06-25 2018-12-21 株洲新奥燃气有限公司 A kind of gas facility intelligent telemetering controller
CN108712447A (en) * 2018-06-27 2018-10-26 金卡智能集团股份有限公司 A kind of data acquisition parsing plate and method adapting to industrial flow meter

Also Published As

Publication number Publication date
CN110336792A (en) 2019-10-15

Similar Documents

Publication Publication Date Title
US9262254B2 (en) Method and apparatus to manage information between a scan tool and networked devices
CN110532168B (en) Full-link interface pressure measurement method and device, computer equipment and storage medium
CN106851513B (en) Method and system for testing electronic product
CN101778307A (en) Device for testing functions of set top box
CN102478797A (en) Monitoring system with configurable communication protocol
CN110493669B (en) Network resource checking method, device, equipment and computer storage medium
CN108965052A (en) A kind of data reading system for the electronic control unit software debugging after entrucking
CN111835799A (en) Automatic acquisition system and method for vehicle log
CN101324363B (en) Air conditioner monitoring system
CN103401930A (en) Web Service-based industrial monitoring method and device
CN108540491B (en) Semi-automatic penetration testing system and method based on passive scanning
CN111813622B (en) Equipment monitoring method and device
US20130027217A1 (en) Systems, Methods, and Apparatus for Automatically Configuring a Utility Meter
CN106959688A (en) A kind of vehicle trouble messages acquisition method and device
CN102707710A (en) Diagnosis function verification method and system for automobile electronic control unit
CN104702598B (en) A kind of intelligent grid distributed networking protocol safety detecting method
CN113992348B (en) Monitoring method and system of all-in-one machine
CN110336792B (en) Method for analyzing communication protocol of universal flowmeter
CN106775818B (en) ECU (electronic control Unit) upgrading method and ECU upgrading equipment based on CAN (controller area network) bus
KR101330143B1 (en) Method of testing can gateway
CN112328420A (en) Method, device and system for detecting equipment fault
CN107843867A (en) Obtain the method and device of check and correction parameter
CN101908985A (en) Message checking method and device
CN113438226B (en) Message generating and analyzing method, device and system based on hybrid transmission protocol
CN115842861A (en) Edge connection device adaptation method, device and computer readable storage medium

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20231108

Address after: 325600 291 weft seventeen Road, Yueqing Economic Development Zone, Wenzhou, Zhejiang

Patentee after: Goldcard Smart Group Co.,Ltd.

Patentee after: ZHEJIANG TANCY INSTRUMENT SCIENCE & TECHNOLOGY Co.,Ltd.

Address before: 325600 291 weft seventeen Road, Yueqing Economic Development Zone, Wenzhou, Zhejiang

Patentee before: Goldcard Smart Group Co.,Ltd.