CN105005511A - Serial communication data checking method - Google Patents
Serial communication data checking method Download PDFInfo
- Publication number
- CN105005511A CN105005511A CN201510387234.0A CN201510387234A CN105005511A CN 105005511 A CN105005511 A CN 105005511A CN 201510387234 A CN201510387234 A CN 201510387234A CN 105005511 A CN105005511 A CN 105005511A
- Authority
- CN
- China
- Prior art keywords
- serial communication
- communication data
- check bit
- data text
- text
- 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
Links
Abstract
The present invention relates to a serial communication data checking method. The method is characterized in that a set of serial communication data sent by a sender sequentially comprises a serial communication data text, a first check bit and a second check bit, wherein the first check bit is a parity check bit, the second check bit is the accumulated sum of the number of "1" in the serial communication data text; and after receiving the data sent by the sender, a receiver performs parity check at first and then performs check of the second check bit, and if the number of "1" in the received serial communication data text is the same as the second check bit, a signal of correctly receiving the data is given out, or otherwise, the signal of incorrectly receiving the data is given out. Compared to the prior art, the advantage of the serial communication data checking method is that according to the checking method provided by the present invention, firstly first-time check is performed by using "odd parity" or "even parity" and then second-time check is performed on the accumulated sum of the number of "1" in the serial communication data text; and the double check mode is high in reliability and will not cause misjudgment.
Description
Technical field
The present invention relates to a kind of serial communication data method of calibration.
Background technology
When serial communication, the method of calibration of take over party to the serial communication data accuracy received adopts " very " " idol " method of calibration usually, namely, the number of " 1 " (high level) in one group of serial communication data received is added up, then by being that odd number or even number verify.This method of calibration erroneous judgement possibility is comparatively large, during as " odd ", if when one group of data is because of strong electromagnetic generation odd number disturbing pulse, can produce erroneous judgement; Equally, time " even parity check ", one group of data, because receiving even number disturbing pulse, also can produce erroneous judgement.
Summary of the invention
Technical matters to be solved by this invention provides for above-mentioned prior art the serial communication data method of calibration that a kind of reliability is high, can not produce erroneous judgement.
The present invention solves the problems of the technologies described above adopted technical scheme: a kind of serial communication data method of calibration, it is characterized in that: one group of serial communication data that transmit leg sends comprises successively: serial communication data text+the first check bit+the second check bit, wherein the content of the first check bit is: be " 1 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 0 "; Or first the content of check bit be: be " 0 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 1 "; The content of the second check bit is: the Cumulate Sum of the number of " 1 " in serial communication data text;
When the content of the first check bit is: be " 1 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 0 "; And after take over party receives the data that transmit leg sends, first the number of " 1 " in the serial communication data text of reception is added up, if the number of " 1 " is odd number in the serial communication data text received, and the first check bit is " 0 ", then provide the signal receiving corrupt data, if the first check bit is " 1 ", then carry out next step verification: if the number of " 1 " is identical with the second check bit in the serial communication data text received, then provide and receive the correct signal of data, otherwise provide the signal receiving corrupt data;
When the content of the first check bit is: be " 0 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 1 "; And after take over party receives the data that transmit leg sends, first the number of " 1 " in the serial communication data text of reception is added up, if the number of " 1 " is odd number in the serial communication data text received, and the first check bit is " 1 ", then provide the signal receiving corrupt data, if the first check bit is " 0 ", then carry out next step verification: if the number of " 1 " is identical with the second check bit in the serial communication data text received, then provide and receive the correct signal of data, otherwise provide the signal receiving corrupt data.
Compared with prior art, the invention has the advantages that: method of calibration provided by the invention, first " odd " or " even parity check " is used to carry out first time checking, and then by carrying out second time checking to the Cumulate Sum of the number of " 1 " in serial communication data text, the mode of this double verification, reliability is high, can not produce erroneous judgement.
Accompanying drawing explanation
Fig. 1 is the content composition diagram of one group of serial communication data that in the embodiment of the present invention one, transmit leg sends;
Fig. 2 is serial communication data method of calibration process flow diagram in the embodiment of the present invention one;
Fig. 3 is serial communication data method of calibration process flow diagram in the embodiment of the present invention two.
Embodiment
Below in conjunction with accompanying drawing embodiment, the present invention is described in further detail.
Embodiment one
The serial communication data method of calibration that the present embodiment provides, one group of serial communication data that transmit leg sends comprises successively: serial communication data text+the first check bit+the second check bit, wherein the content of the first check bit is: be " 1 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 0 "; The content of the second check bit is: the Cumulate Sum of the number of " 1 " in serial communication data text;
When the content of the first check bit is: be " 1 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 0 "; And after take over party receives the data that transmit leg sends, first the number of " 1 " in the serial communication data text of reception is added up, if the number of " 1 " is odd number in the serial communication data text received, and the first check bit is " 0 ", then provide the signal receiving corrupt data, if the first check bit is " 1 ", then carry out next step verification: if the number of " 1 " is identical with the second check bit in the serial communication data text received, then provide and receive the correct signal of data, otherwise provide the signal receiving corrupt data;
Embodiment two
With embodiment one unlike, the content of the first check bit is: for " 0 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 1 ";
When the content of the first check bit is: be " 0 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 1 "; And after take over party receives the data that transmit leg sends, first the number of " 1 " in the serial communication data text of reception is added up, if the number of " 1 " is odd number in the serial communication data text received, and the first check bit is " 1 ", then provide the signal receiving corrupt data, if the first check bit is " 0 ", then carry out next step verification: if the number of " 1 " is identical with the second check bit in the serial communication data text received, then provide and receive the correct signal of data, otherwise provide the signal receiving corrupt data.
Claims (1)
1. a serial communication data method of calibration, it is characterized in that: one group of serial communication data that transmit leg sends comprises successively: serial communication data text+the first check bit+the second check bit, wherein the content of the first check bit is: be " 1 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 0 "; Or first the content of check bit be: be " 0 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 1 "; The content of the second check bit is: the Cumulate Sum of the number of " 1 " in serial communication data text;
When the content of the first check bit is: be " 1 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 0 "; And after take over party receives the data that transmit leg sends, first the number of " 1 " in the serial communication data text of reception is added up, if the number of " 1 " is odd number in the serial communication data text received, and the first check bit is " 0 ", then provide the signal receiving corrupt data, if the first check bit is " 1 ", then carry out next step verification: if the number of " 1 " is identical with the second check bit in the serial communication data text received, then provide and receive the correct signal of data, otherwise provide the signal receiving corrupt data;
When the content of the first check bit is: be " 0 " when in serial communication data text, the number of " 1 " is odd number, in serial communication data text, the number of " 1 " is even number is " 1 "; And after take over party receives the data that transmit leg sends, first the number of " 1 " in the serial communication data text of reception is added up, if the number of " 1 " is odd number in the serial communication data text received, and the first check bit is " 1 ", then provide the signal receiving corrupt data, if the first check bit is " 0 ", then carry out next step verification: if the number of " 1 " is identical with the second check bit in the serial communication data text received, then provide and receive the correct signal of data, otherwise provide the signal receiving corrupt data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510387234.0A CN105005511A (en) | 2015-06-30 | 2015-06-30 | Serial communication data checking method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510387234.0A CN105005511A (en) | 2015-06-30 | 2015-06-30 | Serial communication data checking method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105005511A true CN105005511A (en) | 2015-10-28 |
Family
ID=54378191
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510387234.0A Pending CN105005511A (en) | 2015-06-30 | 2015-06-30 | Serial communication data checking method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105005511A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108197688A (en) * | 2018-02-07 | 2018-06-22 | 施玥 | A kind of coding mode with check code |
CN109039536A (en) * | 2018-07-24 | 2018-12-18 | 上海小蚁科技有限公司 | Transmission method, equipment and the readable medium of data |
CN110457970A (en) * | 2019-09-12 | 2019-11-15 | 上海明矽微电子有限公司 | A kind of self checking method of memory in RFID chip |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6240151B1 (en) * | 1997-04-08 | 2001-05-29 | Samsung Electronics Co., Ltd. | Method for transmitting and receiving asynchronous serial data in digital signal processor |
US20090249164A1 (en) * | 2006-08-02 | 2009-10-01 | Jorg Hammer | Method for serial asynchronous transmission of data in an arragement for the monitoring, controlling, and regulating an operational control facility of building |
CN101785189A (en) * | 2007-08-30 | 2010-07-21 | 松下电器产业株式会社 | Encoding device and decoding device |
CN102096620A (en) * | 2009-12-11 | 2011-06-15 | 华为技术有限公司 | Method and device for detecting connection state of serial port, and communication system |
CN202433889U (en) * | 2011-12-19 | 2012-09-12 | 中国航空工业集团公司洛阳电光设备研究所 | Device for serial communication data parity check |
CN103473196A (en) * | 2013-08-30 | 2013-12-25 | 中国空间技术研究院 | Device for transmitting telemetric and telecontrolled data between 1553B bus and satellite interior equipment bus |
CN103577378A (en) * | 2013-11-15 | 2014-02-12 | 哈尔滨工业大学深圳研究生院 | Full-duplex asynchronous serial communication method |
-
2015
- 2015-06-30 CN CN201510387234.0A patent/CN105005511A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6240151B1 (en) * | 1997-04-08 | 2001-05-29 | Samsung Electronics Co., Ltd. | Method for transmitting and receiving asynchronous serial data in digital signal processor |
US20090249164A1 (en) * | 2006-08-02 | 2009-10-01 | Jorg Hammer | Method for serial asynchronous transmission of data in an arragement for the monitoring, controlling, and regulating an operational control facility of building |
CN101785189A (en) * | 2007-08-30 | 2010-07-21 | 松下电器产业株式会社 | Encoding device and decoding device |
CN102096620A (en) * | 2009-12-11 | 2011-06-15 | 华为技术有限公司 | Method and device for detecting connection state of serial port, and communication system |
CN202433889U (en) * | 2011-12-19 | 2012-09-12 | 中国航空工业集团公司洛阳电光设备研究所 | Device for serial communication data parity check |
CN103473196A (en) * | 2013-08-30 | 2013-12-25 | 中国空间技术研究院 | Device for transmitting telemetric and telecontrolled data between 1553B bus and satellite interior equipment bus |
CN103577378A (en) * | 2013-11-15 | 2014-02-12 | 哈尔滨工业大学深圳研究生院 | Full-duplex asynchronous serial communication method |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108197688A (en) * | 2018-02-07 | 2018-06-22 | 施玥 | A kind of coding mode with check code |
CN108197688B (en) * | 2018-02-07 | 2021-05-18 | 施玥 | Coding method with check code |
CN109039536A (en) * | 2018-07-24 | 2018-12-18 | 上海小蚁科技有限公司 | Transmission method, equipment and the readable medium of data |
CN110457970A (en) * | 2019-09-12 | 2019-11-15 | 上海明矽微电子有限公司 | A kind of self checking method of memory in RFID chip |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20150019921A1 (en) | Method of encoding data | |
CN107078931A (en) | By bus system from sender by the participant of the method for frame serial transmission at least one recipient and bus system | |
KR102357899B1 (en) | Method and apparatus for valid encoding | |
CN104714920A (en) | Baud rate self-adaptation signal receiving method | |
CN106817197B (en) | Communication coding and decoding method based on duty ratio modulation | |
CN104038316B (en) | The highly reliable timeliness asynchronous serial communication method high of space camera | |
AU2012321618A8 (en) | Apparatus and method for transmitting and receiving data in communication/broadcasting system | |
CN105005511A (en) | Serial communication data checking method | |
JP2018501706A5 (en) | ||
US10334089B2 (en) | Method for serially transmitting a frame from a transmitter to at least one receiver via a bus system, and a subscriber station for a bus system | |
CN104852876A (en) | Wireless aviation burst communication system | |
CN103312458B (en) | Hybrid coding method | |
CN105680947A (en) | Serial data receiving method capable of filtering burrs | |
US20140161442A1 (en) | Data sending or receiving method, device, and apparatus used in optical fiber transmission | |
GB2522387A (en) | Method and apparatus for a modified HARQ procedure after a receiver outage event | |
CN104639294A (en) | Improved CRC (Cyclic Redundancy Check) realization method | |
CN104468042A (en) | Data transmission method and system | |
CN101442380B (en) | Method and apparatus for testing error rate based on high speed serial interface encoded mode | |
CN205545212U (en) | Manchester code's codec based on FPGA | |
CN104199277A (en) | Electronic clock correcting method based on audio transmission | |
CN104253621A (en) | Data receiver and data receiving method | |
CN105045758A (en) | Serial communication data verification method | |
CN102932103B (en) | A kind of message transmission rate adaptive reception method based on digital transformer substation | |
CN202433889U (en) | Device for serial communication data parity check | |
CN104682981A (en) | Decoding board of ADS-B (automatic dependent surveillance broadcast) receiver |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20151028 |
|
RJ01 | Rejection of invention patent application after publication |