CAN bus test experiment system
By designing a CAN bus test experimental system and integrating multiple test functions and experimental modules, the problem of lack of an intuitive experimental platform and in-depth analysis of communication quality in the existing technology is solved, efficient CAN bus testing and teaching is achieved, and teaching efficiency is improved.
Patent Information
- Application Number
- CN202411651764.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The existing CAN bus testing and teaching methods lack an intuitive experimental platform, making it difficult to analyze communication quality in depth, cannot simulate complex scenarios, and have low teaching efficiency.
A CAN bus testing experimental system is designed, integrating data acquisition and processing, data forwarding, control and display, analysis and reporting modules, providing bit error rate statistics, timing analysis and waveform detection functions, and supporting multi-frame transmission and analysis.
The system is built-in automatic baud rate recognition function to reduce the risk of communication failure; supports multi-frame transmission and analysis to help identify physical layer signal problems and logic layer errors; simulates data transmission under high load conditions, detects system bottlenecks and optimizes scheduling strategies.
Smart Images

Figure CN119575929A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of data processing, and in particular to a CAN bus test experimental system. Background Art
[0002] CAN (Controller Area Network) bus is an efficient and reliable serial communication bus protocol, which is widely used in automotive electronics, industrial automation, medical equipment and aerospace, etc., for real-time data transmission and control signal exchange between devices. The main features of CAN bus include: High reliability: through differential signal transmission and error detection mechanism, the stability of communication is ensured. Strong real-time performance: support priority scheduling to ensure timely transmission of high-priority data frames. Strong scalability: support multi-node communication, up to 110 nodes can be connected. CAN bus supports multiple frame types (standard frame, extended frame, remote frame), and realizes efficient data exchange between multiple nodes through distributed control architecture. Due to its high reliability and low cost, CAN bus is particularly widely used in modern vehicles, covering many aspects from power system control to in-vehicle infotainment system.
[0003] Although the protocol design of CAN bus is mature, in the teaching of CAN bus, students need to master technical details such as frame structure, arbitration mechanism and error handling. It is difficult to achieve comprehensive understanding by simply relying on theoretical explanation. At present, CAN bus testing and teaching mostly rely on hardware tools and simple software simulation platforms, but these methods have the following shortcomings: 1. Lack of intuitive experimental platform: It is difficult for students to observe the transmission process of data frames on actual equipment, especially key mechanisms such as frame arbitration, scheduling and error detection. 2. Insufficient data analysis ability: Traditional test tools are difficult to conduct in-depth analysis of communication quality, such as insufficient observation of the scheduling effect of frame priority or the trend of error rate changes. 3. Unable to simulate complex scenarios: There is a lack of experimental environment that supports high-load and multi-node communication scenarios, and it is difficult to verify the performance of the system under real conditions. 4. Low teaching efficiency: Manual operation takes a lot of time, and the process of experimental data collation and report generation is cumbersome. Summary of the invention
[0004] In order to overcome the above technical defects, this application designs a CAN bus test experimental system, which integrates multiple test functions and experimental modules to provide comprehensive support for the teaching and research of CAN bus. The specific scheme is as follows: In a first aspect of the present application, a CAN bus test experimental system is provided, wherein the method comprises: Data acquisition and processing module: used to collect data frames from the CAN bus, add timestamps, and perform tasks such as data parsing, synchronization, filtering, and caching to ensure efficient and accurate data transmission; Data forwarding module: used to forward data frames between different channels according to experimental requirements; Control and display module: used to generate and send control instructions according to vehicle status data, and obtain and update vehicle status information; Experimental report generation unit: used to organize experimental data such as bit error rate, timing analysis, waveform detection, etc. into experimental reports; Wherein, the data acquisition and processing module includes: Data acquisition unit: used to obtain data frames from the CAN bus in real time and add a timestamp to each data frame; Data parsing unit: used to decode the collected raw CAN data frames into understandable vehicle status information; Message filtering unit: Filters out required key data as high-priority data frames through preset rules and dynamic adjustments; The data acquisition and processing module also includes a baud rate automatic identification unit and a CANopen management unit; Among them: Baud rate automatic identification unit: used to collect CAN signals of target devices and determine whether the sampled frame signals are valid; The system presets a set of common standard baud rates and tries to set these baud rates one by one and send standard data frames.
[0005] Verify the response data of the target device; If a valid data frame is received, the baud rate detection is determined to be successful.
[0006] If all baud rates are not detected successfully, communication failure is reported; After the baud rate detection is successful, the system updates the baud rate configuration and passes the target baud rate to the data acquisition unit and the data analysis unit to ensure the synchronization of subsequent data acquisition and analysis; The CANopen management unit comprises: Obtain the response data of the slave node, including node ID, PDO mapping information, SDO read and write response, and node status information; The system sends NMT management messages to poll all possible node addresses; Detect which nodes have responded and record their IDs as valid nodes; The system sets the mapping content of PDO according to the experimental requirements; Update the slave's mapping table via SDO write command; Parse the heartbeat message of the slave station to monitor whether the node is online or in normal state; Send SYNC messages regularly to synchronize the data updates of each slave station; Wherein, the control and display module includes: Control instruction generation unit: generates control instructions based on the real-time status of the vehicle and sends the control instructions to the target node through the CAN bus; Status monitoring unit: used to obtain real-time vehicle status data from the data analysis unit, and display and update the vehicle status data; Data storage unit: used to store all data during the experiment in real time.
[0007] Wherein, the analysis and reporting module includes: Bit error rate statistics unit: used to detect and count errors in CAN bus communication in real time, calculate the bit error rate, and analyze different types of errors; Timing Analysis Unit: Calculates and visualizes the communication delay between nodes, generates timing diagrams, and helps analyze the real-time performance of communications.
[0008] Waveform detection unit: detects anomalies in the CAN bus data waveform, analyzes the waveform quality, and helps identify noise and signal interference.
[0009] Experimental report generation unit: Integrate all analysis data, generate detailed experimental reports, and support export for subsequent analysis and sharing.
[0010] Wherein, the bit error rate statistics unit includes: Obtaining the parsed data frame from the data parsing unit, which includes the frame ID, data field, verification result and timestamp; According to the verification result, the error frame in the data frame and the error type of the error frame are obtained, and the bit error rate is calculated, and the bit error rate includes the overall bit error rate and various types of error rates.
[0011] Wherein, the timing analysis unit comprises: Obtain the timestamp and node ID of the data frame from the data parsing unit and synchronize the timestamp; When a data frame is transmitted from node A to node B, the timing analysis unit calculates the transmission delay by comparing the sending timestamp of each data frame at node A with the receiving timestamp at node B; Wherein, the waveform detection unit comprises: Collecting data frames transmitted on the CAN bus, and obtaining timestamps of the data frames and waveform signals of level changes, wherein the waveform signals of level changes are signal levels on the CAN bus; Analyze the waveform data collected on the CAN bus, compare and analyze the actual waveform collected with the standard waveform, detect and identify abnormal waveforms, and analyze the noise source in the signal; Perform real-time detection on each sampled signal level to confirm whether the high level and low level are within the standard voltage range; If the level is found to be beyond the standard voltage range, the signal is marked as abnormal level deviation and detailed information of the level deviation is recorded; Obtain the time of the rising and falling edges in the waveform data to confirm whether the time of the change exceeds the predetermined time range; if it exceeds, mark the signal as abnormal signal distortion and record the detailed information of the rising and falling edge change time; Obtaining the pulse width of the signal in the waveform data, and if it is found that the pulse width changes, marking the signal as abnormal waveform distortion, and recording detailed information of the pulse width change; Obtain the abnormal part of the detection waveform, mark the abnormal area in real time, and generate an analysis report; Wherein, the experimental report generating unit comprises: Integrate the error data generated by the analysis and reporting module and verify the acquired data; Time-align the data obtained from different units to ensure that the timestamp reference of all data is consistent; Generate a complete experimental report according to the preset report structure.
[0012] One or more technical solutions provided in this application have at least the following technical effects or advantages: 1. The system has a built-in baud rate automatic identification function, which can quickly detect the device baud rate and automatically adapt it, and provide hardware connection status detection function, real-time detection of bus connection and node status, reduce the risk of communication failure, and realize baud rate automatic identification and connection status monitoring; 2. The system can simulate the transmission of standard frames, extended frames and remote frames, and analyze the priority scheduling effects of different frame types. It can also provide dynamic screening and modification functions to flexibly respond to complex experimental requirements to support the transmission and analysis of multiple frame types; 3. The system supports bit error rate statistics, timing analysis and waveform detection functions to help users identify physical layer signal problems (such as level offset) and logic layer errors (such as data loss). It can also simulate data transmission under high load conditions, detect system bottlenecks and optimize scheduling strategies to provide error detection and waveform diagnosis capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1A schematic diagram of a CAN bus test experimental system flow provided in an embodiment of the present application; Explanation of reference numerals: 11. Data acquisition and processing module, 12. Data forwarding module, 13. Control and display module, 14. Analysis and reporting module. DETAILED DESCRIPTION
[0015] The present application provides a CAN bus test experimental system, which realizes efficient management and optimization in the glass cutting process through systematic data collection, intelligent algorithm optimization, automated equipment control and real-time monitoring feedback. This solution introduces an automated data collection and verification mechanism in the order information acquisition module to ensure the accuracy of order entry. The system can directly extract information from the electronic form or ERP system submitted by the customer, reduce the mistakes of manual operation, and ensure the convenience of subsequent tracking and classification. In addition, this solution scientifically classifies the orders through the classification module according to the different glass thickness, specifications and delivery time, avoiding the mixed cutting of glass of different thicknesses. Based on this, the system can generate the optimal cutting schedule according to the urgency of the order, the glass thickness and specification information, and ensure the orderliness of production. During the cutting execution process, this solution introduces a real-time monitoring and feedback module, which can collect information such as cutting progress and equipment status in real time. If an abnormal situation occurs during the cutting process, the system will immediately issue an alarm and suspend cutting, and record the fault information at the same time. The system also has a task automatic recovery function, which can continue to execute from the interruption point after troubleshooting, reducing downtime, improving production continuity, and has broad application prospects.
[0016] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0017] It should be noted that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or modules that are not explicitly listed or inherent to these processes, methods, products or devices.
[0018] Embodiment 1, as Figure 1 As shown, the present application provides a CAN bus test experimental system, and the method includes: Data acquisition and processing module 11: used to collect data frames from the CAN bus, add time stamps, and perform tasks such as data analysis, synchronization, filtering, and caching; Data forwarding module 12: used to forward data frames between different channels according to experimental requirements; Control and display module 13: used to generate and send control instructions according to vehicle status data, and obtain and update vehicle status information; Experimental report generation unit 14: used to organize experimental data such as bit error rate, timing analysis, waveform detection, etc. into an experimental report; Wherein, the data acquisition and processing module includes: Data acquisition unit: used to obtain data frames from the CAN bus in real time and add a timestamp to each data frame; Specifically, the system is connected to the CAN bus through a CAN logic analyzer or a CAN transceiver. When data flows in from the CAN bus, the data acquisition unit monitors and receives all CAN data frames passing through the CAN controller. Each data frame includes a frame ID, a data field, a control field, etc. Among them: CAN analyzer or transceiver: The system can be connected to the CAN bus through a hardware interface (such as a NI CAN card or a Kvaser CAN interface). The hardware device will collect data frames from the bus in real time; The system will attach a timestamp to each received data frame to record the exact time when the data frame arrives at the system. The accuracy of the timestamp can reach microseconds or nanoseconds, ensuring high accuracy of timing analysis; In addition, the acquisition frequency of data frames can be dynamically adjusted according to the system configuration. When the bus load is high, the system automatically adjusts the acquisition frequency to ensure stable data acquisition; Each data frame contains the following information: Frame ID (such as standard frame, extended frame) Data domain (such as vehicle status information such as speed, rotation speed, fuel level, etc.) Control field (such as data frame type, remote frame flag, etc.) Timestamp (accurate to microseconds or nanoseconds, for subsequent timing analysis) The data acquisition unit will store the collected data frames into a buffer and mark them with timestamps, and then pass them to the next processing unit for parsing; The buffer is a ring buffer or a double buffer, so that when one buffer is being processed, the other buffer can continue to receive new data; In addition: the system can dynamically adjust the frequency of data collection according to the bus load. When the bus communication is busy, the collection frequency may be automatically reduced to avoid data loss or processing bottlenecks; when the bus load is low, the collection frequency will be increased to capture more data; Data parsing unit: used to decode the collected raw CAN data frames into understandable vehicle status information, such as vehicle speed, rotation speed, fuel level, etc.
[0019] Specifically, the system identifies the type of data frame, including standard frame, extended frame, remote frame, etc., and determines the frame priority and data content. The specific method is as follows: The analysis unit obtains the original CAN data frame collected in real time from the data collection unit; Each CAN data frame usually contains the following fields: Frame ID: used to identify the content and priority of the data frame.
[0020] Control field: Indicates the type of frame (standard frame, extended frame, remote frame, etc.).
[0021] Data field: contains specific data content, with a length of 0 to 8 bytes.
[0022] CRC check field: used to check the integrity of the data frame.
[0023] Frame tail: indicates the end of the frame.
[0024] Determine the type of data frame based on the control field and frame ID: Standard frame and extended frame: Standard frame: The frame ID is 11 bits and is used to identify common data frames.
[0025] Extended frame: The frame ID is 29 bits and is applicable to more complex data frames.
[0026] Data frame and remote frame: Data frame: contains the actual data content.
[0027] Remote frame: does not contain data content and is only used to request data; Select the appropriate parsing method according to the frame type. For example, for a data frame, parse its data field; for a remote frame, only record the request information without further parsing.
[0028] The system extracts valid binary data from the data field; According to the frame ID and CAN signal database (DBC file), the meaning of each field in the data domain is determined, and the binary data is converted into actual values accordingly. For example: the first 2 bytes represent the vehicle speed. The 3rd byte represents the engine speed. The 4th byte represents the fuel level.
[0029] During the decoding process, the data parsing unit will perform a CRC check, which checks the integrity of the data frame to determine whether there is a bit error or frame loss. If the check fails, the system will mark the frame as an error frame and record it in the error log for subsequent analysis.
[0030] Frame error marking: If an error frame is detected, such as a format error or a bit error, the system will generate an error log for the error frame for subsequent logging and report generation.
[0031] Convert the parsed raw data (such as raw byte values) into actual physical quantities (such as vehicle speed: km / h, speed: rpm, fuel volume: %); The parsed data is quality checked and passed to downstream modules if it meets the preset threshold or verification rules. The parsed vehicle status data includes: Vehicle speed (km / h) Speed (rpm) Oil volume (%) Temperature (℃) Other sensor data such as water level, oil temperature, etc. Message filtering unit: Through preset rules and dynamic adjustments, the required key data is screened out as high-priority data frames, so that it can filter unnecessary CAN messages according to experimental requirements, reduce the data processing burden, and ensure that high-priority information is processed in a timely manner; Specifically; The system can preset filtering rules based on the ID, priority or frame type of the data frame to ignore irrelevant data. For example, the system only pays attention to messages from a specific node or a specific ID; During the experiment, users can dynamically adjust the filtering rules. For example, the system may only focus on real-time data frames or error frames, and discard or delay data frames with long transmission delays; During the experiment, users can dynamically adjust the filtering conditions as needed. For example, it can be set to display the oil level frame first when the oil level is lower than a certain value, while ignoring other frames; Data frames are dynamically managed according to their priority and type. Critical data (such as control instructions) will be processed first in the data stream, while low-priority data (such as diagnostic information) can be processed later, and the filtered valid data frames, including key information such as vehicle speed and rotation speed, will be passed to the downstream control, monitoring and analysis modules; All collected and parsed data will be stored in the database, and the storage method supports fields such as timestamp, frame ID, and data value.
[0032] Data storage formats support CSV, Excel, SQL database, etc. for subsequent analysis and report generation; The data acquisition and processing module also includes a baud rate automatic identification unit and a CANopen management unit; Wherein: the baud rate automatic identification unit includes: Collect the CAN signal of the target device and determine whether the sampled frame signal is valid; it can capture the original signal on the bus through the hardware interface (such as CAN transceiver). When in use, the system tries different baud rate configurations to send or receive data and detect whether the communication is successful; The system presets a set of common standard baud rates (such as 125kbps, 250kbps, 500kbps, 1000kbps, etc.), and tries to set these baud rates one by one and send standard data frames (such as remote frames).
[0033] Verify the response data of the target device (such as CRC check and frame ID matching); If a valid data frame is received, the baud rate detection is determined to be successful.
[0034] If all baud rates are not detected successfully, the communication fails, that is, the baud rate does not match or the device does not respond, and the user is prompted to check the hardware connection, the target device status, or manually set the baud rate; After the baud rate detection is successful, the system updates the baud rate configuration and passes the target baud rate to the data acquisition unit and the data analysis unit to ensure the synchronization of subsequent data acquisition and analysis; The CANopen management unit comprises: Obtain the response data of the slave node, including node ID, PDO mapping information, SDO read and write response, and node status information (such as NMT status, heartbeat message); The system sends NMT management messages to poll all possible node addresses (e.g., 1 to 127); Detect which nodes have responded and record their IDs as valid nodes; The system sets the mapping content of PDO according to the experimental requirements; Update the slave's mapping table via SDO write command; Parse the heartbeat message of the slave station to monitor whether the node is online or in normal state; Send SYNC messages regularly to synchronize the data updates of each slave station; Based on this unit, it can obtain: the slave node list and its status information; the read and write results of PDO and SDO; the real-time status of the node (such as whether it is online or error), and obtain: the valid node list: passed to the status monitoring unit to display the valid slaves in the system; abnormal node status: trigger an alarm or suggest reconfiguration, so as to ensure the smooth progress of the experiment.
[0035] The control and display module comprises: Control command generation unit: Generates control commands based on the real-time status of the vehicle and sends the control commands to the target nodes through the CAN bus, such as control nodes, vehicle models, lights, brakes, etc. These commands can be automatic or manual, depending on the needs of the experiment; The specific operations are as follows: The control instruction generation unit obtains real-time vehicle status data (such as vehicle speed, fuel level, rotation speed, etc.) from the data analysis unit or the status monitoring unit to determine the timing of generating the control instruction; When the user manually controls the vehicle through the interface, the control command generation unit also receives input commands from the user (such as acceleration, braking, light switch, etc.); Due to experimental needs, the control instruction generation mode is as follows: Automatic control mode: The system automatically generates control instructions according to the set logic and rules. For example, if the oil level is lower than a certain threshold, the system automatically generates a low oil level alarm instruction and sends it to the CAN bus.
[0036] Manual control mode: The user manually inputs instructions through the control interface (such as pressing the "brake" button), and the system generates corresponding control instructions in real time and sends them to the target node.
[0037] Complex control instructions: If the experimental scenario is complex, you may need to generate multiple control instructions, such as controlling acceleration, braking, and lighting at the same time. The system will generate complex instructions based on the conditions.
[0038] The control command generation unit executes the control decision logic each time it receives vehicle status data or user input. For example, in an acceleration test, the control unit generates an appropriate acceleration command based on the difference between the current vehicle speed and the target vehicle speed.
[0039] Conditional judgment: Based on the current vehicle status, the system will determine whether a certain control command needs to be generated. For example, when the vehicle is driving at a low speed, a "turn on the lights" command may be generated; and when the fuel level is too low, the system will generate an "alarm" or "remind to refuel" command.
[0040] After the control instruction is generated, the system will encapsulate the instruction data into a data frame that complies with the CAN protocol (for example, using specific ID and data fields to represent different types of instructions).
[0041] Frame ID and data field: The frame ID of the command data frame represents the target node, and the data field contains the specific content of the control command (such as throttle, brake force, light switch, etc.).
[0042] CAN bus transmission: The generated data frame is sent to the target node via the CAN bus. This process is implemented through a CAN interface card or a CAN transceiver.
[0043] Status monitoring unit: used to obtain real-time vehicle status data (such as vehicle speed, fuel level, temperature, etc.) from the data analysis unit, and display and update the vehicle status data. This unit not only provides real-time feedback, but also allows users to manually adjust vehicle status and control.
[0044] The specific operations are as follows: The status monitoring unit obtains real-time vehicle status data (such as vehicle speed, fuel level, temperature, etc.) from the data analysis unit. These data are usually obtained and decoded from the CAN bus by the data acquisition module and then transmitted to this module; When the control command is executed, the system will feedback the execution status of the command (for example, whether the acceleration command is effective, whether the braking is successful). The status monitoring unit transmits the feedback information to the user; The vehicle status can be displayed through a graphical interface, usually including a virtual dashboard, charts or digital indicators. For example, the vehicle speed is displayed as a rotating needle on the virtual dashboard, and the fuel level is displayed through a progress bar; The status monitoring unit will refresh the display content in real time to ensure that the user can see the latest vehicle status data; If the system detects an abnormality (such as low oil level, high temperature), the status monitoring unit can alert the user with different colors or prompts (such as flashing red lights, alarm sounds, etc.); The user can perform manual operations through the interface, such as accelerating, braking, turning on and off lights, etc. The state monitoring unit will generate control instructions based on user input and pass them to the target node through the control instruction generation unit; When the user operates (such as braking, accelerating), the state monitoring unit will immediately feedback the vehicle state change according to the operation; During the experiment, the status monitoring unit can display the vehicle status (vehicle speed, fuel level, rotation speed, etc.) and the control command execution results (such as "brake successful", "acceleration completed"), and when the status changes, the graphical interface will be dynamically updated to ensure that users can view the experimental progress in real time; Data storage unit: used to store all data during the experiment in real time and integrate them, including vehicle status data, control instructions, error logs, etc. Through data storage, experimental data can be used for subsequent analysis, backtracking and report generation; The data forwarding module comprises: Data receiving unit: used to receive original CAN data frame from the data acquisition unit of the system, wherein the original CAN data frame includes frame ID, data field, timestamp, etc.; Forwarding rules management unit: Used to store user-defined forwarding rules, which support dynamic addition, modification and deletion; and can customize forwarding conditions (such as frame ID range, data field content) and modification logic; The forwarding rules are rules input by the user through an interactive interface or a configuration file; Pass the current valid forwarding rule set to the data filtering unit; Data screening unit: used to match the data frames according to the forwarding rules and filter out the frames that do not need to be forwarded. The specific operations are as follows; By comparing the frame ID, data field, timestamp and other fields, it is determined whether the forwarding conditions are met; Pass the frames that meet the conditions to the frame modification unit; Record the frames that do not meet the conditions into the log unit; The frame modification unit is used to modify the frame ID or data field according to the rule. The specific operation is as follows: Obtaining frames that meet the conditions and are passed by the data screening unit, as well as the modification logic defined in the forwarding rules; Modify the frame ID and a field value of the data domain that meet the conditions and are transmitted by the data screening unit according to the modification logic defined in the forwarding rule; Pass the modified frame to the forwarding execution unit; Forwarding execution unit: used to send data frames that meet the rules and complete the modification to the target channel.
[0045] Forwarding log unit: used to record detailed information during the forwarding process, including frames that do not match the rules, frames before and after modification, frames that fail to send, etc. Wherein; the analysis and reporting module includes: Bit error rate statistics unit: used to detect and count errors in CAN bus communication in real time, calculate the bit error rate, and analyze different types of errors, such as data bit error, frame format error, CRC error, etc. Timing Analysis Unit: The system calculates and visualizes the communication delay between nodes through high-precision timestamps (especially in systems that support PTP), generates timing diagrams, and helps analyze the real-time performance of communications. The timing diagrams are updated in real time with the arrival of each data frame to ensure the accuracy of node delay information.
[0046] Waveform detection unit: The system accurately samples the level changes of each data frame, and uses algorithms to identify and detect anomalies in the CAN bus data waveform. By comparing it with the standard waveform, the waveform quality is analyzed, so that it can effectively identify problems in the communication process, such as signal noise, voltage fluctuations, etc., and help identify noise and signal interference; Experimental report generation unit: used to format and integrate the data generated by each unit during the experiment (such as timing diagram, bit error rate, waveform diagram, etc.), and generate a complete experimental report that supports export, which is convenient for subsequent analysis and sharing; The bit error rate statistics unit comprises: Obtain the parsed data frame from the data parsing unit, which includes the frame ID, data field, check result and timestamp. Each data frame will undergo CRC check and format check. Any error found will be marked as an error frame with the error type (e.g. CRC error, format error, etc.). The error types and detection methods are as follows: CRC error: By comparing the cyclic redundancy check (CRC) of the data frame content, it is detected whether the data has been tampered with or lost during transmission.
[0047] Bit error: refers to an error in the bits in the data frame, which may be caused by factors such as signal interference and electrical noise.
[0048] Format error: The format of the data frame does not match the CAN protocol, for example, the length and field order of the frame are incorrect.
[0049] Timeout error: The sending or receiving of a data frame exceeds the specified time window.
[0050] The bit error rate statistics unit records the detailed information of all error frames, including frame ID, timestamp, error type, and data value, and stores them in the error log; Whenever the system detects an error frame, the bit error rate statistics unit will increase the error frame counter. The error frame count includes CRC error, bit error, format error and timeout error; Every time a data frame is collected and passes verification, the system will increase the total frame counter. Even if the frame has no errors, it will be counted in the total frame count; The bit error rate is calculated by the total number of frames and the number of error frames. The bit error rate includes the total bit error rate and the bit error rate of each error type. The bit error rate is calculated by dividing the total number of frames by the number of error frames and multiplying by 100%. The bit error rate of each error type is calculated by dividing the total number of frames by the number of error frames of this type and multiplying by 100%. Taking bit error statistics as an example, whenever an error occurs in a bit in a data frame, the bit error rate statistics unit will record the bit error and count the frequency of bit errors to help locate possible electrical noise or interference problems during the communication process.
[0051] After each error frame or data frame is collected, the bit error rate is calculated and updated in real time through the bit error rate statistics unit. The updated bit error rate will be used for subsequent data display and alarm judgment, so that the system will regularly refresh the bit error rate calculation results to ensure that users see the latest communication quality data; Among them; the bit error rate can be displayed in real time in the form of a line graph or a bar graph; Line chart: used to reflect the change of bit error rate in different time periods or experimental stages; Histogram: used to show the proportion of each error type (CRC error, bit error, format error, timeout error) in the total errors; In addition, the system will issue a real-time alarm based on the preset bit error rate threshold (for example, 5%). If the bit error rate exceeds the set threshold, the bit error rate statistics unit will trigger a warning to remind the user that there is a problem with the communication quality; Wherein, the timing analysis unit comprises: The timestamp and node ID of the data frame are obtained from the data parsing unit, and the PTP protocol is used to synchronize the timestamp. If the timestamp is synchronized by the PTP protocol, the clocks of all nodes will be synchronized to the nanosecond level. This means that the timestamp of each data frame will be highly consistent between nodes, thereby ensuring the accuracy of delay calculation; If the system is equipped with a hardware-level timestamp function, each data frame can also be time-stamped at the hardware level to avoid delay errors caused by operating system scheduling; When a data frame is transmitted from node A to node B, the timing analysis unit calculates the transmission delay by comparing the sending timestamp of each data frame at node A with the receiving timestamp at node B; In the case of multiple nodes, the timing analysis unit will calculate the delay between all nodes and obtain the communication delay data between each node; The specific method is as follows: Whenever a data frame arrives, the timing analysis unit extracts the timestamp in the data frame. These timestamps are usually generated by the data acquisition unit or hardware clock, indicating the time when the data frame was sent by node A and received by node B; By comparing the sending timestamp and receiving timestamp of each data frame, the system calculates the transmission delay of the data from node A to node B, where the delay is the receiving timestamp minus the sending timestamp; The calculation method of each delay is as follows: One-way delay: Calculates the one-way delay from one node to another, that is, the delay from the sending node to the receiving node.
[0052] Two-way delay: For some experiments, the system may need to calculate the two-way delay from the sending node to the receiving node and then back to the sending node. The system analyzes the delay of two-way communication by measuring the complete cycle from node A to node B and then from node B back to node A.
[0053] Multi-frame latency: If the data transmission process involves multiple data frames (for example, large data blocks are transmitted in fragments), the timing analysis unit calculates the latency of each data frame separately and combines them into the complete transmission latency.
[0054] The system takes into account the order of data frames and ensures that the latency calculation correctly reflects the transmission process of all frames.
[0055] The average delay, maximum delay, and minimum delay between each node are calculated through the timing analysis unit, so that these statistics can help analyze bottlenecks in communication, such as whether the delay of some nodes is too high; As the network load and the number of data frames increase, the timing analysis unit records and displays the changing trend of latency. For example, as the number of nodes increases or the amount of communication increases, the latency may gradually increase, and the timing analysis unit helps track these changes.
[0056] Detect latency peaks in real time and generate latency-exceeding alerts to alert users of possible network bottlenecks. The timing analysis unit generates a timing diagram based on the calculated delay data to help users intuitively understand the communication delay between different nodes. A timing diagram is usually a diagram with the horizontal axis representing time and the vertical axis representing nodes or data frames. The communication delay of each node is represented by a line, and the communication between nodes is connected by arrows; The timing diagram can show the sending and receiving time of each data frame. The communication delay between nodes is marked on the diagram to show its size, trend and fluctuation. The timing diagram is updated dynamically. Every time a new data frame is collected, the diagram is redrawn to show the new delay data.
[0057] The system will continuously compare the newly collected data with the previous data and automatically adjust the node positions in the timing diagram to ensure the real-time update of the delay information; Based on real-time latency data, the timing analysis unit can automatically identify latency bottlenecks and generate optimization suggestions. For example, the system can recommend adjusting the data acquisition frequency, increasing the baud rate, or adjusting the data frame size to reduce latency.
[0058] Dynamic adjustment: The system dynamically adjusts data collection parameters or transmission frequency based on network load and latency analysis results to ensure low latency even under high load; When communicating between multiple nodes, the timing analysis unit can automatically select a better transmission path according to the delay data to minimize the delay of data transmission.
[0059] The system can calculate the shortest path based on the network topology and adjust the routing of data frames to achieve the best latency optimization.
[0060] Among them, the timing diagram generated by the timing analysis unit can be exported to image format (such as PNG, JPEG) or vector format (such as SVG), which is convenient for users to view and analyze.
[0061] Users can select data for a specific time period and generate a time series diagram for that period.
[0062] The system will generate a delay statistics report, showing data such as the maximum delay, minimum delay, and average delay between nodes.
[0063] Delay reports can be exported in PDF or Excel format for easy analysis and archiving.
[0064] When the delay of a node exceeds the set threshold, the system will trigger a delay alarm to remind the user to optimize.
[0065] Wherein, the waveform detection unit comprises: Collecting data frames transmitted on the CAN bus, and obtaining timestamps of the data frames and waveform signals of level changes, wherein the waveform signals of level changes are signal levels on the CAN bus; Specifically: In the CAN protocol, the standard waveform should be a rectangular wave with fixed rising edge, falling edge and stable level. The standard waveform is specified by the CAN physical layer protocol. The characteristics of the waveform (such as rise time, fall time, signal width, etc.) are theoretically fixed, and the level standard of the CAN bus is usually 0V to 3.3V (or 0V to 5V, depending on the CAN interface used). The level of the signal should vary within these standard ranges, so the waveform detection unit compares and analyzes the actual waveform collected with the standard waveform. The level, time characteristics, etc. of the standard waveform and the actual waveform should be highly consistent; The waveform data collected on the CAN bus is analyzed, the actual waveform collected is compared and analyzed with the standard waveform, the abnormal waveform is detected and identified, and the noise source in the signal is analyzed; the inventors analyzed that external or internal electromagnetic interference (EMI) may cause noise in the signal waveform. For example, near electrical equipment, the CAN bus signal may be interfered by external noise, causing signal distortion.
[0066] Therefore, the waveform detection unit can be used to compare the standard waveform of the signal and analyze the noise source in the signal. For example, if the rising edge of the signal is no longer smooth but becomes irregular, it may indicate that the signal is affected by high-frequency noise. Perform real-time detection on each sampled signal level to confirm whether the high level and low level are within the standard voltage range; Specifically, level offset means that the high or low level of the CAN signal exceeds the specified voltage range. Level offset can cause data parsing errors or reduce signal reliability.
[0067] The waveform detection unit will perform real-time detection on each signal level sampled to ensure that the high level and low level are within the standard voltage range.
[0068] If the level is found to be out of the standard range (such as the high level is greater than 3.3V or less than 0V), the signal is marked as abnormal level deviation and the detailed information of the level deviation is recorded; Obtain the time of the rising and falling edges in the waveform data to confirm whether the time of the change exceeds the predetermined time range; if it exceeds, mark the signal as abnormal signal distortion and record the detailed information of the rising and falling edge change time; Specifically: signal distortion refers to the change in the shape of the waveform. Common distortions include: Long rise / fall time: The standard waveform requires that the rising edge and falling edge be completed within a certain time range. If the signal changes too slowly, it means that the waveform may be distorted, which may be caused by power supply noise or poor wiring.
[0069] Signal width variation: The pulse width of the signal should remain stable. If the pulse width changes, it means that the signal is distorted.
[0070] Obtaining the pulse width of the signal in the waveform data, and if it is found that the pulse width changes, marking the signal as abnormal waveform distortion, and recording detailed information of the pulse width change; Obtain the abnormal part of the detection waveform, mark the abnormal area in real time, and generate an analysis report; Specifically, common anomalies include: The level is too high or too low (level offset).
[0071] Rise / fall times too long (signal distortion).
[0072] Signal period or pulse width changes (waveform distortion).
[0073] Frequent noise disturbances.
[0074] Abnormal waveforms are usually highlighted with different colors or marks (such as red marks) to help users quickly identify them.
[0075] In addition, the waveform detection unit will generate a waveform graph in real time to show how the collected signal level changes over time. The waveform graph will show the comparison between the actual waveform and the standard waveform, helping users to intuitively understand the signal quality; The waveform will be updated in real time to show the level change process of each data frame; Among them, the experimental report generation unit includes: Integrate the error data generated by the analysis and reporting module and verify the acquired data; that is, integrate the data generated by the bit error rate statistics, timing analysis, waveform detection and other units; The details are as follows: The experimental report generation unit mainly obtains data from the following units: Bit error rate statistics unit: overall bit error rate; The number and distribution of various error types (e.g. CRC errors, format errors, bit errors, etc.); A bar chart or pie chart showing the percentage of error types; Timing Analysis Unit: Statistics of inter-node communication delay (such as maximum delay, minimum delay, average delay); Line chart of node delay change trend; Timing diagram of multiple nodes; Waveform detection unit: Comparison data between the actual waveform collected and the standard waveform; Description of waveform anomalies (such as noise interference, level offset, signal distortion); Waveform comparison chart, marking abnormal areas; Other data: Experiment configuration information (such as CAN baud rate, number of nodes); Time information (experiment start time, end time); The acquired data is verified through the experimental report generation unit to ensure the integrity and consistency of the data. For example, check whether the data of each analysis unit covers the complete time period; for repeated or invalid data (such as data missing due to frame loss or timeout), the system will compensate or mark the data; The system time-aligns the data obtained from different units to ensure that the timestamp reference of all data is consistent. For example, the timestamp of timing analysis needs to be synchronized with the time period of waveform detection.
[0076] Generate a complete experimental report according to the preset report structure; The method of using this system is as follows; the following is the specific operation method for each experimental project using this system to carry out experiments, covering the operation steps and key results.
[0077] 1. CAN bus hardware recognition experiment Experimental objectives Familiar with CAN bus hardware architecture, including transceivers, main controllers, and node device connection methods.
[0078] Observe whether the CAN bus communication works normally after the hardware is connected.
[0079] Procedure Hardware connection: Use a CAN transceiver (such as a USB-CAN module) to connect the PC and the experimental platform, correctly connect multiple CAN nodes (such as sensors and actuators) of the experimental platform to the bus through terminal resistors, and ensure that all nodes are powered on and running normally.
[0080] System initialization: Start the baud rate automatic identification unit in the system, detect the baud rate of the current CAN bus, update the baud rate setting according to the detection result and synchronize it to the data acquisition unit.
[0081] Hardware test: Use the status monitoring unit to observe the real-time status of the CAN bus, including the number of frames received, frame type distribution, etc. Use the waveform detection unit to monitor the physical signal quality of the CAN bus to ensure that the signal level meets the standard.
[0082] Experimental records: Store the real-time collected hardware connection status and waveform data into the data storage unit for subsequent analysis.
[0083] This experiment can be used to verify whether the hardware connection is correct and whether the CAN bus is working properly. Waveform detection can also be used to confirm whether the physical layer characteristics of the hardware signal conform to the CAN specification.
[0084] 2. CAN bus transmission protocol experiment (information transmission of different communication message frames); Experimental objectives: Understand the CAN bus protocol, verify the transmission characteristics of standard frames, extended frames and remote frames, and analyze the priorities of different frame types and their impact on communication efficiency.
[0085] Steps: Frame type test: Use the experimental platform to generate various types of CAN messages (such as standard frames, extended frames, and remote frames).
[0086] The data acquisition unit captures the messages transmitted on the bus, and decodes the frame ID and data field in the data analysis unit.
[0087] Priority Verification: Use the message filtering unit to set frame ID filtering rules to give priority to receiving frames within a specific frame ID range.
[0088] Send messages of different priorities on the bus and observe the order in which the system receives and processes them.
[0089] Experimental Log: Use the bit error rate statistics unit to monitor error frames and retransmissions under high load conditions.
[0090] Use the experiment report generation unit to generate transmission efficiency reports for different frame types.
[0091] Through this experiment, the transmission characteristics and priority impact of different frame types can be compared, and the communication performance bottleneck under heavy load conditions can be analyzed through reports.
[0092] 3. CAN bus node communication experiment Experimental objectives: Observe the data interaction between the master and slave nodes of the CAN bus and verify the real-time and reliability of communication in a multi-node environment.
[0093] Procedure Node scanning: Use the CANopen management unit to send NMT messages to scan slave nodes and record valid node IDs.
[0094] Perform PDO / SDO configuration on slave nodes to ensure that each node can communicate normally.
[0095] Communication test: Send test data frames to the slave nodes and record the response time.
[0096] The communication delay between nodes is calculated by the timing analysis unit to generate a timing diagram.
[0097] Status monitoring: Use the status monitoring unit to observe the status of slave nodes in real time (such as online status, response time).
[0098] Mark and record abnormal behaviors of nodes (such as frame loss and timeout).
[0099] Through this experiment, we can obtain the node scanning results to verify whether the node configuration is correct, and the timing analysis results to evaluate the real-time and stability of communication between nodes.
[0100] 4. Control and data acquisition experiment based on CAN bus Experimental goal: Use the CAN bus to realize control command transmission and data acquisition between devices and verify the control accuracy and data acquisition rate of the system.
[0101] Procedure Control command test: Use the experimental platform to send control commands to the actuator nodes (such as turning on / off devices, adjusting parameters).
[0102] Use the data forwarding module to forward control commands between different channels and verify the execution of cross-channel instructions.
[0103] Data acquisition verification: Use the data acquisition unit to obtain sensor data (such as temperature and pressure) in real time.
[0104] The data fields are decoded in the data parsing unit, and the physical quantities are extracted and displayed in the status monitoring unit.
[0105] Result storage and analysis: The collected data is stored in the data storage unit, and the collection rate and control delay report is generated through the experiment report generation unit.
[0106] This experiment can evaluate the response performance of the equipment through the execution of control instructions, and obtain data acquisition rate and stability analysis to verify the real-time performance and reliability of the system.
[0107] 5. Data and waveform detection comparative analysis experiment Experimental objectives: Analyze the relationship between physical signals and logical data through waveform detection, and verify the impact of signal interference on data transmission.
[0108] Procedure Synchronous capture of data and waveform: Use the data acquisition unit to collect data frames.
[0109] At the same time, the waveform detection unit is used to capture the physical layer signal waveform and align the time stamp.
[0110] Waveform and data comparison: Compare the rising edge, falling edge and stability of the waveform signal with the matching of the data frame content.
[0111] Identify the effects of noise or interference in the waveform on the data frame.
[0112] Interference analysis: artificially introduce noise into the experiment (such as increasing electromagnetic interference) and observe the changes in the waveform and the error rate of the data frame.
[0113] The bit error rate statistics unit is used to record the number of error frames under noise conditions.
[0114] Report generation: Use the experimental report generation unit to generate waveform and data comparison analysis reports, including signal quality and data integrity assessment.
[0115] This experiment evaluates the impact of signal quality on data transmission reliability by comparing waveforms and data.
[0116] Analyze the bit error rate changes under noisy conditions to verify the system's anti-interference performance.
[0117] It should be noted that the above-mentioned sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. And the above-mentioned specific embodiments of this specification are described. The processes depicted in the accompanying drawings do not necessarily require the specific order and continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0118] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
[0119] This specification and drawings are merely exemplary illustrations of the present application and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, a person skilled in the art may make various modifications and variations to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the present application and its equivalents, the present application intends to include these modifications and variations.
Claims
1. A CAN bus test experimental system, characterized in that: The method comprises: Data acquisition and processing module: used to collect data frames from the CAN bus, add timestamps, and perform tasks such as data parsing, synchronization, filtering, and caching; Data forwarding module: used to forward data frames between different channels according to experimental requirements; Control and display module: used to generate and send control instructions according to vehicle status data, and obtain and update vehicle status information; Analysis and reporting module: used to organize experimental data such as bit error rate, timing analysis, waveform detection, etc. into experimental reports.
2. A CAN bus test experimental system as claimed in claim 1, characterized in that: The data acquisition and processing module includes: Data acquisition unit: used to obtain data frames from the CAN bus in real time and add a timestamp to each data frame; Data parsing unit: used to decode the collected raw CAN data frames into understandable vehicle status information; Message filtering unit: Through preset rules and dynamic adjustments, it filters out the required key data as high-priority data frames.
3. A CAN bus test experimental system as claimed in claim 1, characterized in that: The data forwarding module comprises: Data receiving unit: used to receive the original CAN data frame from the system's data acquisition unit; Forwarding rules management unit: Used to store user-defined forwarding rules and modification logic; Pass the current effective forwarding rule set to the data filtering unit; Data screening unit: used to match the data frames according to the forwarding rules, filter out the frames that do not need to be forwarded, and pass the frames that meet the conditions to the frame modification unit; A frame modification unit, the frame modification unit is used to modify the frame ID or data field according to the rule, and pass the modified frame to the forwarding execution unit; Forwarding execution unit: used to send data frames that meet the rules and complete the modification to the target channel.
4. A CAN bus test experimental system as claimed in claim 1, characterized in that: The control and display module comprises: Control instruction generation unit: generates control instructions based on the real-time status of the vehicle and sends the control instructions to the target node through the CAN bus; Status monitoring unit: used to obtain real-time vehicle status data from the data analysis unit, and display and update the vehicle status data; Data storage unit: used to store all data during the experiment in real time.
5. A CAN bus test experimental system as claimed in claim 1, characterized in that: The analysis and reporting module includes: Bit error rate statistics unit: used to detect and count errors in CAN bus communication in real time, calculate the bit error rate, and analyze different types of errors; Timing Analysis Unit: Calculates and visualizes the communication delay between nodes, generates timing diagrams, and helps analyze the real-time performance of communications; Waveform detection unit: detects anomalies in the CAN bus data waveform, analyzes waveform quality, and helps identify noise and signal interference; Experimental report generation unit: Integrate all analysis data, generate detailed experimental reports, and support export for subsequent analysis and sharing.
6. A CAN bus test experimental system as claimed in claim 5, characterized in that: The bit error rate statistics unit comprises: Obtaining the parsed data frame from the data parsing unit, which includes the frame ID, data field, verification result and timestamp; According to the verification result, the error frame in the data frame and the error type of the error frame are obtained, and the bit error rate is calculated, and the bit error rate includes the overall bit error rate and various types of error rates.
7. A CAN bus test experimental system as claimed in claim 5, characterized in that: The timing analysis unit comprises: Obtain the timestamp and node ID of the data frame from the data parsing unit and synchronize the timestamp; When a data frame is transmitted from node A to node B, the timing analysis unit calculates the transmission delay by comparing the sending timestamp of each data frame at node A with the receiving timestamp of node B.
8. A CAN bus test experimental system as claimed in claim 5, characterized in that: The waveform detection unit comprises: Collecting data frames transmitted on the CAN bus, and obtaining timestamps of the data frames and waveform signals of level changes, wherein the waveform signals of level changes are signal levels on the CAN bus; Analyze the waveform data collected on the CAN bus, compare and analyze the actual waveform collected with the standard waveform, detect and identify abnormal waveforms, and analyze the noise source in the signal; Perform real-time detection on each sampled signal level to confirm whether the high level and low level are within the standard voltage range; If the level is found to be beyond the standard voltage range, the signal is marked as abnormal level deviation and detailed information of the level deviation is recorded; Obtain the time of the rising and falling edges in the waveform data to confirm whether the time of the change exceeds the predetermined time range; if it exceeds, mark the signal as abnormal signal distortion and record the detailed information of the rising and falling edge change time; Obtaining the pulse width of the signal in the waveform data, and if it is found that the pulse width changes, marking the signal as abnormal waveform distortion, and recording detailed information of the pulse width change; Obtain the abnormal part in the detected waveform, mark the abnormal area in real time, and generate an analysis report.
9. A CAN bus test experimental system as claimed in claim 5, characterized in that: The experimental report generating unit comprises: Integrate the error data generated by the analysis and reporting module and verify the acquired data; Time-align the data obtained from different units to ensure that the timestamp reference of all data is consistent; Generate a complete experimental report according to the preset report structure.
Citation Information
Patent Citations
Performance testing method and performance testing device of bus type motion control system
CN103217973A
Multichannel redundant CAN (Controller Area Network) bus test system with frame start sensitive synchronous trigger function
CN104506376A
CAN-bus-based error code testing method and system
CN106559286A
CAN bus simulation test method and system
CN115629599A
CAN data processing method and system and storage medium
CN116594966A
Cited By
Automobile motion state evaluation method and system based on automobile CAN signal
CN120122629A
Real-time synchronous control method and system based on EtherMAC bus
CN120881125A