CN106559286A - A kind of error-code testing method and system based on CAN - Google Patents

A kind of error-code testing method and system based on CAN Download PDF

Info

Publication number
CN106559286A
CN106559286A CN201611033763.1A CN201611033763A CN106559286A CN 106559286 A CN106559286 A CN 106559286A CN 201611033763 A CN201611033763 A CN 201611033763A CN 106559286 A CN106559286 A CN 106559286A
Authority
CN
China
Prior art keywords
data
frame
error
error code
code
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
CN201611033763.1A
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.)
CETC 41 Institute
Original Assignee
CETC 41 Institute
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 CETC 41 Institute filed Critical CETC 41 Institute
Priority to CN201611033763.1A priority Critical patent/CN106559286A/en
Publication of CN106559286A publication Critical patent/CN106559286A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0823Errors, e.g. transmission errors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The invention discloses a kind of error-code testing method and system based on CAN, produces frame, the figure that will be tested or self-defined word are placed on data field, send frames to corresponding bus according to CAN protocol;Frame is decoded according to CAN protocol, ID is filtered, the data for meeting the frame of condition are taken out, error code testing is carried out as figure to be tested or word;The data that the data for receiving and recipient prestore are contrasted, the data of continuous preseting length are identical, then it is assumed that synchronous success, the data for receiving and the data for prestoring are compared by unit data after synchronous success, it is then error code to differ, if error code, error code quantity adds one, constantly repeats;According to error code incremental data and the data amount check for receiving, the corresponding bit error rate is calculated.The present invention can carry out error code testing to the CAN frame of framing, by carrying out error code testing to CAN, with the correctness of real-time judge bus data, can lift the stability and jamproof ability of bus.

Description

A kind of error-code testing method and system based on CAN
Technical field
The present invention relates to a kind of error-code testing method and system based on CAN.
Background technology
The one kind of CAN as fieldbus, it is simple with system architecture, the characteristics of strong antijamming capability, also have Certain fault-tolerant ability.Originally the data communication being made to solve in automobile between numerous control and measuring apparatus, later by It is widely used in the other fields such as truck, oversize vehicle, ship, Aero-Space.With the expansion of CAN range of application Greatly, also constantly perfect, the control system and tester based on CAN is also more and more, and CAN is total for CAN agreement Line has purposes widely, and in long time from now on, CAN all can have most important in bus field at the scene Status.
The operation principle of error code testing is:The pattern generator of error code testing system produces pseudo noise code or self-defining Data, and system under test (SUT) is issued as test pattern, the pattern for receiving is sent to Error detection unit, error code system by system under test (SUT) The number of bit errors in communication system is counted by Error detection unit;The number of bit errors for counting is carried out by internal logic control circuits Calculate, draw the bit error rate.
Although CAN has higher stability, but still it cannot be guaranteed that bus occurs without mistake, CAN can be with Support that multiple nodes, multiple nodes are communicated by CAN agreement, node is more, and the probability for occurring error code in bus is got over Greatly, bus stability is also lower.Error code testing can produce the situation of error code during analogue communication, and artificial inserts in the bus Enter error code, can interpolate that the disposal ability of error code occurs to bus in each node in bus.Error code survey is carried out to the data in bus Examination, can monitor the mistake being likely to occur with real-time judge bus state, and according to the error code for detecting come to bus and bus In each node be improved, lifted bus stability and jamproof ability.
The error-code testing method of generally CAN is by pseudo-random sequence or self-defining data insertion CAN association CAN frames with error code are sent to error code recipient by the data field of view frame, and recipient is according to the CAN frames for receiving by data Data in area are taken out, and the data to taking out carry out error code testing, determine whether error code and count error code number and error code Rate.
But existing CAN tester product is varied, speed 5Kbps~1Mbps, mode of operation has at a high speed Pattern, low speed fault-tolerant mode, monofilar mode, existing error code testing instrument support that the error code testing of non-frame, some buses have into The error code testing of frame, such as RS232 buses, FC buses etc., existing CAN tester can not also support error code testing The product of function.
The content of the invention
The present invention is in order to solve the above problems, it is proposed that a kind of error-code testing method and system based on CAN, this It is bright to carry out error code testing to the CAN frame of framing, by carrying out error code testing to CAN, can be total with real-time judge The correctness of line number evidence, lifts the stability and jamproof ability of bus.
To achieve these goals, the present invention is adopted the following technical scheme that:
A kind of error-code testing method based on CAN, comprises the following steps:
(1) frame is produced, the figure that will be tested or self-defined word are placed on sender and receiving side data area, assist according to CAN View sends frames to corresponding bus;
(2) frame is decoded according to CAN protocol, ID is filtered, the data for meeting the frame of condition are taken out, as Figure to be tested or word carry out error code testing;
(3) data of the data for receiving and recipient are contrasted, the data of continuous preseting length are identical, then it is assumed that same Walk successfully, the data that (1) is arranged the step of the data received to recipient after synchronous success and recipient are by each length list Position is compared, and identical is not then error code, and it is then error code to differ, if error code, error code quantity adds one;
(4) according to error code incremental data and the data amount check for receiving, calculate the corresponding bit error rate.
In the step (1), frame is the CAN protocol frame for meeting ISO11898 standards.
In the step (1), data type is normal data frame or growth data frame, and ID can set, and data length can set, and Data length can not be 0, and frame period can set, and resolution chart includes pseudo-random sequence, full 0, complete 1 or self-defining word.
In the step (1), resolution chart or self-defining word are placed on into the data field of CAN protocol frame, radom insertion is missed Code, the bit error rate can set, then be transmitted CAN protocol frame, and transmission process will observe CAN protocol.
In the step (2), when the data of bus transfer are received, arrange and filter ID, only receive the specific ID of setting Frame.
In the step (4), the bit error rate that the bit error rate for calculating is arranged with sender is identical, then it represents that bus communication shape State is normal, different then mistake occurs in expression bus.
In the step (4), by error code number divided by the data total number for receiving, the corresponding bit error rate is calculated.
A kind of test system of application said method, including CAN data generation module and error code testing statistical module, Wherein:
There is module in the CAN data, be configured to produce the CAN protocol frame for meeting ISO11898 standards, frame Data type is normal data frame or growth data frame, arranges corresponding ID, data length and frame period, by resolution chart or certainly The word of definition is placed on the data field of CAN protocol frame, inserts error code, is then transmitted CAN protocol frame;
The error code testing statistical module, is configured to receive the data in bus, receives the frame of specific ID, judge frame number Whether there is error code according in, and count corresponding error code quantity, calculate the bit error rate.
Beneficial effects of the present invention are:Traditional CAN tester has transmission, reception, filtration, triggering, statistics Etc. function, the not function of error code testing, therefore effectively detection and statistics can not be carried out to the error code in bus, bus goes out Can not find in time and process when existing mistake, error code testing is carried out to bus data, effectively solving can not be real-time The problem whether monitoring bus correctly communicates.
Description of the drawings
Fig. 1 is the error code testing schematic diagram based on CAN.
Specific embodiment:
The invention will be further described with embodiment below in conjunction with the accompanying drawings.
The operation principle of frame format and error code testing of the present invention based on CAN, proposes a kind of mistake based on CAN Code method of testing, which includes at least following two main functional modules, as shown in Figure 1.
1) there is module in CAN data:Generation meets the CAN protocol frame of ISO11898 standards, and data type is standard Frame or growth data frame, ID can set, and data length can set (can not be 0), and frame period can set, and resolution chart includes pseudorandom Resolution chart or self-defining word are placed on the data field of CAN protocol frame by sequence, full 0, complete 1 or self-defining word, be can be inserted into and are missed Code, the bit error rate can set, then be transmitted CAN protocol frame, and transmission process will observe CAN protocol.
2) error code testing statistical module:This module can be arranged in recipient for the data in bus receive Filter ID, only receives the frame of specific ID, and determines whether error code, calculates the bit error rate.The resolution chart of receiver module and transmission mould Block is identical, also comprising pseudo-random sequence, full 0, complete 1 or self-defining word, after receiver module process, error code number and error code Rate can be displayed in statistics.
The workflow of the error-code testing method based on CAN proposed by the present invention is:
Step 1:There is module and produce frame in agreement, the figure that will be tested or self-defined word are placed on data field, assist according to CAN View sends frames to bus;
Step 2:The frame for receiving is decoded by receiver module according to CAN protocol, and ID is filtered, and will meet condition Frame data take out, carry out error code testing as figure to be tested or word;
Step 3:The data that the data for receiving and recipient prestore are contrasted, continuous 32 bits are identical, then it is assumed that The data for receiving and the data for prestoring are compared after synchronous success by synchronous success by bit, and identical is not then error code, no Identical is then error code, if error code, bit error code number adds 1;
Step 4:The bit error rate is calculated with the data amount check for receiving by bit error code number.
Although the above-mentioned accompanying drawing that combines is described to the specific embodiment of the present invention, not to present invention protection model The restriction enclosed, one of ordinary skill in the art should be understood that on the basis of technical scheme those skilled in the art are not The various modifications made by needing to pay creative work or deformation are still within protection scope of the present invention.

Claims (8)

1. a kind of error-code testing method based on CAN, is characterized in that:Comprise the following steps:
(1) frame is produced, the figure that will be tested or self-defined word are placed on sender and receiving side data area, will according to CAN protocol Frame is sent to corresponding bus;
(2) frame is decoded according to CAN protocol, ID is filtered, the data that will meet the frame of condition are taken out, used as will survey The figure or word of examination carries out error code testing;
(3) data of the data for receiving and recipient are contrasted, the data of continuous preseting length are identical, then it is assumed that it is synchronous into The data that the step of work(, data received to recipient after synchronous success and recipient (1) is arranged are entered by each long measure Row compares, and identical is not then error code, and it is then error code to differ, if error code, error code quantity adds one;
(4) according to error code incremental data and the data amount check for receiving, calculate the corresponding bit error rate.
2. a kind of error-code testing method based on CAN as claimed in claim 1, is characterized in that:In the step (1), Frame is the CAN protocol frame for meeting ISO11898 standards.
3. a kind of error-code testing method based on CAN as claimed in claim 1, is characterized in that:In the step (1), Data type is normal data frame or growth data frame, and ID can set, and data length can set, and data length can not be 0, frame period Can set, resolution chart includes pseudo-random sequence, full 0, complete 1 or self-defining word.
4. a kind of error-code testing method based on CAN as claimed in claim 1, is characterized in that:In the step (1), Resolution chart or self-defining word are placed on into the data field of CAN protocol frame, radom insertion error code, the bit error rate can set, then by CAN Protocol frame is transmitted, and transmission process will observe CAN protocol.
5. a kind of error-code testing method based on CAN as claimed in claim 1, is characterized in that:In the step (2), When the data of bus transfer are received, arrange and filter ID, only receive the frame of the specific ID of setting.
6. a kind of error-code testing method based on CAN as claimed in claim 1, is characterized in that:In the step (4), The bit error rate that the bit error rate for calculating is arranged with sender is identical, then it represents that bus communication state is normal, different then represent bus There is mistake.
7. a kind of error-code testing method based on CAN as claimed in claim 1, is characterized in that:In the step (4), By error code number divided by the data total number for receiving, the corresponding bit error rate is calculated.
8. a kind of method testing system of application as any one of claim 1-7, is characterized in that:Including CAN There is module and error code testing statistical module in data, wherein:
There is module in the CAN data, be configured to produce the CAN protocol frame for meeting ISO11898 standards, the data of frame Type is normal data frame or growth data frame, arranges corresponding ID, data length and frame period, by resolution chart or self-defined Word be placed on the data field of CAN protocol frame, insert error code, then CAN protocol frame be transmitted;
The error code testing statistical module, is configured to receive the data in bus, receives the frame of specific ID, in judging frame data Whether there is error code, and count corresponding error code quantity, calculate the bit error rate.
CN201611033763.1A 2016-11-15 2016-11-15 A kind of error-code testing method and system based on CAN Pending CN106559286A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611033763.1A CN106559286A (en) 2016-11-15 2016-11-15 A kind of error-code testing method and system based on CAN

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611033763.1A CN106559286A (en) 2016-11-15 2016-11-15 A kind of error-code testing method and system based on CAN

Publications (1)

Publication Number Publication Date
CN106559286A true CN106559286A (en) 2017-04-05

Family

ID=58443497

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611033763.1A Pending CN106559286A (en) 2016-11-15 2016-11-15 A kind of error-code testing method and system based on CAN

Country Status (1)

Country Link
CN (1) CN106559286A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566085A (en) * 2017-09-04 2018-01-09 中国电子科技集团公司第四十研究所 A kind of bit error code method of testing and system based on FC buses
CN108737038A (en) * 2018-05-14 2018-11-02 西京学院 Communicate error code device
CN110650066A (en) * 2019-09-27 2020-01-03 南京工程学院 Embedded bus communication detection system and reliability detection method thereof
CN110798386A (en) * 2019-11-12 2020-02-14 中电科仪器仪表有限公司 Configurable CAN bus protocol transceiving test method and system
CN111313992A (en) * 2020-03-11 2020-06-19 智慧航海(青岛)科技有限公司 Intelligent ship communication performance testing method and system
CN111880983A (en) * 2020-08-04 2020-11-03 北京天融信网络安全技术有限公司 CAN bus abnormality detection method and device
CN113162827A (en) * 2021-04-23 2021-07-23 中国科学院地质与地球物理研究所 Error rate testing method and system for underground single-core bus system
CN114144997A (en) * 2019-06-03 2022-03-04 罗伯特·博世有限公司 Error detection test device for a subscriber station of a serial bus system and method for testing a mechanism for error detection in communication in a serial bus system
CN114363229A (en) * 2022-01-05 2022-04-15 瞬联软件科技(北京)有限公司 Self-checking method and self-checking device for vehicle-mounted machine test
CN114710423A (en) * 2022-04-07 2022-07-05 四川灵通电讯有限公司 Error code testing method of data chain system
CN115484515A (en) * 2022-08-26 2022-12-16 四川九州电子科技股份有限公司 Statistical method for error rate in running test

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100162090A1 (en) * 2001-10-20 2010-06-24 Christoph Emde Method of detecting data transmission errors in a CAN controller, and a CAN controller for carrying out the method
CN202267836U (en) * 2011-11-02 2012-06-06 中国重汽集团济南动力有限公司 Bus simulation testboard for heavy-duty car
CN103370700A (en) * 2010-12-21 2013-10-23 罗伯特·博世有限公司 Method and device for serial data transmission having additionally inserted data
DE102012110712A1 (en) * 2012-10-09 2014-04-10 Sensor-Technik Wiedemann Gmbh Method for testing function of error detection unit of controller area network bus controller unit, involves checking incorrect data transferring frames by error detection unit during test cycle of verification of frames as defective
CN105515893A (en) * 2015-11-26 2016-04-20 普华基础软件股份有限公司 Method for determining location of sample point

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100162090A1 (en) * 2001-10-20 2010-06-24 Christoph Emde Method of detecting data transmission errors in a CAN controller, and a CAN controller for carrying out the method
CN103370700A (en) * 2010-12-21 2013-10-23 罗伯特·博世有限公司 Method and device for serial data transmission having additionally inserted data
CN202267836U (en) * 2011-11-02 2012-06-06 中国重汽集团济南动力有限公司 Bus simulation testboard for heavy-duty car
DE102012110712A1 (en) * 2012-10-09 2014-04-10 Sensor-Technik Wiedemann Gmbh Method for testing function of error detection unit of controller area network bus controller unit, involves checking incorrect data transferring frames by error detection unit during test cycle of verification of frames as defective
CN105515893A (en) * 2015-11-26 2016-04-20 普华基础软件股份有限公司 Method for determining location of sample point

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张子键,张越,王剑: "一种应用于CAN总线的异常检测***", 《信息安全与通信保密》 *
王冰: "基于CVI的以太网和CAN总线传输测试***设计及实现", 《物联网技术》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107566085A (en) * 2017-09-04 2018-01-09 中国电子科技集团公司第四十研究所 A kind of bit error code method of testing and system based on FC buses
CN108737038A (en) * 2018-05-14 2018-11-02 西京学院 Communicate error code device
CN114144997A (en) * 2019-06-03 2022-03-04 罗伯特·博世有限公司 Error detection test device for a subscriber station of a serial bus system and method for testing a mechanism for error detection in communication in a serial bus system
CN114144997B (en) * 2019-06-03 2023-06-27 罗伯特·博世有限公司 Error detection test device for subscriber stations of a serial bus system and method for detecting a mechanism for error detection in a communication in a serial bus system
CN110650066A (en) * 2019-09-27 2020-01-03 南京工程学院 Embedded bus communication detection system and reliability detection method thereof
CN110798386A (en) * 2019-11-12 2020-02-14 中电科仪器仪表有限公司 Configurable CAN bus protocol transceiving test method and system
CN111313992A (en) * 2020-03-11 2020-06-19 智慧航海(青岛)科技有限公司 Intelligent ship communication performance testing method and system
CN111880983A (en) * 2020-08-04 2020-11-03 北京天融信网络安全技术有限公司 CAN bus abnormality detection method and device
CN113162827A (en) * 2021-04-23 2021-07-23 中国科学院地质与地球物理研究所 Error rate testing method and system for underground single-core bus system
CN114363229A (en) * 2022-01-05 2022-04-15 瞬联软件科技(北京)有限公司 Self-checking method and self-checking device for vehicle-mounted machine test
CN114710423A (en) * 2022-04-07 2022-07-05 四川灵通电讯有限公司 Error code testing method of data chain system
CN115484515A (en) * 2022-08-26 2022-12-16 四川九州电子科技股份有限公司 Statistical method for error rate in running test

Similar Documents

Publication Publication Date Title
CN106559286A (en) A kind of error-code testing method and system based on CAN
CN102393738B (en) Diagnostic device and test method of automobile electronic control unit (ECU)
US10083149B2 (en) Method for serially transmitting a frame from a transmitter to at least one receiver and participants of a bus system via a bus system
US7478234B2 (en) Distributed control and monitoring system
US9167058B2 (en) Timestamp correction in a multi-lane communication link with skew
US8352809B2 (en) Checking method and electronic circuit for the secure serial transmission of data
CN109669899B (en) Method for adaptively adjusting serial port communication baud rate and serial port device
CN109347598A (en) Check code processing method, electronic equipment and storage connect medium
US20210044610A1 (en) Anomaly detection method and anomaly detection device
US20170289321A1 (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
CN110650066A (en) Embedded bus communication detection system and reliability detection method thereof
JP2013121070A (en) Relay system, and relay device and communication device forming the same
CN103001808B (en) A kind of port failure detection interchanger and implementation method
CN107566085A (en) A kind of bit error code method of testing and system based on FC buses
CN110768871B (en) Test method and system for automatically counting data transmission correctness of DCS (distributed control system)
CN115657646A (en) Test method and device of CAN controller
CN101882974A (en) Method and system of real-time online detection of high-speed serial signals
CN114422126A (en) Joint debugging test system and method for quantum key management software module
CN1801690B (en) Method, system, and apparatus for link latency management
CN110962883B (en) Data communication method and device for railway vehicle and related equipment
CN102437893B (en) High speed 1553B bus communication system error correction method
CN100512325C (en) Device and method for detecting transmission state of connection E1 interface
JP2000502853A (en) Parity maintenance test routine
CN112821991B (en) Data transmission method and device
CN101573919A (en) Method for sending a data transfer block and method and system for transferring a data transfer block

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

Application publication date: 20170405

RJ01 Rejection of invention patent application after publication