CN109739747A - A kind of general analytic method of serial communication information protocol - Google Patents

A kind of general analytic method of serial communication information protocol Download PDF

Info

Publication number
CN109739747A
CN109739747A CN201811525431.4A CN201811525431A CN109739747A CN 109739747 A CN109739747 A CN 109739747A CN 201811525431 A CN201811525431 A CN 201811525431A CN 109739747 A CN109739747 A CN 109739747A
Authority
CN
China
Prior art keywords
variable
protocol
frame head
byte
byte 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.)
Pending
Application number
CN201811525431.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.)
Xian Institute of Modern Control Technology
Original Assignee
Xian Institute of Modern Control Technology
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 Xian Institute of Modern Control Technology filed Critical Xian Institute of Modern Control Technology
Priority to CN201811525431.4A priority Critical patent/CN109739747A/en
Publication of CN109739747A publication Critical patent/CN109739747A/en
Pending legal-status Critical Current

Links

Landscapes

  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention belongs to product test, analysis and assessment software fields, disclose a kind of general analytic method of serial communication information protocol, comprising: one, configuration parameter file is filled according to communication message protocol;Two, frame head mark is searched;Three, judge whether to find frame head mark;Four, it is identified since frame head and starts the protocol byte length of intercept communication information, judgement frame head is identified to the byte number of the end of data to be resolved and whether is less than protocol byte length;Five, verification judgement is carried out to communication message protocol;Six, i-th of variable is read, sequence parses the characteristic parameter of i-th of variable;Seven, judge whether i-th of variable is the last one variable information.The present invention enormously simplifies the resolving of serial communication information protocol, eliminate the compiling procedure of different communication protocol analysis software, the readability for improving communication protocol, effectively reduces the error rate of resolving, and significantly improves the efficiency during debugging efforts.

Description

A kind of general analytic method of serial communication information protocol
Technical field
The present invention relates to product test, analysis and assessment software field more particularly to a kind of serial communication information protocol solutions Analysis method.
Background technique
During product test, since the communication protocol of different product is not often identical, it is therefore desirable to for difference The corresponding analysis software of product edition, and the protocol contents of conventional protocol analysis software are readable poor, are not easy to modify, greatly The working efficiency of test assignment when reducing product development greatly.
Summary of the invention
In order to solve product communication protocol disunity existing in the prior art, need constantly to modify test software, software It is readable to protocol contents poor, it is not easy to modify, the problems such as test job inefficiency, the invention proposes a kind of serial communication letters Cease the general analytic method of agreement.
In order to solve the above-mentioned technical problem, technical scheme is as follows:
A kind of general analytic method of serial communication information protocol, includes the following steps:
Step 1: filling in configuration parameter file according to communication message protocol;The configuration parameter include protocol byte length, Frame head mark, verification mode, variable characteristic parameter, the characteristic parameter of variable includes variable declaration, varying byte length, variable Zoom factor, types of variables, multibyte variable transmitting-receiving sequence;
Step 2: searching frame head mark;
Step 3: judging whether to find frame head mark;
When finding frame head mark, step 4 is skipped to, otherwise judges whether it is communications information data ending, if being judged as YES, Parsing terminates, otherwise return step two;
Step 4: since frame head identify start intercept communication information protocol byte length, judgement frame head be identified to it is to be resolved Whether the byte number of the end of data is less than protocol byte length;
If the byte number that frame head is identified to the end of data to be resolved is less than protocol byte length, parsing terminates, otherwise, It skips to step 5;
Step 5: carrying out verification judgement to communication message protocol;
If check results are incorrect, the byte and return step two for abandoning frame head identification length in step 2 is held again Row;Otherwise step 6 is skipped to;
Step 6: reading i-th of variable, sequence parses the characteristic parameter of i-th of variable, and i=1 ... n, n are variable number;
Step 7: judging whether i-th of variable is the last one variable information;
If so, return step two begins looking for frame head mark again, otherwise, return step six reads next variable.
Further, in the step 6, the characteristic parameter that sequence parses i-th of variable further comprises:
1. reading variable declaration;
2. reading varying byte length;
3. rearranging varying byte data sequence according to multibyte variable transmitting-receiving sequence;
4. varying byte data conversion is switched to decimal number according to types of variables;
5. restoring actual physical information divided by variable zoom coefficient.
Advantageous effects of the invention:
In the present invention, by using the general analytic method of serial communication information protocol, according to the byte length of information protocol, The characteristic parameter of frame head mark, verification mode and variable fills in the information protocol configuration parameter file of different product, opens in product Begin first to load the configuration parameter file of the product before test, can be realized real time parsing is carried out to output of products information, it can be achieved that The online data of product shows, analyzes and assesses;In addition, product information agreement can be read and be modified by configuration file, increase The readability and alterability of agreement, therefore different information protocols can be adapted to by modification configuration file;For those For client development provide test, assess software enterprise propose a kind of solution of general parsing of information protocol, no longer need to For the different software communication interfaces of every kind of product customization, the versatility of test software is significantly improved.
Detailed description of the invention
Fig. 1 is a kind of configuration parameter file template of serial communication information protocol proposed by the present invention;
Fig. 2 is a kind of flow chart of the general parsing of serial communication information protocol proposed by the present invention.
Specific embodiment
The present invention is described in further detail below in conjunction with the accompanying drawings.
Compared with conventional analytic method, a kind of general analytic method of serial communication information protocol mainly believes serial communication Breath agreement is refined and uniformly, and is opened in the form of configuration file to parsing person, so that analytic method of the invention can be with Protocol analysis suitable for nearly all serial communication information.In order to reach the general purpose of protocol analysis, need to solve a variety of Serial communication messaging protocol format is unified or general problem is arranged.
The present invention is realized for serial communication information protocol to be unified for and be expressed by configuration parameter.Referring to Fig.1, serial In the profile template of communication message protocol, the configuration parameter of communication protocol first include protocol byte length, frame head mark, The characteristic parameter of verification mode, variable;Protocol byte length is the length of a cycle transmission in communication, and unit is byte Number;The frame head of agreement identifies, with hexadecimal mark, using space as blank character between multiple bytes;The verification of protocol information Mode, the method for calibration in characterization information transmission process.
Secondly the characteristic parameter description of the variable of communication protocol includes variable declaration, varying byte length, types of variables, change Measure zoom factor, multibyte variable transmitting-receiving sequence;Variable declaration, that is, variable name is for showing;Varying byte length is divided into 1~8 Eight kinds of byte;Types of variables is divided into unsigned int (U), has symbol integer (I), single-precision floating point (F) and double-precision floating point (D) Four kinds;Variable zoom coefficient is used to describe the multiple restored when amplification or variable receive when variable is sent, and variable zoom coefficient is Can mixed decimal decimal number;Multibyte variable transmitting-receiving sequence is divided into first low rear high (LH) and two kinds of from low to high (HL).
Referring to Fig. 2, a kind of general analytic method of serial communication information protocol provided by the invention includes the following steps:
Step 1: filling in configuration parameter file according to communication message protocol;The configuration parameter include protocol byte length, Frame head mark, transmission cycle, verification mode, variable characteristic parameter, the characteristic parameter of variable includes variable declaration, varying byte Length, variable zoom coefficient, types of variables, multibyte variable transmitting-receiving sequence.
Step 2: searching frame head mark;
Step 3: judging whether to find frame head mark;
When finding frame head mark, step 4 is skipped to, otherwise judges whether it is communications information data ending, if being judged as YES, Parsing terminates, otherwise return step two;
Step 4: since frame head identify start intercept communication information protocol byte length, judgement frame head be identified to it is to be resolved Whether the byte number of the end of data is less than protocol byte length;
If the byte number that frame head is identified to the end of data to be resolved is less than protocol byte length, parsing terminates, otherwise, It skips to step 5;
Step 5: carrying out verification judgement to communication message protocol;
If check results are incorrect, the byte and return step two for abandoning frame head identification length in step 2 is held again Row;Otherwise step 6 is skipped to;
Step 6: reading i-th of variable, sequence parses the characteristic parameter of i-th of variable, and i=1 ... n, n are variable number;
It is specific as follows:
6.1 read variable declaration;
6.2 read varying byte length;
6.3 rearrange varying byte data sequence according to variable transmitting-receiving sequence;
Varying byte data conversion is switched to decimal number according to types of variables by 6.4;
6.5 restore actual physical information divided by variable zoom coefficient;
Step 7: judging whether i-th of variable is the last one variable information;
If so, return step two begins looking for frame head mark again, otherwise, return step six reads next variable.
The foregoing is only a preferred embodiment of the present invention, but scope of protection of the present invention is not limited thereto, Anyone skilled in the art in the technical scope disclosed by the present invention, according to the technique and scheme of the present invention and its Inventive concept is subject to equivalent substitution or change, should be covered by the protection scope of the present invention.

Claims (2)

1. a kind of general analytic method of serial communication information protocol, which comprises the steps of:
Step 1: filling in configuration parameter file according to communication message protocol;The configuration parameter includes protocol byte length, frame head Mark, verification mode, variable characteristic parameter, the characteristic parameter of variable includes variable declaration, varying byte length, variable zoom Coefficient, types of variables, multibyte variable transmitting-receiving sequence;
Step 2: searching frame head mark;
Step 3: judging whether to find frame head mark;
When finding frame head mark, step 4 is skipped to, otherwise judges whether it is communications information data ending, if being judged as YES, parsing Terminate, otherwise return step two;
Step 4: since frame head identify start intercept communication information protocol byte length, judgement frame head be identified to data to be resolved Whether the byte number of ending is less than protocol byte length;
If the byte number that frame head is identified to the end of data to be resolved is less than protocol byte length, parsing terminates, otherwise, skips to To step 5;
Step 5: carrying out verification judgement to communication message protocol;
If check results are incorrect, the byte and return step two for abandoning frame head identification length in step 2 is re-executed;It is no Then skip to step 6;
Step 6: reading i-th of variable, sequence parses the characteristic parameter of i-th of variable, and i=1 ... n, n are variable number;
Step 7: judging whether i-th of variable is the last one variable information;
If so, return step two begins looking for frame head mark again, otherwise, return step six reads next variable.
2. a kind of general analytic method of serial communication information protocol as described in claim 1, which is characterized in that the step 6 In, the characteristic parameter that sequence parses i-th of variable further comprises:
1. reading variable declaration;
2. reading varying byte length;
3. rearranging varying byte data sequence according to multibyte variable transmitting-receiving sequence;
4. varying byte data conversion is switched to decimal number according to types of variables;
5. restoring actual physical information divided by variable zoom coefficient.
CN201811525431.4A 2018-12-13 2018-12-13 A kind of general analytic method of serial communication information protocol Pending CN109739747A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811525431.4A CN109739747A (en) 2018-12-13 2018-12-13 A kind of general analytic method of serial communication information protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811525431.4A CN109739747A (en) 2018-12-13 2018-12-13 A kind of general analytic method of serial communication information protocol

Publications (1)

Publication Number Publication Date
CN109739747A true CN109739747A (en) 2019-05-10

Family

ID=66359023

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811525431.4A Pending CN109739747A (en) 2018-12-13 2018-12-13 A kind of general analytic method of serial communication information protocol

Country Status (1)

Country Link
CN (1) CN109739747A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213297A (en) * 2019-06-27 2019-09-06 北京史河科技有限公司 A kind of data analysis method, device and computer readable storage medium
CN110545283A (en) * 2019-09-12 2019-12-06 潍柴动力股份有限公司 Bit-based J1939 variable data acquisition method
CN111091697A (en) * 2019-11-29 2020-05-01 湖北航天飞行器研究所 Telemetry data processing system
CN111107059A (en) * 2019-11-29 2020-05-05 彩虹无人机科技有限公司 Unmanned aerial vehicle multi-protocol transmission data analysis method
CN111314304A (en) * 2020-01-17 2020-06-19 西安微电子技术研究所 Multi-type data stream oriented frame identification method, device and readable storage medium
CN111339020A (en) * 2020-02-25 2020-06-26 东莞市峰谷科技有限公司 Serial port data receiving and transmitting method
CN112235302A (en) * 2020-10-15 2021-01-15 天津津航计算技术研究所 Protocol analysis method suitable for multiple buses
CN112491645A (en) * 2020-11-11 2021-03-12 深圳数联天下智能科技有限公司 Automatic test method and automatic test equipment
CN112486910A (en) * 2020-11-23 2021-03-12 天津津航计算技术研究所 Method for rapidly analyzing mass data files
CN114168517A (en) * 2020-09-11 2022-03-11 北京机械设备研究所 Universal asynchronous serial data analysis method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070168590A1 (en) * 2005-12-21 2007-07-19 Crain Ii Charles E Serial Port that Supports Multiple Protocols
CN102098131A (en) * 2009-12-15 2011-06-15 航天科工惯性技术有限公司 Dynamic parameter configuration-based general framing and de-framing method for serial port data frames
CN104780140A (en) * 2014-01-12 2015-07-15 盛吉高科(北京)科技有限公司 Configurable communication protocol identifying and parsing system
CN105681134A (en) * 2016-03-04 2016-06-15 西安航天动力技术研究所 General multiple serial port communication protocol detection and identification method
CN108415857A (en) * 2018-03-01 2018-08-17 合肥威艾尔智能技术有限公司 A kind of universal process method of serial data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070168590A1 (en) * 2005-12-21 2007-07-19 Crain Ii Charles E Serial Port that Supports Multiple Protocols
CN102098131A (en) * 2009-12-15 2011-06-15 航天科工惯性技术有限公司 Dynamic parameter configuration-based general framing and de-framing method for serial port data frames
CN104780140A (en) * 2014-01-12 2015-07-15 盛吉高科(北京)科技有限公司 Configurable communication protocol identifying and parsing system
CN105681134A (en) * 2016-03-04 2016-06-15 西安航天动力技术研究所 General multiple serial port communication protocol detection and identification method
CN108415857A (en) * 2018-03-01 2018-08-17 合肥威艾尔智能技术有限公司 A kind of universal process method of serial data

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110213297A (en) * 2019-06-27 2019-09-06 北京史河科技有限公司 A kind of data analysis method, device and computer readable storage medium
CN110545283A (en) * 2019-09-12 2019-12-06 潍柴动力股份有限公司 Bit-based J1939 variable data acquisition method
CN110545283B (en) * 2019-09-12 2022-08-23 潍柴动力股份有限公司 Bit-based J1939 variable data acquisition method
CN111091697A (en) * 2019-11-29 2020-05-01 湖北航天飞行器研究所 Telemetry data processing system
CN111107059A (en) * 2019-11-29 2020-05-05 彩虹无人机科技有限公司 Unmanned aerial vehicle multi-protocol transmission data analysis method
CN111314304A (en) * 2020-01-17 2020-06-19 西安微电子技术研究所 Multi-type data stream oriented frame identification method, device and readable storage medium
CN111314304B (en) * 2020-01-17 2022-07-19 西安微电子技术研究所 Multi-type data stream oriented frame identification method, device and readable storage medium
CN111339020A (en) * 2020-02-25 2020-06-26 东莞市峰谷科技有限公司 Serial port data receiving and transmitting method
CN114168517A (en) * 2020-09-11 2022-03-11 北京机械设备研究所 Universal asynchronous serial data analysis method and device
CN114168517B (en) * 2020-09-11 2024-01-16 北京机械设备研究所 Universal asynchronous serial data analysis method and device
CN112235302A (en) * 2020-10-15 2021-01-15 天津津航计算技术研究所 Protocol analysis method suitable for multiple buses
CN112235302B (en) * 2020-10-15 2023-03-24 天津津航计算技术研究所 Protocol analysis method suitable for multiple buses
CN112491645A (en) * 2020-11-11 2021-03-12 深圳数联天下智能科技有限公司 Automatic test method and automatic test equipment
CN112486910A (en) * 2020-11-23 2021-03-12 天津津航计算技术研究所 Method for rapidly analyzing mass data files

Similar Documents

Publication Publication Date Title
CN109739747A (en) A kind of general analytic method of serial communication information protocol
CN105450232A (en) Encoding method, decoding method, encoding device and decoding device
CN101651683B (en) Method for generating analysis source code of signaling message
CN106598581A (en) ASTERIX message parsing code generation method based on XML
CN110704649B (en) Method and system for constructing flow image data set
CN111131403A (en) Message coding and decoding method and device for Internet of things equipment
CN111147462A (en) FPGA-based step protocol analysis method, system, terminal and storage medium
CN115242896B (en) Dynamic message parsing method and device, electronic equipment and computer readable storage medium
CN106941501A (en) A kind of data communications method and device
CN107193917A (en) Whole station CONFIG.SYS lossless data update method based on IID
CN112702228A (en) Service current limiting response method and device, electronic equipment and readable storage medium
CN111831540A (en) Debugging information processing method, processing device and storage medium
CN114745452B (en) Equipment management method and device and electronic equipment
CN115801922A (en) Analytic rule generation method based on serial communication byte code protocol
FI115350B (en) Method and apparatus for using a data structure for data compression
CN112651214B (en) Method for converting data table plaintext into binary ciphertext convenient for program to read
CN113891088A (en) PNG image decompression logic circuit and device
CN112217896A (en) JSON message conversion method and related device
CN113342738A (en) Method, apparatus, computer program product and medium for modifying controller algorithm
CN113010186A (en) Firmware and application data integration method and system applied to optical module
CN104506311A (en) Method for achieving check-in function
CN116094778B (en) Real-time monitoring system based on Internet
CN114385947B (en) Webpage publishing method, system, device and medium
CN113206843B (en) Network conference control method and device, electronic equipment and storage medium
CN117714564B (en) Universal DLT645 protocol analysis method and device based on java language

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: 20190510