CN114362882A - 256byte data error correction method based on CAN bus - Google Patents
256byte data error correction method based on CAN bus Download PDFInfo
- Publication number
- CN114362882A CN114362882A CN202111635095.0A CN202111635095A CN114362882A CN 114362882 A CN114362882 A CN 114362882A CN 202111635095 A CN202111635095 A CN 202111635095A CN 114362882 A CN114362882 A CN 114362882A
- Authority
- CN
- China
- Prior art keywords
- column
- data
- error
- row
- byte
- 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
- 238000000034 method Methods 0.000 title claims abstract description 17
- 238000012937 correction Methods 0.000 title claims abstract description 16
- 230000005540 biological transmission Effects 0.000 claims abstract description 21
- 238000004364 calculation method Methods 0.000 claims description 19
- 238000004891 communication Methods 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 238000013524 data verification Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 208000032370 Secondary transmission Diseases 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Landscapes
- Detection And Prevention Of Errors In Transmission (AREA)
Abstract
The invention relates to a 256-byte data error correction method based on a CAN bus, which is used for correcting 256-byte data with 16-byte horizontal columns and longitudinal columns, and comprises the steps of calculating and storing check values before S1 transmission, finding wrong horizontal columns and wrong vertical columns after S2 transmission, positioning wrong data by S3 and correcting the wrong data by S4.
Description
Technical Field
The invention relates to the technical field of CAN bus communication, in particular to a 256-byte data error correction method based on a CAN bus.
Background
CAN is a short term for Controller Area Network (CAN) and is most widely used in automobiles. At present, when the automobile ECU is communicated based on a CAN bus, data is usually checked by adopting CRC (cyclic redundancy check) to confirm the correctness of data transmission, the CRC CAN solve the verification problems of the correctness and the integrity of the data transmission, but the error data cannot be repaired.
Disclosure of Invention
The invention aims to provide a 256-byte data error correction method based on a CAN bus, which CAN repair and correct error of transmitted error data.
The invention provides the following technical scheme: a256-byte data error correction method based on a CAN bus is used for correcting errors of 256-byte data with 16 bytes in rows and columns, and comprises the following steps:
s1: calculating and storing a check value before transmission: performing CRC calculation on data of 1-15 bytes in each row column by column, and storing an original row check value obtained in the 16 th byte of each row column; performing CRC calculation on the original column check values of the 2 nd to 16 th bytes of each column by column, and storing the obtained column data check values in the 1 st byte of each column;
s2: finding wrong horizontal and vertical columns after transmission: after transmission, performing CRC calculation on data of 1-15 bytes of each row column by column, comparing an obtained existing row check value with an original row check value in a 16 th byte, after an error row is found, performing CRC calculation on data of 2-16 columns by column, comparing an obtained existing column check value with an original column check value in the 1 st byte, and finding an error vertical column;
s3: positioning error data: the cross area of the error row and the error number row is error data;
s4: correcting the error data: and performing CRC calculation with other error row data one by one from 0X00 to 0XFF, performing CRC calculation with the other error column data when the calculated row check value is equal to the original row check value in the 16 th byte of the error row, and completing error correction by using the data instead of the error data when the calculated column check value is equal to the original column check value in the 1 st byte of the error column.
Has the advantages that: the 256-byte data error correction method based on the CAN bus CAN verify the integrity and the correctness of data in the data transmission process, CAN find errors in time and carry out repair and error correction, realizes the self-repair function of the data, and avoids the waste of time and resources caused by the retransmission of the data; the working procedures are reduced, the data transmission efficiency is improved, the data faults are effectively reduced, and the subsequent faults caused by the data transmission errors are avoided; the method has the advantages that the flow is simplified, the data safety is improved, the high-efficiency operation of the electronic parts of the automobile is ensured, the occupation of bus resources caused by the secondary transmission of data is avoided, and the data transmission delay and the transmission error frequency of other equipment caused by the occupation of the data bus are further reduced; the method has the advantages of reasonable steps, ingenious and novel thought and better solves the problem that CRC in the prior art can only find data errors but can not correct and repair error data.
Drawings
Fig. 1 is a schematic diagram of an implementation of the 256-byte data error correction method based on the CAN bus according to the present invention.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings.
Specific embodiment 1 of the 256-byte data error correction method based on the CAN bus of the present invention:
the 256-byte data error correction method based on the CAN bus is based on a CRC data verification algorithm and is used for correcting the 256-byte data with 16 bytes in rows and columns, the 256-byte data described in figure 1 is taken as an example for explanation, each row comprises 16 bytes in total of 00-0F, and each column comprises 16 bytes in total of 00-F0, and the method comprises the following steps:
s1: calculating and storing a check value before transmission: before transmission, performing CRC calculation on data of 1-15 bytes (namely 00-0E bytes) of each row column by column, and storing an original row check value obtained in the 16 th byte (namely a D area in the figure 1) of each row column; CRC calculation is performed on the 2 nd to 16 th byte (i.e., 10-F0 bytes) data of each column by column, and the original column check value is stored in the 1 st byte (i.e., area A of FIG. 1) of each column.
S2: finding wrong horizontal and vertical columns after transmission: after transmission, performing CRC calculation on data of 1-15 bytes (namely 00-0E bytes) of each row column by column, comparing an obtained existing row check value with an original row check value in the 16 th byte of the row column, if the existing row check value is inconsistent with the original row check value, finding an error row (namely a B area), performing CRC calculation on data of 2-16 bytes (namely 10-F0 bytes) of each column by column, comparing the obtained existing column check value with the original column check value in the 1 st byte of the column, and if the existing column check value is inconsistent with the original column check value, finding an error column (namely a C area);
s3: positioning error data: a cross positioning method, which determines a cross area of a B area and a C area in a first graph as error data;
s4: correcting the error data: CRC calculation is performed with other data of the error row one by one from 0X00 to 0XFF, when the calculated row check value is equal to the original row check value F0 in the 16 th byte of the error row, CRC calculation is performed with the other data of the error column using the data, and when the calculated column check value is equal to the original column check value 60 in the 1 st byte of the error column, verification is passed, and error correction is completed using the data instead of the error data.
In this embodiment, the CRC calculation is performed according to "check value = X16+X13+X12+X11+X10+X8+X6+X5+X2+1(XnThe formula representing the nth byte of data of the column) "is calculated.
In summary, the invention provides a 256-byte data error correction method based on the CAN bus based on CAN bus communication and CRC (cyclic redundancy check), which CAN not only find out error information in time after data transmission, but also CAN realize data repair function and correct error data in time; the data retransmission caused by data transmission errors is reduced, the bus pressure is reduced, the time waste and the fault risk are reduced, and the technical problems that errors can only be found and the errors cannot be corrected in CRC data verification in the prior art can be effectively solved.
The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above-mentioned embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may occur to those skilled in the art without departing from the principle of the invention, and are considered to be within the scope of the invention.
Claims (1)
1. A256-byte data error correction method based on a CAN bus is characterized by being used for correcting errors of 256-byte data with 16 bytes in horizontal and vertical rows, and comprising the following steps of:
s1: calculating and storing a check value before transmission: performing CRC calculation on data of 1-15 bytes in each row column by column, and storing an original row check value obtained in the 16 th byte of each row column; performing CRC calculation on the original column check values of the 2 nd to 16 th bytes of each column by column, and storing the obtained column data check values in the 1 st byte of each column;
s2: finding wrong horizontal and vertical columns after transmission: after transmission, performing CRC calculation on data of 1-15 bytes of each row column by column, comparing an obtained existing row check value with an original row check value in a 16 th byte, after an error row is found, performing CRC calculation on data of 2-16 columns by column, comparing an obtained existing column check value with an original column check value in the 1 st byte, and finding an error vertical column;
s3: positioning error data: the cross area of the error row and the error number row is error data;
s4: correcting the error data: and performing CRC calculation with other error row data one by one from 0X00 to 0XFF, performing CRC calculation with the other error column data when the calculated row check value is equal to the original row check value in the 16 th byte of the error row, and completing error correction by using the data instead of the error data when the calculated column check value is equal to the original column check value in the 1 st byte of the error column.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111635095.0A CN114362882A (en) | 2021-12-29 | 2021-12-29 | 256byte data error correction method based on CAN bus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111635095.0A CN114362882A (en) | 2021-12-29 | 2021-12-29 | 256byte data error correction method based on CAN bus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114362882A true CN114362882A (en) | 2022-04-15 |
Family
ID=81102384
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111635095.0A Pending CN114362882A (en) | 2021-12-29 | 2021-12-29 | 256byte data error correction method based on CAN bus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114362882A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1321028A (en) * | 2001-05-18 | 2001-11-07 | 北京大学 | Data transmission method with packet check |
US20120192044A1 (en) * | 2011-01-24 | 2012-07-26 | Sarance Technologies Inc. | Method and Apparatus for Determining a Cyclic Redundancy Check (CRC) for a Data Message |
CN110034987A (en) * | 2019-03-21 | 2019-07-19 | 中国船舶重工集团公司第七0七研究所 | A kind of CAN communication controller based on FPGA |
CN112702065A (en) * | 2020-12-18 | 2021-04-23 | 广东高云半导体科技股份有限公司 | FPGA code stream data verification method and device |
-
2021
- 2021-12-29 CN CN202111635095.0A patent/CN114362882A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1321028A (en) * | 2001-05-18 | 2001-11-07 | 北京大学 | Data transmission method with packet check |
US20120192044A1 (en) * | 2011-01-24 | 2012-07-26 | Sarance Technologies Inc. | Method and Apparatus for Determining a Cyclic Redundancy Check (CRC) for a Data Message |
CN110034987A (en) * | 2019-03-21 | 2019-07-19 | 中国船舶重工集团公司第七0七研究所 | A kind of CAN communication controller based on FPGA |
CN112702065A (en) * | 2020-12-18 | 2021-04-23 | 广东高云半导体科技股份有限公司 | FPGA code stream data verification method and device |
Non-Patent Citations (1)
Title |
---|
张建育;黄永玉;王晓;: "基于CAN的分布式数控系统通讯技术研究", 青海大学学报(自然科学版), no. 05 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105119694B (en) | The method and system of crc value in a kind of calculating express network | |
US8352809B2 (en) | Checking method and electronic circuit for the secure serial transmission of data | |
CN102024501A (en) | Memory system and control method for the same | |
CN111143107B (en) | FPGA single event reversal verification circuit and method | |
CN103763067A (en) | Method and device for error correction and calibration of communication data packets | |
WO2024098647A1 (en) | Check-code recovery method and system, electronic device and storage medium | |
CN110457160A (en) | A kind of error correction method and device | |
CN113489570A (en) | Data transmission method, device and equipment for PCIe link | |
CN114362882A (en) | 256byte data error correction method based on CAN bus | |
US20040117549A1 (en) | Control method for distributed storage system | |
CN111863107B (en) | Flash memory error correction method and device | |
CN114679300B (en) | Data verification method and device, electronic equipment and storage medium | |
CN115904798A (en) | Error correction and detection method and system of memory and controller | |
CN114513285B (en) | Method, device, equipment and readable storage medium for detecting and correcting transmission data | |
CN105812085A (en) | Error correction method and system of audio USB Key | |
DE102018219877A1 (en) | Device and method for generating error correction information | |
CN108400787B (en) | Parallel FIR filter fault-tolerant method based on BCH coding | |
DE102013201422B3 (en) | Method for restoring lost and/or damaged data transmitted from transmitting device to receiving device, involves replacing current entry of LDPC parity check matrix with entry of Galois field until entry in matrix is modified | |
CN109358981B (en) | Memory read error correction method, system, computer device, and storage medium | |
CN107168817B (en) | Data restoration method and device applied to storage array and storage equipment | |
CN101477507B (en) | USB error correction encoding/decoding device and method, USB transmission system and method | |
CN105527637A (en) | BCH decoding method and device in Beidou satellite navigation positioning system | |
CN110795274A (en) | Single event upset resistant telemetry data access method and system | |
CN118199800A (en) | Data transmission optimization method and system | |
CN100525117C (en) | Decoder for iterative n-dimensional decoding and implementing method thereof |
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 | ||
CB02 | Change of applicant information |
Address after: Rooms 1903, 1905, and 1906, Block B, Dongfang Building, Intersection of Haihai Road and Songshan Road, Erqi District, Zhengzhou City, Henan Province, 450000 Applicant after: Zhongcheng Technology Co.,Ltd. Address before: 450000 No. 807, floor 8, building B, gram building, No. 18, business outer ring road, Zhengzhou area (Zhengdong), pilot Free Trade Zone, Zhengzhou City, Henan Province Applicant before: Zhengzhou Zhonghui Communication Technology Co.,Ltd. |
|
CB02 | Change of applicant information |