Method for Analyzing Vehicle Bus Data and Electronic Device
By obtaining the target actual signal curve and bus data of the vehicle, and automatically identifying the CAN bus signal curve, the problem of low vehicle bus data analysis efficiency is solved, and efficient and accurate signal analysis is achieved.
Patent Information
- Application Number
- CN202210813773.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-07-12
AI Technical Summary
In the prior art, vehicle bus data analysis efficiency is low, and signals on the CAN bus cannot be efficiently analyzed, resulting in reduced reliability and increased weight of the electrical system.
By obtaining the target actual signal curve of the vehicle and the vehicle bus data, each candidate bus signal curve is determined, and the target actual signal curve is compared with each candidate bus signal curve according to the target actual signal curve, and the bus signal curve corresponding to the specified signal is automatically identified to realize signal analysis.
It improves the efficiency and accuracy of signal resolution, reduces manual intervention, and ensures the reliability and accuracy of the analysis results.
Smart Images

Figure CN115202325B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vehicles, and particularly to a method for parsing vehicle bus data and an electronic device. Background Art
[0002] With the vigorous development of the automotive industry, the number of electronic control units in vehicles has gradually increased. The signal exchange between various electronic control units has led to an increase in the level of automotive wiring harnesses. The contradiction between the complex and thick wiring harnesses and the limited wiring space in the vehicle has become increasingly prominent. The numerous wiring harnesses have led to a decline in the reliability of the electrical system and an increase in weight at the same time. The CAN (Controller Area Network) bus connects the various internal electronic units of the vehicle into a local area network, realizing information sharing and greatly reducing the vehicle's wiring harness.
[0003] During the testing process of new energy vehicles, it is necessary to collect relevant parameters of the whole vehicle and each subsystem. Installing sensors and other data acquisition devices to obtain signals is a simple method. However, affected by factors such as vehicle layout space, signal acquisition difficulty, and signal triggering conditions, some control signals such as rotational speed, torque, and switch variables required during the vehicle testing process are difficult to collect using sensors. Therefore, these signals can only be parsed through CAN bus signals in order to observe the real-time operating conditions of the whole vehicle and components.
[0004] Moreover, in order to test and evaluate the mainstream new energy vehicles on the current market, understand the working characteristics of key components of the powertrain, learn and draw on their advanced control principles, and conduct comparative analysis on their vehicle control strategies, it is necessary to collect a large number of signals from the target vehicle model. The CAN bus provides an efficient and feasible data interaction and processing environment for vehicle development, and at the same time makes it possible to monitor vehicle control parameters to a certain extent using CAN bus noise. Therefore, in the process of analyzing and resolving the multi-energy coupling control characteristics of new energy vehicles, it is necessary to analyze and resolve the CAN bus topology and key signals in order to lay the foundation for observing the real-time operating conditions of the whole vehicle and components.
[0005] The data transmitted on the CAN bus is transmitted through the CAN bus protocol. Generally, when collecting CAN bus data, it is necessary to parse the CAN protocol to determine parameters such as the ID and position corresponding to the signal, data length, coefficient, and offset in order to correctly interpret the CAN bus data. The traditional method for parsing CAN bus data is generally to perform byte matching on each frame of data in the bus data collected from the CAN bus, and then parse the successfully matched bytes. Since the parsing process requires manual operation, the parsing efficiency of this data parsing method is relatively low. Summary of the Invention
[0006] An embodiment of the present invention provides a method for parsing vehicle bus data and an electronic device, which can solve the technical problem of low efficiency in parsing vehicle bus data.
[0007] The embodiment of the present invention provides the following technical solutions to solve the above technical problems:
[0008] In a first aspect, an embodiment of the present invention provides a method for parsing bus data, including:
[0009] Obtain the target actual signal curve of the vehicle, where the target actual signal curve includes the actual signal curve of a specified signal under a preset operation rule;
[0010] Obtain vehicle bus data;
[0011] Determine each candidate bus signal curve according to the vehicle bus data;
[0012] Parse the specified signal according to the target actual signal curve and each candidate bus signal curve to obtain a parsing result.
[0013] Optionally, the parsing the specified signal according to the target actual signal curve and each candidate bus signal curve to obtain a parsing result includes:
[0014] Determine a target bus signal curve from the candidate bus signal curves according to the target actual signal curve;
[0015] Parse the specified signal according to the target actual signal curve and the target bus signal curve to obtain a parsing result.
[0016] Optionally, the determining a target bus signal curve from the candidate bus signal curves according to the target actual signal curve includes:
[0017] Perform curve feature matching between the target actual signal curve and each candidate bus signal curve;
[0018] Determine that the candidate bus signal curve whose curve features match the target actual signal curve is the target bus signal curve.
[0019] Optionally, the parsing the specified signal according to the target actual signal curve and the target bus signal curve to obtain a parsing result includes:
[0020] Determine a signal parsing curve according to the target actual signal curve and the target bus signal curve;
[0021] Parse the specified signal according to the signal parsing curve to obtain a parsing result.
[0022] Optionally, determining the signal analysis curve according to the target actual signal curve and the target bus signal curve includes:
[0023] Obtain at least two sets of calculation parameters, each set of the calculation parameters including the actual signal value of the target actual signal curve and the bus signal value of the target bus signal curve at the same moment;
[0024] Substitute the at least two sets of calculation parameters into a preset parameter equation to determine the signal analysis curve.
[0025] Optionally, analyzing the specified signal according to the signal analysis curve to obtain an analysis result includes:
[0026] Substitute the bus signal value of the target bus signal curve into the signal analysis curve to calculate the true signal value of the specified signal, and use the true signal value as the analysis result, where the parameter equation of the signal analysis curve is as follows:
[0027] y = kx + b
[0028] In the parameter equation, y is the true signal value of the specified signal, k is the proportionality coefficient of the specified signal, x is the bus signal value of the target bus signal curve, and b is the offset value of the specified signal.
[0029] Optionally, the vehicle bus data includes multiple data frames, and each data frame has a corresponding frame ID. Determining each candidate bus signal curve according to the vehicle bus data includes:
[0030] Classify each data frame according to the frame ID to obtain each data frame set;
[0031] Determine each candidate bus signal curve according to the data of each data frame in each data frame set.
[0032] Optionally, determining each candidate bus signal curve according to the data of each data frame in each data frame set includes:
[0033] Obtain the specified byte segment data of each data frame in each data frame set;
[0034] Calculate the bus signal value of each specified byte segment data;
[0035] Generate each candidate bus signal curve according to each bus signal value.
[0036] Optionally, the preset operation rules include a first operation rule and a second operation rule;
[0037] Obtain the first actual signal curve of the specified signal under the first operation rule and the second actual signal curve of the specified signal under the second operation rule;
[0038] Use the first actual signal curve and the second actual signal curve as the target actual signal curve;
[0039] Then: According to the target actual signal curve and each candidate bus signal curve, analyze the specified signal to obtain an analysis result, including:
[0040] According to the analysis result of the second actual signal curve, verify the analysis result of the first actual signal curve, and use the analysis result of the first actual signal curve that passes the verification as the analysis result of the specified signal.
[0041] In a second aspect, an embodiment of the present invention provides an electronic device, including:
[0042] A bus data acquisition device for acquiring vehicle bus data;
[0043] A controller for being respectively electrically connected to the bus data acquisition device and the vehicle, the controller includes:
[0044] At least one processor; and
[0045] A memory communicatively connected to the at least one processor; wherein,
[0046] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the vehicle bus data analysis method as described above.
[0047] Compared with the prior art, the present invention has at least the following beneficial effects: On the one hand, according to vehicle bus data, the present invention determines each candidate bus signal curve, and compares the target actual signal curve with each candidate bus signal curve to automatically identify the bus signal curve corresponding to the specified signal, so as to analyze the specified signal according to the bus signal curve corresponding to the specified signal and the target actual signal curve. The signal analysis process is automatically completed without manual participation. Therefore, it can improve the efficiency of signal analysis. On the other hand, since the target actual signal curve truly reflects the signal change of the specified signal, by using the target actual signal curve as the standard for identifying the bus signal curve, the true signal value corresponding to the bus signal value on the bus signal curve can be accurately calculated. Therefore, it can improve the reliability and accuracy of the signal analysis result. Description of the Drawings
[0048] One or more embodiments are merely illustrated by way of example in the accompanying drawings corresponding thereto. These illustrative descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements, unless otherwise stated, and the drawings in the figures do not constitute a scale limitation.
[0049] Figure 1 It is a schematic structural diagram of a vehicle bus data parsing system provided by an embodiment of the present invention;
[0050] Figure 2 It is a schematic flowchart of a vehicle bus data parsing method provided by an embodiment of the present invention;
[0051] Figure 3a It is a schematic diagram of a target actual signal curve provided by an embodiment of the present invention;
[0052] Figure 3b It is another schematic diagram of a target actual signal curve provided by an embodiment of the present invention;
[0053] Figure 4 is Figure 2 The flowchart of S23 shown;
[0054] Figure 5 It is a schematic diagram of a candidate bus signal curve provided by an embodiment of the present invention;
[0055] Figure 6 is Figure 2 The flowchart of S24 shown;
[0056] Figure 7 It is a schematic diagram of determining a signal parsing curve provided by an embodiment of the present invention;
[0057] Figure 8 It is a schematic structural diagram of a vehicle bus data parsing device provided by an embodiment of the present invention;
[0058] Figure 9 is Figure 8 The schematic structural diagram of the parsing module 84 shown;
[0059] Figure 10 is Figure 8 The schematic structural diagram of the parsing module 83 shown;
[0060] Figure 11 It is a schematic hardware structure diagram of a controller provided by an embodiment of the present invention. Detailed implementation manners
[0061] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts belong to the scope of protection of the present invention.
[0062] It should be noted that if there is no conflict, the various features in the embodiments of the present invention can be combined with each other, and all are within the scope of protection of the present invention. In addition, although functional module division is carried out in the device schematic diagram and the logical sequence is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order from the module division in the device or the sequence in the flowchart. Furthermore, the terms "first", "second", "third", etc. used in the present invention do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0063] An embodiment of the present invention provides a vehicle bus data parsing system. Please refer to Figure 1 , the vehicle bus data parsing system 100 includes a vehicle 11 and an electronic device 12.
[0064] The vehicle 11 can be connected to the electronic device 12 through an external interface. The vehicle 11 can receive the interaction commands sent by the electronic device 12 and send various data and / or parameters to the electronic device 12 according to the interaction commands, such as the actual signal curve of the vehicle 11, etc. Among them, the actual signal curve is used to indicate relevant information during the operation of the vehicle 11, such as speed information, acceleration information, charging current information, etc. The vehicle 11 can be any type of vehicle, such as a car, a truck, a bus, etc.
[0065] The electronic device 12 can collect the CAN bus data of the vehicle 11 and parse the data corresponding to the signals that need to be parsed in the CAN bus data in order to analyze the operation status of the vehicle 11.
[0066] In some embodiments, as Figure 1 shown, the electronic device 12 includes a bus data collection device 121 and a controller 122.
[0067] The bus data collection device 121 is used to connect to the vehicle 11. When the devices on the vehicle 11 work, corresponding CAN bus data will be generated on the CAN bus of the vehicle 11, and the bus data collection device 121 can collect the CAN bus data on the CAN bus in real time.
[0068] CAN bus data is transmitted through the CAN bus on vehicle 11. The CAN bus is used to connect different devices on vehicle 11 to form an interactive network and achieve data interaction between different devices. For example, the CAN bus includes Node 1, Node 2, and Node 3. Node 1 is used to connect the engine, Node 2 is used to connect the transmission, and Node 3 is used to connect the ECU (Electronic Control Unit). The engine, transmission, and ECU are connected through the bus. The CAN data sent from the engine and transmission can obtain sufficient control information to coordinate the entire electrical system to work within a reasonable working range, achieving the optimization of power distribution and the maximization of energy conservation.
[0069] The nodes on the CAN bus send data in the form of messages and broadcast them to all nodes in the network. Each message is called a "frame" of data (the basic unit for transmitting data). During the data transmission process through the CAN data bus, different addresses are required to distinguish devices of different nodes.
[0070] The message frames of the CAN bus include five types: data frame, remote frame, error frame, overload frame, and inter-frame space. The data frame is used to represent the frame for the sending unit to transmit data to the transmission unit. The data frame includes two types: standard frame and extended frame. The remote frame / remote control frame is used to represent the frame for the receiving unit to request data from the sending unit with the same ID. The error frame is used to represent the frame for notifying other units of an error when an error is detected. The overload frame is used to represent the frame that can notify other nodes to suspend sending new messages when a node is busy processing the received information.
[0071] Taking the remote frame as an example, when the ECU needs to obtain data from a certain node regularly (such as the real-time speed of the tachometer, the real-time fuel level of the fuel gauge, etc.), the ECU can send a remote frame to the CAN bus. When the corresponding node receives and determines that the frame ID matches its own and it is a remote frame, it can send its real-time data to the bus. Thus, the ECU can obtain the real-time data of the corresponding node.
[0072] The data frame is the most commonly used frame. Among them, the data frame generally consists of 7 segments in structure, namely frame start, arbitration segment, control segment, data segment, CRC segment, ACK segment, and frame end. Among them, the frame start indicates the start of the frame and consists of a dominant level. The arbitration segment indicates the priority of the frame and consists of an identifier (ID) and a transmission frame type (RTR). The control segment indicates the number of bytes of data and consists of 6 bits (bits). The data segment can send 0 - 8 bytes of data. The CRC segment is used to verify whether the transmission is correct. The ACK segment indicates whether the reception is normal. The frame end consists of 7 consecutive recessive bits.
[0073] For example, as shown in Table 1 below, the messages of the CAN bus include five data frames. When parsing the messages, the two main parts required are the frame ID and the data. The frame ID is generally a character after converting the 29-bit identifier (ID) into hexadecimal. For example, the frame ID of the data frame with the serial number 0x000000004 is 1818D0F3, which is converted from 11000000110001101000011110011. The data segment is generally composed of 1-8 bytes. Each byte includes two characters, divided into the high 4 bits and the 4th bit. Some data needs to be represented by combining two adjacent bytes. In this case, it needs to be divided into the high byte and the low byte. For example, the data segment of the data frame with the frame ID 1818D0F3 is ce0d007d006d1100. In the CAN bus protocol, it is specified that the first byte ce and the second byte 0d represent the total voltage. In the first byte ce, c is the high 4 bits and e is the low 4 bits, and the first byte is the low byte and the second byte is the high byte. Therefore, when parsing, it needs to be parsed according to 0dce. First, convert the hexadecimal 0dce to decimal, and the obtained value is 3534. This value is amplified and offset. Assuming that the corresponding scale factor and offset are 0.1 and 0 respectively, the total voltage value is 3534 * 0.1 + 0 = 353.4 (V).
[0074] Table 1
[0075]
[0076] The controller 122 is respectively connected to the bus data acquisition device 121 and the vehicle 11. The controller 122 serves as the control core and is used to execute the vehicle bus data parsing method described below.
[0077] In some embodiments, the controller 122 may include any general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), single-chip microcomputer, ARM (Acorn RISC Machine) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components. Additionally, the controller 122 may also be any conventional processor, microcontroller, or state machine. The controller 122 may also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors in combination with a DSP and / or any other such configuration.
[0078] The embodiment of the present invention provides a vehicle bus data parsing method. Please refer to Figure 2 , the vehicle bus data parsing method S200 includes:
[0079] S21. Obtain the target actual signal curve of vehicle 11. The target actual signal curve includes the actual signal curve of a specified signal under a preset operation rule.
[0080] In this embodiment, the target actual signal curve is the signal curve of the specified signal generated by vehicle 11 when operating vehicle 11 under a preset operation rule. It can reflect the signal change of the specified signal during the operation of vehicle 11. The specified signal can be any type of signal, such as a speed signal, an acceleration signal, etc.
[0081] For example, when the specified signal is a speed signal, under a preset operation rule, vehicle 11 accelerates from a standstill to 30 km / h, then decelerates to 0 km / h, then accelerates to 30 km / h again, then decelerates to 0 km / h again, then accelerates to 30 km / h again, and finally decelerates to 0 km / h. After the operation ends, vehicle 11 generates an actual signal curve that can reflect the speed change. This actual signal curve is as shown in Figure 3a shown.
[0082] For another example, when the specified signal is an acceleration signal, under a preset operation rule, vehicle 11 accelerates from a standstill, then decelerates, then accelerates again, then decelerates again, then accelerates again, and finally the acceleration decreases to 0. After the operation ends, vehicle 11 generates an actual signal curve that can reflect the acceleration change. This actual signal curve is as shown in Figure 3b shown.
[0083] In this embodiment, the controller 122 is communicatively connected to vehicle 11. During the operation of vehicle 11, the controller 122 can send an interaction command to vehicle 11 so that vehicle 11 returns signal curve information according to the interaction command, and the controller 122 uses this signal curve information as the target actual signal curve.
[0084] S22. Obtain vehicle bus data.
[0085] In this embodiment, the vehicle bus data is the bus data on the CAN bus of vehicle 11 when operating vehicle 11 under a preset operation rule. The vehicle bus data can include data corresponding to various different types of signals, such as data corresponding to a speed signal, data corresponding to an acceleration signal, data corresponding to a charging voltage, and data corresponding to a charging current.
[0086] The vehicle bus data can include multiple data frames, and each data frame has a corresponding frame ID. Among them, the frame ID is mainly used for arbitration on the CAN bus. Generally speaking, the ID of each node (sending to the CAN bus) on the CAN bus should be different. The lower the ID value, the higher the priority of the message. Therefore, when two messages with different IDs go online at the same time, the arbitration mechanism will allow the message with the lower ID value to occupy the bus, and the message with the higher ID value will exit.
[0087] The data segments in each data frame may include data of different types of signals. For example, the data segment of a data frame includes 8 bytes. From left to right, the first and second bytes are used to represent the speed signal value, the third and fourth bytes are used to represent the acceleration value, the fifth and sixth bytes are used to represent the charging voltage value, and the seventh and eighth bytes are used to represent the charging current value.
[0088] The data segments in each data frame may also include valid data and invalid data of a specific signal. For example, the data segment of a data frame includes 8 bytes. From left to right, the data of the fifth and sixth bytes are the valid data representing the speed signal value. For the speed signal, the data of the first, second, third, fourth, seventh, and eighth bytes from left to right are invalid data.
[0089] In this embodiment, when operating the vehicle 11 under the preset operation rules, the bus data acquisition device 121 collects the bus data of the vehicle 11 in real time and transmits the collected bus data in real time to the controller 122. The controller 122 uses this bus data as the vehicle bus data.
[0090] S23. Determine each candidate bus signal curve according to the vehicle bus data;
[0091] As described above, the vehicle bus data includes data corresponding to various different types of signals. In this embodiment, the controller 122 can identify the data of each type of signal and process the data of each type of signal to determine each candidate bus signal curve. In some embodiments, each candidate bus signal curve corresponds to one signal respectively, and each candidate bus signal curve is used to represent the change of the bus signal value represented by the data of the corresponding type of signal. For example, the candidate bus signal curve includes the bus signal curve corresponding to the speed signal, and this bus signal curve can reflect the change of the bus signal value represented by the data of the speed signal. Another example is that the candidate bus signal curve includes the bus signal curve corresponding to the acceleration signal, and this bus signal curve can reflect the change of the bus signal value represented by the data of the acceleration signal.
[0092] S24. Analyze the specified signal according to the target actual signal curve and each candidate bus signal curve to obtain an analysis result.
[0093] As described above, each candidate bus signal curve is used to represent the change of the bus signal value represented by the data of the corresponding type of signal. The bus signal value represented by the data of each type of signal has a corresponding proportional coefficient and offset value. That is to say, the bus signal value is not the real signal value, but the value obtained after being amplified and offset on the basis of the real signal value. Although the bus signal value is amplified and offset, the change trend of the bus signal value is similar to that of the real signal value. The target actual signal curve truly reflects the real change trend of the specified signal. Therefore, as long as the controller 122 finds a curve similar to the target actual signal curve among each candidate bus signal curve, the candidate bus signal curve corresponding to the specified signal can be screened out.
[0094] After the candidate bus signal curve corresponding to the specified signal is screened out, the controller 122 can use the target actual signal curve as the standard for the screened candidate bus signal curve. With reference to this standard, the real signal value corresponding to the bus signal value of this candidate bus signal curve can be restored, so as to realize the analysis of the specified signal.
[0095] Therefore, in this embodiment, as long as the actual signal curve and vehicle bus data of the specified signal under the preset operation rule are obtained from the vehicle 11, each candidate bus signal curve is determined according to the vehicle bus data, and then according to this actual signal curve and each candidate bus signal curve, the specified signal can be analyzed, without manually analyzing the specified signal according to the CAN bus protocol. Therefore, it can improve the signal analysis efficiency.
[0096] Since the target actual signal curve truly reflects the signal change of the specified signal, using the target actual signal curve as the standard for the screened candidate bus signal curve can accurately calculate what value the bus signal value of this candidate bus signal curve truly represents. Therefore, it can improve the reliability and accuracy of the signal analysis result.
[0097] In some embodiments, please refer to Figure 4 , S23 includes:
[0098] S231. Classify each data frame according to the frame ID to obtain each data frame set;
[0099] S232. Determine each candidate bus signal curve according to the data of each data frame in each data frame set.
[0100] As described above, the vehicle bus data includes multiple data frames, each data frame has a corresponding frame ID, and the frame IDs of the data frames belonging to a specific type of signal are the same. Therefore, the controller 122 can classify the data of each type of signal according to the frame ID to obtain multiple data frames under each frame ID, forming a data frame set.
[0101] For example, please refer to Table 2 below. 0x10fe6f2a is a given frame ID. The controller 122 can match this frame ID with the frame IDs of multiple data frames respectively, filter out the data frames with successful frame ID matching, and obtain the data frame set shown in Table 2.
[0102] Table 2
[0103]
[0104]
[0105] Since the valid data of a specific type of signal exists in a specific byte segment of a data frame. For example, the valid data of the speed signal exists in the fifth and sixth bytes of the data segment of the data frame with the frame ID of 0x10fe6f2a. Therefore, the controller 122 can respectively intercept the data of the specific byte segments of each data frame in the data frame set, find the data belonging to the speed signal. Thus, in this way, the controller 122 can find the data belonging to each type of signal, laying a foundation for determining each candidate bus signal curve.
[0106] In some embodiments, in S232, first, the controller 122 obtains the data of the specified byte segments of each data frame in each data frame set to obtain the bus signals belonging to each type of signal. Then, the controller 122 calculates the bus signal values of each specified byte segment data to obtain the bus signal values of each type of signal changing with time. Finally, the controller 122 generates each candidate bus signal curve according to the bus signal values of each type of signal changing with time. Please refer to Figure 5 , Figure 5 which is a schematic diagram of a candidate bus signal curve provided by an embodiment of the present invention.
[0107] Therefore, by using this method, by dividing multiple data frames of vehicle bus data to obtain multiple data frame sets, and then determining each candidate bus signal curve according to the data of each data frame in each data frame set, each candidate bus signal curve can reflect the change of the bus signal value represented by the data of each type of signal, which is beneficial to subsequently screening out candidate bus signal curves similar to the target actual signal curve, and thus is beneficial to accurately analyzing the specified signal.
[0108] In some embodiments, please refer to Figure 6 , S24 includes:
[0109] S241. Determine the target bus signal curve from the candidate bus signal curves according to the target actual signal curve;
[0110] As described above, the target actual signal curve truly reflects the change of the specified signal. If a candidate bus signal curve is similar to the target actual signal curve, it indicates that the candidate bus signal curve is a curve generated based on the bus signal value of the specified signal. Therefore, after the controller 122 determines the candidate bus signal curve, it takes it as the target bus signal curve.
[0111] In some embodiments, when determining whether the target actual signal curve is similar to each candidate bus signal curve, the controller 122 can perform curve feature matching between the target actual signal curve and each candidate bus signal curve, and determine the candidate bus signal curve whose curve features match the target actual signal curve as the target bus signal curve. For example, the controller 122 can determine whether there is a candidate bus signal curve with the same conditions among each candidate bus signal curve according to conditions such as the curve type and the number of periods of the target actual signal curve. If there is a candidate for this bus signal curve, it indicates that the curve features of this candidate bus signal curve match the curve features of the target actual signal curve. It can be understood that the controller 122 can also screen out the target bus signal curve similar to the target actual signal curve from the candidate bus signal curves according to any suitable algorithms such as curve fitting algorithms and similarity algorithms.
[0112] S242. Analyze the specified signal based on the target actual signal curve and the target bus signal curve to obtain an analysis result.
[0113] As described above, the bus signal value on the target bus signal curve is not the true signal value of the specified signal, but a value obtained after amplification and offset. The target actual signal curve truly reflects the signal change of the specified signal. Therefore, for the bus signal value on the target bus signal curve, the controller 122 can find the actual signal value at the corresponding moment on the target actual signal curve. Based on this actual signal value, the proportional coefficient and offset of the bus signal value on the target bus signal curve can be calculated, so as to subsequently determine the true signal value corresponding to the bus signal value on the target bus signal curve according to the proportional coefficient and offset, and complete the analysis of the specified signal.
[0114] In some embodiments, the controller 122 obtains at least two sets of calculation parameters. Each set of calculation parameters includes the actual signal value of the target actual signal curve and the bus signal value of the target bus signal curve at the same moment. Among them, the number of sets of calculation parameters and the selection rules of the calculation parameters can be determined according to the actual needs of the user and are not limited here. The controller 122 substitutes the at least two sets of calculation parameters into the preset parameter equation to determine the signal analysis curve.
[0115] For example, as Figure 7As shown, curve 1 is the target bus signal curve, and curve 2 is the target actual signal curve. The controller 122 respectively selects the bus signal value x1 and the actual signal value y1 at time t1 as the first set of calculation parameters (x1, y1), selects the bus signal value x2 and the actual signal value y2 at time t2 as the second set of calculation parameters (x2, y2), selects the bus signal value x3 and the actual signal value y3 at time t3 as the third set of calculation parameters (x3, y3), selects the bus signal value x4 and the actual signal value y4 at time t4 as the fourth set of calculation parameters (x4, y4), and selects the bus signal value x5 and the actual signal value y5 at time t5 as the fifth set of calculation parameters (x5, y5). The controller 122 substitutes these five sets of calculation parameters into the equation y = kx + b. In this equation, k represents the proportionality coefficient of the bus signal value to be calculated, and b represents the offset of the bus signal value to be calculated. After calculating the proportionality coefficient k and the offset, the signal analysis curve y = kx + b can be determined.
[0116] After the signal analysis curve is determined, the controller 122 can substitute the bus signal value of the target bus signal curve into the signal analysis curve y = kx + b to calculate the true signal value of the specified signal, and use this true signal value as the analysis result. In the parametric equation of the signal analysis curve, y is the true signal value of the specified signal, k is the proportionality coefficient of the specified signal, x is the bus signal value of the target bus signal curve, and b is the offset value of the specified signal.
[0117] Generally speaking, different from the traditional technology, on the one hand, since this method only needs to obtain the actual signal curve and vehicle bus data of the specified signal under the preset operation rule from the vehicle 11, determine each candidate bus signal curve according to the vehicle bus data, and then analyze the specified signal based on this actual signal curve and each candidate bus signal curve, without the need for manual analysis of the specified signal according to the CAN bus protocol. Therefore, it can improve the signal analysis efficiency. On the other hand, since the target actual signal curve truly reflects the signal change of the specified signal, using the target actual signal curve as the standard for screening candidate bus signal curves can accurately calculate the value represented by the bus signal value of this candidate bus signal curve. Therefore, it can improve the reliability and accuracy of the signal analysis result.
[0118] In some embodiments, in order to further improve the reliability and accuracy of the signal analysis result, the controller 122 can use two or more actual signal curves of the specified signal under different operation rules as the target actual signal curves, respectively screen out the target bus signal curves similar to each actual signal curve, and then analyze the specified signal according to each actual signal curve and the corresponding target bus signal curve to obtain multiple analysis results, and determine the final analysis result based on the multiple analysis results.
[0119] For example, the preset operation rules include a first operation rule and a second operation rule. The controller 122 obtains a first actual signal curve of a specified signal under the first operation rule and a second actual signal curve of the specified signal under the second operation rule, and uses the first actual signal curve and the second actual signal curve as the target actual signal curves.
[0120] Assume that the specified signal is a speed signal. Under the first operation rule, the vehicle 11 accelerates from a standstill to 30 km / h, then decelerates to 0 km / h, then accelerates to 30 km / h again, then decelerates to 0 km / h again, then accelerates to 30 km / h again, and finally decelerates to 0 km / h. After the operation ends, the vehicle 11 generates a first actual signal curve that can reflect the speed change.
[0121] When the specified signal is a speed signal and under the second operation rule, the vehicle 11 accelerates from a standstill to 30 km / h, then decelerates to 0 km / h, then accelerates to 30 km / h again, then decelerates to 0 km / h again, then accelerates to 30 km / h again, then decelerates to 0 km / h again, then accelerates to 30 km / h again, and finally decelerates to 0 km / h. After the operation ends, the vehicle 11 generates a second actual signal curve that can reflect the speed change.
[0122] The controller 122 respectively filters out a target bus signal curve similar to the first actual signal curve and a target bus signal curve similar to the second actual signal curve. According to the first actual signal curve and the corresponding target bus signal curve, the specified signal is analyzed to obtain a first analysis result, and according to the second actual signal curve and the corresponding target bus signal curve, the specified signal is analyzed to obtain a second analysis result. Then, according to the second analysis result, the first analysis result is verified. If the second analysis result is consistent with the first analysis result, it is determined that the verification is passed and the first analysis result after the verification is passed is used as the analysis result of the specified signal. If the second analysis result is not consistent with the first analysis result, an alarm message is output to indicate that the signal analysis fails.
[0123] Therefore, this method can obtain more than two analysis results based on the actual signal curves of the specified signal under different operation rules, mutually verify the more than two analysis results, and use the analysis result that passes the verification as the final analysis result of the specified signal, which can avoid the one-sidedness of a single analysis result, thereby improving the reliability and accuracy of the analysis result.
[0124] It should be noted that in the above various embodiments, there is not necessarily a certain order between the above steps. Those of ordinary skill in the art can understand from the description of the embodiments of the present invention that in different embodiments, the above steps can have different execution orders, that is, they can be executed in parallel or exchanged, etc.
[0125] An embodiment of the present invention provides a vehicle bus data parsing device. Please refer to Figure 8 , the vehicle bus data parsing device 800 includes a first acquisition module 81, a second acquisition module 82, a determination module 83, and a parsing module 84. The first acquisition module 81 is used to acquire the target actual signal curve of the vehicle 11. The target actual signal curve includes the actual signal curve of a specified signal under a preset operation rule. The second acquisition module 82 is used to acquire vehicle bus data. The determination module 83 is used to determine each candidate bus signal curve according to the vehicle bus data. The parsing module 84 parses the specified signal based on the target actual signal curve and each candidate bus signal curve to obtain a parsing result.
[0126] In some embodiments, please refer to Figure 9 , the parsing module 84 includes a first determination unit 841 and a parsing unit 842. The first determination unit 841 is used to determine the target bus signal curve from each candidate bus signal curve according to the target actual signal curve. The parsing unit 842 is used to parse the specified signal based on the target actual signal curve and the target bus signal curve to obtain a parsing result.
[0127] In some embodiments, the first determination unit 841 is specifically configured to: perform curve feature matching between the target actual signal curve and each candidate bus signal curve, and determine the candidate bus signal curve whose curve features match the target actual signal curve as the target bus signal curve.
[0128] In some embodiments, the parsing unit 842 is specifically configured to: determine a signal parsing curve according to the target actual signal curve and the target bus signal curve, and parse the specified signal according to the signal parsing curve to obtain a parsing result.
[0129] In some embodiments, the vehicle bus data includes multiple data frames, and each data frame has a corresponding frame ID. Please refer to Figure 10 , the determination module 83 includes a classification unit 831 and a second determination unit 832. The classification unit 831 is used to classify each data frame according to the frame ID to obtain each data frame set. The second determination unit 832 is used to determine each candidate bus signal curve according to the data of each data frame in each data frame set.
[0130] In some embodiments, the second determination unit 832 is specifically configured to: acquire the specified byte segment data of each data frame in each data frame set, calculate the bus signal value of each specified data segment data, and generate each candidate bus signal curve according to each bus signal value.
[0131] The vehicle bus data parsing device can execute the vehicle bus data parsing method provided by the embodiments of the present invention, and has functional modules and beneficial effects corresponding to the execution of the method. For technical details not described in detail in the embodiments of the vehicle bus data parsing device, reference can be made to the vehicle bus data parsing method provided by the embodiments of the present invention.
[0132] Please refer to Figure 11 , Figure 11 which is a schematic hardware structure diagram of a controller 122 provided by an embodiment of the present invention. As Figure 11 shown, the controller 122 includes one or more processors 1221 and a memory 1222. Among them, Figure 11 one processor 1221 is taken as an example herein.
[0133] The processor 1221 and the memory 1222 can be connected by a bus or other means, Figure 11 and the connection by bus is taken as an example herein.
[0134] The memory 1222, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions / modules corresponding to the vehicle bus data parsing method in the embodiments of the present invention. By running the non-volatile software programs, instructions, and modules stored in the memory 1222, the processor 1221 executes various functional applications and data processing of the vehicle bus data parsing device, that is, implements the vehicle bus data parsing method provided by the above method embodiments and the functions of each module or unit of the above device embodiments.
[0135] The memory 1222 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 1222 may optionally include a memory remotely provided with respect to the processor 1221, and these remote memories can be connected to the processor 1221 through a network. Examples of the above networks include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0136] The program instructions / modules are stored in the memory 1222, and when executed by the one or more processors 1221, execute the vehicle bus data parsing method in any of the above method embodiments.
[0137] The embodiments of the present invention also provide a non-volatile computer storage medium, and the computer storage medium stores computer-executable instructions, and these computer-executable instructions are executed by one or more processors, for example Figure 11One of the processors 1221 can enable the above-mentioned one or more processors to execute the vehicle bus data parsing method in any of the above method embodiments.
[0138] An embodiment of the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-volatile computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by the controller 122, the controller 122 is enabled to execute the above-mentioned vehicle bus data parsing method.
[0139] The device or equipment embodiments described above are merely illustrative. The unit modules described as separate components may or may not be physically separated. The components shown as module units may or may not be physical units, that is, they may be located in one place or distributed to multiple network module units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0141] Finally, it should be noted that the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. These embodiments are not additional limitations to the content of the present invention. The purpose of providing these embodiments is to make the understanding of the disclosed content of the present invention more thorough and comprehensive. And under the idea of the present invention, the above technical features continue to be combined with each other, and there are many other variations in different aspects of the present invention as described above, all of which are regarded as the scope described in the specification of the present invention; further, for those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.
Claims
1. A method for parsing vehicle bus data, characterized in that Including: Obtain the target actual signal curve of the vehicle, where the target actual signal curve includes the actual signal curve of a specified signal under a preset operation rule; Obtain vehicle bus data, where the vehicle bus data includes multiple data frames, and each data frame has a corresponding frame ID; Classify each of the data frames according to the frame ID to obtain each data frame set; Determine each candidate bus signal curve according to the data of each data frame in each data frame set; Perform curve feature matching between the target actual signal curve and each candidate bus signal curve; Determine the candidate bus signal curve whose curve features match the target actual signal curve as the target bus signal curve; Determine a signal analysis curve according to the target actual signal curve and the target bus signal curve; Analyze the specified signal according to the signal analysis curve to obtain an analysis result.
2. The method according to claim 1, characterized in that, The determining the signal analysis curve according to the target actual signal curve and the target bus signal curve includes: Obtain at least two sets of calculation parameters, and each set of calculation parameters includes the actual signal value of the target actual signal curve and the bus signal value of the target bus signal curve at the same moment; Substitute the at least two sets of calculation parameters into a preset parameter equation to determine the signal analysis curve.
3. The method according to claim 1, wherein The analyzing the specified signal according to the signal analysis curve to obtain an analysis result includes: Substitute the bus signal value of the target bus signal curve into the signal analysis curve, calculate the true signal value of the specified signal, and use the true signal value as the analysis result, where the parameter equation of the signal analysis curve is as follows: y = kx + b In the parameter equation, y is the true signal value of the specified signal, k is the proportional coefficient of the specified signal, x is the bus signal value of the target bus signal curve, and b is the offset value of the specified signal.
4. The method according to claim 1, characterized in that, The determining each candidate bus signal curve according to the data of each data frame in each data frame set includes: Obtain the specified byte segment data of each data frame in each data frame set; Calculate the bus signal value of each specified byte segment data; Generate each candidate bus signal curve according to each bus signal value.
5. The method according to any one of claims 1 to 4, characterized in that The preset operation rule includes a first operation rule and a second operation rule; Obtain the first actual signal curve of the specified signal under the first operation rule and the second actual signal curve of the specified signal under the second operation rule; Use the first actual signal curve and the second actual signal curve as the target actual signal curve; Then: Analyzing the specified signal according to the target actual signal curve and each candidate bus signal curve to obtain an analysis result includes: Verify the analysis result of the first actual signal curve according to the analysis result of the second actual signal curve, and use the analysis result of the first actual signal curve that passes the verification as the analysis result of the specified signal.
6. An electronic device, characterized in that, Including: A bus data acquisition device for acquiring vehicle bus data; A controller, configured to be connected to the bus data acquisition device and the vehicle respectively, the controller comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the vehicle bus data parsing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Signal resolution method for quickly positioning CAN signal by utilizing diagnosis signal
CN107450510A