Search

CN-122001964-A - Automatic analysis method based on LabVIEW platform CAN bus

CN122001964ACN 122001964 ACN122001964 ACN 122001964ACN-122001964-A

Abstract

The invention discloses a method for automatically analyzing CAN bus based on LabVIEW platform, which relates to the technical field of CAN bus communication network monitoring and comprises the following steps of S1, constructing a platform cooperation module, S2, extracting analysis rules in a file, S3, collecting data in real time, S4, communication monitoring and correcting, S5, automatically analyzing and converting, S6, and displaying and recording results. The invention integrates the whole flow of CAN bus data acquisition, analysis, display and recording, thoroughly solves the problems of fragmentation, poor real-time performance, dependence on manual experience and insufficient visualization of the traditional scheme operation, realizes one-key high-efficiency operation through the standardized module design and the automatic analysis algorithm, improves the accuracy and consistency of data analysis through the basic anti-interference mechanism optimization, and provides stable and reliable technical support for equipment state monitoring and fault diagnosis in the fields of automobile electronics, industrial control and the like.

Inventors

  • LIU SHUANG
  • ZOU LIN
  • PENG XIAOQIANG
  • LIU HAO

Assignees

  • 武汉森木磊石科技有限公司

Dates

Publication Date
20260508
Application Date
20260112

Claims (9)

  1. 1. A method for automatically analyzing CAN bus based on LabVIEW platform is characterized by comprising the following steps: S1, constructing a platform cooperation module: Constructing a CAN interface module, an analysis configuration module, a data processing module and a man-machine interaction module which work cooperatively in a LabVIEW software platform, wherein a CAN bus communication monitoring and mixing self-adaptive correction sub-module is integrated in the data processing module; S2, extracting analysis rules in the file: Loading and identifying a standard CAN database file, namely a DBC file, extracting analysis rules such as signal definition, message ID, signal start bit, signal length, scaling and offset by the analysis configuration module, converting the analysis rules into a cluster or array data structure which CAN be processed by LabVIEW to form an analysis rule library; S3, collecting data in real time: the CAN interface module is physically connected to a CAN bus communication network to be tested, acquires CAN bus original data frames and communication link state parameters in real time, and synchronously transmits the CAN bus original data frames and the communication link state parameters to the data processing module; s4, communication monitoring correction: The CAN bus communication monitoring and mixing self-adaptive correction submodule sequentially performs: monitoring a communication link, namely identifying the type of mixed noise, the interference intensity and the abnormal communication state in CAN bus communication in real time; bayes self-adaptive noise covariance updating, namely dynamically adjusting noise covariance parameters based on the monitored noise characteristics; the robust kernel function weighting Kalman filtering is used for restraining the interference of mixed noise to communication data; Classifying and identifying communication burst abnormality and gradual change abnormality, and outputting corrected data stream and communication monitoring result; s5, automatic analysis and conversion: The data processing module calls the analysis rule library, executes an automatic analysis algorithm based on the DBC file on the corrected data stream, and converts the data stream into a signal value with physical significance; S6, result display and record: the man-machine interaction module graphically displays the analyzed physical signal value, the data comparison before and after correction and the CAN bus communication monitoring result in real time, and automatically records and stores related data and monitoring logs.
  2. 2. The method for automatically analyzing CAN bus based on LabVIEW platform of claim 1, wherein in step S3, the real-time acquisition of CAN bus original data frames and communication link state parameters comprises signal transmission delay and frame loss rate.
  3. 3. The method for automatically analyzing based on the LabVIEW platform CAN bus according to claim 1, wherein in the step S4, the mixed noise type comprises Gaussian noise and non-Gaussian impulse noise; The communication burst abnormality comprises a bus instantaneous short circuit and electromagnetic spike interference, the gradual change abnormality comprises a link drift and continuous electromagnetic interference, and the communication monitoring result comprises a noise type duty ratio, an interference level and an abnormal frequency.
  4. 4. The method of claim 1, wherein in the step S3, the hardware carrier of the CAN interface module is PCIeCAN boards, supports the CAN2.0A/B protocol, has a data transmission rate of more than or equal to 1Mbps, and has a communication link state acquisition function to acquire parameters of signal transmission delay, frame loss rate and bus load rate.
  5. 5. The method for automatically analyzing CAN bus based on LabVIEW platform according to claim 1, wherein in step S4, the CAN bus communication monitoring and mixing self-adaptive noise covariance updating step of the self-adaptive correction submodule is used for monitoring the noise characteristics in the CAN bus communication in real time, and specifically comprises the following steps: based on the residual sequence in the sliding window, gaussian noise variance is obtained through maximum likelihood estimation: ; Wherein, the , In order to observe the data of the object, As a result of the state prediction value, In order to observe the matrix, Is shown at the moment Based on the latest The variance of the estimates calculated from the individual data, The number of data samples selected for calculating the variance, i.e. from the current moment The number of samples traced back in the forward direction, Is a cyclic index variable in the summation formula, which ranges from To the point of , Represent the first Error values at each instant; Calculating non-Gaussian impulse noise variance by adopting median absolute deviation MAD: ; Wherein, the Representing standard deviation estimates based on a particular calculation scheme, the calculation of which depends on window size The current time of the time series , Is a constant coefficient of the number of the pieces of the material, I.e. the absolute deviation of the median, Representing a time series From the first From moment to moment A subset of data at each time instant; Estimating noise mixing coefficients through Kullback-Leibler divergence, called KL divergence for short: ; Wherein, the Representing relative entropy for measuring two probability distributions And The degree of difference between the two, Is a distribution of the probability that the probability, Mean value is expressed as Variance is Is used for the normal distribution of the (c), Is a normal distributed average parameter; the formula is used for quantifying the duty ratio of Gaussian noise in CAN bus communication , Then the non-gaussian noise ratio; According to the formula Updating process noise covariance According to the formula Updating observed noise covariance Wherein As a forgetting factor, Is the sampling period; Based on And (3) with Calculating the communication interference level of the CAN bus when And is also provided with When it is determined as low interference And is also provided with When it is judged as middle interference, when And is also provided with In this case, high interference is determined.
  6. 6. The method for automatically analyzing CAN bus based on LabVIEW platform of claim 1, wherein in step S4, in the step of weighting Kalman filtering by using a robust kernel function, huber robust kernel function is adopted: ; Wherein, the Kalman gain press The calculation is performed such that, , Is that Is used as a first derivative of (a), Is the prediction covariance matrix.
  7. 7. The method for automatically analyzing CAN bus based on LabVIEW platform of claim 1, wherein in step S4, the density clustering anomaly classification processing step is used for monitoring the communication anomaly state of the CAN bus, and specifically comprises the following steps: Defining a set of data points within a cluster window , ; Calculate each data point Neighborhood density: ; If it is And is also provided with Wherein If the CAN bus communication burst is determined to be abnormal, adopting Correction of if And is also provided with If the CAN bus communication gradual change abnormality is determined, adopting While Is a noise estimate; And recording the abnormal occurrence time stamp, the abnormal type and the interference intensity to form a CAN bus communication abnormal monitoring log.
  8. 8. The method for automatically analyzing CAN bus based on LabVIEW platform of claim 1, wherein in step S6, the graphical display content of the human-computer interaction module comprises: The communication monitoring panel is used for carrying out quality scoring, noise type duty ratio cake diagram, interference level real-time indicator, anomaly type and frequency statistics on the CAN bus communication link; the data display panel is used for displaying the waveform curves of the original data, the corrected data and the analysis results and the signal instantaneous value numerical frame; the interaction control supports DBC file loading, CAN communication start and stop, signal screening, correction model parameter adjustment and communication monitoring log export.
  9. 9. The method of claim 1, wherein in the step S6, the data record storage format is CSV format, and includes time stamp, signal name, original value, correction value, analysis value, noise type, interference level, abnormal level, and communication link parameter field.

Description

Automatic analysis method based on LabVIEW platform CAN bus Technical Field The invention relates to the technical field of CAN bus communication network monitoring, in particular to a method for automatically analyzing a CAN bus based on a LabVIEW platform. Background The CAN bus is used as an industrial field core communication network, the communication reliability of the CAN bus directly determines the operation safety of equipment, real-time monitoring, interference identification and data analysis of the communication state of the CAN bus are key links for guaranteeing the communication quality, the CAN bus is widely applied to strong electromagnetic interference scenes such as automobile electronics and industrial control, the communication process is easily influenced by Gaussian noise and non-Gaussian impulse noise (such as electromagnetic peak of an ignition system), and communication anomalies such as instantaneous short circuit of the bus and link drift CAN occur. The typical flow of the existing CAN bus data analysis scheme is that a general CAN card is adopted to match with official software to collect data, files are exported and then analyzed by manual or script offline, and the scheme has the obvious defects of fragmented operation flow, low automation degree, poor analysis instantaneity, incapability of meeting the dynamic monitoring requirement, dependence on manual experience and unstable analysis accuracy. Disclosure of Invention Aiming at the defects of the prior art, the invention provides a method for automatically analyzing CAN bus based on LabVIEW platform, which solves the problems in the prior art. The method for automatically analyzing the CAN bus based on the LabVIEW platform comprises the following steps of: S1, constructing a platform cooperation module: Constructing a CAN interface module, an analysis configuration module, a data processing module and a man-machine interaction module which work cooperatively in a LabVIEW software platform, wherein a CAN bus communication monitoring and mixing self-adaptive correction sub-module is integrated in the data processing module; S2, extracting analysis rules in the file: Loading and identifying a standard CAN database file, namely a DBC file, extracting analysis rules such as signal definition, message ID, signal start bit, signal length, scaling and offset by the analysis configuration module, converting the analysis rules into a cluster or array data structure which CAN be processed by LabVIEW to form an analysis rule library; S3, collecting data in real time: the CAN interface module is physically connected to a CAN bus communication network to be tested, acquires CAN bus original data frames and communication link state parameters in real time, and synchronously transmits the CAN bus original data frames and the communication link state parameters to the data processing module; s4, communication monitoring correction: The CAN bus communication monitoring and mixing self-adaptive correction submodule sequentially performs: monitoring a communication link, namely identifying the type of mixed noise, the interference intensity and the abnormal communication state in CAN bus communication in real time; bayes self-adaptive noise covariance updating, namely dynamically adjusting noise covariance parameters based on the monitored noise characteristics; the robust kernel function weighting Kalman filtering is used for restraining the interference of mixed noise to communication data; Classifying and identifying communication burst abnormality and gradual change abnormality, and outputting corrected data stream and communication monitoring result; s5, automatic analysis and conversion: The data processing module calls the analysis rule library, executes an automatic analysis algorithm based on the DBC file on the corrected data stream, and converts the data stream into a signal value with physical significance; S6, result display and record: the man-machine interaction module graphically displays the analyzed physical signal value, the data comparison before and after correction and the CAN bus communication monitoring result in real time, and automatically records and stores related data and monitoring logs. Further, in the step S3, the real-time acquisition of the CAN bus original data frame and the communication link state parameters includes signal transmission delay and frame loss rate. Further, in the step S4, the mixed noise type includes gaussian noise and non-gaussian impulse noise; The communication burst abnormality comprises a bus instantaneous short circuit and electromagnetic spike interference, the gradual change abnormality comprises a link drift and continuous electromagnetic interference, and the communication monitoring result comprises a noise type duty ratio, an interference level and an abnormal frequency. In step S3, the hardware carrier of the CAN interface module is PCIeCAN boards, supports the CAN2.0a/B protoco