CN-122027459-A - Bus communication data processing method, device and equipment
Abstract
The application discloses a processing method, a device and equipment of bus communication data, belonging to the technical field of communication, wherein the method comprises the steps of determining a metadata set of signals corresponding to communication frame identifiers based on DBC files and the communication frame identifiers in the bus communication data; the metadata set comprises a signal start bit, a signal length, a coding type, a scaling factor and a signal offset, wherein the signal start bit, the signal start bit and the signal length are based on the coding type, the signal length and the signal length of a signal corresponding to a communication frame identifier, bit field extraction is carried out on bus communication data to obtain an original value of the signal corresponding to the communication frame identifier, the scaling factor and the signal offset of the signal corresponding to the communication frame identifier are based on the scaling factor and the signal offset of the signal corresponding to the communication frame identifier, an analysis value is obtained, and a visual image of the corresponding signal is generated based on the analysis value and a preset time axis of the signal corresponding to the communication frame identifier, wherein the time axis in the visual image is identical to the preset time axis. The scheme improves the time axis alignment efficiency of the signal visual image.
Inventors
- SI WENKUI
- CHEN SI
- CHEN HAO
- GONG KAN
Assignees
- 东风汽车集团股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260106
Claims (10)
- 1. A method for processing bus communication data, comprising: Determining a metadata set of signals corresponding to communication frame identifiers based on the communication frame identifiers in a DBC file and bus communication data, wherein the metadata set comprises signal start bits, signal lengths, coding types, scaling factors and signal offsets; performing bit field extraction on the bus communication data based on the coding type, the signal start bit and the signal length of the signal corresponding to the communication frame identifier to obtain an original value of the signal corresponding to the communication frame identifier; converting the original value based on the scaling factor and the signal offset of the signal corresponding to the communication frame identifier to obtain an analysis value; And generating a visual image of the corresponding signal based on the analysis value of the signal corresponding to the communication frame identifier and a preset time axis, wherein the time axis in the visual image is the same as the preset time axis.
- 2. The method for processing bus communication data according to claim 1, wherein the performing bit field extraction on the bus communication data based on the coding type, the signal start bit and the signal length of the signal corresponding to the communication frame identifier to obtain an original value of the signal corresponding to the communication frame identifier includes: if the coding type of the signal corresponding to the communication frame identifier is Intel format coding, determining a byte start bit and a first bit offset based on the signal start bit; if the signal does not cross bytes, constructing a mask based on the signal length; and carrying out bit field extraction on the bus communication data based on the byte start bit, the first bit offset and the mask to obtain an original value of a signal corresponding to the communication frame identifier.
- 3. The method of processing bus communication data according to claim 2, wherein after said determining a byte start bit and a first bit offset based on said signal start bit, said method further comprises: if the signal spans bytes, performing a bit field extraction operation on the bus communication data from the signal start bit based on the signal start bit, the signal length, the byte start bit and the first bit offset until the operation frequency is the same as the signal length, and obtaining an original value of the signal corresponding to the communication frame identifier, wherein the bit field extraction operation includes: determining a current bit corresponding to the current bit field extraction operation, wherein the current bit corresponding to the first bit field extraction operation is the signal start bit; determining a current byte index based on the byte start bit, the first bit offset, and the current bit; determining a current bit index based on the first bit offset and the current bit; An original value of the current bit is extracted from the bus communication data based on the current byte index and the current bit index.
- 4. The method for processing bus communication data according to claim 1, wherein the performing bit field extraction on the bus communication data based on the coding type, the signal start bit and the signal length of the signal corresponding to the communication frame identifier to obtain an original value of the signal corresponding to the communication frame identifier includes: If the coding type of the signal corresponding to the communication frame identifier is a Motorola format code, determining a byte start bit based on the signal start bit; Determining a number of signal bytes occupied based on the signal start bit and the signal length; Extracting a target byte data segment in the bus communication data according to the number of bytes occupied by the signal from the byte start bit; Performing byte reverse sequence reorganization on the target byte data segment; determining a second bit offset based on the number of signal bytes occupied, the signal start bit, and the signal length; and starting from the highest bit of the recombined data segment, extracting the bit field of the recombined data segment according to the second bit offset and the signal length to obtain the original value of the signal corresponding to the communication frame identifier.
- 5. The method according to claim 1, wherein the visualized image includes a coordinate axis and a time-resolved value curve of a signal corresponding to the communication frame identifier, and the generating the visualized image of the corresponding signal based on the resolved value of the signal corresponding to the communication frame identifier and a preset time axis includes: determining a fifth percentile and a ninety-fifth percentile based on all of the resolved values of the signals corresponding to the communication frame identifications; determining a range of a longitudinal axis of the coordinate axis based on the fifth percentile and the ninety-fifth percentile; determining the preset time axis as the transverse axis of the coordinate axis; And generating a time-resolved value curve based on the time stamp and the resolved value of the signal corresponding to the communication frame identification.
- 6. The method for processing bus communication data according to claim 5, further comprising: If a zoom operation or a movement operation of a cursor line for the transverse axis of any visual view is detected, the transverse axis or the cursor line of other visual views is correspondingly and synchronously updated.
- 7. The method for processing bus communication data according to claim 5, further comprising: Determining an effective range of an analytic value of a signal corresponding to the communication frame identifier based on the DBC file; if the analysis value of the signal corresponding to the communication frame identifier is not in the effective range, determining an associated signal set of the signal corresponding to the communication frame identifier based on the DBC file; and displaying the abnormal information of the signal corresponding to the communication frame identifier in the visual image corresponding to the associated signal set.
- 8. The method according to claim 5, wherein generating a time-resolved value curve based on the time stamp and the resolved value of the signal corresponding to the communication frame identifier, comprises: determining an analysis value density based on the time stamp of the signal corresponding to the communication frame identifier and the number of analysis values; If the resolution value density is larger than a preset density threshold value, downsampling the resolution value; Based on the analysis value after the down-sampling processing and the corresponding time stamp, a piecewise linear interpolation algorithm is adopted to generate a time-analysis value curve.
- 9. A processing apparatus for bus communication data, comprising: The system comprises a metadata determining module, a data processing module and a data processing module, wherein the metadata determining module is used for determining a metadata set of signals corresponding to communication frame identifiers based on the communication frame identifiers in a DBC file and bus communication data, wherein the metadata set comprises a signal start bit, a signal length, a coding type, a scaling factor and a signal offset; The original value extraction module is used for extracting the bit field of the bus communication data based on the coding type, the signal start bit and the signal length of the signal corresponding to the communication frame identifier to obtain the original value of the signal corresponding to the communication frame identifier; the analysis value determining module is used for converting the original value based on the scaling factor and the signal offset of the signal corresponding to the communication frame identifier to obtain an analysis value; And the image generation module is used for generating a visual image of the corresponding signal based on the analysis value of the signal corresponding to the communication frame identifier and a preset time axis, wherein the time axis in the visual image is the same as the preset time axis.
- 10. A processing device for bus communication data, comprising a processor and a memory, characterized in that the memory stores computer program instructions executable by the processor, which processor, when executing the computer program instructions, implements the steps of the method according to any of claims 1 to 8.
Description
Bus communication data processing method, device and equipment Technical Field The present application belongs to the field of communication technologies, and in particular, to a method, an apparatus, and a device for processing bus communication data. Background The bus communication data are communication data commonly used by vehicles, and analysis of the bus communication data is a core means for vehicle state monitoring, fault diagnosis, performance evaluation and algorithm verification. In the industry, a three-level segmentation processing scheme is generally adopted for processing such data, specifically, in the first stage, a special analysis tool (such as Vector CANoe) is used for loading a controller area network Database (DBC) file for describing bus signal definition, binary log format (Binary Logging Format, BLF) data is analyzed by the DBC file, CSV format files containing time stamps and signal values of all signals are output, in the second stage, CSV format files of target signals are screened through a Python script, and in the third stage, a desktop graphic library such as Matplotlib is called to generate independent graphs of single signals in the target signals based on the CSV format files. The engineer needs to manually adjust the time axes of the independent graphs one by one to align the time axes of the independent graphs for signal correlation analysis. According to the three-stage segmentation processing scheme, engineers are required to spend a large amount of time to manually align time axes of different independent graphs, the process is high in repeated labor intensity, alignment accuracy is affected by human factors, and the problem of low alignment efficiency of the time axes exists. Disclosure of Invention The embodiment of the application provides a processing method, a device and equipment of bus communication data, and further can improve the time axis alignment efficiency of visual images of different signals at least to a certain extent. Other features and advantages of the application will be apparent from the following detailed description, or may be learned by the practice of the application. According to a first aspect of an embodiment of the present application, there is provided a method for processing bus communication data, including: Determining a metadata set of signals corresponding to BLF data communication frame identifiers based on the communication frame identifiers in the DBC file and the bus communication data, wherein the metadata set comprises signal start bits, signal length, coding types, scaling factors and signal offset; Performing bit field extraction on BLF data bus communication data based on the coding type, the signal start bit and the signal length of the signal corresponding to the BLF data communication frame identifier to obtain an original value of the signal corresponding to the BLF data communication frame identifier; converting the original value of the BLF data based on the scaling factor and the signal offset of the signal corresponding to the BLF data communication frame identifier to obtain an analysis value; And generating a visual image of the corresponding signal based on the analysis value of the signal corresponding to the BLF data communication frame identifier and a preset time axis, wherein the time axis in the BLF data visual image is the same as the BLF data preset time axis. In some embodiments, the BLF data performs bit field extraction on the BLF data bus communication data based on the encoding type, the signal start bit, and the signal length of the signal corresponding to the BLF data communication frame identifier, to obtain an original value of the signal corresponding to the BLF data communication frame identifier, including: if the encoding type of the signal corresponding to the BLF data communication frame identifier is Intel format encoding, determining a byte start bit and a first bit offset based on the BLF data signal start bit; If the signal does not span bytes, constructing a mask based on the BLF data signal length; And performing bit field extraction on the BLF data bus communication data based on the BLF data byte start bit, the BLF data first bit offset and the BLF data mask to obtain an original value of a signal corresponding to the BLF data communication frame identifier. In some embodiments, after the BLF data determines the byte start bit and the first bit offset based on the BLF data signal start bit, the method of processing the bus communication data further comprises: If the signal spans bytes, performing a bit field extraction operation on the BLF data bus communication data from the BLF data signal start bit based on the BLF data signal start bit, the BLF data signal length, the BLF data byte start bit, and the BLF data first bit offset until the operation number is the same as the BLF data signal length, to obtain an original value of the signal corresponding to the BLF data communica