Method for automatically analyzing CAN bus based on LabVIEW platform
By building an automatic CAN bus parsing system on the LabVIEW platform, and combining techniques such as Bayesian adaptive noise covariance update and robust kernel function weighted Kalman filtering, the problems of fragmented operation and poor real-time performance of CAN bus communication parsing schemes are solved. This achieves efficient and accurate communication status monitoring and data parsing, and is suitable for automotive electronics and industrial control fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN SENMU LEISHI TECH CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing CAN bus communication parsing solutions suffer from fragmented operation processes, low automation, poor real-time parsing performance, reliance on manual experience, and unstable parsing accuracy. They cannot meet dynamic monitoring requirements, especially in scenarios with strong electromagnetic interference where communication anomalies occur frequently.
Based on the LabVIEW platform, a CAN interface, parsing configuration, data processing, and human-computer interaction module are built. A communication monitoring and hybrid adaptive correction submodule is integrated. Data is collected in real time and processed through Bayesian adaptive noise covariance update, robust kernel function weighted Kalman filtering, and density clustering anomaly hierarchical processing to achieve automatic parsing and real-time monitoring.
It achieves full-process integration of CAN bus data acquisition, parsing, display and recording, improves the accuracy and consistency of parsing, can accurately identify noise type, quantify interference level and grade and trace communication anomalies in complex interference environment, generate standardized quality assessment reports, and improve operation and maintenance efficiency.
Smart Images

Figure CN122001964A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of CAN bus communication network monitoring technology, specifically a method for automatic CAN bus parsing based on the LabVIEW platform. Background Technology
[0002] As the core communication network in industrial fields, the reliability of the CAN bus directly determines the safety of equipment operation. Real-time monitoring of the CAN bus communication status, interference identification, and data parsing are key links to ensure communication quality. The CAN bus is widely used in strong electromagnetic interference scenarios such as automotive electronics and industrial control. During the communication process, it is susceptible to Gaussian noise and non-Gaussian impulse noise (such as electromagnetic spikes in ignition systems), and communication anomalies such as instantaneous bus short circuits and link drift may occur.
[0003] The typical process of existing CAN bus data parsing solutions is as follows: data is collected using a general CAN card and official software, and then the exported file is parsed offline by manual means or scripts. This solution has significant drawbacks: the operation process is fragmented, the degree of automation is low, the real-time parsing is poor, it cannot meet the needs of dynamic monitoring, it relies on manual experience, and the parsing accuracy is unstable. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a method for automatic parsing of the CAN bus based on the LabVIEW platform, which solves the problems mentioned in the background section.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for automatic parsing of the CAN bus based on the LabVIEW platform, comprising the following steps: S1. Constructing a platform collaboration module: The LabVIEW software platform is used to build a CAN interface module, a configuration parsing module, a data processing module, and a human-computer interaction module for collaborative work. The data processing module integrates a CAN bus communication monitoring and hybrid adaptive correction submodule. S2. Extract the parsing rules from the file: The parsing configuration module loads and identifies the standard CAN database file, i.e., the DBC file, and extracts parsing rules such as signal definition, message ID, signal start bit, signal length, scaling ratio, and offset. These rules are then converted into cluster or array data structures that LabVIEW can process, forming a parsing rule library. S3. Real-time data acquisition: The CAN interface module is physically connected to the CAN bus communication network under test, and collects raw CAN bus data frames and communication link status parameters in real time, and transmits them synchronously to the data processing module. S4. Communication monitoring and calibration: The CAN bus communication monitoring and hybrid adaptive correction submodules execute sequentially: Communication link monitoring: Real-time identification of mixed noise types, interference intensity, and abnormal communication states in CAN bus communication; Bayesian adaptive noise covariance update: dynamically adjusts the noise covariance parameter based on the detected noise characteristics; Robust kernel-weighted Kalman filtering: suppresses the interference of mixed noise on communication data; Density clustering anomaly hierarchical processing: hierarchically identify sudden and gradual communication anomalies, and output corrected data streams and communication monitoring results; S5. Automatic parsing and conversion: The data processing module calls the parsing rule base to perform an automatic parsing algorithm based on DBC files on the corrected data stream, converting it into signal values with physical meaning; S6. Results Display and Recording: The human-computer interaction module displays the analyzed physical signal values, the comparison of data before and after correction, and the CAN bus communication monitoring results in real time in a graphical format, and automatically records and stores relevant data and monitoring logs.
[0006] Furthermore, in step S3, the raw data frames of the CAN bus and communication link status parameters, including signal transmission delay and frame loss rate, are collected in real time.
[0007] Furthermore, in step S4, the mixed noise types include Gaussian noise and non-Gaussian impulse noise; Sudden communication anomalies include instantaneous bus short circuits and electromagnetic spike interference; gradual anomalies include link drift and continuous electromagnetic interference; communication monitoring results include noise type percentage, interference level, and anomaly frequency.
[0008] Furthermore, in step S3, the hardware carrier of the CAN interface module is a PCIeCAN board, which supports the CAN2.0A / B protocol, has a data transmission rate of ≥1Mbps, and has a communication link status acquisition function to collect parameters such as signal transmission delay, frame loss rate, and bus load rate.
[0009] Furthermore, in step S4, the Bayesian adaptive noise covariance update step of the CAN bus communication monitoring and hybrid adaptive correction submodule is used to monitor the noise characteristics in CAN bus communication in real time, specifically including: Based on the residual sequence within the sliding window, the Gaussian noise variance is obtained through maximum likelihood estimation.
[0010] in, , For observation data, This is the predicted state value. For the observation matrix, Indicates at time Based on recent The estimated variance calculated from the data points The number of data samples selected to calculate the variance, i.e., from the current time. The number of samples traced back. It is the loop index variable in the summation formula, and its value ranges from... arrive , Indicates the first Error value at each moment; The variance of non-Gaussian impulse noise was calculated using the median absolute deviation (MAD).
[0011] in, This represents the standard deviation estimate obtained based on a specific calculation method, the calculation of which depends on the window size. and the current moment of the time series , The constant coefficients, That is, the absolute deviation of the median. Representing time series In the middle, from the first The moment to the A subset of data at each moment; The noise mixing factor is estimated using the Kullback-Leibler divergence, or KL divergence for short.
[0012] in, Relative entropy is used to measure the probability distribution between two probability distributions. and The degree of difference between them It is a probability distribution. The mean is The variance is The normal distribution is the mean parameter of the normal distribution; This formula is used to quantify the proportion of Gaussian noise in CAN bus communication. , This represents the proportion of non-Gaussian noise; According to the formula Update process noise covariance According to the formula Update observation noise covariance ,in Forgetting factor, The sampling period; based on and Calculate the interference level of CAN bus communication: when and When, it is judged as low interference; when and When, it is determined to be medium interference; when and At that time, it was determined to be high interference.
[0013] Furthermore, in step S4, the Huber robust kernel function is used in the robust kernel function weighted Kalman filtering step:
[0014] in, Kalman gain according to calculate, , for The first derivative, To predict the covariance matrix.
[0015] Furthermore, in step S4, the density clustering anomaly grading processing step is used to monitor abnormal states of CAN bus communication, specifically including: Define the set of data points within the clustering window , ; Calculate each data point - Neighborhood density:
[0016] like and ,in If this occurs, it is determined to be a sudden abnormality in CAN bus communication, and the following measures are taken: Correction; if and If so, it is determined to be a gradual abnormality in CAN bus communication, and the following measures are taken: ,and This is a noise estimate; Then, record the timestamp of the anomaly, the anomaly type, and the interference intensity to form a CAN bus communication anomaly monitoring log.
[0017] Furthermore, in step S6, the graphical display content of the human-computer interaction module includes: Communication monitoring panel: CAN bus communication link quality score, noise type percentage pie chart, real-time interference level indicator, anomaly type and frequency statistics; Data display panel: waveform curves of raw data, corrected data, and analytical results, and instantaneous signal value boxes; The interactive controls support DBC file loading, CAN communication start / stop, signal filtering, calibration model parameter adjustment, and communication monitoring log export.
[0018] Furthermore, in step S6, the data record storage format is CSV format, which includes timestamp, signal name, original value, correction value, parsed value, noise type, interference level, anomaly level, and communication link parameter fields.
[0019] This invention provides a method for automatic parsing of the CAN bus based on the LabVIEW platform, which has the following beneficial effects: 1. This method for automatic CAN bus parsing based on the LabVIEW platform integrates the entire process of CAN bus data acquisition, parsing, display, and recording. It completely solves the pain points of traditional solutions, such as fragmented operation, poor real-time performance, reliance on human experience, and insufficient visualization. Through standardized module design and automatic parsing algorithms, it achieves one-click efficient operation. At the same time, through optimization of basic anti-interference mechanisms, it improves the accuracy and consistency of data parsing, providing stable and reliable technical support for equipment status monitoring and fault diagnosis in fields such as automotive electronics and industrial control.
[0020] 2. This method for automatic CAN bus parsing based on the LabVIEW platform, by integrating communication monitoring and hybrid adaptive correction modules, overcomes the limitations of traditional solutions that can only parse data but cannot monitor communication status. Through a hybrid model that integrates multiple algorithms, it achieves accurate identification of noise types, dynamic quantification of interference levels, and hierarchical tracing of communication anomalies. This not only significantly improves the accuracy of data correction and model adaptability under complex interference environments, but also generates standardized communication quality assessment reports, providing data support for rapid troubleshooting of communication faults, greatly improving operation and maintenance efficiency, and filling the technical gap in the integration of real-time monitoring and data parsing of CAN bus communication status. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the automatic parsing process of a CAN bus automatic parsing method based on the LabVIEW platform according to the present invention; Figure 2 This is a schematic diagram of the integrated process of hybrid adaptive correction and communication monitoring of a method for automatic parsing of CAN bus based on the LabVIEW platform according to the present invention. Detailed Implementation
[0022] The embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and should not be construed as limiting the scope of the invention.
[0023] like Figures 1-2As shown, the present invention provides a technical solution: a method for automatic parsing of CAN bus based on the LabVIEW platform, comprising the following steps: S1. Constructing a platform collaboration module: The LabVIEW software platform is used to build a CAN interface module, a configuration parsing module, a data processing module, and a human-computer interaction module for collaborative work. The data processing module integrates a CAN bus communication monitoring and hybrid adaptive correction submodule. S2. Extract the parsing rules from the file: The parsing configuration module loads and identifies the standard CAN database file, i.e., the DBC file, and extracts parsing rules such as signal definition, message ID, signal start bit, signal length, scaling ratio, and offset. These rules are then converted into cluster or array data structures that LabVIEW can process, forming a parsing rule library. S3. Real-time data acquisition: The CAN interface module is physically connected to the CAN bus communication network under test, and collects raw CAN bus data frames and communication link status parameters in real time, and transmits them synchronously to the data processing module. Real-time acquisition of raw data frames from the CAN bus and communication link status parameters, including signal transmission delay and frame loss rate; The hardware carrier of the CAN interface module is a PCIeCAN board, which supports the CAN2.0A / B protocol, has a data transmission rate of ≥1Mbps, and has the function of acquiring communication link status to collect parameters such as signal transmission delay, frame loss rate, and bus load rate. S4. Communication monitoring and calibration: The CAN bus communication monitoring and hybrid adaptive correction submodules execute sequentially: Communication link monitoring: Real-time identification of mixed noise types, interference intensity, and abnormal communication states in CAN bus communication. Mixed noise types include Gaussian noise and non-Gaussian impulse noise. Bayesian adaptive noise covariance update: dynamically adjusts the noise covariance parameter based on the detected noise characteristics; The Bayesian adaptive noise covariance update step of the CAN bus communication monitoring and hybrid adaptive correction submodule is used to monitor the noise characteristics in CAN bus communication in real time, specifically including: Based on the residual sequence within the sliding window, the Gaussian noise variance is obtained through maximum likelihood estimation.
[0024] in, , For observation data, This is the predicted state value. For the observation matrix, Indicates at time Based on recent The estimated variance calculated from the data is used to measure the dispersion of the data and reflects signal fluctuations in CAN bus communication monitoring and automatic analysis scenarios. The number of data samples selected to calculate the variance, i.e., from the current time. The number of samples traced back. The size of the time window for variance calculation is determined. It is the loop index variable in the summation formula, and its value ranges from... arrive , Indicates the first Error value at each moment; The variance of non-Gaussian impulse noise was calculated using the median absolute deviation (MAD).
[0025] in, This represents the standard deviation estimate obtained based on a specific calculation method, the calculation of which depends on the window size. and the current moment of the time series , This is a constant coefficient, introduced to ensure that the estimate calculated based on the median absolute deviation (MAD) is consistent with the traditional standard deviation calculation result for normally distributed data. That is, the absolute deviation of the median. Representing time series In the middle, from the first The moment to the A subset of data at each moment; The noise mixing factor is estimated using the Kullback-Leibler divergence, or KL divergence for short.
[0026] in, Relative entropy is used to measure the probability distribution between two probability distributions. and The degree of difference between them It is a probability distribution. The mean is The variance is The normal distribution is the mean parameter of the normal distribution; This formula is used to quantify the proportion of Gaussian noise in CAN bus communication. , This represents the proportion of non-Gaussian noise; According to the formula Update process noise covariance According to the formula Update observation noise covariance ,in Forgetting factor, The sampling period; based on and Calculate the interference level of CAN bus communication: when and When, it is judged as low interference; when and When, it is determined to be medium interference; when and At that time, it was determined to be high interference; Robust kernel-weighted Kalman filtering: suppresses the interference of mixed noise on communication data; In the robust kernel-weighted Kalman filtering step, the Huber robust kernel function is used:
[0027] in, Kalman gain according to calculate, , for The first derivative, To predict the covariance matrix; this step is used to suppress the interference of mixed noise on data transmission in CAN bus communication and improve the reliability of communication data. Density clustering anomaly hierarchical processing: hierarchically identify sudden and gradual communication anomalies, and output corrected data streams and communication monitoring results; The density clustering anomaly grading process is used to monitor abnormal states in CAN bus communication, and specifically includes: Define the set of data points within the clustering window , ; Calculate each data point - Neighborhood density:
[0028] like and ,in If this occurs, it is determined to be a sudden abnormality in CAN bus communication, and the following measures are taken: Correction; if and If so, it is determined to be a gradual abnormality in CAN bus communication, and the following measures are taken: ,and This is a noise estimate; Then record the timestamp of the anomaly, the anomaly type, and the interference intensity to form a CAN bus communication anomaly monitoring log; Sudden communication anomalies include instantaneous bus short circuits and electromagnetic spike interference; gradual anomalies include link drift and continuous electromagnetic interference; communication monitoring results include noise type proportion, interference level, and anomaly frequency. S5. Automatic parsing and conversion: The data processing module calls the parsing rule base to perform an automatic parsing algorithm based on DBC files on the corrected data stream, converting it into signal values with physical meaning; S6. Results Display and Recording: The human-computer interaction module displays the analyzed physical signal values, the comparison of data before and after correction, and the CAN bus communication monitoring results in real time in a graphical format, and automatically records and stores relevant data and monitoring logs; The graphical display content of the human-computer interaction module includes: Communication monitoring panel: CAN bus communication link quality score, noise type percentage pie chart, real-time interference level indicator, anomaly type and frequency statistics; Data display panel: waveform curves of raw data, corrected data, and analytical results, and instantaneous signal value boxes; The interactive controls support DBC file loading, CAN communication start / stop, signal filtering, calibration model parameter adjustment, and communication monitoring log export. The data records are stored in CSV format, which includes fields such as timestamp, signal name, original value, correction value, resolved value, noise type, interference level, anomaly level, and communication link parameters.
[0029] The specific plan is as follows: Functional module construction: Each module collaborates through data flow interaction. CAN interface module: Using a PCIeCAN board as the hardware carrier, it physically connects to the CAN bus communication network under test. It not only collects raw data frames, but also synchronously collects communication link parameters (transmission delay, frame loss rate, bus load rate) to provide basic data for communication monitoring. Parsing configuration module: Loads DBC files, extracts parsing rules, and converts them into a LabVIEW-compatible structure to form a parsing rule base; Data processing module: integrates CAN bus communication monitoring and hybrid adaptive correction submodule. First, communication monitoring and data correction are completed through this submodule, and then the parsing rule base is called to complete data parsing. The human-computer interaction module displays real-time communication quality scores, a pie chart showing the proportion of noise types, a real-time interference level indicator (visualized low / medium / high interference labels), and a statistical table of anomaly types and frequencies. The data display panel synchronously presents waveform comparison curves and instantaneous signal value boxes for raw data, corrected data, and analytical results. In addition to the original functions, the interactive controls are designed with communication monitoring parameter configuration, supporting adjustments to monitoring-related parameters such as sliding window length and cluster density threshold. It also features communication monitoring log export, supporting export of details such as anomaly timestamps, interference intensity, and link parameters in CSV / Excel format. The CAN bus communication monitoring and hybrid adaptive correction submodule achieves comprehensive perception and data optimization of the CAN bus communication status through a three-layer algorithm logic. The specific algorithm design is as follows: Assuming the signal transmission of the CAN bus communication system satisfies a nonlinear time-varying model, the state equation and observation equation are defined as follows:
[0030]
[0031] in, for The signal state vector at any given moment (including the actual signal value, rate of change, and acceleration); for The communication link state parameters (transmission delay, frame loss rate) at each time step are used to dynamically adjust the state transition function, enabling the model to adapt to link changes; this is a nonlinear state transition function. Based on the link parameters, the correction is as follows:
[0032] in,
[0033] Normalized transmission delay ( The transmission delay data collected by the CAN interface module is obtained through standardized processing. The process noise vector follows a time-varying Gaussian distribution. , By combining Bayesian estimation with real-time link state updates, the worse the link quality (the higher the frame loss rate). The larger the value, the better the model's resistance to interference. for Observational data at any given time (including raw signal, mixed noise, outliers, and link distortion); The observation function is set as follows: ( ); For mixed noise vectors (Gaussian noise) +Non-Gaussian impulse noise ),Right now ,in, This is the noise mixing coefficient, used to quantify the proportion of different types of communication noise. Communication anomaly vector (burst anomaly) +Gradual anomaly Identification is achieved through density clustering hierarchical classification; The link distortion term is obtained by fitting the transmission delay and frame loss rate:
[0034] This is the frame loss rate, used to correct the impact of link distortion on the observed data; The specific usage process is as follows: Step 1: Communication link status acquisition and preprocessing The CAN interface module synchronously acquires raw data frames and link parameters (transmission delay). Frame loss rate Bus load rate Standardize the link parameters:
[0035] The transmission delay threshold specified by the CAN bus protocol. (Frame loss rate is directly normalized) to form the link state vector. ; Step 2: Bayesian Adaptive Noise Monitoring and Covariance Update Based on link state vector By combining the residual sequence within the sliding window, noise type monitoring and parameter updates can be achieved. Gaussian noise variance The maximum likelihood estimation is used to calculate:
[0036] Non-Gaussian noise variance The median absolute deviation (MAD) is used for calculation.
[0037] Noise mixing coefficient The KL divergence is used to measure the goodness of fit between the observed data (after removing the distortion term) and the Gaussian distribution.
[0038] The value directly reflects the proportion of Gaussian noise in communication and is used for noise type monitoring; Interference Level Quantification: Combining link status and noise variance, an interference level score is defined.
[0039] To observe the noise covariance, The corresponding monitoring results are categorized into three levels: low interference, medium interference, and high interference. Covariance matrix update:
[0040] This enables dynamic binding of covariance to communication link quality; Step 3: Robust kernel function weighted filtering The Huber robust kernel function is introduced to correct the Kalman gain, and the robust threshold is dynamically adjusted based on the interference level. :
[0041] The higher the interference level, The larger the value, the better the model's fault tolerance. Kalman gain weighting formula:
[0042] Among them, weight , For Huber kernel function; The noise suppression effect is recorded synchronously during the filtering process: Used for communication data quality assessment; Step 4: Density Clustering Anomaly Monitoring and Hierarchical Processing The DBSCAN algorithm based on a sliding window, combined with link status, enables accurate detection of anomaly types: Constructing the residual set ( ), calculate each residual - Neighborhood density:
[0043] in The greater the link latency, The larger the value, the better to accommodate residual fluctuations caused by link distortion; Anomaly classification determination: Sudden anomaly (transient communication link failure): and and The fault is identified as a sudden fault such as a momentary short circuit or electromagnetic spike, and the timestamp of the fault occurrence, link parameters (transmission delay and frame loss rate at this time) are recorded. The correction will trigger an abnormal alarm in the human-computer interaction module. Gradual anomalies (communication link aging or continuous interference): but and The interference was identified as link aging and persistent electromagnetic interference. The duration and level of interference changes were recorded. Correction (removal of noise and distortion effects); Anomaly tracing assistance: By combining the link parameters and noise type at the time of the anomaly, anomaly tracing labels are generated, such as "high interference - non-Gaussian noise - sudden anomaly" and "medium interference - link delay - gradual anomaly", to provide a basis for troubleshooting communication faults; The following are the steps of an embodiment of the method for CAN bus communication monitoring and automatic parsing using the method of the present invention: The parser is launched in the LabVIEW platform. The user sets the sliding window length through the communication monitoring parameter configuration control in the human-computer interaction module. Clustering window length Forgetting factors Then load the DBC file corresponding to the CAN bus under test; The parsing configuration module automatically extracts parsing rules such as signal definitions, message IDs, and scaling ratios from the DBC file and converts them into LabVIEW cluster data structures to generate a parsing rule base; the hybrid adaptive correction submodule initializes the state vector. Covariance matrix ( (Initial standard deviation of signal fluctuation in the DBC file), and simultaneously initialize link state parameters. ; When the user activates the communication and monitoring control, the CAN interface module establishes a physical connection with the CAN bus communication network under test, and the sampling frequency is set to a preset frequency, such as 100Hz. The system collects raw data frames and communication link parameters (transmission delay, frame loss rate, bus load rate) and transmits them synchronously to the data processing module. The data processing module calls the CAN bus communication monitoring and hybrid adaptive correction submodule to sequentially perform link status preprocessing → Bayesian adaptive noise monitoring and covariance update → robust kernel function weighted filtering → density clustering anomaly monitoring and hierarchical processing, and outputs the corrected data stream and communication monitoring results. The data processing module calls the parsing rule base and performs an automatic parsing algorithm based on DBC files on the corrected data stream. The physical signal value is converted into a meaningful signal value (such as engine speed and water temperature) using the formula: Physical signal value = Corrected original data × Scaling ratio + Offset. The data processing module synchronously transmits the analysis results, data before and after correction, and communication monitoring results to the human-computer interaction module. The communication monitoring panel displays the link quality score, noise ratio pie chart, interference level indicator, and anomaly statistics table in real time. The data display panel draws a three-curve comparison chart (original data, correction data, and analysis results). At the same time, the program automatically records and stores all data (including timestamp, signal field, monitoring field, and link parameter field). If high interference or sudden abnormality is detected, the human-computer interaction module will automatically trigger an audible and visual alarm. Users can view the abnormality log and trace the abnormality details through controls. After the test is completed, the user stops the communication and monitoring controls, the CAN interface module stops data acquisition, the data processing module terminates the calculation, and a comprehensive report is automatically generated, which includes communication quality assessment (interference statistics, anomaly tracing, link reliability score) and a summary of the analysis results. The report can be exported and the monitoring log can be exported separately, thus completing this process.
[0044] Based on the above, this invention integrates the entire process of CAN bus data acquisition, parsing, display, and recording, completely solving the pain points of traditional solutions such as fragmented operation, poor real-time performance, reliance on human experience, and insufficient visualization. Through standardized module design and automatic parsing algorithms, it achieves one-click efficient operation. At the same time, through optimization of the basic anti-interference mechanism, it improves the accuracy and consistency of data parsing, providing stable and reliable technical support for equipment status monitoring and fault diagnosis in fields such as automotive electronics and industrial control. This invention, by integrating a communication monitoring and hybrid adaptive correction module, overcomes the limitations of traditional solutions that can only analyze data but cannot monitor communication status. Through a hybrid model that integrates multiple algorithms, it achieves accurate identification of noise types, dynamic quantification of interference levels, and graded tracing of communication anomalies. This not only significantly improves the accuracy of data correction and model adaptability under complex interference environments, but also generates standardized communication quality assessment reports, providing data support for rapid troubleshooting of communication faults, greatly improving operation and maintenance efficiency, and filling the technical gap in the integration of real-time monitoring and data analysis of CAN bus communication status.
[0045] The embodiments of the present invention are given for illustrative and descriptive purposes only, and are not intended to be exhaustive or to limit the invention to the forms disclosed. Many modifications and variations will be apparent to those skilled in the art. The embodiments were chosen and described in order to better illustrate the principles and practical application of the invention, and to enable those skilled in the art to understand the invention and to design various embodiments with various modifications suitable for a particular purpose.
Claims
1. A method for automatic parsing of CAN bus based on the LabVIEW platform, characterized in that: Includes the following steps: S1. Constructing a platform collaboration module: The LabVIEW software platform is used to build a CAN interface module, a configuration parsing module, a data processing module, and a human-computer interaction module for collaborative work. The data processing module integrates a CAN bus communication monitoring and hybrid adaptive correction submodule. S2. Extract the parsing rules from the file: The parsing configuration module loads and identifies the standard CAN database file, i.e., the DBC file, and extracts parsing rules such as signal definition, message ID, signal start bit, signal length, scaling ratio, and offset. These rules are then converted into cluster or array data structures that LabVIEW can process, forming a parsing rule library. S3. Real-time data acquisition: The CAN interface module is physically connected to the CAN bus communication network under test, and collects raw CAN bus data frames and communication link status parameters in real time, and transmits them synchronously to the data processing module. S4. Communication monitoring and calibration: The CAN bus communication monitoring and hybrid adaptive correction submodules execute sequentially: Communication link monitoring: Real-time identification of mixed noise types, interference intensity, and abnormal communication states in CAN bus communication; Bayesian adaptive noise covariance update: dynamically adjusts the noise covariance parameter based on the detected noise characteristics; Robust kernel-weighted Kalman filtering: suppresses the interference of mixed noise on communication data; Density clustering anomaly hierarchical processing: hierarchically identify sudden and gradual communication anomalies, and output corrected data streams and communication monitoring results; S5. Automatic parsing and conversion: The data processing module calls the parsing rule base to perform an automatic parsing algorithm based on DBC files on the corrected data stream, converting it into signal values with physical meaning; S6. Results Display and Recording: The human-computer interaction module displays the analyzed physical signal values, the comparison of data before and after correction, and the CAN bus communication monitoring results in real time in a graphical format, and automatically records and stores relevant data and monitoring logs.
2. The method for automatic parsing of CAN bus based on LabVIEW platform according to claim 1, characterized in that: In step S3, the raw data frames of the CAN bus and communication link status parameters, including signal transmission delay and frame loss rate, are collected in real time.
3. The method for automatic parsing of CAN bus based on LabVIEW platform according to claim 1, characterized in that: In step S4, the mixed noise types include Gaussian noise and non-Gaussian impulse noise; Sudden communication anomalies include instantaneous bus short circuits and electromagnetic spike interference; gradual anomalies include link drift and continuous electromagnetic interference; communication monitoring results include noise type percentage, interference level, and anomaly frequency.
4. The method for automatic parsing of CAN bus based on LabVIEW platform according to claim 1, characterized in that: In step S3, the hardware carrier of the CAN interface module is a PCIeCAN board, which supports the CAN2.0A / B protocol, has a data transmission rate of ≥1Mbps, and has the function of acquiring communication link status to collect parameters such as signal transmission delay, frame loss rate, and bus load rate.
5. The method for automatic parsing of CAN bus based on LabVIEW platform according to claim 1, characterized in that: In step S4, the Bayesian adaptive noise covariance update step of the CAN bus communication monitoring and hybrid adaptive correction submodule is used to monitor the noise characteristics in CAN bus communication in real time, specifically including: Based on the residual sequence within the sliding window, the Gaussian noise variance is obtained through maximum likelihood estimation. ; in, , For observation data, This is the predicted state value. For the observation matrix, Indicates at time Based on recent The estimated variance calculated from the data points The number of data samples selected to calculate the variance, i.e., from the current time. The number of samples traced back. It is the loop index variable in the summation formula, and its value ranges from... arrive , Indicates the first Error value at each moment; The variance of non-Gaussian impulse noise was calculated using the median absolute deviation (MAD). ; in, This represents the standard deviation estimate obtained based on a specific calculation method, the calculation of which depends on the window size. and the current moment of the time series , The constant coefficients, That is, the absolute deviation of the median. Representing time series In the middle, from the first The moment to the A subset of data at each moment; The noise mixing factor is estimated using the Kullback-Leibler divergence, or KL divergence for short. ; in, Relative entropy is used to measure the probability distribution between two probability distributions. and The degree of difference between them It is a probability distribution. The mean is The variance is The normal distribution is the mean parameter of the normal distribution; This formula is used to quantify the proportion of Gaussian noise in CAN bus communication. , This represents the proportion of non-Gaussian noise; According to the formula Update process noise covariance According to the formula Update observation noise covariance ,in Forgetting factor, The sampling period; based on and Calculate the interference level of CAN bus communication: when and When, it is judged as low interference; when and When, it is determined to be medium interference; when and At that time, it was determined to be high interference.
6. The method for automatic parsing of CAN bus based on LabVIEW platform according to claim 1, characterized in that: In step S4, the Huber robust kernel function is used in the robust kernel function weighted Kalman filtering step. ; in, Kalman gain according to calculate, , for The first derivative, To predict the covariance matrix.
7. The method for automatic parsing of CAN bus based on LabVIEW platform according to claim 1, characterized in that: In step S4, the density clustering anomaly grading processing step is used to monitor abnormal states of CAN bus communication, specifically including: Define the set of data points within the clustering window , ; Calculate each data point - Neighborhood density: ; like and ,in If this occurs, it is determined to be a sudden abnormality in CAN bus communication, and the following measures are taken: Correction; if and If so, it is determined to be a gradual abnormality in CAN bus communication, and the following measures are taken: ,and This is a noise estimate; Then, record the timestamp of the anomaly, the anomaly type, and the interference intensity to form a CAN bus communication anomaly monitoring log.
8. The method for automatic parsing of CAN bus based on LabVIEW platform according to claim 1, characterized in that: In step S6, the graphical display content of the human-computer interaction module includes: Communication monitoring panel: CAN bus communication link quality score, noise type percentage pie chart, real-time interference level indicator, anomaly type and frequency statistics; Data display panel: waveform curves of raw data, corrected data, and analytical results, and instantaneous signal value boxes; The interactive controls support DBC file loading, CAN communication start / stop, signal filtering, calibration model parameter adjustment, and communication monitoring log export.
9. The method for automatic parsing of CAN bus based on LabVIEW platform according to claim 1, characterized in that: In step S6, the data record storage format is CSV, which includes timestamp, signal name, original value, correction value, parsed value, noise type, interference level, anomaly level, and communication link parameter fields.