CN108306785A - CAN message cycle detecting system and method - Google Patents

CAN message cycle detecting system and method Download PDF

Info

Publication number
CN108306785A
CN108306785A CN201711460935.8A CN201711460935A CN108306785A CN 108306785 A CN108306785 A CN 108306785A CN 201711460935 A CN201711460935 A CN 201711460935A CN 108306785 A CN108306785 A CN 108306785A
Authority
CN
China
Prior art keywords
message
information
message information
memory
timestamp
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
CN201711460935.8A
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.)
Shenzhen OptimumNano Energy Co Ltd
Original Assignee
Shenzhen OptimumNano Energy 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 Shenzhen OptimumNano Energy Co Ltd filed Critical Shenzhen OptimumNano Energy Co Ltd
Priority to CN201711460935.8A priority Critical patent/CN108306785A/en
Publication of CN108306785A publication Critical patent/CN108306785A/en
Pending legal-status Critical Current

Links

Classifications

    • 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
    • H04L12/40052High-speed IEEE 1394 serial bus
    • H04L12/40078Bus configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • 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)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

The present invention provides a kind of CAN message periodicity detection methods, includes the following steps:The CAN message information for including CAN message ID and CAN message essential information that multiple nodes are sent is received, and will be stored in memory after the CAN message information configuration timestamp received;Corresponding CAN message information is read from memory in real time;The time interval of CAN message ID identical current CAN message information and previous CAN message information is calculated, and exports the CAN message period of corresponding CAN message ID after averaging to calculated multiple time intervals.CAN message periodicity detection methods accuracy rate and efficiency provided by the invention are higher.The present invention also provides a kind of CAN message cycle detecting systems.

Description

CAN message cycle detecting system and method
【Technical field】
The present invention relates to controller local area network (Controller Area Network, CAN) technical fields, especially relate to And a kind of CAN message cycle detecting system and method.
【Background technology】
CAN (Controller Area Network, controller local area network) bus be widely used in Industry Control and Automobile bus communicates, and different communications protocol is also devised to carry out data interaction between each CAN communication node of different field. Periodic CAN message is generally applied to the important informations such as heartbeat signal or real-time system information between CAN nodes more Newly, therefore, there is stringent restriction to the sending cycle of CAN message, and be also the emphasis in test event.Currently, to CAN message The detection method in period is usually artificial detection, for example, being read out simultaneously shape to the message in CAN bus by adapter first It is saved in local at listing file, then judges the communication interval of a message, i.e. communication cycle by timestamp again.So And artificial detection may miss intermediate data frame, cause admission control, be easy to cause careless mistake, so that the CAN of detection The accuracy rate in message period is relatively low.
In consideration of it, it is really necessary to provide a kind of new CAN message cycle detecting system and method to overcome drawbacks described above.
【Invention content】
The higher CAN message cycle detecting system of higher and accuracy and side the object of the present invention is to provide a kind of efficiency Method.
To achieve the goals above, the present invention provides a kind of CAN message cycle detecting system, including host computer, adapter And multiple nodes;One end of the adapter is connected with the multiple node and the other end is connected with the host computer;It is described Host computer includes main control module and the memory that is connected with the main control module;The main control module includes dispensing unit, reads Take unit and computing unit;What the dispensing unit was used to receive the multiple node transmission includes CAN message ID and CAN report The CAN message information of literary essential information, and the memory will be stored in after the CAN message information configuration timestamp received In;The reading unit from the memory for reading corresponding CAN message information in real time;The computing unit is based on The time interval of CAN message ID identical current CAN message information and previous CAN message information is calculated, and to calculated multiple Time interval exports the CAN message period of corresponding CAN message ID after averaging.
To achieve the goals above, the present invention provides a kind of CAN message periodicity detection methods, be applied to include host computer, In the CAN message cycle detecting system of adapter and multiple nodes, one end of the adapter is connected with the multiple node And the other end is connected with the host computer;The host computer includes memory;It is characterized in that, the CAN message cycle detection Method includes the following steps:
Receive multiple nodes transmissions includes the CAN message information of CAN message ID and CAN message essential information, and will connect It is stored in the memory after the CAN message information configuration timestamp received;
Corresponding CAN message information is read from the memory in real time;
The time interval of CAN message ID identical current CAN message information and previous CAN message information is calculated, and to meter The multiple time intervals calculated export the CAN message period of corresponding CAN message ID after averaging.
Compared with the prior art, CAN message cycle detecting system provided by the invention and method, by accessing host computer CAN network to analyze the CAN message period that multiple nodes are sent out, and then avoid the non real-time nature artificially analyzed and accidentally grasp in real time The property made also improves efficiency while improving the accuracy rate of CAN message cycle detection.
【Description of the drawings】
Fig. 1 is the configuration diagram for the CAN message cycle detecting system that present pre-ferred embodiments provide.
Fig. 2 is the functional block diagram of host computer in Fig. 1.
Fig. 3 is the flow chart for the CAN message periodicity detection methods that the good embodiment of the present invention provides.
【Specific implementation mode】
It is clear in order to make the purpose of the present invention, technical solution and advantageous effects be more clear, below in conjunction with this hair Attached drawing in bright embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described Embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field The every other embodiment that those of ordinary skill is obtained without making creative work, belongs to protection of the present invention Range.
When an element was considered with another element " being connected ", it can be directly to another element or It may be simultaneously present centering elements.Unless otherwise defined, all of technologies and scientific terms used here by the article and belong to this hair The normally understood meaning of bright those skilled in the art is identical.Term used in the description of the invention herein It is only for the purpose of describing specific embodiments and is not intended to limit the present invention.
Referring to Fig. 1, its CAN (Controller Area Network, control for providing for present pre-ferred embodiments Device local area network) message cycle detecting system 100 configuration diagram.The CAN message cycle detecting system 100 for pair The CAN message period is detected.Specifically, the CAN message cycle detecting system 100 include host computer 10, adapter 20 with And multiple nodes 30.One end of the adapter 20 is connected with the multiple node 30 and the other end and 10 phase of the host computer Even.In the present embodiment, the adapter 20 is communicated by CAN bus and the multiple node 30 and passes through USB (Universal Serial Bus, universal serial bus) is communicated with the host computer 10.It is appreciated that the multiple section Point corresponds to different devices respectively, for example, when CAN bus is applied on electric vehicle, one of node can correspond to vehicle Controller, another node can correspond to the insulation monitoring module in battery management system, and other nodes can then correspond to cell tube Detection module in reason system, wherein each detection module is used to detect the electric current, voltage and temperature of battery.Further, institute It is the data information that multiple nodes 30 are sent out to state CAN message.
Furthermore, it is necessary to explanation be due to cannot directly be communicated between multiple nodes 30 and the host computer 10, because This, needs adapter 20 to transfer.Wherein, adapter 20 can be USB-CAN cards.It is appreciated that the USB-CAN cards are One end can carry out CAN communication and the other end can carry out the element of USB communications.
Further, the host computer 10 is personal computer (PC, Personal Computer).The host computer 10 It is connected with the adapter 20 by USB interface.It is appreciated that in other embodiments, the host computer 10 can also lead to Other serial ports are crossed, for example, RS232 serial ports or RS485 serial ports are connected with the adapter 20 to be communicated.
It is the functional block diagram of the host computer 10 referring again to Fig. 2.The host computer 10 include main control module 11 with And the memory 12 being connected with the main control module 11.Wherein, the main control module 11 is used to receive the transmission of multiple nodes 30 CAN message information, and by the CAN message information storage in the memory 12, the main control module 11 can also pass through It accesses to the memory 12 corresponding to be read out and calculate by the CAN message information in the memory 12 The CAN message period.Wherein, the memory 12 can be electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) or FLASH flash memories etc..The main control module 11 can be by interior Portion's communication bus, for example, SPI (Serial Peripheral Interface, Serial Peripheral Interface (SPI)) or I2C buses are by institute CAN message information is stated the memory 12 is written and is read out access to the memory 12.In the present embodiment, institute It is MCU (Microcontroller Unit, micro-control unit) to state main control module 11.
Further, the main control module 11 includes dispensing unit 111, reading unit 112, judging unit 113 and meter Calculate unit 114.It should be noted that the memory 12 is external memory, it will be understood that the main control module 11 further includes Internal storage (not shown) and processor (not shown), above-mentioned each functional unit can be stored in master in form of software programs In the internal storage for controlling module 11, and executed by processor.In alternate embodiment, above-mentioned each functional unit is alternatively with spy The hardware of function is determined, for example, burning has the chip of particular software application.
Above-mentioned each functional unit is described in detail with reference to Fig. 3.
As shown in figure 3, the flow chart of its CAN message periodicity detection methods provided for present pre-ferred embodiments.It is answered Illustrate, method of the invention is not limited to the sequence of following step, and in other embodiment, and method of the invention can be with The a portion or part steps therein for only including step as described below can be deleted.
Step S01, the dispensing unit 111 are used to receive the CAN message information of the transmission of the multiple node 30, and will connect It is stored in the memory 12 after the CAN message information configuration timestamp received.Wherein, the CAN message information includes CAN Message ID (Identity, identity number) and CAN message essential information.Specifically, the CAN message essential information includes Frame format, frame type, data length and data etc..
In the present embodiment, the dispensing unit 111 deposits the CAN message information received according to figure (map) structure It is stored in the memory 12.Wherein, figure (Map) is a kind of data structure that the form according to key-value pair is stored.Into one Step ground, CAN message ID correspond to the key of map structures, and CAN message essential information corresponds to the value of map structures.It is appreciated that by In key in graph structure have uniqueness, therefore, no matter CAN message information content number, can be according to CAN message ID It is stored respectively, and then improves the accuracy of CAN message cycle detection.
It is appreciated that timestamp is time identifier, i.e., the dispensing unit 111 matches the CAN message information received Stored after setting current time, due to the time be in real-time change, the timestamp of each message information is different.
Step S02, the reading unit 112 from the memory 12 for reading corresponding CAN message information in real time.
Step S03, the judging unit 113 are used to judge whether the timestamp in the CAN message information read to be empty;If Timestamp in the CAN message information of reading is not sky, then sends out computations and enter step S04;If the CAN message read Timestamp in information is sky, then enters step S05.
It is appreciated that after CAN message information storage is in memory 12, if system initialization or other failures, will lead The timestamp of CAN message information is caused to reset, as empty, therefore, it is necessary to reconfigure the time to the CAN message information currently read Stamp calculates time interval with subsequent CAN message information to facilitate, improves the accuracy of CAN message cycle detection.Certainly, exist In other embodiment, which can also omit.
Step S04, the computing unit 114 for calculate the identical current CAN message information of CAN message ID with it is previous The time interval of CAN message information, and the CAN of corresponding CAN message ID is exported after averaging to calculated multiple time intervals The message period.
It is appreciated that identical CAN message ID is expressed as same class message, therefore, with current CAN message information when Between stamp subtract the timestamp of previous CAN message information, you can obtain the time interval of adjacent CAN message information successively, will Multiple time intervals, which average, can obtain the CAN message period of same CAN message ID.Further, it is averaging In the process in order to improve accuracy, can by multiple time intervals minimum value and maximum value remove after average again.
Step S05, the configuration module 111 are additionally operable to current time being allocated to current CAN as new timestamp Message information.
CAN message cycle detecting system 100 provided by the present invention and method, by the way that by host computer 10, (computer end is debugged Software) access CAN network with analyze the CAN message period that multiple nodes 30 are sent out in real time, and then avoid artificially analyze it is non- Real-time and maloperation also improve efficiency while improving the accuracy rate of CAN message cycle detection.
The present invention is not only in the description and the implementation described, therefore for the personnel of familiar field Other advantage and modification is easily implemented, therefore in the essence without departing substantially from universal defined by claim and equivalency range In the case of refreshing and range, the present invention is not limited to specific details, representative equipment and diagrams shown and described herein Example.

Claims (10)

1. a kind of CAN message cycle detecting system, it is characterised in that:Including host computer, adapter and multiple nodes;Described turn The one end for connecing device is connected with the multiple node and the other end is connected with the host computer;The host computer include main control module with And the memory being connected with the main control module;The main control module includes dispensing unit, reading unit and computing unit;Institute State the CAN message letter including CAN message ID and CAN message essential information that dispensing unit is sent for receiving the multiple node Breath, and will be stored in the memory after the CAN message information configuration timestamp received;The reading unit is for real-time Corresponding CAN message information is read from the memory;The computing unit is identical current for calculating CAN message ID The time interval of CAN message information and previous CAN message information, and output pair after averaging to calculated multiple time intervals Answer the CAN message period of CAN message ID.
2. CAN message cycle detecting system as described in claim 1, it is characterised in that:The dispensing unit is according to map structures By the CAN message information storage received in the memory;The CAN message ID corresponds to the key of the map structures, institute State the value that CAN message essential information corresponds to the map structures.
3. CAN message cycle detecting system as described in claim 1, it is characterised in that:The main control module further includes judging Module, the judgment module are used to judge whether the timestamp in the CAN message information read to be empty;If the CAN message read Timestamp in information is not sky, then sends out computations and calculated with controlling the computing unit.
4. CAN message cycle detecting system as claimed in claim 3, it is characterised in that:If in the CAN message information read Timestamp is sky, then the configuration module is additionally operable to current time being allocated to current CAN message letter as new timestamp Breath.
5. CAN message cycle detecting system as described in claim 1, it is characterised in that:The adapter by CAN bus with The multiple node communicate and communicated by USB and the host computer.
6. a kind of CAN message periodicity detection methods, applied to the CAN message week for including host computer, adapter and multiple nodes In phase detecting system, one end of the adapter is connected with the multiple node and the other end is connected with the host computer;It is described Host computer includes memory;It is characterized in that, the CAN message periodicity detection methods include the following steps:
Receive multiple nodes transmissions includes the CAN message information of CAN message ID and CAN message essential information, and will receive CAN message information configuration timestamp after be stored in the memory;
Corresponding CAN message information is read from the memory in real time;
The time interval of CAN message ID identical current CAN message information and previous CAN message information is calculated, and to calculating Multiple time intervals average after export CAN message period of corresponding CAN message ID.
7. CAN message periodicity detection methods as claimed in claim 6, it is characterised in that:It " receives multiple nodes to send described The CAN message information for including CAN message ID and CAN message essential information, and CAN message information configuration time that will be received Be stored in after stamp in the memory " step in, the CAN message information storage received is deposited in described according to map structures In reservoir;The CAN message ID corresponds to the key of the map structures, and the CAN message essential information corresponds to the map structures value。
8. CAN message periodicity detection methods as claimed in claim 6, it is characterised in that:The CAN message periodicity detection methods " time interval of CAN message ID identical current CAN message information and previous CAN message information is calculated, and to calculating described Further include walking as follows before the step in the CAN message period of the corresponding CAN message ID of output after the multiple time intervals gone out are averaged " Suddenly:
Judge whether the timestamp in the CAN message information read is empty;
If the timestamp in the CAN message information read is not sky, computations are sent out.
9. CAN message periodicity detection methods as claimed in claim 8, it is characterised in that:The CAN message periodicity detection methods Further include following steps:
If the timestamp in the CAN message information read is sky, it is allocated to using current time as new timestamp current CAN message information.
10. CAN message periodicity detection methods as claimed in claim 6, it is characterised in that:The CAN message essential information packet Include frame format, frame type, data length and data.
CN201711460935.8A 2017-12-28 2017-12-28 CAN message cycle detecting system and method Pending CN108306785A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711460935.8A CN108306785A (en) 2017-12-28 2017-12-28 CAN message cycle detecting system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711460935.8A CN108306785A (en) 2017-12-28 2017-12-28 CAN message cycle detecting system and method

Publications (1)

Publication Number Publication Date
CN108306785A true CN108306785A (en) 2018-07-20

Family

ID=62867560

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711460935.8A Pending CN108306785A (en) 2017-12-28 2017-12-28 CAN message cycle detecting system and method

Country Status (1)

Country Link
CN (1) CN108306785A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109286547A (en) * 2018-08-30 2019-01-29 百度在线网络技术(北京)有限公司 Message processing method, device, electronic control unit and readable storage medium storing program for executing
CN109634258A (en) * 2018-11-30 2019-04-16 北京新能源汽车股份有限公司 Bus message checking method, device and system for hardware-in-loop test
CN111464415A (en) * 2020-04-02 2020-07-28 昆易电子科技(上海)有限公司 Method for early warning of CAN bus message abnormity and electronic equipment
CN112255556A (en) * 2020-04-30 2021-01-22 蜂巢能源科技有限公司 Battery pack offline detection method and system
CN112398672A (en) * 2019-08-16 2021-02-23 北京新能源汽车股份有限公司 Message detection method and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109286547A (en) * 2018-08-30 2019-01-29 百度在线网络技术(北京)有限公司 Message processing method, device, electronic control unit and readable storage medium storing program for executing
US11362857B2 (en) 2018-08-30 2022-06-14 Apollo Intelligent Driving Technology (Beijing) Co., Ltd. Message processing method, apparatus, electronic control unit and readable storage medium
CN109634258A (en) * 2018-11-30 2019-04-16 北京新能源汽车股份有限公司 Bus message checking method, device and system for hardware-in-loop test
CN112398672A (en) * 2019-08-16 2021-02-23 北京新能源汽车股份有限公司 Message detection method and device
CN111464415A (en) * 2020-04-02 2020-07-28 昆易电子科技(上海)有限公司 Method for early warning of CAN bus message abnormity and electronic equipment
CN112255556A (en) * 2020-04-30 2021-01-22 蜂巢能源科技有限公司 Battery pack offline detection method and system
CN112255556B (en) * 2020-04-30 2023-06-02 蜂巢能源科技有限公司 Battery pack off-line detection method and system

Similar Documents

Publication Publication Date Title
CN108306785A (en) CAN message cycle detecting system and method
CN103546467A (en) Method for transmitting Modbus RTU protocol on TCP/IP network
KR101256944B1 (en) System and method for data recovery for automatic meter reading system
CN106100939B (en) The network equipment starts time test method and test console
CN105471973A (en) Remote monitoring method and remote monitoring system based on indicating lamp color of monitored object
CN106253950A (en) A kind of bandwidth carrier platform district's recognition methods
CN107481503A (en) A kind of kilowatt meter reading-out system and meter register method
CN114301991B (en) Communication method, device, system and computer readable storage medium
CN106443171A (en) System and method for metering data of power bus during power failure of power utilization equipment
CN109150669B (en) Remote communication system using operation and maintenance and operation and maintenance debugging method
CN102761626B (en) A kind of In-vehicle networking node address and upgrade method
CN102946335A (en) Network condition detection method and network condition detection system
CN110430548B (en) Data reissue method, device, collector and storage medium
CN105515925A (en) UART multi-master real-time communication system
CN103441894A (en) Method and system for L2TP concurrent connection performance test
CN115657646B (en) Test method and device of CAN controller
CN113949628B (en) Automatic equipment adding method and system
US5778172A (en) Enhanced real-time topology analysis system or high speed networks
CN108337126A (en) CAN message test device and method
CN204145528U (en) The how main real-time communication system of a kind of UART
CN110177032B (en) Message routing quality monitoring method and gateway controller
Popa Smart meters reading through power line communications
CN110995857B (en) Real-time high-concurrency long-connection timeout fast processing method
CN105488608A (en) Configuration-free rack server information acquisition method and system
CN204679112U (en) Based on the temperature/humiditydetection detection system of WIFI radio communication

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180720

WD01 Invention patent application deemed withdrawn after publication