Detection method and device, electronic equipment, medium and program product
By automatically detecting bit overlap errors in DBC files using electronic devices, the problems of low efficiency and insufficient accuracy of manual detection are solved, achieving efficient and accurate DBC file inspection and improving the development quality of CAN communication software.
Patent Information
- Application Number
- CN202511375488.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-24
- Publication Date
- 2026-01-02
AI Technical Summary
In existing technologies, DBC file error detection relies on manual inspection, which is inefficient and lacks accuracy, affecting the development efficiency and quality of CAN communication software.
The system automatically detects DBC files using electronic devices, obtains signal layout information, and identifies crossover errors in signal groups, including signal keywords, byte order, and data length code configuration, thus achieving automated detection.
This improves the efficiency and accuracy of DBC file error detection, avoids the inefficiency and errors of manual detection, and ensures the development quality of CAN communication software.
Smart Images

Figure CN121256008A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a detection method, apparatus, electronic device, medium, and program product. Background Technology
[0002] Automotive electronic control units (ECUs) typically communicate serially via a controller area network (CAN). The database CAN (CAN database file) is a standard file format used to describe the CAN communication protocol; it is the CAN database file, describing the data communication between CAN network nodes. DBC files are primarily used for integrating and developing CAN communication software. Errors in the DBC file can negatively impact the development efficiency and quality of the communication software.
[0003] Currently, errors in DBC files are typically checked manually. However, manual checking is not only inefficient but also cannot guarantee accuracy. Summary of the Invention
[0004] The purpose of this application is to provide a detection method, apparatus, electronic device, medium, and program that can improve the efficiency and accuracy of checking errors in DBC files.
[0005] The first aspect of this application provides a detection method applied to an electronic device. The method includes: acquiring a DBC file; determining that the DBC file does not contain a first error, wherein the first error indicates that the signal layout cannot be correctly acquired; acquiring bit information occupied by each signal in the same signal group in the DBC file, the bit information including bit labels; and, based on the bit information occupied by each signal, determining that at least two signals in the same signal group in the DBC file have a bit crossover error if the bit information occupied by at least two signals overlaps.
[0006] The above detection method can improve the efficiency and accuracy of checking for errors in DBC files.
[0007] In one possible implementation of the first aspect above, the first error includes the absence of a signal in the DBC file, and the method further includes: determining that the first error exists in the DBC file if the signal key string and / or signal special symbol are not present in the line following the signal key in the DBC file.
[0008] In one possible implementation of the first aspect above, the first error includes a signal in the DBC file not belonging to any message, and the method further includes: determining that the DBC file has the first error if a first characteristic character and / or a second characteristic character are present in the line following the characteristic keyword of the DBC file.
[0009] In one possible implementation of the first aspect above, the byte order of the DBC file is little-endian, the first error includes incorrect configuration of the DBC file's data length code (DLC), and the method further includes: determining that the DBC file has a first error when the maximum number of bits occupied by a signal in the DBC file is greater than the maximum number of valid bits in the DBC file.
[0010] In one possible implementation of the first aspect above, the byte order of the DBC file is big-endian, and the first error includes incorrect configuration of the DBC file's Data Length Code (DLC). If the DBC file includes a first type of signal that does not span bytes, and the start bit of the first type of signal is greater than the maximum significant bit of the DBC file, then the DBC file is determined to have a first error. If the DBC file includes a second type of signal that spans bytes, and the byte sequence number of the highest byte of the second type of signal is greater than the number of bytes in the DLC of the DBC file, then the DBC file is determined to have a first error.
[0011] In one possible implementation of the first aspect above, the first error includes the existence of more than one byte order in the DBC file, and the method further includes: obtaining all byte orders of all signals of the DBC file and storing all byte orders in a first dictionary database; querying the first dictionary database, and determining that the DBC file has a first error if there is more than one byte order in the first dictionary database.
[0012] In one possible implementation of the first aspect above, the first error includes the absence of message type configuration and / or message type initialization in the DBC file, and the method further includes: determining that the DBC file has a first error if the DBC file does not have message type keyword and / or message type initialization keyword.
[0013] In one possible implementation of the first aspect above, the message type keyword includes a first keyword, and the initialization keyword includes a second keyword; the method further includes: storing each line of the DBC file in a first DBC list data; reading the first DBC list data and obtaining the index of the first keyword in the first row of the first DBC list data; inserting the message type configuration information into the position of the first row index according to the first row index; reading the first DBC list data and obtaining the index of the second keyword in the second row of the first DBC list data; inserting the message type initialization information into the position of the second row index according to the second row index; obtaining messages in the first DBC list data that do not include a third keyword, the third keyword being used to define the message type of the messages in the first DBC list data; initializing the message type of the messages that do not include the third keyword to the Application type; and outputting the first DBC list data in text format.
[0014] In one possible implementation of the first aspect above, the first error includes the absence of diagnostic configuration state and / or diagnostic configuration state initialization in the DBC file, and the method further includes: determining that the DBC file has a first error when the DBC file does not have diagnostic configuration definition keywords and / or diagnostic configuration initialization keywords.
[0015] In one possible implementation of the first aspect described above, the diagnostic configuration definition keyword includes a fourth keyword, and the diagnostic configuration initialization keyword includes a fifth keyword; the method further includes: storing each line of the DBC file in a second DBC list data; reading the second DBC list data and obtaining the index of the fourth keyword in the third row of the second DBC list data; inserting the diagnostic requirement configuration information at the position of the third row index, inserting the diagnostic response configuration information at the position of (third row index + 1), and inserting the diagnostic status configuration information at the position of (third row index + 2) according to the third row index; reading the second DBC list data and obtaining the index of the fifth keyword in the fourth row of the DBC file; inserting the diagnostic requirement initialization information at the position of the fourth row index, inserting the diagnostic response initialization information at the position of (fourth row index + 1), and inserting the diagnostic status initialization information at the position of (fourth row index + 2) according to the fourth row index.
[0016] In one possible implementation of the first aspect above, the first error includes the existence of at least two signals with the same signal name in the same signal group in the DBC file. The method further includes: obtaining all signal names of each signal group in the DBC file and storing each signal name in a second dictionary database according to the signal group to which it belongs; querying each signal group in the second dictionary database, and determining that the DBC file has a first error if at least two signals with the same name exist in the signal group.
[0017] In one possible implementation of the first aspect above, the method further includes: outputting a warning message if at least one signal name in the DBC file has more than 32 characters, or if at least two signals in the DBC file have the same signal name.
[0018] A second aspect of this application provides a detection device, comprising: a first acquisition module, a first determination module, a second acquisition module, and a second determination module; the first acquisition module is used to acquire a DBC file; the first determination module is used to determine that the DBC file does not contain a first error, wherein the first error indicates that the signal layout cannot be correctly acquired; the second acquisition module is used to acquire bit information occupied by each signal in the same signal group in the DBC file, the bit information including bit labels; the second determination module is used to determine, based on the bit information occupied by each signal, that at least two signals in the same signal group in the DBC file have a bit crossover error when there is overlap between the bit information occupied by at least two signals.
[0019] A third aspect of this application provides an electronic device, including a processor and an interface circuit. The interface circuit is used to receive signals from other communication devices and transmit them to the processor, or to send signals from the processor to other communication devices. The processor implements the methods described in the first aspect and any of the implementations of the first aspect through logic circuits or executing code instructions.
[0020] The fourth aspect of this application provides a computer-readable storage medium storing a computer program or instructions that, when executed by a communication device, implement the method described in the first aspect and any implementation thereof.
[0021] The fifth aspect of this application provides a program product including instructions that, when executed, cause the method described in the first aspect and any implementation thereof to be implemented. Attached Figure Description
[0022] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0023] Figure 1 A schematic diagram of a communication scenario between ECUs is shown according to an embodiment of this application;
[0024] Figure 2 A schematic flowchart of a detection method is shown according to an embodiment of this application;
[0025] Figure 3 A schematic diagram of a message data layout is shown according to an embodiment of this application;
[0026] Figure 4 A schematic diagram of a detection device 200 is shown according to an embodiment of this application;
[0027] Figure 5 A schematic diagram of the hardware structure of a vehicle 100 is shown according to an embodiment of this application. Detailed Implementation
[0028] The illustrative embodiments of this application include, but are not limited to, a detection method, apparatus, electronic device, medium, and program product.
[0029] The terminology used in the embodiments of this application will be introduced below.
[0030] 1. Controller Area Network (CAN): A serial communication network widely used in automotive electronics and other fields. CAN uses serial data transmission, and its bus protocol supports multiple master controllers. When a node (station) on the CAN bus sends data, it broadcasts it to all nodes in the network in the form of a message. Message transmission typically includes four different types of frames: data frames, error frames, remote frames, and overload frames.
[0031] 2. Electronic Control Unit (ECU): Commonly used in automobiles, the computer in a car is also called the vehicle's computer. ECUs typically use simple logic gates and integrated circuit principles to process some simple electronic signals and perform calculations.
[0032] 3. Database Controller Area Network (DBC) File: A standard file format used to describe the CAN communication protocol. It is the CAN database file, describing data communication between CAN network nodes. Simply put, CAN network communication is based on DBC files. DBC files define object types, such as network nodes, messages, signals, and environment variables. The structure of a DBC file includes version information, new symbol specifications, node definitions, value tables, message definitions, and signal definitions. The message definition section details the name, size, sender, and included signals of each frame. Each message has a unique identifier and priority, as well as data length and receiver node information. Message definitions begin with "BO_". Signals are specific data fields extracted from messages. The signal definition section provides attributes such as signal name, start bit, length, data type, byte order, scaling factor, and offset. Signal definitions begin with "SG_".
[0033] Figure 1 The image illustrates a scenario where ECUs communicate with each other via CAN. For example... Figure 1 As shown, vehicle 100 may include multiple ECU modules, such as ECU1, ECU2, ECU3, ECU4, etc. These ECUs can communicate with each other via a CAN bus. As described in the background section, CAN network communication is based on DBC files. A DBC file is a signal data matrix that describes, records, and defines the communication protocol between automotive ECUs. It is mainly used for integrating and developing CAN communication software. If the DBC file contains errors, it will affect the development efficiency and quality of the communication software. Currently, the method for detecting errors in DBC files usually relies on manual inspection. However, manual inspection is not only inefficient but also prone to errors.
[0034] In view of this, embodiments of this application provide a detection method. In this method, an electronic device acquires a DBC file. If the DBC file does not have a first error, that is, if there is no error indicating that the signal layout cannot be correctly acquired, and if it is determined that the bit information occupied by at least two signals overlaps, then it is determined that at least two signals in the same signal group in the DBC file have a bit overlap error.
[0035] The above detection method can detect DBC files using electronic devices, avoiding the need for manual error detection in DBC files, and is highly efficient and accurate.
[0036] The detection method provided in this application embodiment can be applied to the development of CAN communication software using E2E communication protection, and this software can be applied to vehicle 100, such as in the form of an application (APP) or script. It should be understood that vehicle 100 can be any type of vehicle such as a car, truck, motorcycle, bus, ship, airplane, helicopter, lawnmower, recreational vehicle, amusement park vehicle, construction equipment, tram, golf cart, train, and handcart; this application embodiment does not limit the type of vehicle 100.
[0037] To better understand the technical solutions of the embodiments of this application, the detection method provided by the embodiments of this application will be described in detail below, taking vehicle 100 as an example.
[0038] Figure 2 A schematic flowchart of a detection method is shown according to an embodiment of this application. It can be understood that... Figure 2The execution entities for each step of the illustrated process are all electronic devices. These electronic devices can be the electronic devices of the vehicle 100, or other electronic devices; this embodiment does not impose specific limitations. For simplicity, the following description... Figure 2 The execution entity for each step in the illustrated process will not be described again. For example... Figure 2 As shown, this process includes, but is not limited to, the following:
[0039] S210, obtain the DBC file.
[0040] In some embodiments, the electronic device parses the DBC file in text format and detects the type of the DBC file. The message type of the DBC file is an application (APP) type.
[0041] S220, Determine that the DBC file does not have a first error, wherein the first error indicates that the signal layout cannot be correctly obtained.
[0042] It is understood that the first error can include various types of errors indicating that the signal layout cannot be correctly obtained. For example, the first error can include errors affecting parameters such as the start bit and length of the obtained signal. For instance, the first error can include one or more of the following errors: no signal exists in the DBC file; the signal in the DBC file does not belong to any message; the DLC (Data Length Code) configuration in the DBC file is incorrect; the DBC file contains more than one byte order; the DBC file does not have message type configuration and / or message type initialization; the DBC file does not have diagnostic configuration status and / or the initialization of the diagnostic configuration status; at least two signals with the same signal name exist in the same signal group in the DBC file, etc. Various types of first errors will be described in detail below and will not be repeated here.
[0043] S230: Obtain the bit information occupied by each signal in the same signal group in the DBC file. The bit information includes the bit label.
[0044] S240, based on the bit information occupied by each signal, if there is a bit overlap between the bit information occupied by at least two signals, determine that there is a bit overlap error between at least two signals in the same signal group in the DBC file.
[0045] In some embodiments, the electronic device can parse a DBC file to obtain the bit information occupied by each signal in each signal group and store all the information in a first list dictionary signal database. For example, the first list dictionary signal database is: ([{signalgroup1:{signal1:[bit a0,bit a1…],…}},signalgroup2:{signal2:[bit b0,bit b1...],…}},[{signalgroup3:{signal3:[bit c0,bit c1…],…}},signalgroup4:{signal4:[bit d0,bit d1...],…}},…]). Here, signalgroup1, signalgroup2, signalgroup3, signalgroup4, etc., represent different signal groups, and signal1, signal2, signal3, signal4, etc., represent different signals. bit a0, bit a1, bit b0, bit b1, bit c0, bit c1, bit d0, bit d1, etc. represent different bits, and a0, a1, b0, b1, c0, c1, d0, d1 can be natural numbers.
[0046] It is understood that the start bit of each signal can be the bit label of the start bit of each signal. The length of each signal can be the number of bits occupied by each signal. The byte order of the signals can include big-endian, such as Motorola mode, and little-endian, such as Intel mode. It is understood that the byte order of the signals can also have other types. In this embodiment of the application, the type of byte order of the signals is not specifically limited.
[0047] It is understandable that electronic devices can determine the byte index of each byte in each frame message based on the number of bytes in each frame message in the DBC file. Electronic devices can then determine the left and right endpoint information of the byte corresponding to each byte index in each frame message based on the byte index and the number of bytes.
[0048] Understandably, according to the CAN protocol or the Controller Area Network Flexible Data Rate (CANFD) protocol, the total length of the data segment in a frame, i.e., the number of bytes, is n bytes. The value of n can include {1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64}. The byte index of each byte can be from byte 0, byte 1, ..., byte(n-1). In some embodiments, the number of bits per byte can be a natural number, such as 8 bits, meaning one byte can have 8 bits. Based on the value of n and the number of bits per byte, the byte index of each byte in the data layout of each frame in the DBC file, the information of the left endpoint of each byte in the data layout of each frame (i.e., the bit label of the left endpoint of each byte), and the information of the right endpoint of each byte in the data layout of each frame (i.e., the bit label of the right endpoint of each byte) can be obtained.
[0049] For example, such as Figure 3 As shown, n equals 16, and a message frame contains 16 bytes, including the byte indices of each byte: {byte0, byte1, byte2, byte3, byte4, byte5, byte6, byte7, byte8, byte9, byte10, byte11, byte12, byte13, byte14, byte15}. Each byte is 8 bits long. For example, byte0 includes bits 0, 1, 2, 3, 4, 5, 6, and 7.
[0050] The total length of this frame is 128 bits, and the value range of the bit label of this frame is [0, 127]. In the data layout of this frame, the left endpoint bit number of byte 0 is 7, the left endpoint bit number of byte 1 is 15, the left endpoint bit number of byte 2 is 23, the left endpoint bit number of byte 3 is 31, the left endpoint bit number of byte 4 is 39, the left endpoint bit number of byte 5 is 47, the left endpoint bit number of byte 6 is 55, the left endpoint bit number of byte 7 is 63, the left endpoint bit number of byte 8 is 71, the left endpoint bit number of byte 9 is 79, the left endpoint bit number of byte 10 is 87, the left endpoint bit number of byte 11 is 95, the left endpoint bit number of byte 12 is 103, the left endpoint bit number of byte 13 is 111, the left endpoint bit number of byte 14 is 119, and the left endpoint bit number of byte 15 is 127. The list of data for all left endpoints is {7, 15, 23, 31, 39, 47, 55, 63, 71, 79, 87, 95, 103, 111, 119, 127}.
[0051] In the data layout of this frame, the bit label of the right endpoint of byte 0 is 0, the bit label of the right endpoint of byte 1 is 8, the bit label of the right endpoint of byte 2 is 16, the bit label of the right endpoint of byte 3 is 24, the bit label of the right endpoint of byte 4 is 32, the bit label of the right endpoint of byte 5 is 40, the bit label of the right endpoint of byte 6 is 48, the bit label of the right endpoint of byte 7 is 56, the bit label of the right endpoint of byte 8 is 64, the bit label of the right endpoint of byte 9 is 72, the bit label of the right endpoint of byte 10 is 80, the bit label of the right endpoint of byte 11 is 88, the bit label of the right endpoint of byte 12 is 96, the bit label of the right endpoint of byte 13 is 104, the bit label of the right endpoint of byte 14 is 112, and the bit label of the right endpoint of byte 15 is 120. The list of data for all right endpoints is {0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120}.
[0052] It is understandable that electronic devices can determine the byte index of the byte containing the start bit of each signal in each frame message based on the start bit of each signal in each frame message and the number of bytes in each frame message.
[0053] The byte index of the byte containing the start bit of each signal is calculated as (bit label of the start bit of each signal - remainder) / number of bits per byte.
[0054] It is understandable that electronic devices can obtain the bit information occupied by each signal in each frame message based on any item among the byte index, byte length, left endpoint information, right endpoint information, signal start bit, signal length, and signal byte order.
[0055] It is understandable that the signals in each frame of a DBC file may or may not span bytes. The following will first describe an embodiment of the method for obtaining the bit information of each signal when the signals do not span bytes. For ease of description, the first signal is taken as any non-byte signal in each frame, the first byte is taken as the byte containing the start bit of the first signal, the byte bit width is set to 8, and the first frame is taken as any frame in the series of frames.
[0056] In some embodiments, the byte order of the signals in the first frame message is big-endian, i.e., Motorola. In the signal list, the value range of the bit label of the start bit of the preceding signal of the first signal in the first frame message is [the right endpoint of the byte where the start bit of the first signal is located, and the left endpoint of the byte where the start bit of the first signal is located]; and the bit label of the start bit of the preceding signal is less than the bit label of the start bit of the first signal; and the difference between the bit label of the start bit of the first signal and the bit label of the start bit of the preceding signal is equal to the length of the first signal, that is, there is no blank bit between the first signal and the preceding signal; then the bit label occupied by the first signal can be determined from the bit label of the start bit of the first signal to (the bit label of the start bit of the first signal - the length of the first signal + 1).
[0057] In some embodiments, the length of the first signal corresponding to the first frame message is 1, that is, the number of bits occupied by the first signal is 1, which is less than the number of bytes. And the number of bits occupied by the first signal in the first byte is equal to the length of the first signal 1. Then it can be determined that the bit label occupied by the first signal is the bit label of the start bit of the first signal.
[0058] In some embodiments, the byte order corresponding to the signal is big-endian, i.e., Motorola. The bit label of the start bit of the first signal in the first frame message is the bit label of the left endpoint of the first byte in the data layout of the first frame message. The length of the first signal is equal to the number of bytes, such as 8. The number of bits occupied by the first signal in the first byte is equal to the length of the first signal. The bit label occupied by the first signal can be determined from the bit label of the right endpoint of the first byte to the bit label of the left endpoint of the byte where the start bit of the first signal is located, that is, from the bit label of the right endpoint of the byte where the start bit of the first signal is located to (the bit label of the right endpoint of the byte where the start bit of the first signal is located + the length of the first signal - 1).
[0059] In some embodiments, the byte order of the signals corresponding to the first frame message is big-endian, i.e., Motorola. The length of the first signal in the first frame message is greater than 1 and less than or equal to 7. The bit label of the start bit of the first signal is not the bit label of the left endpoint of the first frame message, and the bit label of the end point of the first signal is greater than the right endpoint of the first byte, i.e., greater than the right endpoint of the byte where the start bit of the first signal is located. The bit label occupied by the first signal can be determined from the bit label of the start bit of the first signal to (bit label of the start bit of the first signal - length of the first signal + 1). Wherein, the bit label of the end point of the first signal is equal to (bit label of the start bit of the first signal - length of the first signal + 1).
[0060] In some embodiments, the byte order of the signals corresponding to the first frame message is little-endian, i.e., Intel. The length of the first signal in the first frame message is greater than 1 and less than or equal to 7. The value range of the bit label of the start bit of the first signal is [the right endpoint of the first byte and the left endpoint of the first byte]. The number of bits occupied by the first signal in the first byte (=(abs(bit label of the start bit - the left endpoint of the first byte))) is equal to the length of the first byte. Then the bit label occupied by the first signal can be determined from the bit label of the start bit of the first signal to (bit label of the start bit of the first signal + the length of the first signal - 1).
[0061] In some embodiments, the byte order of the first signal corresponding to the first frame message is little-endian (Intel), the length of the first signal is greater than 1 and less than or equal to 7, and the bit label of the end bit of the first signal is less than the left endpoint of the first byte. Therefore, it can be determined that the first signal does not span bytes. The bit labels occupied by the first signal range from the bit label of the start bit of the first signal to (the bit label of the start bit of the first signal + the length of the first signal - 1). Specifically, the bit label of the end bit of the first signal is equal to (the bit label of the start bit of the first signal + the length of the first signal - 1).
[0062] The following describes an embodiment of the method for obtaining the bit information occupied by each signal when the signal spans multiple bytes. For ease of description, the second signal is taken as any signal that spans multiple bytes in each frame message. The second byte is taken as the byte containing the start bit of the second signal. The byte has 8 bits. The first frame message is taken as any frame message in each frame message.
[0063] In some embodiments, the start bit of the second signal is within the second byte; the number of bits occupied by the second signal in the second byte is less than the length of the second signal.
[0064] In some embodiments, the byte order of the signal corresponding to the first frame message is big-endian, i.e., Motorola. If the length of the second signal is greater than 1 and the length of the second signal in the second byte is less than the length of the second signal, then the second signal spans multiple bytes. The length of the second signal in the second byte is equal to (abs(bit label of the start bit of the second signal - right endpoint of the byte containing the start bit of the second signal) + 1).
[0065] If (length of the second signal - length of the second signal in the second byte) / 8 = p + q, where p and q are natural numbers. The bit labels occupied by the second signal include the bit labels occupied by the second signal in the byte where the second signal starts, the bit labels occupied by the second signal in the next byte after the byte where the second signal starts, ..., up to the bit labels occupied by the second signal in the p bytes after the byte where the second signal starts, and the bit labels occupied by the second signal in the (p+1) bytes after the byte where the second signal starts.
[0066] First, we can obtain the bit label occupied by the second signal in the second byte, that is, the bit label occupied by the byte where the start bit of the second signal is located, including: the bit label from the start bit of the second signal to the bit label of the start bit of the second signal - abs (bit label of the start bit of the second signal - right endpoint of the byte where the start bit of the second signal is located).
[0067] Then the remaining bit labels can be obtained. If the length of the second signal, excluding the number of bits occupied by the second signal in the second byte, is greater than 8 (i.e., if (length of the second signal - abs(bit label of the start bit of the second signal - right endpoint of the byte containing the start bit of the second signal) + 1) is greater than 8), then the bit label occupied by the second signal in the byte following the byte containing the start bit of the second signal is from the left endpoint of the byte following the start bit of the second signal to (left endpoint of the byte following the start bit of the second signal - 7). And so on.
[0068] Continue acquiring the number of bits of the second signal other than the previously calculated number of bits occupied, until the number of bits occupied by the last remaining uncalculated second signal is less than or equal to 8. Then, the bit index occupied in the next (p+1) bytes of the byte containing the start bit of the last remaining second signal is calculated as follows: from the left endpoint of the next (p+1) byte of the byte containing the start bit of the second signal, to the left endpoint of the next (p+1) byte of the byte containing the start bit of the second signal - the number of bits occupied by the last remaining uncalculated second signal + 1.
[0069] In one possible implementation, the bit label occupied by the first signal in the byte where the first signal starts can be obtained first, and the bit label occupied in the first byte can be obtained as: from the bit label of the first signal start bit to the bit label of the first signal start bit - abs (bit label of the first signal start bit - right endpoint of the byte where the first signal start bit is located).
[0070] Then continue to obtain the remaining bit labels. If the number of bits in the first signal other than the bits occupied by the first signal in the first byte is greater than 8, that is, if (length of the first signal - abs(bit label of the first signal's start bit - right endpoint of the byte where the first signal's start bit is located) + 1) is greater than 8, and (length of the first signal - abs(bit label of the first signal's start bit - right endpoint of the byte where the first signal's start bit is located) + 1) = 8p + q, where p and q are natural numbers. The bit labels occupied by the next byte after the first byte, up to the p bytes after the first byte, include: from the left endpoint of the next byte after the byte where the start bit of the first signal is located, to (the left endpoint of the next byte after the byte where the start bit of the first signal is located - 7), from the left endpoint of the next two bytes after the byte where the start bit of the first signal is located, to (the left endpoint of the next two bytes after the start bit of the first signal is located - 7), ..., and so on, until from the left endpoint of the p bytes after the byte where the start bit of the first signal is located, to (the left endpoint of the p bytes after the start bit of the first signal is located - 7).
[0071] Finally, the number of bits occupied by the first signal in the next (p+1) bytes of the first byte is obtained as follows: from the left endpoint of the byte at (the byte index where the first signal starts + p), to the left endpoint of the byte at (the byte index where the first signal starts + p) - (the length of the first signal - the number of bits occupied by the first signal in the byte at the first signal - 8p) + 1.
[0072] In some embodiments, the byte order of the signals corresponding to the first frame message is little-endian, i.e., Intel. If the length of the second signal is greater than 1 and the number of bits occupied by the second signal in the byte where the second signal starts is less than the length of the second signal, then the second signal spans bytes. The number of bits occupied by the second signal in the byte where the second signal starts is equal to (abs(bit label of the second signal's start bit - left endpoint of the byte where the second signal's start bit is located) + 1).
[0073] First, we can obtain the bit label occupied by the second signal in the second byte, that is, the bit label occupied by the byte where the start bit of the second signal is located, including: the bit label from the start bit of the second signal to the bit label of the start bit of the second signal + abs (bit label of the start bit of the second signal - left endpoint of the byte where the start bit of the second signal is located).
[0074] Then the remaining bit labels can be obtained. If the number of bits in the second signal, excluding the number of bits occupied by the second byte, is greater than 8, that is, if (the length of the second signal - abs(the bit label of the start bit of the second signal - the left endpoint of the byte containing the start bit of the second signal) - 1) is greater than 8, then the bit label occupied by the next byte after the start bit of the second signal is from the right endpoint of the next byte after the start bit of the second signal to (the right endpoint of the next byte after the start bit of the second signal + 7). And so on.
[0075] Continue acquiring the number of bits of the second signal other than the previously calculated number of bits occupied, until the number of bits occupied by the last remaining uncalculated second signal is less than or equal to 8. Then, the bit index occupied in the next (p+1) bytes of the byte containing the start bit of the last remaining second signal is (from the right endpoint of the next (p+1) byte of the byte containing the start bit of the second signal to the left endpoint of the next (p+1) byte of the byte containing the start bit of the second signal + the number of bits occupied by the last remaining uncalculated second signal - 1).
[0076] In one possible implementation, the bit label occupied by the second signal in the byte where the start bit of the second signal is located can be obtained first. That is, the bit label occupied by the second byte is obtained as: from the bit label of the start bit of the second signal to the bit label of the start bit of the second signal + abs (bit label of the start bit of the second signal - left endpoint of the byte where the start bit of the second signal is located).
[0077] Then continue to obtain the remaining bit labels. If the length of the second signal, excluding the number of bits occupied by the second signal in the second byte, is greater than 8, that is, if (length of the second signal - abs(bit label of the start bit of the second signal - left endpoint of the byte where the start bit of the second signal is located) - 1) is greater than 8, and (length of the second signal - abs(bit label of the start bit of the second signal - right endpoint of the byte where the start bit of the second signal is located) + 1) = 8p + q, where p and q are natural numbers. The bit positions occupied by the next byte after the second byte, up to the p bytes after the second byte, include: from the right endpoint of the byte after the byte where the start bit of the second signal is located, to (the right endpoint of the byte after the byte where the start bit of the second signal is located + 7), from the right endpoint of the 2 bytes after the byte where the start bit of the second signal is located, to (the right endpoint of the 2 bytes after the start bit of the second signal is located + 7), ..., and so on, until from the right endpoint of the p bytes after the byte where the start bit of the second signal is located, to (the right endpoint of the p bytes after the start bit of the second signal is located + 7).
[0078] Finally, the number of bits occupied by the second signal in the next (p+1) bytes of the first byte is obtained as follows: from the right end of the byte at (the byte index where the second signal starts + p), to the right end of the byte at (the byte index where the second signal starts + p) + (the length of the second signal - the number of bits occupied by the second signal in the byte where the second signal starts - 8p) - 1.
[0079] In some embodiments, the byte order of the signals in the first frame message is big-endian, i.e., Motorola. The bit label of the start bit of the second signal in the first frame message is the bit label of the left endpoint of the second byte of the first frame message, i.e., the start bit of the second signal is located at the left endpoint of the second byte. The length of the second signal is 8m, where m is a natural number greater than 1. It can be determined that the second signal spans bytes, thereby determining the bit label occupied by the second signal, from the bit label of the right endpoint of the byte where the start bit of the second signal is located to (the bit label of the right endpoint of the byte where the start bit of the second signal is located + the length of the second signal - 1).
[0080] Specifically, the bit label of the start bit of the second signal can be determined by the range of the bit label value of [0, (number of bytes in the first frame × 8 - 1)], and (bit label of the start bit of the second signal + 1) being an integer multiple of 8, thus making it the bit label of the left endpoint in the data layout of the first frame. In this embodiment, the method for determining the bit label of the start bit of the first signal to be the bit label of the left endpoint in the data layout of the first frame is not specifically limited.
[0081] In some embodiments, the byte order of the signals corresponding to the first frame message is little-endian, i.e., Intel. The bit label of the start bit of the second signal in the first frame message is the bit label of the right endpoint in the data layout of the first frame message. The length of the second signal is 8n, where n is a natural number greater than 1. It can be determined that the second signal spans bytes, thereby determining the bit label occupied by the second signal, from the bit label of the right endpoint of the byte where the start bit of the second signal is located to (the bit label of the right endpoint of the byte where the start bit of the second signal is located + the length of the second signal - 1).
[0082] In some embodiments, the first list dictionary signal database is traversed and queried. If at least two signals in a signal group occupy overlapping bits, it is determined that there is a first error in the DBC file and an error report is output. The information format of each report can be as follows: "signal1-overlap-signal2: [5,6,7]" (that is, the bits of signal1 and signal2 that overlap are 5,6,7).
[0083] The following section will introduce the different types of first errors in detail.
[0084] In some embodiments, the first error may include a signal that the DBC file does not exist.
[0085] This is understandable. The DBC file can be parsed to check for the presence of signal keywords, such as "BO_decidframename:framebytelength txnodename". If the signal keyword is found, the next line can be checked for the presence of signal key strings, such as "SG_", and signal special symbols, such as "|+@()[]". If neither the signal key string nor the signal special symbols are found, it can be determined that the signal does not exist in the DBC file.
[0086] In some embodiments, the first error may include a signal in the DBC file that does not belong to any message.
[0087] This is understandable. The DBC file can be parsed to check for the presence of a characteristic keyword, such as 'VECTOR__INDEPENDENT_SIG_MSG:'. If the characteristic keyword is found, the next line after it is checked for the presence of a first characteristic character, such as 'Vector__XXX', and a second characteristic character, such as 'vector__xxx'. If the first and / or second characteristic characters are found, it can be determined that the signal in the DBC file does not belong to any message.
[0088] In some embodiments, the first error may include an incorrect data length code (DLC) configuration in the DBC file.
[0089] It is understandable that if the byte order of the DBC file is little-endian, such as Intel mode, the DLC configuration of the DBC file is n1 bytes, each byte includes m1 bits, where n1 and m1 are natural numbers, and the maximum number of valid bits in the DBC file is n1×m1-1. If any signal in the DBC file occupies more than n1×m1-1 bits, it is determined that the DLC configuration of the DBC file is incorrect.
[0090] It's understandable that if the DBC file uses big-endian byte order, such as in Motorola mode, the DLC configuration of the DBC file is n² bytes, with each byte containing m² bits, where n² and m² are natural numbers. The maximum number of significant bits in the DBC file is n² × m² - 1. For the first type of signal in the DBC file that does not span bytes, if the start bit of the first accumulation signal is greater than n² × m² - 1, the DLC configuration of the DBC file is incorrect. For the second type of signal in the DBC file that spans bytes, if the byte number of the highest byte of the second type of signal is greater than n², the DLC configuration of the DBC file is incorrect.
[0091] In some embodiments, the first error may include the existence of more than one byte order in the DBC file.
[0092] It is understandable that a DBC file can be parsed to obtain the byte order of all signals in the DBC file, and all byte orders can be stored in a first dictionary database. The first dictionary database is queried; if more than one byte order exists in the first dictionary database, it is determined that the DBC file contains a first error.
[0093] For example, if the signal's byte order is Motorola, the keyword for the byte order is denoted as M; if the signal's byte order is Intel, the keyword is denoted as I. All byte orders are then stored in a first dictionary database, such as the first dictionary database [{Singnal1:I},{Singnal2:M},{Singnal3:I},…]. Then, the first dictionary database can be traversed and queried. If more than one byte order keyword exists, it is determined that more than one byte order exists in the first dictionary database.
[0094] In some embodiments, the first case may include the absence of message type configuration and / or message type initialization in the DBC file. If it is determined that the absence of message type configuration and / or message type initialization in the DBC file indicates a first error in the DBC file.
[0095] It is understandable that by parsing the DBC file, one can check whether message type keywords, such as ([BA_DEF_BO_"MsgType"ENUM"Application","CDD","NM","ISO-TP";]), and whether message type initialization keywords, such as ([BA_DEF_DEF_"MsgType""Application";]), exist in the DBC file. If it is determined that message type keywords and / or message type initialization keywords do not exist, it can be concluded that message type configuration and / or message type initialization do not exist in the DBC file.
[0096] It is understood that in some embodiments, if it is determined that the message type keyword and / or message type initialization keyword do not exist, the user can be prompted to perform automatic repair. The repair process may include: reading each line of the DBC file and storing each line in the first DBC list data. The message type keyword includes the first keyword. The first keyword is found in the first DBC list data, such as the first row index (index1) containing (BA_DEF_BO_), and the message type configuration information, such as the standard message type MsgType definition ([BA_DEF_BO_"MsgType"ENUM"Application","CDD","NM","ISO-TP";]), is inserted into the first DBC list data at the position of index1. The initialization keyword includes the second keyword. Find the second key in the first DBC list data, such as the second row index where (BA_DEF_DEF_) is located, for example, index2. Insert the message type initialization information, such as the standard message type initialization MsgType initialization ([BA_DEF_DEF_"MsgType""Application";]), into the index2 position in the first DBC list data. Collect all DBC files that do not have a third key. The third key is used to define the message type in the first DBC list data; for example, the third key can be ([BA_"MsgType"BO_canid(dec)0;]). If the third key does not exist, initialize the message type of the corresponding message to "Application". Finally, re-output the first DBC list data as a txt text file and save it as a .dbc format file.
[0097] In some embodiments, the first error may include the absence of diagnostic configuration state and / or the initialization of diagnostic configuration state in the DBC file.
[0098] It is understandable that the DBC file can be parsed to detect the presence of diagnostic configuration definition keywords, such as the first diagnostic configuration definition keyword (i.e., the standard DiagRequest definition [BA_DEF_BO_"DiagRequest"ENUM"No","Yes";]), the second diagnostic configuration definition keyword (i.e., the standard DiagResponse definition [BA_DEF_BO_"DiagResponse"ENUM"No","Yes";]), the third diagnostic configuration definition keyword (i.e., the standard DiagState definition [BA_DEF_BO_"DiagState"ENUM"No","Yes";]), and the presence of diagnostic configuration initialization keywords in the DBC file, such as the first diagnostic configuration initialization keyword (i.e., the standard DiagRequest initialization [BA_DEF_DEF_"DiagRequest""No"]), the second diagnostic configuration initialization keyword (i.e., the standard DiagResponse initialization [BA_DEF_DEF_"DiagResponse""No"]), and the third diagnostic configuration initialization keyword (i.e., the standard DiagState initialization [BA_DEF_DEF_"DiagState""No"]). If it is determined that there are no diagnostic configuration definition keywords and / or diagnostic configuration initialization keywords, it can be determined that there are no diagnostic configuration states and / or diagnostic configuration state initializations in the DBC file.
[0099] It is understood that in some embodiments, if it is determined that the diagnostic configuration definition keyword and / or diagnostic configuration initialization keyword do not exist, the user may be prompted to perform an automated repair. The repair process may include: reading each line of the DBC file and storing each line in a second DBC list data. Find the fourth key in the second DBC list data, such as the third row index (index3) containing (BA_DEF_BO_), and insert the diagnostic request configuration information, such as the standard first diagnostic configuration DiagRequest definition ([BA_DEF_BO_"DiagRequest"ENUM"No","Yes";]), into the second DBC list data at index3; insert the diagnostic response configuration information, such as the standard second diagnostic configuration DiagResponse definition ([BA_DEF_BO_"DiagResponse"ENUM"No","Yes";]), into the second DBC list data at index3+1; and insert the diagnostic status configuration information, such as the standard third diagnostic configuration DiagState definition ([BA_DEF_BO_"DiagState"ENUM"No","Yes";]), into the second DBC list data at index3+2. In the second DBC list data, locate the fifth key, such as (BA_DEF_DEF_), at the fourth row index (index4). Insert the diagnostic request initialization information, such as the standard first diagnostic configuration initialization DiagRequest ([BA_DEF_DEF_"DiagRequest""No";]), into the second DBC list data at index4. Insert the diagnostic response initialization information, such as the standard first diagnostic configuration initialization DiagResponse ([BA_DEF_DEF_"DiagResponse""No";]), into the second DBC list data at index4+1. Insert the diagnostic status initialization information, such as the standard third diagnostic configuration initialization DiagState ([BA_DEF_DEF_"DiagState""No";]), into the second DBC list data at index4+2. Output the second DBC list data as a txt text file and save it as a .dbc format file.
[0100] In some embodiments, the first error may include the existence of at least two signals with the same signal name in the same signal group in the DBC file.
[0101] It's understandable that by parsing the signal group (SG) in each message of the DBC file, all signal names for each signal group can be obtained, and each signal name can be stored in a second dictionary database according to its signal group. For example, the second dictionary database could be ({SG_Name1:[signal1, signal2.....], SG_Name2:[signal3, signal3.....], ......}). A traversal query is performed on each signal group in the second dictionary database. For example, a traversal query is performed on SG_Name1. If at least two identical signal names exist in this signal group, such as signal1 equaling signal2, it confirms that signals with the same signal name exist within the same signal group in the DBC file.
[0102] In some embodiments, if at least one signal name in the DBC file contains more than 32 characters, or if it is determined that at least two signals in the DBC file have the same signal name, a warning message is output.
[0103] This is understandable. The DBC file can be parsed, and lines starting with "SG_" are detected. Using ":" as the delimiter, these lines are split into two parts, C1 and C2. C1 and C2 are then separated and merged into a list L1 using spaces. The second element of L1 is the signal name. If the signal name is longer than 32 English characters, a warning message can be printed. Signals exceeding 32 characters are listed in the format [1)signal1, 2)signal1, 3)signal1…] for the user to view the warning message.
[0104] It's understandable that the signal groups in each frame could be used as keys, with a list of signal names stored in a third dictionary database. For example, the third dictionary database could be ({SG1:[s1,s2,s3…],SG2:[s4,s2,s5…],SG3:[s6,s7,s8…]…}). Here, SG1, SG2, and SG3 are different signal groups, and s1, s2, s3, s5, s6, s7, and s8 are different signal names. No duplicate signals are added to each signal group. A query is performed on the second dictionary database 1. If a signal name appears in two signal groups simultaneously, a warning message "s2:SG1and SG2" can be printed (meaning signal s2 appears in both signal groups SG1 and SG2).
[0105] The above detection method improves the efficiency of detecting errors in DBC files, is simple to follow, and provides a good user experience.
[0106] For example, Figure 4A schematic diagram of the structure of a detection device 200 is shown according to an embodiment of this application.
[0107] like Figure 4 As shown, the detection device 200 includes a first acquisition module 210, a first determination module 220, a second acquisition module 230, and a second determination module 240.
[0108] The first acquisition module 210 is used to acquire DBC files.
[0109] The first determining module 220 is used to determine that the DBC file does not have a first error, wherein the first error indicates that the signal layout cannot be correctly obtained.
[0110] The second acquisition module 230 is used to acquire the bit information occupied by each signal in the same signal group in the DBC file. The bit information includes the bit label.
[0111] The second determining module 240 is used to determine, based on the bit information occupied by each signal, that at least two signals in the same signal group in the DBC file have bit overlap errors when there is overlap between the bit information occupied by at least two signals.
[0112] The specific execution methods of the first acquisition module 210, the first determination module 220, the second acquisition module 230, and the second determination module 240 can be referred to the description of steps S210 to S240 above, and will not be repeated here.
[0113] Optionally, the components described above are merely examples. In actual applications, components in each of the above modules may be added or removed as needed. Figure 4 This should not be construed as a limitation on the embodiments of this application.
[0114] It is understood that in other embodiments, depending on actual needs, the steps shown in the above embodiments can be combined, deleted or replaced with other steps that are beneficial to achieving the purpose of this application. For example, the above steps S204 and S205 can be combined into one step. This application does not impose any restrictions here.
[0115] This application also provides a data processing system, which may include at least one processor that executes instructions stored in a non-transitory computer-readable medium such as memory. The processor may be any conventional processor, such as a commercially available central processing unit (CPU). Optionally, the processor may be a dedicated device such as an application-specific integrated circuit (ASIC) or other hardware-based processor.
[0116] In some embodiments, the memory may contain instructions (e.g., program logic) that can be executed by a processor to perform various functions of the detection device 200, including the functions of the embodiments described above.
[0117] This application also provides a vehicle that may include at least one processor that executes instructions stored in a non-transitory computer-readable medium such as memory. The processor may be any conventional processor, such as a commercially available CPU. Alternatively, the processor may be a special-purpose device such as an ASIC or other hardware-based processor. The memory may contain instructions (e.g., program logic) that can be executed by the processor to perform various functions of the vehicle 100, including the functions of the embodiments described above.
[0118] For example, Figure 5 A schematic diagram of the hardware structure of a vehicle 100 is shown according to an embodiment of this application.
[0119] like Figure 5 As shown, the vehicle 100 includes one or more (only one is shown in the figure) processors 110, memory 120, communication interface 130, and bus 140. The processors 110, memory 120, and communication interface 130 are interconnected via the bus 140.
[0120] The processor 110, including but not limited to, CPU, microprocessor, application-specific integrated circuit, etc., is used to execute relevant programs to achieve the functions required by the vehicle 100 in this application embodiment.
[0121] Memory 120 may include one or more memories for storing data or one or more applications. The memory may be read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM).
[0122] Processor 110 can also be an integrated circuit chip with signal processing capabilities. The aforementioned processor 110 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 120. Processor 110 reads the information in memory 120 and, in conjunction with its hardware, completes the functions required by vehicle 100 in the embodiments of this application.
[0123] The communication interface 130 is used to enable communication between the vehicle 100 and other vehicles or communication networks. In some embodiments, the vehicle 100 establishes a communication connection with a second vehicle and / or a traffic management system through the communication interface 130.
[0124] Bus 140 is used to connect processor 110, memory 120, communication interface 130 and other possible modules or circuits.
[0125] It should be understood that Figure 5 The structure of the vehicle 100 shown is only an example. In other embodiments, the vehicle 100 may include more or fewer modules. For example, the vehicle may also include a first module, at least one second module, and a target module, etc. This application does not limit the scope of the invention.
[0126] In some embodiments, this application also provides a computer-readable storage medium storing at least one computer program instruction, at least one program segment, code set, or instruction set, which is loaded and executed by a model training system to implement the detection methods provided in the above-described method embodiments.
[0127] In some embodiments, this application also provides a computer program product, which includes computer program instructions that, when executed by a model training system, enable a device to implement the detection methods provided in the above-described method embodiments.
[0128] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0129] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.
[0130] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0131] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried on or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, computer-readable media may include various media capable of storing program code, such as USB flash drives, external hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0132] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.
[0133] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.
[0134] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0135] Although this application has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of this application.
Claims
1. A detection method applied to electronic equipment, characterized in that, The method includes: Obtain the DBC file; It is determined that the DBC file does not have a first error, wherein the first error indicates that the signal layout cannot be correctly obtained; Obtain the bit information occupied by each signal in the same signal group in the DBC file, wherein the bit information includes bit labels; Based on the bit information occupied by each signal, if there is overlap between the bit information occupied by at least two signals, it is determined that at least two signals in the same signal group in the DBC file have bit overlap errors.
2. The method according to claim 1, characterized in that, The first error includes the absence of a signal in the DBC file, and the method further includes: If the signal key string and / or signal special symbol are not present in the line following the signal key in the DBC file, it is determined that the DBC file contains the first error.
3. The method according to claim 1, characterized in that, The first error includes a signal in the DBC file that does not belong to any message, and the method further includes: If a first characteristic character and / or a second characteristic character are present in the line following the characteristic keyword of the DBC file, it is determined that the DBC file contains the first error.
4. The method according to claim 1, characterized in that, The DBC file is in little-endian byte order, and the first error includes incorrect configuration of the Data Length Code (DLC) in the DBC file. The method further includes: If the maximum number of bits occupied by a signal in the DBC file is greater than the maximum number of valid bits in the DBC file, it is determined that the DBC file has a first error.
5. The method according to claim 1, characterized in that, The DBC file is in big-endian byte order, and the first error includes incorrect Data Length Code (DLC) configuration in the DBC file. If the DBC file includes a first type of signal that does not span bytes, and the start bit of the first type of signal is greater than the maximum number of significant bits in the DBC file, then the DBC file is determined to have a first error. If the DBC file includes a second type of signal spanning multiple bytes, and the byte sequence number of the highest byte of the second type of signal is greater than the number of bytes in the DLC of the DBC file, then the DBC file is determined to have a first error.
6. The method according to claim 1, characterized in that, The first error includes the existence of more than [a certain number of] DBC files. A byte order, the method further includes: Obtain the byte order of all signals in the DBC file and store the byte order in the first dictionary database; If the first dictionary database is queried and more than one byte order exists in the first dictionary database, it is determined that the DBC file has a first error.
7. The method according to claim 1, characterized in that, The first error includes the absence of message type configuration and / or message type initialization in the DBC file, and the method further includes: If the DBC file does not contain a message type keyword and / or a message type initialization keyword, it is determined that the DBC file has a first error.
8. The method according to claim 7, characterized in that, The message type keyword includes a first keyword, and the initialization keyword includes a second keyword; The method further includes: Store each line of the DBC file in the first DBC list data; Read the first DBC list data and obtain the index of the first key in the first row of the first DBC list data; Based on the first row index, insert the message type configuration information into the position of the first row index; Read the first DBC list data and obtain the index of the second key in the second row of the first DBC list data; Based on the index of the second row, insert the initialization information of the message type at the position of the index of the second row; Obtain messages in the first DBC list data that do not include a third keyword, wherein the third keyword is used to define the message type of the messages in the first DBC list data; Initialize the message type of the message that does not include the third keyword to the Application type; Output the data from the first DBC list in text format.
9. The method according to claim 1, characterized in that, The first error includes the absence of a diagnostic configuration state and / or the initialization of the diagnostic configuration state in the DBC file. The method further includes: If the DBC file does not contain diagnostic configuration definition keywords and / or diagnostic configuration initialization keywords, it is determined that the DBC file has a first error.
10. The method according to claim 9, characterized in that, The diagnostic configuration definition keywords include a fourth keyword, and the diagnostic configuration initialization keywords include a fifth keyword; The method further includes: Store each line of the DBC file in the second DBC list data; Read the second DBC list data and obtain the index of the fourth key in the third row of the second DBC list data; Based on the third row index, insert the diagnostic requirement configuration information at the position of the third row index, insert the diagnostic response configuration information at the position of (the third row index + 1), and insert the diagnostic status configuration information at the position of (the third row index + 2). Read the second DBC list data and obtain the index of the fifth key in the fourth line of the DBC file; Based on the fourth row index, the diagnostic request initialization information is inserted at the position of the fourth row index, the diagnostic response initialization information is inserted at the position of (the fourth row index + 1), and the diagnostic status initialization information is inserted at the position of (the fourth row index + 2).
11. The method according to claim 1, characterized in that, The first error includes the existence of at least two signals with the same signal name in the same signal group in the DBC file, and the method further includes: Obtain all signal names for each signal group in the DBC file, and store each signal name in a second dictionary database according to its signal group. If each signal group in the second dictionary database is queried, and at least two identical signal names exist in the signal group, it is determined that the DBC file contains a first error.
12. The method according to claim 1, characterized in that, The method further includes: If at least one signal name in the DBC file contains more than 32 characters, or if at least two signals in the DBC file have the same signal name, a warning message will be output.
13. A detection device, characterized in that, include: First acquisition module, first determination module, second acquisition module, second determination module; The first acquisition module is used to acquire DBC files; The first determining module is used to determine that the DBC file does not have a first error, wherein the first error indicates that the signal layout cannot be correctly obtained; The second acquisition module is used to acquire the bit information occupied by each signal in the same signal group in the DBC file, and the bit information includes bit labels; The second determining module is used to determine, based on the bit information occupied by each signal, that at least two signals in the same signal group in the DBC file have bit overlap errors when there is overlap between the bit information occupied by at least two signals.
14. An electronic device, characterized in that, The device includes a processor and an interface circuit, wherein the interface circuit is used to receive signals from other communication devices and transmit them to the processor, or to send signals from the processor to other communication devices, and the processor implements the method as described in any one of claims 1 to 12 through logic circuits or executing code instructions.
15. A computer-readable storage medium, characterized in that, The storage medium stores a computer program or instructions, which, when executed by a communication device, implement the method as described in any one of claims 1 to 12.
16. A program product, characterized in that, The program product includes instructions that, when executed, cause the method as described in any one of claims 1 to 12 to be implemented.