CN103475651A - Data-unit-based data transmission method - Google Patents

Data-unit-based data transmission method Download PDF

Info

Publication number
CN103475651A
CN103475651A CN201310394226XA CN201310394226A CN103475651A CN 103475651 A CN103475651 A CN 103475651A CN 201310394226X A CN201310394226X A CN 201310394226XA CN 201310394226 A CN201310394226 A CN 201310394226A CN 103475651 A CN103475651 A CN 103475651A
Authority
CN
China
Prior art keywords
data
unit
isn
transmission method
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.)
Granted
Application number
CN201310394226XA
Other languages
Chinese (zh)
Other versions
CN103475651B (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.)
GUANGXI TALENTCLOUD INFORMATION TECHNOLOGY Co Ltd
Original Assignee
GUANGXI TALENTCLOUD INFORMATION TECHNOLOGY 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 GUANGXI TALENTCLOUD INFORMATION TECHNOLOGY Co Ltd filed Critical GUANGXI TALENTCLOUD INFORMATION TECHNOLOGY Co Ltd
Priority to CN201310394226.XA priority Critical patent/CN103475651B/en
Publication of CN103475651A publication Critical patent/CN103475651A/en
Application granted granted Critical
Publication of CN103475651B publication Critical patent/CN103475651B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a data-unit-based data transmission method. The data-unit-based data transmission method comprises the steps: defining a data unit; defining identical data flow structure bodies at a sending end and a receiving end; burstifying data flow; sending and receiving the data flow; analyzing the data flow. The data unit-based data transmission method has the beneficial effects that 1) an outer-space communication protocol achieves an agreement at the sending end and the receiving end, a data protocol is a fixed rule without the need of transmission and any expand; 2) the data structure bodies are defined simply, internal codes of each data unit and data of the data unit are paired to form independent data bodies, and when the structure bodies contain a plurality of data bodies, the ranking is not limited by a sequence; 3) the data bodies of the data structure bodies can be flexibly stretched and expanded as required.

Description

The data transmission method of a kind of based on data unit
Technical field
The present invention relates to data communication field, relate in particular to the data transmission method of a kind of based on data unit.
Background technology
Data communication is according to certain communication protocol, utilizes a kind of communication mode and the communication service of data transmission technology transfer data information between two terminals.It can realize the data information transfer between computer and computer, computer and terminal and terminal and terminal.
In prior art, data communication protocol is to communicate accurately and effectively the mandatory rule of institute and agreement, but takes communication protocol that following shortcoming is arranged:
1) packing agreement and analysis protocol must be strict corresponding, otherwise cause parse error
2) autgmentability is poor: as agreement increases or the minimizing project, the agreement of packing and analysis protocol must upgrade simultaneously
3) the resolution logic reusability is poor.
If a kind of method of transfer of data easily can be provided, will be very significant.
Summary of the invention
For addressing the above problem, the present invention proposes the data transmission method of a kind of based on data unit, comprising:
Definition data cell step;
In transmitting terminal and receiving terminal definition same data stream structure step;
Set of streams bag step;
Data flow sending and receiving step;
The parsing of the data stream step;
Wherein, defined data cell comprises data, data name, the data ISN of representative data title, data length, data analysis method;
The data flow architecture body has defined outer communication protocol and internal layer data volume, described outer communication protocol definition data flow start sign and data length, end sign and data length thereof, described internal layer data volume, between starting sign and finishing to identify, occurs in pairs according to data ISN and data;
The step of described set of streams bag is assembled into packet by the data to be transmitted unit according to the data structure body;
The parsing of described data flow is resolved data stream according to the data flow architecture body of definition.
Beneficial effect of the present invention is:
1) outer communication protocol is reached common understanding and is got final product transmitting terminal and receiving terminal both sides, and data protocol is a kind of unalterable rules, does not need transmission, has shortened the length of data flow, but and arbitrary extension.
2) data structure body definition is simple, and each data cell ISN and data unit data are become a partner and formed independently data volume, and the data ISN when data volume in and data sort and also are not subject to sequence limit when a plurality of to having.
3) the data structure body can flexible expansion, increases data, and also can be according to demand, flexibly flexible and extended packet.
4) can, according to packet, automatically resolve and computing.
5) take data cell as resolution unit, facilitate updating maintenance expansion resolution logic.
Embodiment
Below technical solution of the present invention is elaborated.
Basic thought of the present invention makes take the individual data unit as the logic main body, and the step mainly comprised comprises:
Definition data cell step;
In transmitting terminal and receiving terminal definition same data stream structure step;
Set of streams bag step;
Data flow sending and receiving step;
The step of parsing of the data stream.
Below each step is explained respectively.
1. define the data cell step
Data cell is the system minimum data body that the present invention defines, the comprehensive information that comprises data to be transmitted, specifically have, data name, data type (as shaping, character type etc.), data length, correction factor and/or revise side-play amount, data analysis method, distinguish the data ISN of different pieces of information information for system.
As an air detection system, the transfer of data that need to gather sensing equipment is to host computer, the data message of transmission has device numbering, device type, air themperature, air humidity, can be by device numbering, device type, air themperature, air humidity is defined as respectively data cell, as shown in the table:
Figure 201310394226X100002DEST_PATH_IMAGE001
Wherein, parseInt is analytical function, at this, only for for example, in practice, can define as required different analytical functions or other analytic methods.
2. in transmitting terminal and receiving terminal definition same data stream structure step
The purpose of this step is to set up a common data flow architecture body at transmitting terminal and receiving terminal, the unified identification for whole system to transmitting data stream.
The data flow architecture body has defined outer communication protocol and internal layer data volume, described outer communication protocol definition data flow start sign and data length, end sign and data length thereof, described internal layer data volume, between starting sign and finishing to identify, occurs in pairs according to data ISN and data.The data structure body also is defined the length of data ISN and data.
The present embodiment structure has following features:
1) data flow is by 16 system character string splicings.
2) data flow starts to start identifying 7E, to finish sign 21, finishes.
3) data volume partly comprises at least one data and data ISN pair.Should be appreciated that described data ISN is the data ISN of this data institute's corresponding data unit.As, transmit the air themperature data cell, data volume is: 01092E(01 is air themperature data cell ISN, and 092E is the air themperature data, and 16 systems of employing mean); For another example, transmission air themperature data cell and device numbering data cell, data volume is 01092E6508. (01 is air themperature data cell ISN, and 092E is the air themperature data, and 65 is device numbering data cell ISN, and 08 is the device numbering data)
Be below the example of above-mentioned air detection system institute definition data structure body:
3. set of streams bag step
This step is assembled into packet by all data to be transmitted unit according to the data structure body.
Take above-mentioned air detection system as example: certain sensing equipment gets temperature data 092E(16 system), need the information of this sensing equipment of transmission and the temperature data obtained thereof, according to the definition of data flow architecture body, can assemble the temperature data bag as follows:
Figure 201310394226X100002DEST_PATH_IMAGE003
The final data bag is: 7E6508660101092E21.
4. data flow sending and receiving step
Data stream transmitting: the data packet transmission of step 3 assembling is arrived to receiving terminal.
As, by network or serial ports or other transmission means transmitting data streams 7E6508660101092E21 to receiving terminal.
Data flow receives: receiving terminal receives data flow.
This step utilization be prior art.
5. parsing of the data stream step
This step comprises following sub-step:
Steps A: receiving terminal checking data stream starts sign and finishes sign, carries out the following step as legal;
Be specially: with the 7E beginning, with the packet of 21 endings, be only legal data.
Step B: the data flow received is changed to byte arrays byte[], byte[0 wherein] for starting sign, index index is 0;
Step C: index index+ starts identification data length, obtains first data ISN.
Step D: the upper step of index index+ is obtained the length of data ISN, according to the data ISN, obtains the data length that this ISN is corresponding, reads the designated length data.
Step e: the data ISN that step D is obtained and data are preserved.
Be specially: the interim memory carrier Dictionary<int of receiving terminal definition data, object tempData, int record data unit ISN wherein, object record data cell data
Step F: index index+ step D obtains the length of data, obtains next data ISN, if next data finishes for finishing sign, otherwise repeating step D, E.
Step G: according to the data ISN, call the analytic method resolution data of corresponding data unit.
Take air detection system recited above as example, and the 7E6508660101092E21 parsing of the data stream step of its transmission is:
The receiving terminal verification thinks legal after starting to identify 7E and finishing sign 21, defines the interim memory carrier Dictionary<int of data, object > tempData, and the data flow 7E6508660101092E21 received is converted to byte arrays byte[].Byte[0 wherein] for starting to identify 7E, index index is 0.
Index index+1, obtain next data cell ISN, and 65, according to the description of data cell 65, its length is 1, index+1 obtains the data 08 of data ISN 65 place data cells, is saved in tempData (65,08).And then, obtain next byte data, index index+1, obtain data ISN 66 ... circulation successively, finish sign 21 until read, and stops reading.
Finally, receiving terminal, according to the data cell ISN read, calls the analytic method resolution data of corresponding data resolution unit.
Beneficial effect of the present invention is:
1) outer communication protocol is reached common understanding and is got final product transmitting terminal and receiving terminal both sides, and data protocol is a kind of unalterable rules, does not need transmission, arbitrary extension.Add agreement, shorten the length of data flow.
2) data structure body definition is simple, and each data cell ISN and data unit data are become a partner and formed independently data volume, and the data ISN when data volume in and data sort and also are not subject to sequence limit when a plurality of to having.
3) the data structure body can flexible expansion, increases data, and also can be according to demand, flexibly flexible and extended packet.
4) can, according to packet, automatically resolve and computing.
5) take data cell as resolution unit, facilitate updating maintenance expansion resolution logic.

Claims (8)

1. the data transmission method of a based on data unit, is characterized in that, comprising:
Definition data cell step;
In transmitting terminal and receiving terminal definition same data stream structure step;
Set of streams bag step;
Data flow sending and receiving step;
The parsing of the data stream step;
Wherein, defined data cell comprises data, data name, the data ISN of representative data title, data length, data analysis method;
The data flow architecture body has defined outer communication protocol and internal layer data volume, described outer communication protocol definition data flow start sign and data length, end sign and data length thereof, described internal layer data volume, between starting sign and finishing to identify, occurs in pairs according to data ISN and data;
The step of described set of streams bag is assembled into packet by the data to be transmitted unit according to the data structure body;
The parsing of described data flow is resolved data stream according to the data flow architecture body of definition.
2. the data transmission method of a kind of based on data as claimed in claim 1 unit, is characterized in that, described data cell has also comprised data type and/or correction factor, correction side-play amount.
3. the data transmission method of a kind of based on data as claimed in claim 1 or 2 unit, is characterized in that, the analytic method of data cell is to take analytical function.
4. the data transmission method of a kind of based on data as claimed in claim 1 unit, is characterized in that, described data flow is taked 16 system character strings.
5. as the data transmission method of claim 1 or 2 or 4 described a kind of based on data unit, it is characterized in that, described data flow starts to be designated 7E, finishes to be designated 21.
6. as the data transmission method of the described a kind of based on data of any one in claim 1,2,4 unit, it is characterized in that, the step of described parsing of the data stream is specially:
Steps A: receiving terminal checking data stream starts sign and finishes sign, carries out the following step as legal;
Step B: the data flow received is changed to byte arrays byte[], byte[0 wherein] for starting sign, index index is 0;
Step C: index index+ starts identification data length, obtains first data ISN.
Step D: the upper step of index index+ is obtained the length of data ISN, and according to described data ISN, the length of corresponding data, read the designated length data.
Step e: the data ISN that step D is obtained and data are preserved.
Step F: index index+ step D obtains the length of data, obtains next data ISN, if next data finishes for finishing sign, otherwise repeating step D, E.
Step G: according to the data ISN, call the data analysis method resolution data of corresponding data unit.
7. the data transmission method of a kind of based on data as claimed in claim 6 unit, is characterized in that, in the step of described parsing of the data stream, and the interim memory carrier storage data of receiving terminal definition data and corresponding data ISN thereof.
8. the data transmission method of a kind of based on data as claimed in claim 7 unit, is characterized in that, the interim memory carrier of described data adopts Dictionary<int, object > storage.Int record data ISN wherein, the object record data.
CN201310394226.XA 2013-09-03 2013-09-03 A kind of data transmission method based on data cell Active CN103475651B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310394226.XA CN103475651B (en) 2013-09-03 2013-09-03 A kind of data transmission method based on data cell

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310394226.XA CN103475651B (en) 2013-09-03 2013-09-03 A kind of data transmission method based on data cell

Publications (2)

Publication Number Publication Date
CN103475651A true CN103475651A (en) 2013-12-25
CN103475651B CN103475651B (en) 2016-08-24

Family

ID=49800347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310394226.XA Active CN103475651B (en) 2013-09-03 2013-09-03 A kind of data transmission method based on data cell

Country Status (1)

Country Link
CN (1) CN103475651B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461938A (en) * 2014-12-11 2015-03-25 北京国双科技有限公司 Method and device for reading data
CN105446910A (en) * 2015-11-24 2016-03-30 东软集团股份有限公司 Data transmission methods and apparatus
CN105549900A (en) * 2015-12-05 2016-05-04 中国航空工业集团公司洛阳电光设备研究所 Data transmission analysis method and apparatus
CN106713167A (en) * 2015-11-16 2017-05-24 中兴通讯股份有限公司 Data code stream sending method and device
CN109347883A (en) * 2018-12-05 2019-02-15 南通星云智能科技有限公司 A kind of expansible communication protocol data packet and its communication system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030206519A1 (en) * 2002-05-03 2003-11-06 Michael Sanders System and method for encoding and decoding messages
CN1630286A (en) * 2003-12-16 2005-06-22 盛万兴 A high-efficiency electric data transmission coding decoding method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030206519A1 (en) * 2002-05-03 2003-11-06 Michael Sanders System and method for encoding and decoding messages
CN1630286A (en) * 2003-12-16 2005-06-22 盛万兴 A high-efficiency electric data transmission coding decoding method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461938A (en) * 2014-12-11 2015-03-25 北京国双科技有限公司 Method and device for reading data
CN106713167A (en) * 2015-11-16 2017-05-24 中兴通讯股份有限公司 Data code stream sending method and device
WO2017084515A1 (en) * 2015-11-16 2017-05-26 中兴通讯股份有限公司 Method and device for transmitting data code stream
CN105446910A (en) * 2015-11-24 2016-03-30 东软集团股份有限公司 Data transmission methods and apparatus
CN105446910B (en) * 2015-11-24 2019-01-25 东软集团股份有限公司 A kind of data transmission method and device
CN105549900A (en) * 2015-12-05 2016-05-04 中国航空工业集团公司洛阳电光设备研究所 Data transmission analysis method and apparatus
CN109347883A (en) * 2018-12-05 2019-02-15 南通星云智能科技有限公司 A kind of expansible communication protocol data packet and its communication system

Also Published As

Publication number Publication date
CN103475651B (en) 2016-08-24

Similar Documents

Publication Publication Date Title
CN103475651A (en) Data-unit-based data transmission method
CN102098131B (en) Dynamic parameter configuration-based general framing and de-framing method for serial port data frames
US9286249B2 (en) USB device communication method, device and system wherein a human interface device (HID) descriptor and report are added to a driver of USB device
CN103618792B (en) Data stream identification method and device
CN102571732A (en) Method, device and system for processing sensor protocol information
CN102820959A (en) Method for performing large data volume communication between Modbus master station and Modbus slave station
CN105354020A (en) Json format data analytic method and data receiving end
CN105634599B (en) The data transmission method and system of a kind of visible light communication
CN203151539U (en) AFDX terminal system virtual link layer IP core
CN103458004A (en) Internet of things-based device subscription information changing method and equipment
CN103517375B (en) A kind of to multiple mobile equipment identification, the method for communication and device
CN114710513B (en) Processing system and method for network data
CN102646187A (en) Color graphics coding and identifying method
CN102394720B (en) Information safety checking processor
CN115473841A (en) Method and device for determining network path and storage medium
CN102957585B (en) The data transmission method of a kind of Ethernet and data transmission device
CN107613494B (en) Large-scale user sign-in method based on wireless equipment handshake protocol
CN103365934A (en) Extracting method and device of complex named entity
CN103336757A (en) Hardware protocol stack
CN103036642B (en) A kind of transmission method of data and transmitting terminal and receiving terminal
CN108572948B (en) Doorplate information processing method and device
CN106411534A (en) Embedded device and system with functions of interface recognition and wireless sharing
CN116405420A (en) Network tester, network testing system and network testing method
CN115718676A (en) Method and system for recovering electronic data of GoIP equipment
US6313763B1 (en) Variable length data packet with adjustable length indicator

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Wei Guangliang

Inventor after: Wang Xiaodong

Inventor after: Li Zheng

Inventor after: Su Shining

Inventor after: Gong Junyi

Inventor after: Wei Ning

Inventor after: Yao Zina

Inventor after: Luo Mingsi

Inventor before: Wei Guangliang

Inventor before: Wang Xiaodong

Inventor before: Luo Mingsi

Inventor before: Li Zheng

COR Change of bibliographic data
C14 Grant of patent or utility model
GR01 Patent grant