Real-time detection and analysis method for vehicle-mounted Ethernet and lightweight device
By designing real-time detection and analysis methods and devices for on-board Ethernet, using real-time processing modules of FPGA and arm-linux kernels, real-time analysis and non-standard protocol compatibility problems in complex situations of on-board Ethernet bus are solved, and efficient , portable fault detection and analysis improves the real-time and reliability of the system.
Patent Information
- Application Number
- CN202310733867.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2024-12-20
AI Technical Summary
The existing vehicle-mounted Ethernet bus cannot perform real-time and effective performance analysis and diagnosis under complex conditions, and cannot be compatible with multiple non-standard Ethernet protocols. Traditional complex or fixed detection systems are not convenient to carry.
A real-time detection and analysis method and lightweight device for vehicle-mounted Ethernet are designed, including data acquisition module, core processing module and visualization module. The high-speed acquisition unit designed by FPGA and the real-time processing module of the arm-linux kernel are used. XML format describes the protocol structure file for data normalization and parsing, real-time processing and visual analysis of non-standard Ethernet packets.
Real-time detection and analysis of the on-board Ethernet bus is realized, which improves analysis efficiency and accuracy, is compatible with a variety of non-standard protocols, improves the universality and portability of the system, promptly detects potential faults and improves the on-board Ethernet. Reliability and stability.
Smart Images

Figure CN119172288A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of automotive bus data analysis and fault diagnosis, and specifically is a real-time detection and analysis method and a lightweight device for vehicle-mounted Ethernet, which is applied to fault diagnosis of vehicle-mounted Ethernet buses and uses lightweight mobile embedded devices to facilitate subsequent optimization of vehicle-mounted bus automatic diagnosis technology. Background Art
[0002] With the rapid development of automotive electronic technology, the number of automotive control electronic unit systems (ECU) has gradually increased, the bus has become more and more complex, and safety has always been a key topic, so the real-time performance of information transmission must be extremely high. The traditional single CAN bus can no longer meet today's rapidly growing needs. In-vehicle Ethernet is increasingly widely used in modern automobiles, providing vehicles with high-speed and reliable data transmission and communication capabilities. However, with the increasing popularity of in-vehicle Ethernet applications, the fault detection and analysis problems it faces are becoming more and more prominent. Therefore, the analysis and fault detection technology for in-vehicle Ethernet has been increasingly widely studied and applied.
[0003] Early vehicle network analysis and fault detection technology was mainly based on manual analysis and troubleshooting, lacking real-time and automation, and therefore inefficient, making it difficult to meet the requirements of high-speed communication and data transmission in modern vehicles. With the continuous development of computer technology and embedded systems, vehicle Ethernet analysis and fault detection technology has developed rapidly. At present, most detection methods are based on large-scale detection and analysis systems, which are not easy to carry. Embedded systems provide a new option for this with their lightweight and easy-to-carry advantages.
[0004] At present, various types of vehicle-mounted transmission based on Ethernet have become mainstream. The analysis and fault detection technologies for vehicle-mounted Ethernet mainly cover the following aspects: vehicle-mounted Ethernet data acquisition technology, vehicle-mounted Ethernet data analysis technology, and vehicle-mounted Ethernet fault detection technology. In order to improve the stability of the vehicle bus, it is of practical value to design a device for diagnosing the performance analysis of the vehicle bus; in order to solve the complex bus structure, be compatible with multiple bus data messages, and solve the problem that traditional bus analysis equipment is complex and not easy to carry, it is of application value to design an embedded lightweight mobile analysis device. It provides important support and guarantee for the stability and reliability of automotive electronics. Summary of the invention
[0005] According to the technical problems raised above, a real-time detection and analysis method and a lightweight device for vehicle-mounted Ethernet are proposed to solve the problem that the current vehicle-mounted bus based on Ethernet cannot perform real-time and effective analysis and diagnosis of bus performance under complex conditions, and the problem of incompatibility with multiple non-standard Ethernet protocols. At the same time, the mobile embedded device also effectively overcomes the inconvenience of traditional complex or fixed detection systems.
[0006] The technical solution adopted by the present invention to achieve the above-mentioned purpose is:
[0007] A lightweight device for real-time detection and analysis of vehicle-mounted Ethernet, comprising:
[0008] Data acquisition module, used to collect non-standard vehicle Ethernet data messages;
[0009] The core processing module is used to obtain data packets from the data acquisition module, process them, and analyze the processed data packets;
[0010] The visualization module is used to visualize the analysis results of the core processing module and control the start and end of message detection.
[0011] The data acquisition module comprises:
[0012] High-speed acquisition unit, used for real-time packet capture of Ethernet data packets at the interface, and importing and exporting multiple data packet formats;
[0013] The data cache unit includes two buffers, A and B, for caching data packets acquired by the high-speed acquisition unit;
[0014] The real-time processing unit is used to process the collected vehicle Ethernet messages in real time to meet the requirements of real-time detection and analysis.
[0015] The high-speed acquisition unit is a data acquisition card designed based on FPGA.
[0016] The core processing module includes:
[0017] The sniffing process unit is used to read the message of the data cache unit and perform packet filtering on it, read the filtered message data into the expandable unit, and transfer the analysis result of the message parsing unit to the upper visualization module by using shared memory;
[0018] The expandable unit is used to normalize the received non-standard Ethernet message structure by describing the protocol structure file in XML text editing format;
[0019] The message parsing unit is used to parse the normalized structure file according to the frame type.
[0020] The core processing module is a kernel module with real-time processing designed by using the arm-linux kernel.
[0021] The visualization module comprises:
[0022] The control button module is used to control the start and end of data collection, including starting packet capture, pausing packet capture, and stopping packet capture;
[0023] Visual display of message information module, used to display analysis results including data, charts, and animations;
[0024] The logging module is used to record the operation history of the system.
[0025] A real-time detection and analysis method for vehicle-mounted Ethernet includes the following steps:
[0026] 1) When the control button module of the visualization module issues a packet capture instruction, the data acquisition module starts to capture packets through the automotive field bus connected at the port and puts the packets into the data cache unit;
[0027] 2) After receiving the data packet in the data cache unit, the sniffing process unit filters and processes the data flow in the data packet according to the set packet filtering rules, and retains the packets that need to be analyzed;
[0028] 3) The extensible unit uses the XML description format to normalize the data packets, so that the structure and content of the data packets are described in a unified XML format and mapped to the corresponding XML elements and attributes;
[0029] 4) The message parsing module analyzes the data packets;
[0030] 5) When the control button module of the visualization module issues a stop packet capture instruction, the core processing module uses the arm-linux kernel to perform a real-time interrupt response, returns the parsing packet result to the sniffing process unit, and then sends it to the shared memory through the sniffing process unit, and updates the message information and data frame list;
[0031] 6) Use the designed visualization module to perform packet visualization analysis, parse the frame header, packet loss rate and throughput rate information of the message content, and after completing the analysis, issue a clear buffer command and power off.
[0032] The message parsing module analyzes the data packet, specifically: calculating the length of the frame, checking the integrity of the data packet, parsing the content of the data packet, and detecting errors.
[0033] The present invention has the following beneficial effects and advantages:
[0034] 1. Aiming at the high real-time requirements of vehicle Ethernet, an embedded device that can detect vehicle Ethernet messages in real time is designed. It not only fills the gap in the current vehicle Ethernet bus detection, but also can efficiently analyze the bus. The embedded bus analysis device can realize real-time collection, analysis and processing of vehicle Ethernet data, improving the efficiency and accuracy of bus data analysis.
[0035] 2. For messages in non-standard Ethernet data frame formats, a text description format that is compatible with multiple non-standard protocols is designed, which improves the universality of the detection system.
[0036] 3. Ability to improve the reliability of vehicle Ethernet: Embedded bus analysis equipment can detect the data flow in vehicle Ethernet in real time. By analyzing and monitoring the data flow, potential faults and problems can be discovered in time, and corresponding processing and repair can be carried out, thereby improving the reliability and stability of vehicle Ethernet.
[0037] 4. In view of the problem that traditional bus analysis equipment is not easy to carry, lightweight embedded mobile devices are more portable and can improve their portability, and improve their real-time performance through the optimization of hardware and software. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a functional module diagram of the vehicle-mounted Ethernet real-time detection and analysis device of the present invention;
[0039] Figure 2 It is the overall design flow chart of the present invention;
[0040] Figure 3 It is the design diagram of the data acquisition module of the present invention;
[0041] Figure 4 This is a diagram of the core processing module of the present invention. DETAILED DESCRIPTION
[0042] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0043] A real-time detection and analysis method and device for vehicle-mounted Ethernet, comprising: a data acquisition module, a core processing module, and a visualization module; the data acquisition module is a hardware data acquisition card designed by FPGA, which can collect a huge number of non-standard vehicle-mounted Ethernet data messages at high speed, and the acquisition card is provided with two buffers A and B for storing the captured data for use by the core processing module. After the core processing unit reads the data, it first performs packet filtering according to the established rules, such as CRC check, timestamp, etc., and then uses the XML tree description format to normalize the non-standard Ethernet message, and then analyzes the message, and finally realizes the visualization of the data message in the application layer interface to detect and analyze the bus data and ensure its data security. The method realizes real-time analysis and processing of data in the vehicle-mounted Ethernet through the combination of hardware and software, which can improve the security and reliability of the data.
[0044] The data acquisition module comprises:
[0045] The high-speed acquisition unit uses FPGA to design a data acquisition module for high-speed acquisition of vehicle Ethernet data packets, including real-time packet capture at the interface and importing and exporting packet data formats supported by other capture programs, ensuring the success rate of packet capture while ensuring its real-time performance.
[0046] Data cache unit: When the amount of data in the vehicle Ethernet is overloaded, packet loss and other events are prone to occur. By designing two buffers A and B to support data caching, it is possible to prevent data loss or overload.
[0047] The real-time processing unit is used to process the collected vehicle Ethernet messages in real time, such as optimizing the coordination of software and hardware and reasonably using concurrency and task scheduling to meet the requirements of real-time detection and analysis.
[0048] The various parts of the data acquisition module adopt FPGA to design the data acquisition card to meet the requirements of high-speed acquisition, real-time processing, etc.
[0049] The hardware acquisition card, FPGA can be used to implement various interfaces and protocols to help the arm-linux system communicate with external devices.
[0050] The data acquisition card is characterized in that it includes the following steps: using an FPGA development board for design, storing the bus data acquired at high speed into a buffer, and taking it out before the next data is overwritten, waiting for use by a core processing unit.
[0051] The core data processing module includes:
[0052] Sniffing process unit: reads the message stored in the buffer to the message parsing unit and filters it according to the established packet filtering rules, and then performs data analysis. Finally, it is transmitted to the upper interface for visualization by using shared memory.
[0053] Expandable unit: For the received non-standard Ethernet message structure, the protocol structure file is described in XML text editing format to normalize it. XML can map the message into a tree structure, and the purpose of parsing the message is achieved by designing a parser.
[0054] Message parsing unit: Parses the structure file based on the XML text description format received by the above-mentioned sniffing process by frame type, including packet filtering, packet decoding, data verification, etc., and records the parsing accuracy.
[0055] The visualization module includes:
[0056] Control button function: Design a user-level visual interface to control the start and end of data collection, including starting packet capture, pausing packet capture, and stopping packet capture.
[0057] Visual display of message information function: used to display data, charts, animations, etc., so that users can better understand and analyze data.
[0058] Logging function: used to record the system's operation history so that users or developers can perform troubleshooting or data analysis.
[0059] The visualization interface of the visualization display module includes one or more of a line graph of message correctness, an interrupt response time graph, a progress bar, and a packet capture rate.
[0060] The data acquisition module includes: a processor, a register, and an interface, wherein the processor, the register, and the interface communicate with each other via an in-vehicle Ethernet communication bus;
[0061] The present invention includes improving the real-time performance when collecting data and processing the collected data in real time to ensure the reliability of the analysis result.
[0062] The invention discloses a message editing method which is compatible with multiple bus protocol formats.
[0063] A real-time detection and analysis method and lightweight device for vehicle-mounted Ethernet data, such as Figure 1As shown, it includes: a data acquisition module, a data analysis module, and a visualization module; the data acquisition module is a hardware acquisition card design based on FPGA, which includes fast packet capture at the interface to ensure real-time performance, real-time processing to meet the needs of real-time detection and analysis, and setting a data buffer to prevent data loss or overload, thereby improving the packet capture rate; the data analysis module processes, analyzes and calculates the collected original data packets, specifically: the sniffing process imports the packet from the buffer for analysis, and uses the shared memory technology to share the analyzed data to the upper user interface for visualization operation; as the amount of data increases, the data processing module needs to be scalable and able to adapt to the growing amount of data and processing requirements. By designing an XML-based protocol parsing format in the module, it is compatible with a variety of data message formats to improve its scalability; the message parsing unit is one of the most important parts of the data processing module and the core of the analysis system. The unit mainly parses and analyzes the captured data messages to identify and locate potential faults and problems. The analysis unit includes: packet filtering, packet reassembly, packet decoding, data analysis and data verification operations.
[0064] like Figure 2The figure shows the flow chart of the whole vehicle Ethernet detection and analysis device. The data acquisition module will read the data packet from the vehicle Ethernet bus and store it in the buffer. The sniffing process in the analysis module will read the data packet from the buffer and process and analyze the collected data, including packet filtering, message parsing, checksum and timestamp operations. According to the preset filtering rules, the analysis module can filter the data packet and only retain the data packet that needs to be analyzed. For example, only data packets with a specific source address or destination address can be retained, or only data packets of a specific type can be retained; using XML to normalize the data packet can effectively improve the scalability of the analysis system. Many different frame types are defined in the vehicle Ethernet protocol, and each frame type has different formats and contents. In order to facilitate analysis, the analysis module usually needs to normalize the non-standard Ethernet message and convert it into a standard format. This step usually needs to be described in XML and other formats for subsequent processing; data packet analysis, the analysis module performs in-depth analysis on the data packet, such as calculating the length of the frame, checking the integrity of the data packet, parsing the content of the data packet, detecting errors, etc. These analyses can help identify potential faults and problems, such as communication failures, data transmission errors, etc. Finally, the processed data is passed to the upper-level visualization module, and the analysis module visualizes the analysis results to generate easy-to-understand data packets. These packets usually include information such as source address, destination address, frame type, data field, CRC check, timestamp, etc., and are usually presented in a graphical way so that operators can more intuitively understand and identify the content and characteristics of the message. The upper-level user visualization interface provides a friendly graphical interface that enables users to monitor the status of the vehicle Ethernet in real time, analyze and detect results, and configure and manage the detection equipment.
[0065] like Figure 3 The data acquisition module is shown in the figure. The interface at one end of the data acquisition card is connected to the vehicle Ethernet bus to achieve the physical communication of the bus. At the same time, in order to avoid problems such as packet loss caused by excessive Ethernet messages, the collected data is first stored in the buffer for use by the middle layer (arm-linux kernel processing unit). Vehicle Ethernet data acquisition technology: collects data information transmitted by vehicle Ethernet through a combination of hardware and software, including data messages, communication status, etc. Data acquisition technology is the basis of vehicle Ethernet analysis and fault detection. Its accuracy and real-time performance directly affect the accuracy and efficiency of subsequent analysis and diagnosis.
[0066] Typically, an in-vehicle Ethernet device only needs one interface to connect to the Ethernet bus to capture and analyze data. If the device only needs to read data and does not need to send data to the bus, only one interface is needed. However, if the device needs to send data to the bus, another interface is needed to send the data back to the bus. At the same time, in order to minimize the impact of the device on the bus, some in-vehicle Ethernet devices use a passive connection method, that is, they only read bus data but do not send data to the bus. Therefore, the device is only configured with one interface to connect to the Ethernet bus and does not send data to it.
[0067] like Figure 4 The following are the functions of each unit in the data packet analysis module: The analysis module first needs to parse the format and content of the data packet. According to the vehicle Ethernet protocol, the data packet contains a lot of information, including source address, destination address, frame type, data field, CRC check, etc. The analysis module needs to parse this information for subsequent analysis and processing. Packet filtering: filter the received data packets according to the set rules to remove useless data packets. Packet reassembly: splice the data packets according to the network protocol to restore the original data. Packet decoding: decode the data packets according to the protocol and convert the binary data into a readable format. Data analysis: analyze and interpret each field in the data packet according to the data structure specified by the protocol. Data verification: perform CRC verification, timestamp and other tasks on the data packet to ensure the integrity and accuracy of the data. Vehicle Ethernet data analysis technology: analyze and process the vehicle Ethernet data, extract the various parameters and characteristics of the data message, and identify the type, destination address, source address and other information of the data packet. Data analysis technology can detect the network communication status, data transmission quality and various fault information, and provide data support for subsequent fault diagnosis and troubleshooting.
[0068] A real-time detection and analysis method and device for vehicle Ethernet data has the following specific working process:
[0069] When S1 issues a packet capture command through the control button on the Qt interface, the data acquisition card starts to capture packets through the automotive field bus connected to the port, and puts the packets into the buffer for use by the message information analysis module of the middle layer in the next step.
[0070] The S2 core processing module is a real-time processing kernel module designed with the arm-linux kernel. After the sniffing process receives the data packet in the buffer area, it calls the arm-linux kernel module to analyze and process the packet. According to the automotive Ethernet protocol, the data packet contains a lot of information, including source address, destination address, frame type, data field, CRC check, etc. The analysis module first needs to filter the original bus data stream according to the packet filtering rules to obtain the required Ethernet message data for the next step of data analysis, and to facilitate subsequent more in-depth analysis and processing.
[0071] S3 performs normalization operations. After retaining the packets that need to be analyzed according to the preset filtering rules, it uses the XML description format to normalize the data packets so that the structure and content of the data packets are described in a unified XML format, including parsing the fields, identifiers, and values of each data packet, and mapping them to corresponding XML elements and attributes for subsequent processing and application.
[0072] The S4 core packet analysis module performs in-depth analysis of packets, calculates frame length, checks packet integrity, parses packet content, and detects errors.
[0073] When the controller of the Qt interface issues a command to stop packet capture, S5 uses the real-time arm-linux interrupt processing module to return the packet parsing result to the sniffing process, which is then sent to the shared memory through the sniffing process, and the message information and data frame list are updated.
[0074] S6 uses the designed Qt upper-layer visualization interface to perform packet visualization analysis and parse information such as the frame header, packet loss rate, and throughput rate of the message content.
[0075] When S7 completes the analysis, it issues a command to clear the buffer and powers off, and the device stops working.
[0076] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should be regarded as within the scope of protection of the present invention.
Claims
1. A lightweight device for real-time detection and analysis of vehicle-mounted Ethernet, characterized in that: include: Data acquisition module, used to collect non-standard vehicle Ethernet data messages; The core processing module is used to obtain data packets from the data acquisition module, process them, and analyze the processed data packets; The visualization module is used to visualize the analysis results of the core processing module and control the start and end of message detection.
2. A lightweight device for real-time detection and analysis of vehicle-mounted Ethernet according to claim 1, characterized in that: The data acquisition module comprises: High-speed acquisition unit, used for real-time packet capture of Ethernet data packets at the interface, and importing and exporting multiple data packet formats; The data cache unit includes two buffers A and B, which are used to cache the data packets acquired by the high-speed acquisition unit; The real-time processing unit is used to process the collected vehicle Ethernet messages in real time to meet the requirements of real-time detection and analysis.
3. A lightweight device for real-time detection and analysis of vehicle-mounted Ethernet according to claim 2, characterized in that: The high-speed acquisition unit is a data acquisition card designed based on FPGA.
4. The lightweight device for real-time detection and analysis of vehicle-mounted Ethernet according to claim 1, characterized in that: The core processing module includes: The sniffing process unit is used to read the message of the data cache unit and perform packet filtering on it, read the filtered message data into the expandable unit, and transfer the analysis result of the message parsing unit to the upper visualization module by using shared memory; The expandable unit is used to normalize the received non-standard Ethernet message structure by describing the protocol structure file in XML text editing format; The message parsing unit is used to parse the normalized structure file according to the frame type.
5. The lightweight device for real-time detection and analysis of vehicle-mounted Ethernet according to claim 1, characterized in that: The core processing module is a kernel module with real-time processing designed by using the arm-linux kernel.
6. A lightweight device for real-time detection and analysis of vehicle-mounted Ethernet according to claim 1, characterized in that: The visualization module comprises: The control button module is used to control the start and end of data collection, including starting packet capture, pausing packet capture, and stopping packet capture; Visual display of message information module, used to display analysis results including data, charts, and animations; The logging module is used to record the operation history of the system.
7. A real-time detection and analysis method for vehicle-mounted Ethernet, characterized in that: The following steps are involved: 1) When the control button module of the visualization module issues a packet capture instruction, the data acquisition module starts to capture packets through the automotive field bus connected at the port and puts the packets into the data cache unit; 2) After receiving the data packet in the data cache unit, the sniffing process unit filters and processes the data flow in the data packet according to the set packet filtering rules, and retains the packets that need to be analyzed; 3) The extensible unit uses the XML description format to normalize the data packets, so that the structure and content of the data packets are described in a unified XML format and mapped to the corresponding XML elements and attributes; 4) The message parsing module analyzes the data packets; 5) When the control button module of the visualization module issues a stop packet capture instruction, the core processing module uses the arm-linux kernel to perform a real-time interrupt response, returns the parsing packet result to the sniffing process unit, and then sends it to the shared memory through the sniffing process unit, and updates the message information and data frame list; 6) Use the designed visualization module to perform packet visualization analysis, parse the frame header, packet loss rate and throughput rate information of the message content, and after completing the analysis, issue a clear buffer command and power off.
8. A real-time detection and analysis method for vehicle-mounted Ethernet according to claim 7, characterized in that: The message parsing module analyzes the data packet, specifically: calculating the length of the frame, checking the integrity of the data packet, parsing the content of the data packet, and detecting errors.
