Complete vehicle CAN message analysis method, device, equipment and medium
By traversing the entire vehicle's CAN messages and performing diagnostic signal fitting, the target offset and scaling factor are determined, solving the problem of low efficiency in vehicle CAN message parsing. This enables efficient and accurate automated CAN signal parsing, reducing manpower and time costs.
Patent Information
- Application Number
- CN202511180433.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-10-03
AI Technical Summary
In the existing technology, the efficiency and accuracy of vehicle CAN message parsing are low, and it is impossible to process massive signal data in a timely and accurate manner, resulting in a waste of manpower and time resources and inconsistent DBC file quality.
By traversing the CAN messages of the entire vehicle, selecting valid fields and determining the theoretical values of the CAN signals, fitting them using the physical values of the diagnostic signals, calculating the target offset and scaling factor, and combining the Pearson correlation coefficient to screen out the signals to be analyzed, automated analysis is achieved.
The efficiency and accuracy of CAN message parsing are improved, the manpower and time costs are reduced, and the quality consistency of the generated DBC files is improved.
Smart Images

Figure CN120751041A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of signal analysis technology, and in particular to a method, device, equipment and medium for parsing vehicle CAN messages. Background Art
[0002] With the rapid development of in-vehicle electronic systems, the Controller Area Network (CAN) bus, the core architecture for internal vehicle communications, has seen a significant increase in scale and complexity. The widespread use of multi-domain controllers in intelligent connected vehicle technologies has led to the significant challenges of large data volumes and complex signal correlations in CAN message parsing, severely impacting parsing efficiency and accuracy. Consequently, an efficient and reliable CAN message parsing method is urgently needed to meet the technical requirements of vehicle communication system design and operation. Summary of the Invention
[0003] The present application provides a method, device, equipment and medium for parsing the CAN message of a whole vehicle, which solves the technical problems of low efficiency and low accuracy of the current whole vehicle CAN message parsing. By automatically cleaning, fitting and screening CAN signals based on diagnostic signals, the parsing workload is greatly reduced, the efficiency and accuracy of the whole vehicle CAN signal parsing are improved, and the cost of DBC file generation is reduced.
[0004] In order to achieve the above objectives, the main technical solutions adopted in this application include:
[0005] In a first aspect, an embodiment of the present application provides a vehicle CAN message parsing method, the method comprising:
[0006] Traversing multiple target CAN signals corresponding to the vehicle CAN message, selecting valid fields of each target CAN signal during each traversal process, and determining the CAN signal theoretical value of each target CAN signal according to the valid fields; the vehicle CAN message also corresponds to a target diagnostic signal;
[0007] Fitting the diagnostic signal physical value of the target diagnostic signal and the CAN signal theoretical value to determine a target offset and a target scaling factor of each target CAN signal according to the fitting result;
[0008] The CAN signal physical value of each target CAN signal is determined according to the CAN signal theoretical value, the target offset and the target scaling factor, and the parsing result of the whole vehicle CAN message is determined according to the CAN signal physical value and the diagnostic signal physical value.
[0009] The parsing method proposed in the embodiment of the present application traverses multiple target CAN signals and selects valid fields to determine the theoretical value of the CAN signal, providing an accurate data basis for subsequent CAN message parsing. Subsequently, the accuracy and reliability of the physical value of the diagnostic signal are used to fit the diagnostic signal physical value of the target diagnostic signal with the theoretical value of the CAN signal, which can make the target offset and target scaling factor obtained by fitting more accurate, thereby calculating the accurate CAN signal physical value based on the accurate target offset and target scaling factor. Compared with related technologies, the method proposed in the embodiment of the present application can realize the automatic screening and parsing of CAN signals. When faced with a large number of vehicle CAN message parsing tasks, it can quickly and accurately complete the CAN signal parsing, while ensuring the accuracy of CAN message parsing, it also greatly improves the parsing efficiency and reduces costs.
[0010] Optionally, in some embodiments of the present application, before traversing multiple target CAN signals corresponding to the vehicle CAN message, the method further includes:
[0011] Obtain multiple initial CAN signals included in the vehicle CAN message;
[0012] Determining an initial diagnostic signal in the vehicle CAN message according to a preset data identifier;
[0013] The multiple initial CAN signals are cleaned according to the timestamp of the initial diagnostic signal to obtain the target diagnostic signal and the multiple target CAN signals.
[0014] The embodiment of the present application utilizes the timestamp of the initial diagnostic signal to perform cleaning processing on multiple initial CAN signals, which can quickly remove data that does not match or has low correlation with the timestamp of the diagnostic signal, thereby utilizing the target diagnostic signal and multiple target CAN signals obtained after the cleaning process, thereby greatly reducing the amount of data subsequently traversed and parsed, effectively improving the efficiency of CAN message parsing, and reducing the costs of computing resources and time consumption caused by processing a large amount of redundant data.
[0015] Optionally, in some embodiments of the present application, the cleaning the multiple initial CAN signals according to the timestamp of the initial diagnostic signal to obtain the target diagnostic signal and the multiple target CAN signals includes:
[0016] determining a frequency of the initial diagnostic signal according to a timestamp of the initial diagnostic signal, and screening out a first intermediate CAN signal having a frequency higher than the frequency from the plurality of initial CAN signals;
[0017] filtering out a data frame closest to the timestamp in each of the first intermediate CAN signals, and generating a second intermediate CAN signal based on the filtered data frames;
[0018] Frame number reduction processing is performed on the initial diagnostic signal and the second intermediate CAN signal respectively according to a preset frame number to obtain the processed target diagnostic signal and the multiple target CAN signals.
[0019] The present embodiment utilizes multiple cleaning processes to improve the efficiency of subsequent CAN message parsing. First, the timestamp of the initial diagnostic signal is used to remove initial CAN signals whose signal frequencies do not match the initial diagnostic signal, significantly reducing the amount of data subsequently traversed and parsed. Subsequently, based on the timestamp of the initial diagnostic signal, the data frames of the first intermediate CAN signal are optimized to ensure that the resulting second intermediate CAN signal has the same number of frames as the initial diagnostic signal. Frame reduction processing is then performed on both the initial diagnostic signal and the second intermediate CAN signal, further reducing the amount of data to be parsed. This significantly shortens subsequent processing time and enables more efficient CAN message parsing.
[0020] Optionally, in some embodiments of the present application, selecting a valid field of each target CAN signal during each traversal process, and determining a CAN signal theoretical value of each target CAN signal according to the valid field, includes:
[0021] Convert each word bit of each target CAN signal into a first to-be-selected binary field;
[0022] Selecting a valid field of the target CAN signal from the first candidate field according to a first preset signal start bit, a first preset length, and a first encoding format;
[0023] The valid field of the target CAN signal is converted into a decimal theoretical value of the CAN signal according to the first data type.
[0024] The embodiments of the present application can flexibly set the corresponding signal bits, lengths, and encoding formats according to actual parsing requirements, thereby accurately determining the valid fields of the target CAN signal for subsequent parsing and avoiding interference from invalid data. In addition, the standardized data conversion and selection process facilitates automated data processing. When faced with massive amounts of CAN signals, the theoretical value can be determined quickly and accurately, thereby effectively improving the efficiency of CAN message parsing, reducing errors and time waste that may be caused by manual intervention, and reducing both labor and time costs.
[0025] Optionally, in some embodiments of the present application, determining the diagnostic signal physical value of the target diagnostic signal in the following manner includes:
[0026] Convert each word bit of the target diagnostic signal into a second to-be-selected binary field;
[0027] selecting a valid field of the target diagnostic signal from the second candidate field according to a second preset signal start bit, a second preset length, and a second encoding format;
[0028] Converting the valid field of the target diagnostic signal into a decimal theoretical value of the diagnostic signal according to the second data type;
[0029] A product of a theoretical value of the diagnostic signal and a preset scaling factor is determined, and the product is added to a preset offset to determine a physical value of the diagnostic signal according to the addition result.
[0030] The embodiments of the present application can accurately determine the valid fields of the target diagnostic signal for subsequent analysis, avoiding interference from invalid data. Furthermore, the standardized data processing process facilitates automated operation. When faced with a large number of target diagnostic signals, the physical values of the target diagnostic signal can be quickly and accurately determined, improving the efficiency of CAN message parsing, reducing manual errors and time consumption, and lowering both manpower and time costs.
[0031] Optionally, in some embodiments of the present application, fitting the diagnostic signal physical value of the target diagnostic signal and the CAN signal theoretical value to determine the target offset and target scaling factor of each target CAN signal according to the fitting result includes:
[0032] Constructing a linear fitting model of the CAN signal theoretical value and the diagnostic signal physical value, wherein the CAN signal theoretical value is an independent variable of the linear fitting model and the diagnostic signal physical value is a dependent variable of the linear fitting model;
[0033] Solving the regression parameters of the linear fitting model using the least squares method, wherein the regression parameters include the slope and intercept of the linear fitting model;
[0034] The slope is determined as a target scaling factor of the target CAN signal, and the intercept is determined as a target offset of the target CAN signal.
[0035] The embodiment of the present application takes the physical value of the diagnostic signal as a reference, and obtains the target offset and target scaling factor corresponding to the target CAN signal through linear fitting, so that the physical value of the CAN signal determined by using the target offset, target scaling factor and theoretical value of the CAN signal matches the changing trend of the physical value of the diagnostic signal in the time domain, and can automatically realize the linear fitting process. When faced with a large number of CAN signals and diagnostic signals, the analysis efficiency is effectively improved, the time consumption and possible errors caused by manual calculation are reduced, and the labor cost and time cost are reduced.
[0036] Optionally, in some embodiments of the present application, determining the parsing result of the vehicle CAN message according to the CAN signal physical value and the diagnostic signal physical value includes:
[0037] determining a Pearson correlation coefficient between each of the physical values of the CAN signal and the physical value of the diagnostic signal, and screening out a CAN signal to be analyzed from the plurality of target CAN signals according to the Pearson correlation coefficient;
[0038] The signal information of the CAN signal to be parsed is used as the parsing result of the vehicle CAN message, wherein the signal information includes at least one of a signal channel, a signal ID, a signal length, a signal start bit, the target scaling factor, the offset, and the Pearson correlation coefficient.
[0039] The embodiment of the present application uses the Pearson correlation coefficient to further analyze the degree of matching between the physical value of the CAN signal and the physical value of the diagnostic signal. Based on this, the CAN signal to be parsed that has a strong correlation with the physical value of the diagnostic signal can be screened out from multiple target CAN signals, and then the signal information of the CAN signal to be parsed is used as the parsing result of the whole vehicle CAN message, thereby realizing rapid and automatic parsing of the whole vehicle CAN message.
[0040] In a second aspect, an embodiment of the present application provides a vehicle CAN message parsing device, the device comprising:
[0041] a traversal module, configured to traverse multiple target CAN signals corresponding to a vehicle CAN message, select a valid field of each target CAN signal during each traversal, and determine a CAN signal theoretical value of each target CAN signal based on the valid field; the vehicle CAN message also corresponds to a target diagnostic signal;
[0042] a fitting module, configured to fit the diagnostic signal physical value of the target diagnostic signal and the CAN signal theoretical value, so as to determine a target offset and a target scaling factor of each target CAN signal according to the fitting result;
[0043] The parsing module is used to determine the CAN signal physical value of each target CAN signal according to the CAN signal theoretical value, the target offset and the target scaling factor, and to determine the parsing result of the vehicle CAN message according to the CAN signal physical value and the diagnostic signal physical value.
[0044] The parsing device proposed in the embodiment of the present application traverses multiple target CAN signals and selects valid fields to determine the theoretical value of the CAN signal, providing an accurate data basis for subsequent CAN message parsing. Subsequently, the diagnostic signal physical value of the target diagnostic signal is fitted with the CAN signal theoretical value by utilizing the accuracy and reliability of the diagnostic signal physical value, which can make the target offset and target scaling factor obtained by fitting more accurate, thereby calculating the accurate CAN signal physical value based on the accurate target offset and target scaling factor. Compared with the related art, the method proposed in the embodiment of the present application can realize the automatic screening and parsing of CAN signals. When faced with a large number of vehicle CAN message parsing tasks, it can quickly and accurately complete the CAN signal parsing, while ensuring the accuracy of CAN message parsing, it also greatly improves the parsing efficiency and reduces costs.
[0045] In a third aspect, an embodiment of the present application provides a computer device, including:
[0046] A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the CAN message parsing method described in the above embodiment by executing the computer instructions.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the vehicle CAN message parsing method described in the above embodiment. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the specific implementation methods or the description of the prior art. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0049] Figure 1 This is one of the flow charts of a vehicle CAN message parsing method proposed in an embodiment of the present application;
[0050] Figure 2 This is a second flow chart of a vehicle CAN message parsing method proposed in an embodiment of the present application;
[0051] Figure 3 This is a flowchart of a vehicle CAN message parsing method proposed in an embodiment of the present application;
[0052] Figure 4This is a fourth flow chart of a vehicle CAN message parsing method proposed in an embodiment of the present application;
[0053] FIG5( a ) is a schematic diagram of a valid field in an embodiment of the present application;
[0054] FIG5( b ) is a schematic diagram of a valid field in another embodiment of the present application;
[0055] Figure 6 An automated tool setting interface for a target diagnostic signal in an embodiment of the present application;
[0056] Figure 7 This is a fifth flow chart of a vehicle CAN message parsing method proposed in an embodiment of the present application;
[0057] Figure 8 A schematic diagram showing the trends of the physical values of the CAN signal and the physical values of the diagnostic signal in one embodiment of the present application;
[0058] Figure 9 This is a sixth flow chart of a vehicle CAN message parsing method proposed in an embodiment of the present application;
[0059] Figure 10 This is the parsing setting interface of the automation tool in one embodiment of the present application;
[0060] Figure 11 This is a structural diagram of a vehicle CAN message parsing device proposed in an embodiment of the present application;
[0061] Figure 12 A schematic diagram of the structure of a computer device proposed in an embodiment of the present application. DETAILED DESCRIPTION
[0062] To make the purpose, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of this application.
[0063] In the field of vehicle CAN signal analysis, engineers typically rely on their work experience to complete CAN message analysis through reverse engineering and then generate corresponding DBC files based on the analysis results. With the rapid development of intelligent connected vehicles and the large-scale application of multi-domain controllers, CAN message analysis faces challenges such as large data volumes and complex signal correlations, resulting in a sharp increase in the complexity of CAN message analysis. Manual analysis methods are unable to process the growing amount of signal data in a timely and accurate manner. Not only are they inefficient and consume a lot of manpower and time resources, but they are also prone to errors, resulting in inconsistent quality of the generated DBC files.
[0064] Therefore, an efficient and reliable CAN message parsing method is urgently needed to meet the technical requirements of vehicle communication system design and operation and maintenance.
[0065] According to an embodiment of the present application, an embodiment of a vehicle CAN message parsing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0066] In this embodiment, a vehicle CAN message parsing method is provided, which can be used in the above-mentioned vehicle electronic systems such as the communication system of the intelligent connected vehicle. Figure 1 This is one of the flow charts of the vehicle CAN message parsing method according to an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps:
[0067] Step S3, traverse multiple target CAN signals corresponding to the vehicle CAN message, select the valid field of each target CAN signal during each traversal process, and determine the CAN signal theoretical value of each target CAN signal based on the valid field; the vehicle CAN message also corresponds to a target diagnostic signal.
[0068] Specifically, the vehicle CAN message corresponds to multiple target CAN signals, which transmit data in a specific format. When traversing each target CAN signal, since the signal data may contain redundant or irrelevant information related to the CAN message parsing, valid fields are selected to reduce the amount of data processing and avoid interference from other data. The valid fields are the data in the target CAN signal that are truly relevant to the parsing. After extracting the valid fields, the embodiments of the present application convert these valid fields into decimal form according to specific numerical conversion rules to obtain the CAN signal theoretical value of each target CAN signal, which serves as the data basis for subsequent parsing.
[0069] Step S5 , fitting the diagnostic signal physical value of the target diagnostic signal and the CAN signal theoretical value to determine the target offset and target scaling factor of each target CAN signal according to the fitting result.
[0070] Specifically, the diagnostic signal physical value of the target diagnostic signal reflects the true value of a physical quantity in the actual operation of the vehicle. In order to make the theoretical value of the CAN signal more accurately reflect the actual physical situation, the embodiment of the present application uses the diagnostic signal physical value as a benchmark, quantifies the correspondence between the diagnostic signal physical value and the CAN signal theoretical value by fitting the two, and characterizes this quantization result with a target offset and a target scaling factor. The target scaling factor is used to adjust the ratio of the CAN signal theoretical value to match the magnitude of the actual physical value, and the target offset is used to modify the deviation between the CAN signal theoretical value and the actual physical value corresponding to the target CAN signal, so as to ensure that the adjusted CAN signal theoretical value accurately corresponds to the actual physical value.
[0071] Step S7, determining the CAN signal physical value of each target CAN signal according to the CAN signal theoretical value, the target offset and the target scaling factor, and determining the parsing result of the vehicle CAN message according to the CAN signal physical value and the diagnostic signal physical value.
[0072] Specifically, the theoretical value of the CAN signal obtained in step S3 is combined with the target offset and the target scaling factor to perform a calculation. Specifically, the theoretical value of the CAN signal is multiplied by the target scaling factor and then added to the target offset. The resulting value is the physical value of the CAN signal, which approximates the actual physical value corresponding to the target CAN signal. Further similarity analysis is then performed between the physical values of the CAN signal and the physical values of the diagnostic signal to select a specific CAN signal from among multiple target CAN signals. This CAN signal and its corresponding information, such as its ID, start bit, length, offset, and scaling factor, are the relevant data information for CAN message parsing.
[0073] The parsing method provided in this embodiment traverses multiple target CAN signals and selects valid fields to determine the theoretical value of the CAN signal, providing an accurate data basis for subsequent CAN message parsing. Subsequently, the diagnostic signal physical value of the target diagnostic signal is fitted with the CAN signal theoretical value by utilizing the accuracy and reliability of the diagnostic signal physical value, which can make the target offset and target scaling factor obtained by fitting more accurate, thereby calculating the accurate CAN signal physical value based on the accurate target offset and target scaling factor. Compared with related technologies, the method proposed in the embodiment of the present application can realize the automatic screening and parsing of CAN signals. When faced with a large number of vehicle CAN message parsing tasks, it can quickly and accurately complete the CAN signal parsing, while ensuring the accuracy of CAN message parsing, it also greatly improves the parsing efficiency and reduces costs.
[0074] Figure 2 The second flowchart of the vehicle CAN message parsing method according to an embodiment of the present application is shown. Before the above step S3, the method further includes step S1, which may include the following steps:
[0075] Step S11, obtaining multiple initial CAN signals included in the vehicle CAN message.
[0076] Specifically, vehicle CAN messages, serving as a vehicle network carrier for transmitting information, contain signal data used to characterize various vehicle states and functions. In some embodiments of the present application, an OBD port on the driver's side of the vehicle is connected to one end of a Fire2 device via a CAN wiring harness. The other end of the Fire2 device is connected to a computer via an Ethernet cable, and data acquisition software (such as vehicle spy software) reads and displays the initial CAN signals.
[0077] Step S13: determining the initial diagnostic signal in the vehicle CAN message according to the preset data identifier.
[0078] Specifically, in some embodiments of the present application, another OBD interface under the main driver's seat of the vehicle is extended to multiple connection ends through a one-to-many wiring harness, one end of the diagnostic instrument is connected to one of the connection ends, and the other end of the diagnostic instrument is connected to the data acquisition software via wired or Bluetooth to read and display the diagnostic signal.
[0079] Furthermore, in some examples of the present application, the initial diagnostic signal can be the longitudinal acceleration signal of the VCU. By combining the physical value of the VCU longitudinal acceleration displayed in real time by the diagnostic instrument and the transitions in the data frame in Vehicle Spy, the channel, ID, encoding format, symbol type, signal start bit, length, preset scaling factor, preset offset, DID, and DID data bits of the initial diagnostic signal can be obtained. By editing and exporting the .asc format message in Vehicle Spy, the initial diagnostic signal can be identified in the CAN message using the channel, ID, DID, and DID data bits.
[0080] For example, assume that the channel in the CAN message is "1" and the data length is 8, and the DID of the initial diagnostic signal is set to "90" and "08", and the DID data bits are 3 and 4, that is, the hexadecimal data of the third and fourth bits in the data of the initial diagnostic signal are 90 and 0, respectively. Thus, the following data in the CAN message is determined to be the initial diagnostic signal:
[0081] "0.294776 1 324Rx d 8 01BF 90 08 03D1 0D 70"
[0082] The first column indicates the corresponding timestamp is "0.294776," the second column indicates the channel is "1," the third column indicates the ID is "324," the fourth column "Rx" indicates the signal is a received signal, the fifth column "d" indicates the data identifier field, the sixth column indicates the data length is 8, and columns seven through fourteen are the data corresponding to the initial diagnostic signal. As can be seen, the ninth and tenth columns correspond to DID data bits 3 and 4, respectively, and the corresponding DIDs are "90" and "08," confirming that this data is the initial diagnostic signal.
[0083] Step S15 , cleaning the multiple initial CAN signals according to the timestamps of the initial diagnostic signals to obtain a target diagnostic signal and multiple target CAN signals.
[0084] Specifically, for each initial CAN signal, a cleaning process is performed with reference to the timestamp of the initial diagnostic signal to remove part of the initial CAN signal that is completely mismatched with the initial diagnostic signal in terms of time scale, and the remaining initial CAN signals are processed accordingly with the data frames of the initial diagnostic signals to obtain target diagnostic signals and multiple target CAN signals with the same number of data frames, so as to facilitate subsequent screening of target CAN signals based on the target diagnostic signals.
[0085] Therefore, the embodiment of the present application uses the timestamp of the initial diagnostic signal to clean multiple initial CAN signals, which can quickly remove data that does not match or has low correlation with the timestamp of the diagnostic signal, thereby using the target diagnostic signal and multiple target CAN signals obtained after the cleaning process, greatly reducing the amount of data subsequently traversed and parsed, effectively improving the efficiency of CAN message parsing, and reducing the costs of computing resources and time consumption caused by processing a large amount of redundant data.
[0086] Furthermore, Figure 3 The third flow chart of the vehicle CAN message parsing method according to the embodiment of the present application is shown as follows: Figure 3 As shown, the above step S15 may further include the following steps:
[0087] Step S151 : determining the frequency of the initial diagnostic signal according to the timestamp of the initial diagnostic signal, and screening out a first intermediate CAN signal having a higher frequency from a plurality of initial CAN signals.
[0088] Specifically, the timestamp is the moment when each data point of the initial diagnostic signal is generated, and its frequency is determined by analyzing and calculating the number of timestamps per unit time. CAN message parsing is based on the vehicle's feedback on the diagnostic instrument's diagnostic request and filters out the CAN signal closest to this feedback. Therefore, during the cleaning process, the embodiment of the present application first filters out the first intermediate CAN signal with a frequency higher than the above-mentioned frequency. Initial CAN signals below the above-mentioned frequency can be considered to have no correlation with the initial diagnostic signal, and therefore these initial CAN signals are directly filtered out, which helps improve the efficiency of subsequent parsing.
[0089] Step S153 , filtering out the data frames closest to the timestamp in each first intermediate CAN signal, and generating a second intermediate CAN signal based on the filtered data frames.
[0090] Specifically, each first intermediate CAN signal is composed of data frames, each of which carries its own timestamp. The timestamps of each data frame in the first intermediate CAN signal are compared one by one with the timestamp of the initial diagnostic signal. The data frames with the smallest timestamp difference are selected, i.e., the data frames closest to the timestamp of the initial diagnostic signal. These selected data frames are then used to form the second intermediate CAN signal, ensuring that the number of data frames in the second intermediate CAN signal and the initial diagnostic signal are equal.
[0091] Step S155 , performing frame number reduction processing on the initial diagnostic signal and the second intermediate CAN signal according to a preset frame number, so as to obtain a processed target diagnostic signal and a plurality of target CAN signals.
[0092] Specifically, in some examples of the embodiments of the present application, assuming that the number of data frames of the second intermediate CAN signal and the initial diagnostic signal are both 1254, in order to further reduce the amount of data processing, the python language can be used to evenly select the retained data frames, thereby reducing the number of frames of the second intermediate CAN signal and the initial diagnostic signal to 50 respectively, and then obtaining a target diagnostic signal with a frame number of 50 and multiple target CAN signals.
[0093] Therefore, the embodiments of the present application utilize multiple cleaning processes to improve the efficiency of subsequent CAN message parsing. First, the timestamp of the initial diagnostic signal is used to remove initial CAN signals whose signal frequencies do not match the initial diagnostic signal, significantly reducing the amount of data subsequently traversed and parsed. Subsequently, based on the timestamp of the initial diagnostic signal, the data frames of the first intermediate CAN signal are optimized to ensure that the number of frames in the resulting second intermediate CAN signal is equal to that of the initial diagnostic signal. Frame reduction processing is then performed on the initial diagnostic signal and the second intermediate CAN signal, further reducing the amount of data to be parsed. This significantly shortens subsequent processing time and enables more efficient CAN message parsing.
[0094] In some embodiments of the present application, Figure 4 The fourth flow chart of the vehicle CAN message parsing method according to the embodiment of the present application is shown as follows: Figure 4 As shown, the above step S3 may further include the following steps:
[0095] Step S31 : Convert each word bit of each target CAN signal into a first binary field to be selected.
[0096] Specifically, in some embodiments of the present application, each word in the data of the target CAN signal is in hexadecimal. For example, a target CAN signal is as follows:
[0097] "0.004056 2 5E Rx d 8 01 55E8 12 40C0 5A 40"
[0098] The first candidate field converted into binary format is shown in FIG5(a).
[0099] Step S33 : selecting a valid field of the target CAN signal from the first candidate field according to the first preset signal start bit, the first preset length, and the first encoding format.
[0100] Specifically, in some embodiments of the present application, an automation tool is developed based on Python to implement the vehicle CAN message parsing method proposed in the embodiments of the present application. Using this automation tool, the length range for searching each word position of the first candidate field and the encoding format and symbol type for subsequent data processing can be freely set based on experience. The search length can also be expanded in the absence of experience, and changes in the encoding format and data type are also supported.
[0101] In some examples of the embodiments of the present application, based on the first candidate field as shown in Figure 5(a), the first preset signal start bit and the first preset length are set. It should be noted that it is necessary to first obtain the maximum number of bytes of the first candidate field to ensure that the specified length retrieved from the first preset signal start bit does not exceed the maximum number of bytes.
[0102] Furthermore, if the encoding format is set to Intel, the first preset signal start bit is 16, and the first preset length is 16, then the data corresponding to each word bit of the selected valid field is "0001 01110100 1000", as shown in the word bit corresponding data retrieved along the arrow direction in Figure 5(a).
[0103] In other examples, if the encoding format is set to Motorola, the first preset signal start bit is 16, and the first preset length is 16, the data corresponding to each bit of the selected valid field is "0001 0111 1010 1010", as shown in the bit corresponding data retrieved along the arrow direction in Figure 5(b).
[0104] Step S35 : Convert the valid field of the target CAN signal into a decimal CAN signal theoretical value according to the first data type.
[0105] Specifically, the data type can be unsigned or signed. For example, if the data type is unsigned, the corresponding decimal value for the valid field is "0001 0010 1110 1000," which in turn corresponds to "4840."
[0106] In addition, the initial offset corresponding to the target CAN signal is set to 0, and the initial scaling factor is set to 1, that is, the theoretical value of the CAN signal is the decimal data "4840" obtained by the above conversion.
[0107] Taking the valid field shown in FIG5(b) as an example, if the data type is set to unsigned, the data corresponding to the valid field converted to decimal is “0101 0101 1110 1000”.
[0108] Therefore, the embodiments of the present application can flexibly set the corresponding signal bits, lengths, and encoding formats according to actual parsing requirements, thereby accurately determining the valid fields of the target CAN signal for subsequent parsing and avoiding interference from invalid data. In addition, the standardized data conversion and selection process facilitates the automated processing of data. When faced with massive amounts of CAN signals, the theoretical values can be determined quickly and accurately, thereby effectively improving the efficiency of CAN message parsing, reducing errors and time waste that may be caused by manual intervention, and reducing both labor and time costs.
[0109] In some embodiments of the present application, the diagnostic signal physical value of the target diagnostic signal is determined by:
[0110] Converting each word bit of the target diagnostic signal into a second selected field of binary;
[0111] Selecting a valid field of the target diagnostic signal from the second candidate field according to the second preset signal start bit, the second preset length, and the second coding format;
[0112] Converting the valid field of the target diagnostic signal into a decimal theoretical value of the diagnostic signal according to the second data type;
[0113] The product of the theoretical value of the diagnosis signal and the preset scaling factor is determined, and the product is added to the preset offset to determine the physical value of the diagnosis signal according to the addition result.
[0114] Similarly, an embodiment of the present application develops an automated tool based on Python to implement the vehicle CAN message parsing method proposed in the embodiment of the present application, and uses the automated tool to set the second preset signal start bit, second preset length and second encoding format of the target diagnostic signal.
[0115] Specifically, the method for determining the second candidate field and the valid field is the same as the corresponding description of the target CAN signal, and reference may be made to the description of steps S31 to S35 above, which will not be repeated here.
[0116] In addition, the embodiment of the present application sets a preset scaling factor and a preset offset corresponding to the target diagnostic signal based on the above-mentioned automated tool. Figure 6 The automated tool setting interface for target diagnostic signals is shown in FIG. Figure 6 As shown, the second preset signal start bit is set to "32", the second preset length is set to "16", the second encoding format is set to "Motorola", and the second data type is set to "unsigned". This selects the valid field of the target diagnostic signal and then performs decimal conversion on the valid field to obtain the theoretical value of the diagnostic signal. In addition, the preset scaling factor is set to "0.001" and the preset offset is set to "-0.2". The physical value of the diagnostic signal is the product of the theoretical value of the diagnostic signal and "0.001" plus "-0.2".
[0117] Therefore, the embodiments of the present application can accurately determine the valid fields of the target diagnostic signal for subsequent analysis, avoiding interference from invalid data. In addition, the standardized data processing process facilitates automated operation. When faced with a large number of target diagnostic signals, the physical value of the target diagnostic signal can be quickly and accurately determined, improving the efficiency of CAN message parsing, reducing manual errors and time consumption, and reducing manpower and time costs.
[0118] In some embodiments of the present application, Figure 7 The fifth flow chart of the vehicle CAN message parsing method according to the embodiment of the present application is shown as follows: Figure 7 As shown, the above step S5 may include the following steps:
[0119] Step S51 : constructing a linear fitting model of the CAN signal theoretical value and the diagnosis signal physical value, wherein the CAN signal theoretical value is the independent variable of the linear fitting model, and the diagnosis signal physical value is the dependent variable of the linear fitting model.
[0120] Step S53: using the least squares method to solve the regression parameters of the linear fitting model, wherein the regression parameters include the slope and intercept of the linear fitting model.
[0121] In step S55 , the slope is determined as a target scaling factor of the target CAN signal, and the intercept is determined as a target offset of the target CAN signal.
[0122] Specifically, during the vehicle CAN signal analysis process, when the theoretical value of the CAN signal is known, it is necessary to obtain the physical value of the CAN signal based on the corresponding target scaling factor and target offset. In order to determine the target scaling factor and target offset, the embodiment of the present application uses python to construct a linear fitting model, and then uses the physical value of the diagnostic signal as a benchmark to determine the linear relationship between the theoretical value of the CAN signal and the physical value of the diagnostic signal. The physical value of the diagnostic signal is a numerical value representing a real physical quantity obtained from the actual operation of the vehicle. Therefore, the corresponding target scaling factor and target offset can be determined based on the fitted linear relationship, and the target scaling factor and target offset are used to replace the initial scaling factor and initial offset in the aforementioned step S35, so that the physical value of the CAN signal determined according to the target scaling factor and target offset can approach the physical value of the diagnostic signal, such as Figure 8 shown.
[0123] Therefore, the embodiment of the present application takes the physical value of the diagnostic signal as a reference, and obtains the target offset and target scaling factor corresponding to the target CAN signal through linear fitting, so that the physical value of the CAN signal determined using the target offset, target scaling factor and CAN signal theoretical value matches the changing trend of the physical value of the diagnostic signal in the time domain, and can automatically realize the linear fitting process. When faced with a large number of CAN signals and diagnostic signals, it effectively improves the analysis efficiency, reduces the time consumption and possible errors caused by manual calculation, and reduces labor costs and time costs.
[0124] In some embodiments of the present application, Figure 9 The sixth flow chart of the vehicle CAN message parsing method according to the embodiment of the present application is shown as follows: Figure 9 As shown, the above step S7 may include the following steps:
[0125] Step S71 : determining the Pearson correlation coefficient between each CAN signal physical value and the diagnosis signal physical value, and screening out the CAN signal to be analyzed from the plurality of target CAN signals according to the Pearson correlation coefficient.
[0126] Specifically, the Pearson correlation coefficient is a statistical indicator used to measure the degree of linear correlation between two variables, and its value ranges from -1 to 1. In this scenario, the CAN signal physical value reflects the calculated value of the actual physical quantity of a certain aspect of the vehicle, while the diagnostic signal physical value is the actual physical quantity value directly related to vehicle diagnosis. For each target CAN signal, the Pearson correlation coefficient between the CAN signal physical value and the diagnostic signal physical value is calculated. The closer the Pearson correlation coefficient is to 1, the higher the similarity between the corresponding target CAN signal and the target diagnostic signal. The closer the Pearson correlation coefficient is to -1, the lower the similarity between the corresponding target CAN signal and the target diagnostic signal.
[0127] In some examples of the embodiments of the present application, by setting the similarity threshold to 0.98, target CAN signals with a Pearson correlation coefficient greater than 0.98 are screened out as CAN signals to be parsed. In other examples of the embodiments of the present application, all target CAN signals are sorted in descending order of the Pearson correlation coefficient, and the target CAN signal with the largest Pearson correlation coefficient is screened out as the CAN signal to be parsed.
[0128] Step S73: Use the signal information of the CAN signal to be parsed as the parsing result of the vehicle CAN message, wherein the signal information includes at least one of the signal channel, signal ID, signal length, signal start bit, target scaling factor, offset and Pearson correlation coefficient.
[0129] Specifically, the screened CAN signal to be parsed represents the parsing result of the vehicle CAN message relative to the target diagnostic signal, and Python is used to generate the DBC file, and at least one of the signal channel, signal ID, signal length, signal start bit, target scaling factor, offset and Pearson correlation coefficient of the CAN signal to be parsed is visualized.
[0130] In some examples of the embodiments of this application, Figure 10 The parsing settings interface of the automated tool is shown. In the "Search Length" toolbar, the first preset signal start bit and the first preset length can be set to "16." In the "Encoding Format" toolbar, the first encoding format can be set to "Motorola." In the "Symbol Type" toolbar, the first data type can be set to "unsigned." In the "Similarity [0,1]" toolbar, the similarity threshold can be set to "0.98." Furthermore, the automated tool can determine the maximum number of target diagnostic signal frames and display it on the settings interface. Therefore, the "Diagnostic Frames" toolbar can be set to "50," resulting in a target diagnostic signal with 50 frames and multiple target CAN signals during step S155.
[0131] Therefore, the embodiment of the present application uses the Pearson correlation coefficient to further analyze the degree of matching between the physical value of the CAN signal and the physical value of the diagnostic signal. Based on this, the CAN signal to be analyzed that has a strong correlation with the physical value of the diagnostic signal can be screened out from multiple target CAN signals, and then the signal information of the CAN signal to be analyzed is used as the analysis result of the whole vehicle CAN message, thereby realizing rapid and automatic analysis of the whole vehicle CAN message.
[0132] Accordingly, please refer to Figure 11 , an embodiment of the present application provides a vehicle CAN message parsing device, the device comprising:
[0133] The traversal module 100 is used to traverse multiple target CAN signals corresponding to the vehicle CAN message, select the valid field of each target CAN signal during each traversal process, and determine the CAN signal theoretical value of each target CAN signal based on the valid field; the vehicle CAN message also corresponds to a target diagnostic signal, see step S3 for details;
[0134] A fitting module 200 is configured to fit the diagnostic signal physical value of the target diagnostic signal and the CAN signal theoretical value to determine the target offset and target scaling factor of each target CAN signal according to the fitting result. For details, refer to step S5.
[0135] The parsing module 300 is used to determine the CAN signal physical value of each target CAN signal based on the CAN signal theoretical value, the target offset and the target scaling factor, and to determine the parsing result of the entire vehicle CAN message based on the CAN signal physical value and the diagnostic signal physical value. For details, refer to step S7.
[0136] In some embodiments of the present application, the device also includes a preprocessing module 400, which is used to obtain multiple initial CAN signals included in the whole vehicle CAN message, determine the initial diagnostic signal in the whole vehicle CAN message according to a preset data identifier, and clean the multiple initial CAN signals according to the timestamp of the initial diagnostic signal to obtain a target diagnostic signal and multiple target CAN signals.
[0137] In some embodiments of the present application, the pre-processing module 400 further includes:
[0138] The first cleaning unit 410 is configured to determine the frequency of the initial diagnostic signal according to the timestamp of the initial diagnostic signal, and to filter out a first intermediate CAN signal having a higher frequency than the frequency from the multiple initial CAN signals.
[0139] The second cleaning unit 420 is configured to filter out data frames closest to the timestamp in each first intermediate CAN signal, and generate a second intermediate CAN signal according to the filtered data frames.
[0140] The third cleaning unit 430 is configured to perform frame number reduction processing on the initial diagnostic signal and the second intermediate CAN signal according to a preset frame number, so as to obtain a processed target diagnostic signal and multiple target CAN signals.
[0141] In some embodiments of the present application, the traversal module 100 includes:
[0142] The first conversion unit 110 is configured to convert each word bit of each target CAN signal into a first binary field to be selected.
[0143] The first selection unit 120 is configured to select a valid field of the target CAN signal from the first candidate fields according to a first preset signal start bit, a first preset length, and a first encoding format.
[0144] The second conversion unit 130 is configured to convert the valid field of the target CAN signal into a decimal CAN signal theoretical value according to the first data type.
[0145] In some embodiments of the present application, the apparatus further includes a physical value calculation module 500, including:
[0146] The third conversion unit is configured to convert each word bit of the target diagnostic signal into a second binary field to be selected.
[0147] The second selection unit 510 is configured to select a valid field of the target diagnostic signal from the second candidate fields according to the second preset signal start bit, the second preset length, and the second coding format.
[0148] The fourth conversion unit 520 is configured to convert the valid field of the target diagnostic signal into a decimal theoretical value of the diagnostic signal according to the second data type.
[0149] The calculation unit 530 is configured to determine a product of a theoretical value of the diagnosis signal and a preset scaling factor, and add the product to a preset offset to determine a physical value of the diagnosis signal according to the addition result.
[0150] In some embodiments of the present application, the fitting module 200 further includes:
[0151] A modeling unit 210 is configured to construct a linear fitting model between the theoretical value of the CAN signal and the physical value of the diagnostic signal, wherein the theoretical value of the CAN signal is an independent variable of the linear fitting model and the physical value of the diagnostic signal is a dependent variable of the linear fitting model;
[0152] A solving unit 220 is used to solve the regression parameters of the linear fitting model using the least squares method, wherein the regression parameters include the slope and intercept of the linear fitting model;
[0153] The determining unit 230 is configured to determine the slope as a target scaling factor of the target CAN signal, and determine the intercept as a target offset of the target CAN signal.
[0154] In some embodiments of the present application, the parsing module 300 further includes:
[0155] a screening unit 310 for determining a Pearson correlation coefficient between the physical value of each CAN signal and the physical value of the diagnostic signal, and screening out a CAN signal to be analyzed from a plurality of target CAN signals based on the Pearson correlation coefficient;
[0156] The parsing unit 320 is used to use the signal information of the CAN signal to be parsed as the parsing result of the vehicle CAN message, wherein the signal information includes at least one of the signal channel, signal ID, signal length, signal start bit, target scaling factor, offset and Pearson correlation coefficient.
[0157] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0158] The vehicle CAN message parsing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0159] See also Figure 12 , Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 12 As shown, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components utilize different buses to communicate with each other and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in the memory or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Equally, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 12 A processor 10 is taken as an example.
[0160] The processor 10 may be a central processing unit, a network processor, or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic, or any combination thereof.
[0161] The memory 20 stores instructions that can be executed by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0162] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store data created based on the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0163] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0164] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0165] The embodiments of the present application also provide a computer-readable storage medium. The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as a computer code that can be recorded in a storage medium, or implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and downloaded through a network and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0166] An embodiment of the present application provides a computer program product, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a method according to any embodiment of the present application.
[0167] Although the embodiments of the present application have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations shall fall within the scope defined by the appended claims.
[0168] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0169] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0170] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0171] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0172] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0173] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0174] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0175] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
[0176] Although the embodiments of the present application have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations shall fall within the scope defined by the appended claims.
Claims
1. A vehicle CAN message parsing method, characterized in that: The method comprises: Traversing multiple target CAN signals corresponding to the vehicle CAN message, selecting valid fields of each target CAN signal during each traversal process, and determining the CAN signal theoretical value of each target CAN signal according to the valid fields; the vehicle CAN message also corresponds to a target diagnostic signal; Fitting the diagnostic signal physical value of the target diagnostic signal and the CAN signal theoretical value to determine a target offset and a target scaling factor of each target CAN signal according to the fitting result; The CAN signal physical value of each target CAN signal is determined according to the CAN signal theoretical value, the target offset and the target scaling factor, and the parsing result of the whole vehicle CAN message is determined according to the CAN signal physical value and the diagnostic signal physical value.
2. The method according to claim 1, characterized in that Before traversing multiple target CAN signals corresponding to the vehicle CAN message, the method further includes: Obtain multiple initial CAN signals included in the vehicle CAN message; Determining an initial diagnostic signal in the vehicle CAN message according to a preset data identifier; The multiple initial CAN signals are cleaned according to the timestamp of the initial diagnostic signal to obtain the target diagnostic signal and the multiple target CAN signals.
3. The method according to claim 2, characterized in that The cleaning process of the multiple initial CAN signals according to the timestamp of the initial diagnostic signal to obtain the target diagnostic signal and the multiple target CAN signals includes: determining a frequency of the initial diagnostic signal according to a timestamp of the initial diagnostic signal, and screening out a first intermediate CAN signal having a frequency higher than the frequency from the plurality of initial CAN signals; filtering out a data frame closest to the timestamp in each of the first intermediate CAN signals, and generating a second intermediate CAN signal based on the filtered data frames; Frame number reduction processing is performed on the initial diagnostic signal and the second intermediate CAN signal respectively according to a preset frame number to obtain the processed target diagnostic signal and the multiple target CAN signals.
4. The method according to claim 1, wherein The selecting a valid field of each target CAN signal during each traversal process, and determining a CAN signal theoretical value of each target CAN signal according to the valid field, includes: Convert each word bit of each target CAN signal into a first to-be-selected binary field; Selecting a valid field of the target CAN signal from the first candidate field according to a first preset signal start bit, a first preset length, and a first encoding format; The valid field of the target CAN signal is converted into a decimal theoretical value of the CAN signal according to the first data type.
5. The method according to claim 1, wherein The diagnostic signal physical value of the target diagnostic signal is determined by: Convert each word bit of the target diagnostic signal into a second to-be-selected binary field; selecting a valid field of the target diagnostic signal from the second candidate field according to a second preset signal start bit, a second preset length, and a second encoding format; Converting the valid field of the target diagnostic signal into a decimal theoretical value of the diagnostic signal according to the second data type; A product of a theoretical value of the diagnostic signal and a preset scaling factor is determined, and the product is added to a preset offset to determine a physical value of the diagnostic signal according to the addition result.
6. The method according to claim 1, characterized in that The step of fitting the diagnostic signal physical value of the target diagnostic signal and the CAN signal theoretical value to determine the target offset and the target scaling factor of each target CAN signal according to the fitting result includes: Constructing a linear fitting model of the CAN signal theoretical value and the diagnostic signal physical value, wherein the CAN signal theoretical value is an independent variable of the linear fitting model and the diagnostic signal physical value is a dependent variable of the linear fitting model; Solving the regression parameters of the linear fitting model using the least squares method, wherein the regression parameters include the slope and intercept of the linear fitting model; The slope is determined as a target scaling factor of the target CAN signal, and the intercept is determined as a target offset of the target CAN signal.
7. The method according to claim 1, characterized in that Determining the parsing result of the vehicle CAN message according to the CAN signal physical value and the diagnostic signal physical value includes: determining a Pearson correlation coefficient between each of the physical values of the CAN signal and the physical value of the diagnostic signal, and screening out a CAN signal to be analyzed from the plurality of target CAN signals according to the Pearson correlation coefficient; The signal information of the CAN signal to be parsed is used as the parsing result of the vehicle CAN message, wherein the signal information includes at least one of a signal channel, a signal ID, a signal length, a signal start bit, the target scaling factor, the offset, and the Pearson correlation coefficient.
8. A vehicle CAN message parsing device, characterized in that: The device comprises: a traversal module, configured to traverse multiple target CAN signals corresponding to a vehicle CAN message, select a valid field of each target CAN signal during each traversal, and determine a CAN signal theoretical value of each target CAN signal based on the valid field; the vehicle CAN message also corresponds to a target diagnostic signal; a fitting module, configured to fit the diagnostic signal physical value of the target diagnostic signal and the CAN signal theoretical value, so as to determine a target offset and a target scaling factor of each target CAN signal according to the fitting result; The parsing module is used to determine the CAN signal physical value of each target CAN signal according to the CAN signal theoretical value, the target offset and the target scaling factor, and to determine the parsing result of the vehicle CAN message according to the CAN signal physical value and the diagnostic signal physical value.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the CAN message parsing method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the vehicle CAN message parsing method according to any one of claims 1 to 7.