A timeout detection system and method for CAN FD bus message transmission
By designing a timeout detection system for CAN FD bus message transmission, the problem of unreliable data transmission caused by CAN FD node failure was solved, enabling fast and reliable error reporting and ensuring the integrity of data transmission.
Patent Information
- Application Number
- CN202411616309.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-13
AI Technical Summary
A CAN FD node is unable to send data frames to the bus due to a fault, causing the host computer to fail to recognize the error and mistakenly believe that the node is working normally, thus affecting the reliability of data transmission.
Design a timeout detection system for CAN FD bus message transmission, including message configuration information monitoring, expected time calculation, timer module, fault judgment and error reporting module. The system determines whether a timeout has occurred by monitoring the message configuration and the timer, and reports the error information to the host computer.
This enables timely reporting of errors to the host computer when a CAN FD node fails, improving the reliability and response speed of data transmission.
Smart Images

Figure CN119766626B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer bus communication technology, and relates to a timeout detection system and method for CAN FD bus message transmission. Background Technology
[0002] With the development of electronic technology, electronic devices are becoming increasingly integrated, and the number of nodes that need to exchange information between devices is also increasing. In complex communication systems, a failure in one node may lead to the loss of critical data or command information, causing serious consequences for the entire application system. In systems with high requirements for real-time and reliability communication, such as autonomous driving, medical equipment, and aerospace, ensuring secure data transmission is particularly important.
[0003] CAN FD nodes sample data when sending it to the bus to determine if the data meets expectations, automatically identifying errors in data transmission on the bus and handling faults automatically by retransmission or disconnecting from the bus. However, when the CAN FD node itself malfunctions, it cannot send data frames after receiving commands from the host computer, and cannot identify errors by sampling the data on the bus. The host computer does not receive relevant error information and mistakenly believes the node is still working normally. To address this, this invention proposes a timeout detection method for CAN FD bus message transmission. When no transmitted message is sampled on the bus within a specified expected time, an error message is reported to the host computer. Summary of the Invention
[0004] (I) Purpose of the Invention
[0005] The purpose of this invention is to address the problem that CAN FD nodes, due to inherent faults, cannot send data frames to the bus, and therefore cannot identify errors through bus sampling, leading the host computer to mistakenly believe the node is still working normally because it does not receive relevant error information. This invention provides a CAN FD bus message transmission timeout detection system and method that reports error information to the host computer when no transmitted message is sampled on the bus within a specified expected time.
[0006] (II) Technical Solution
[0007] To address the aforementioned technical problems, this invention provides a timeout detection system for CAN FD bus message transmission, comprising: a message configuration information monitoring module, an expected time calculation module, a message transmission command monitoring module, a timer module, a message receiving module, a fault determination module, and an error reporting module; a host computer connected to the message configuration information monitoring module, the message transmission command monitoring module, and the error reporting module; the timer module connected to the message transmission command monitoring module and the fault determination module; the fault determination module connected to the expected time calculation module, the message receiving module, and the error reporting module; and the message receiving module connected to the bus.
[0008] The system includes a message configuration information monitoring module that monitors the host computer's configuration of the CAN FD node, an expected time calculation module that calculates the expected time (Frame_time) required for data frame transmission based on the configuration information monitored by the message configuration information monitoring module, a message transmission command monitoring module that monitors the host computer's message transmission commands, a timer module that starts timing with a period of can_clk after receiving a message transmission command, a message receiving module that monitors whether there are messages being transmitted on the bus, a fault determination module that determines whether a message has been received on the bus within the expected time based on the timer value, and an error reporting module that reports error information to the host computer.
[0009] The fault determination module implements timeout judgment for CAN FD message transmission. If no message is received on the bus after the timer exceeds the expected time for data transmission, the CAN FD node is determined to be faulty, and the error reporting module reports the error information.
[0010] The message configuration information monitoring module is responsible for monitoring configurations including bit time, frame format, and data length.
[0011] The expected time Frame_time is expressed in can_clk as the time unit.
[0012] The expected time Frame_time is expressed by formula (1):
[0013] Frame_time = Preprocessing time + (18 + 19 * Extended frame identifier) * 1.2 * bit_time1
[0014] +(number of data bytes * 8) * 1.2 * bit_time2
[0015] +(10+CRC checksum length)*bit_time2.(1)
[0016] Preprocessing time: The time from when a node processes the data after receiving a send command until it sends the first bit, expressed in can_clk units.
[0017] Extended frame identifier: When the data frame is an extended frame, the extended frame identifier is 1; otherwise, it is 0.
[0018] Bit_time1: Normal field bit time, i.e. how many can_clk cycles each bit is;
[0019] Bit_time2: Data field bit time, i.e. how many can_clk cycles each bit is;
[0020] CRC check field length: When the data frame carries 0-16 bytes of data, the CRC check field length is 23, including the padding counter and delimiter; when carrying more than 16 bytes of data, the CRC check field length is 28, including the padding counter and delimiter.
[0021] In formula (1), 18: the length of the frame header, control field and ACK response field of the CAN FD standard frame; 19: the extended frame identifier and SRR bit; 1.2: according to the bit stuffing rules, after every five consecutive bits of the same polarity, a bit of opposite polarity needs to be inserted, and 1.2 is the maximum number of bit stuffing bits; data byte number * 8: each data frame carries 0-64 bytes of data, and each byte is 8 bits; 10: the length of the DLC, ESI bits and length stuffing count bits.
[0022] This invention also provides a timeout detection method for CAN FD bus message transmission, comprising the following steps:
[0023] Step 1: Listen for the message configuration information sent by the host computer to the CAN FD node, including bit time, frame format and data length;
[0024] Step 2: Calculate the expected time for message transmission using the monitored message configuration information;
[0025] Step 3: Listen for message sending commands;
[0026] Step 4: After the host computer issues a message sending command, the timer starts counting down;
[0027] Step 5: Based on the timer value, determine within the fault determination module whether a message has been received on the bus before the expected time arrives;
[0028] Step 6: If no message is received on the bus after the timer value exceeds the expected time, the node is determined to be faulty and an error message is reported to the host computer; if the timer value receives a message on the bus within the expected time, the node is determined to be working normally and returns to Step 1 to prepare for the next data transmission.
[0029] (III) Beneficial Effects
[0030] The CAN FD bus message transmission timeout detection system and method provided by the above technical solution can promptly notify the host computer of node failure when the CAN FD node fails to respond to the host computer's data transmission command. It features fast response time and high reliability. Attached Figure Description
[0031] Figure 1 This is a schematic diagram of the timeout detection system according to an embodiment of the present invention. Detailed Implementation
[0032] To make the objectives, contents, and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0033] Reference Figure 1 As shown, the CAN FD bus message transmission timeout detection system in this embodiment includes a message configuration information monitoring module, an expected time calculation module, a message transmission command monitoring module, a timer module, a message receiving module, a fault determination module, and an error reporting module. A host computer is connected to the message configuration information monitoring module, the message transmission command monitoring module, and the error reporting module. The timer module is connected to the message transmission command monitoring module and the fault determination module. The fault determination module is connected to the expected time calculation module, the message receiving module, and the error reporting module. The message receiving module is connected to the bus.
[0034] The message configuration information listening module listens to the host computer's configuration of the CAN FD node. The expected time calculation module calculates the expected time Frame_time required for data frame transmission based on the configuration information listened to by the message configuration information listening module. The message transmission command listening module listens to the host computer's message transmission commands. The timer module starts timing with can_clk as the period after receiving the message transmission command. The message receiving module listens for whether there are messages being transmitted on the bus. The fault determination module determines whether a message has been received on the bus within the expected time based on the timer value. The error reporting module reports error information to the host computer.
[0035] The fault determination module implements timeout judgment for CAN FD message transmission. If no message is received on the bus after the timer has exceeded the expected time for data transmission, the CAN FD node is determined to be faulty, and the error reporting module reports the error information.
[0036] The message configuration information monitoring module is responsible for monitoring configurations including bit time, frame format, and data length.
[0037] The expected time Frame_time, expressed in terms of can_clk, is represented by formula (1):
[0038] Frame_time = Preprocessing time + (18 + 19 * Extended frame identifier) * 1.2 * bit_time1
[0039] +(number of data bytes * 8) * 1.2 * bit_time2
[0040] +(10+CRC checksum length)*bit_time2.(1)
[0041] Preprocessing time: The time from when a node processes the data after receiving a send command until it sends the first bit, expressed in can_clk units.
[0042] 18: The length of the frame header, control field, and ACK response field of the CAN FD standard frame;
[0043] 19: Extended Frame Identifier and SRR Bit;
[0044] Extended frame identifier: When the data frame is an extended frame, the extended frame identifier is 1; otherwise, it is 0.
[0045] 1.2: According to the bit filling rules, after every five consecutive bits of the same polarity, a bit of opposite polarity needs to be inserted. 1.2 is the maximum number of bits to fill.
[0046] Bit_time1: Normal field bit time, i.e. how many can_clk cycles each bit is;
[0047] Data bytes * 8: Each data frame can carry 0-64 bytes of data, with each byte being 8 bits;
[0048] Bit_time2: Data field bit time, i.e. how many can_clk cycles each bit is;
[0049] 10: DLC, ESI bit and length fill count bit length;
[0050] CRC check field length: When the data frame carries 0-16 bytes of data, the CRC check field length is 23 (including padding counters and delimiters). When it carries more than 16 bytes of data, the CRC check field length is 28 (including padding counters and delimiters).
[0051] Based on the above-mentioned CAN FD bus message transmission timeout detection system, the CAN FD bus message transmission timeout detection method in this embodiment includes the following steps:
[0052] Step 1: Listen for the message configuration information sent by the host computer to the CAN FD node, including bit time, frame format and data length;
[0053] Step 2: Calculate the expected time for message transmission using the monitored message configuration information;
[0054] Step 3: Listen for message sending commands;
[0055] Step 4: After the host computer issues a message sending command, the timer starts counting down;
[0056] Step 5: Based on the timer value, determine within the fault determination module whether a message has been received on the bus before the expected time arrives;
[0057] Step 6: If no message is received on the bus after the timer value exceeds the expected time, the node is determined to be faulty and an error message is reported to the host computer; if the timer value receives a message on the bus within the expected time, the node is determined to be working normally and returns to Step 1 to prepare for the next data transmission.
[0058] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A timeout detection system for CAN FD bus message transmission, characterized in that, include: The system includes a message configuration information monitoring module, an expected time calculation module, a message sending command monitoring module, a timer module, a message receiving module, a fault determination module, and an error reporting module; and a host computer connection module, which also includes a message configuration information monitoring module, a message sending command monitoring module, and an error reporting module. The timer module is connected to the message sending command monitoring module and the fault determination module; the fault determination module is connected to the expected time calculation module, the message receiving module, and the error reporting module; the message receiving module is connected to the bus. The message configuration information listening module listens to the host computer's configuration of the CAN FD node. The expected time calculation module calculates the expected time Frame_time required for data frame transmission based on the configuration information listened to by the message configuration information listening module. The message transmission command listening module listens to the host computer's message transmission commands. The timer module starts timing with can_clk as the period after receiving the message transmission command. The message receiving module listens for whether there is a message transmission on the bus. The fault judgment module determines whether a message on the bus has been received within the expected time based on the timer value. The error reporting module reports error information to the host computer. The fault determination module implements timeout judgment for CAN FD message transmission. If no message is received on the bus after the timer has exceeded the expected time for data transmission, the CAN FD node is determined to be faulty, and the error reporting module reports the error information. The expected time Frame_time is expressed by formula (1): Frame_time = Preprocessing time + (18 + 19 * Extended frame identifier) * 1.2 * bit_time1 +(number of data bytes * 8) * 1.2 * bit_time2 +(10+CRC checksum length)*bit_time2. (1) Preprocessing time: The time from when a node processes the data after receiving a send command until it sends the first bit, expressed in can_clk units. Extended frame identifier: When the data frame is an extended frame, the extended frame identifier is 1; otherwise, it is 0. Bit_time1: Normal field bit time, i.e. how many can_clk cycles each bit is; Bit_time2: Data field bit time, i.e. how many can_clk cycles each bit is; CRC check field length: When the data frame carries 0-16 bytes of data, the CRC check field length is 23, including the padding counter and delimiter; when carrying more than 16 bytes of data, the CRC check field length is 28, including the padding counter and delimiter. In formula (1), 18: the length of the frame header, control field and ACK response field of the CAN FD standard frame; 19: the extended frame identifier and SRR bit; 1.2: according to the bit stuffing rules, after every five consecutive bits of the same polarity, a bit of opposite polarity needs to be inserted, and 1.2 is the maximum number of bit stuffing bits; data byte number * 8: each data frame carries 0-64 bytes of data, and each byte is 8 bits; 10: the length of the DLC, ESI bits and length stuffing count bits.
2. The CAN FD bus message transmission timeout detection system as described in claim 1, characterized in that, The message configuration information monitoring module is responsible for monitoring the configurations including bit time, frame format, and data length.
3. The CAN FD bus message transmission timeout detection system as described in claim 2, characterized in that, The expected time Frame_time is in can_clk units.
4. A timeout detection method for CAN FD bus message transmission, characterized in that, The timeout detection method performs timeout detection based on the timeout detection system described in claim 3, and the timeout detection method includes the following steps: Step 1: Listen for the message configuration information sent by the host computer to the CAN FD node, including bit time, frame format and data length; Step 2: Calculate the expected time for message transmission using the monitored message configuration information; Step 3: Listen for message sending commands; Step 4: After the host computer issues a message sending command, the timer starts counting down; Step 5: Based on the timer value, determine within the fault determination module whether a message has been received on the bus before the expected time arrives; Step 6: If no message is received on the bus after the timer value exceeds the expected time, the node is determined to be faulty and an error message is reported to the host computer; if the timer value receives a message on the bus within the expected time, the node is determined to be working normally and returns to Step 1 to prepare for the next data transmission.
Citation Information
Patent Citations
CAN bus intelligent data acquisition module
CN104460396A
CAN bus communication reliability detection method and device
CN118487890A