Signal value analysis method and device, computer equipment and readable storage medium
By including a full signal type signal structure in the signal list details header file, the target signal structure of the target signal type is directly determined, and target auxiliary information is constructed based on the characteristic information of the message to be parsed, the problem of low signal value analysis efficiency in the prior art is solved, and the target signal data of the message to be parsed is quickly parsed.
Patent Information
- Application Number
- CN202510115234.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-04-22
AI Technical Summary
Existing signal value analysis methods are inefficient because each new signal type is resolved, developers spend a lot of time developing signal positioning programs.
By including a full signal type signal structure in the signal list details header file, the target signal structure of the target signal type is directly determined, and the target auxiliary information is constructed based on the characteristic information of the message to be parsed, and the packet to be parsed quickly is analyzed.
It avoids the waste of time in developing signal positioning programs, improves the efficiency of determining target auxiliary information and the analysis efficiency of packets to be parsed.
Smart Images

Figure CN119865539A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automotive electronic technology, and in particular to a signal value analysis method, device, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] The vehicle-mounted CAN (Controller Area Network) bus is a standard protocol for modern automotive communications and is widely used for data exchange between various electronic control units in the vehicle. The electronic control unit will parse the message to be parsed through the signal value parsing method to obtain signal data.
[0003] The current signal value parsing method determines the target signal type of the signal to be parsed according to the service type. Then, the developer needs to develop a signal positioning program corresponding to the target signal type. According to the signal positioning program, the signal message data of the signal to be parsed is located in the message to be parsed, and the signal message data and the message to be parsed are parsed to obtain the target signal data.
[0004] However, the current signal value analysis method, because there are different signal types to be analyzed in the vehicle, each time a new signal type to be analyzed, the developers will spend a lot of time to develop a new signal location program. Therefore, the current signal value analysis method is inefficient. Summary of the invention
[0005] Based on this, it is necessary to provide a signal value analysis method, device, computer equipment, computer readable storage medium and computer program product to address the above technical problems.
[0006] In a first aspect, the present application provides a signal value analysis method, comprising:
[0007] Get the message to be parsed;
[0008] Searching for message index information corresponding to the message to be parsed in the signal list index header file, and determining a target signal type and target signal index information of the target signal type in the message index information according to a target service type;
[0009] Determine a target signal structure of the target signal type in a signal list details header file based on the target signal index information, and determine characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains a signal structure of a full signal type;
[0010] According to the characteristic information of the message to be analyzed and the target signal structure, target auxiliary information of the message to be analyzed is constructed, and the message to be analyzed is analyzed according to the target auxiliary information to obtain target signal data of the message to be analyzed.
[0011] In one of the embodiments, before searching the signal list index header file for the message index information corresponding to the message to be parsed, the method further includes:
[0012] Obtain the signal information file of the target vehicle;
[0013] Parsing the message information of each controller local area network message in the signal information file to obtain each message structure;
[0014] A signal list index header file and a signal list detail header file are generated according to each of the message structures.
[0015] In one embodiment, the parsing of the message information of each controller area network message in the signal information file to obtain each message structure includes:
[0016] For the message information of each controller area network message in the signal information file, an initial message structure corresponding to the controller area network message is created; the message information includes message attribute information, signal attribute information of each signal type and signal location information;
[0017] Creating an initial signal structure of each signal type, and updating each initial signal structure according to the signal attribute information and signal position information of each signal type to obtain a signal structure of each signal type;
[0018] The initial message structure is updated according to the message attribute information and the signal structure of each signal type to obtain a message structure.
[0019] In one of the embodiments, querying the message index information corresponding to the message to be parsed in the signal list index header file, and determining the target signal type and the target signal index information of the target signal type in the message index information according to the target service type, includes:
[0020] According to the message identifier of the message to be parsed, query the message index information corresponding to the message to be parsed in the signal list index header file; the message index information includes each signal type and index information of each signal type;
[0021] Determining a target signal type among the signal types according to the target service type;
[0022] The signal index information corresponding to the target signal type is determined in the message index information as the target signal index information.
[0023] In one embodiment, the target signal structure includes the starting position and length of the signal of the target signal type, and determining the characteristic information of the message to be parsed based on the target signal structure includes:
[0024] Determine the signal message data of the signal to be parsed in the message to be parsed according to the starting position and the length;
[0025] The signal message data of the signal to be analyzed is determined as the characteristic information of the message to be analyzed.
[0026] In one embodiment, the target auxiliary information includes signal location information, and the step of parsing the message to be parsed according to the target auxiliary information to obtain target signal data of the message to be parsed includes:
[0027] Based on the target auxiliary information, determining whether the message to be parsed meets the parsing condition;
[0028] If the message to be parsed meets the parsing condition, intercepting an unsigned integer sequence in the message to be parsed, and calculating a bit start position of the signal to be parsed based on the signal position information;
[0029] Determine whether the sum of the length of the bit start position and the length of the signal position information exceeds a preset length range;
[0030] If the sum of the bit start position and the length does not exceed a preset length range, a mask value of the signal to be parsed is calculated, and target signal data of the signal to be parsed is extracted from the unsigned integer sequence according to the mask value.
[0031] In one of the embodiments, judging whether the message to be parsed meets the parsing condition based on the target auxiliary information includes:
[0032] Determining whether the length of the characteristic information in the target auxiliary information exceeds a preset signal length threshold;
[0033] If the length of the characteristic information does not exceed the signal length threshold, verifying the message to be parsed based on the target signal structure in the target auxiliary information to obtain a verification result;
[0034] Determine whether the message to be parsed meets the parsing condition according to the verification result.
[0035] In a second aspect, the present application also provides a signal value analysis device, comprising:
[0036] An acquisition module is used to obtain the message to be parsed;
[0037] A query module, used to query the message index information corresponding to the message to be parsed in the signal list index header file, and determine the target signal type and the target signal index information of the target signal type in the message index information according to the target service type;
[0038] A determination module, configured to determine a target signal structure of the target signal type in a signal list details header file based on the target signal index information, and determine characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains a signal structure of a full signal type;
[0039] The parsing module is used to construct target auxiliary information of the message to be parsed according to the characteristic information of the message to be parsed and the target signal structure, and parse the message to be parsed according to the target auxiliary information to obtain the target signal data of the message to be parsed.
[0040] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0041] Get the message to be parsed;
[0042] Searching for message index information corresponding to the message to be parsed in the signal list index header file, and determining a target signal type and target signal index information of the target signal type in the message index information according to a target service type;
[0043] Determine a target signal structure of the target signal type in a signal list details header file based on the target signal index information, and determine characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains a signal structure of a full signal type;
[0044] According to the characteristic information of the message to be analyzed and the target signal structure, target auxiliary information of the message to be analyzed is constructed, and the message to be analyzed is analyzed according to the target auxiliary information to obtain target signal data of the message to be analyzed.
[0045] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0046] Get the message to be parsed;
[0047] Searching for message index information corresponding to the message to be parsed in the signal list index header file, and determining a target signal type and target signal index information of the target signal type in the message index information according to a target service type;
[0048] Determine a target signal structure of the target signal type in a signal list details header file based on the target signal index information, and determine characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains a signal structure of a full signal type;
[0049] According to the characteristic information of the message to be analyzed and the target signal structure, target auxiliary information of the message to be analyzed is constructed, and the message to be analyzed is analyzed according to the target auxiliary information to obtain target signal data of the message to be analyzed.
[0050] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0051] Get the message to be parsed;
[0052] Searching for message index information corresponding to the message to be parsed in the signal list index header file, and determining a target signal type and target signal index information of the target signal type in the message index information according to a target service type;
[0053] Determine a target signal structure of the target signal type in a signal list details header file based on the target signal index information, and determine characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains a signal structure of a full signal type;
[0054] According to the characteristic information of the message to be analyzed and the target signal structure, target auxiliary information of the message to be analyzed is constructed, and the message to be analyzed is analyzed according to the target auxiliary information to obtain target signal data of the message to be analyzed.
[0055] The above-mentioned signal value parsing method, device, computer equipment, computer-readable storage medium and computer program product obtain a message to be parsed; query the message index information corresponding to the message to be parsed in the signal list index header file, and determine the target signal type and the target signal index information of the target signal type in the message index information according to the target service type; determine the target signal structure of the target signal type in the signal list details header file based on the target signal index information, and determine the characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains a signal structure of the full signal type; according to the characteristic information of the message to be parsed and the target signal structure, construct the target auxiliary information of the message to be parsed, and parse the message to be parsed according to the target auxiliary information to obtain the target signal data of the message to be parsed. With this method, since the signal list details header file contains the signal structure of the full signal type, the target signal structure of the target signal type can be directly determined in the signal list details header file, and the target auxiliary information for assisting the parsing of the message to be parsed can be quickly obtained by combining the target signal structure and the characteristic information of the message to be parsed, thereby avoiding spending a lot of time to write the signal positioning program of the target signal type and improving the efficiency of determining the target auxiliary information. Furthermore, based on the target auxiliary information, the message to be parsed can be quickly parsed to obtain the target signal data, thereby improving the efficiency of parsing the target signal data and the efficiency of the signal value parsing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A schematic diagram of a flow chart of a signal value analysis method in one embodiment;
[0058] Figure 2 A schematic diagram of a process of generating a signal list index header file and a signal list detail header file in one embodiment;
[0059] Figure 3 A schematic diagram of a process of parsing a signal information file in one embodiment;
[0060] Figure 4 A schematic diagram of a flow chart of generating a signal structure in an exemplary embodiment;
[0061] Figure 5A schematic diagram of a process for querying target signal index information in one embodiment;
[0062] Figure 6 A schematic diagram of a process for determining characteristic information of a message to be parsed in one embodiment;
[0063] Figure 7 A schematic diagram of a process for extracting target signal data in one embodiment;
[0064] Figure 8 A schematic diagram of a process for determining whether a message to be parsed meets a parsing condition in an embodiment;
[0065] Fig. 9 A flowchart of parsing a message to be parsed according to an exemplary embodiment;
[0066] Fig.10 is a structural block diagram of a signal value analysis device in an embodiment;
[0067] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0069] With the rapid development of automotive electronic technology, the in-vehicle CAN bus, as a standard protocol for modern automotive communications, has been widely used for data exchange between various electronic control units (ECUs) in vehicles. In the in-vehicle network, the CAN bus carries a large amount of important vehicle operation data, such as engine speed, vehicle speed, temperature and other key information. The electronic control unit will parse the message to be parsed through the signal value parsing method to obtain the signal data of the CAN bus signal.
[0070] In the current signal value parsing method, the electronic control unit determines the target signal type of the signal to be parsed according to the service type. Then, the developer needs to develop a signal locating program corresponding to the target signal type and install the signal locating program on the electronic control unit. The electronic control unit executes the signal locating program to locate the signal message data of the signal to be parsed in the message to be parsed. Then, the electronic control unit parses the signal message data and the message to be parsed to obtain the target signal data.
[0071] However, the current signal value analysis method, because there are different signal types to be analyzed in the vehicle, each time a new signal type to be analyzed, the developers will spend a lot of time to develop a new signal location program. Therefore, the current signal value analysis method is inefficient.
[0072] Furthermore, since there are signals of different signal types to be analyzed, if different signal types need to be analyzed, the signal location programs of different signal types need to be repeatedly installed in each electronic control unit of the target vehicle, resulting in a large waste of storage resources. The code coupling degree of each signal location program is high, resulting in complex code maintenance.
[0073] In addition, when developers develop signal locating programs, due to many subjective factors, it is easy to cause insufficient accuracy in target signal data analysis, especially when dealing with complex signal positions and lengths, data interception errors are prone to occur. In addition, a signal locating program has poor versatility and is difficult to adapt to CAN signals with different data formats and bit start points.
[0074] Based on the above-mentioned traditional signal value parsing method, the embodiment of the present application provides a signal value parsing method. Since the signal list details header file contains the signal structure of the full signal type, the target signal structure of the target signal type can be directly determined in the signal list details header file, and the target auxiliary information for assisting the parsing of the message to be parsed can be quickly obtained by combining the target signal structure and the characteristic information of the message to be parsed, thereby avoiding spending a lot of time to write the signal positioning program of the target signal type and improving the efficiency of determining the target auxiliary information. Furthermore, based on the target auxiliary information, the message to be parsed can be quickly parsed to obtain the target signal data, thereby improving the efficiency of parsing the target signal data and the efficiency of the signal value parsing method.
[0075] Furthermore, since the signal details list header file contains the signal structures of all signal types, the signal structures of different signal types can be determined by querying only one signal details list header file, thereby quickly determining the characteristic information of different messages to be parsed, avoiding the installation of a large number of signal locating programs in each electronic control unit, and reducing the storage space occupied by the signal value parsing method. Furthermore, by avoiding the installation of a large number of signal locating programs, the maintenance of a large number of signal locating program codes is avoided.
[0076] In addition, since the present application parses the message to be analyzed in combination with the target signal structure of the target signal type to which the signal to be analyzed belongs and the characteristic information of the message to be analyzed, personalized analysis of the signal to be analyzed and positioning of the target signal data in the message to be analyzed are achieved, the analysis accuracy is improved, and at the same time, the versatility of the signal value analysis method is improved.
[0077] In one embodiment, Figure 1 As shown, a signal value analysis method is provided. The embodiment of the present application takes the method applied to an electronic control unit (ECU) in a target vehicle as an example for explanation. The embodiment of the present application does not limit the execution device of the signal value analysis method, and includes the following steps 102 to 108:
[0078] Step 102: Obtain the message to be parsed.
[0079] The message to be parsed is also a controller area network message, that is, a CAN bus message.
[0080] In implementation, the electronic control unit obtains the message to be parsed. The electronic control unit needs to parse the message to be parsed, thereby obtaining the target signal data of the signal to be parsed. The message to be parsed is a message that complies with the vehicle-mounted CAN bus protocol.
[0081] Specifically, when the electronic control unit executes the target business process, the target signal data of the signal to be parsed is required. The electronic control unit obtains the message to be parsed. The electronic control unit needs to parse the message to be parsed to obtain the target signal data of the signal to be parsed. The message to be parsed contains a byte array of the original CAN data.
[0082] For example, the electronic control unit executes the temperature update process according to the period, and needs the target signal data of the temperature signal. The target signal data represents the temperature value. The electronic control unit needs to parse the message to be parsed, so as to obtain the target signal data of the signal to be parsed, so as to clarify the temperature value.
[0083] Step 104, query the message index information corresponding to the message to be parsed in the signal list index header file, and determine the target signal type and the target signal index information of the target signal type in the message index information according to the target service type.
[0084] The message index information includes each signal type and signal index information of each signal type. It should be understood that a CAN message carries at least one signal type, so the message index information of the CAN message also includes at least one signal type and signal type signal index information.
[0085] In implementation, the electronic control unit searches for message index information corresponding to the message to be parsed in the signal list index header file according to the message identifier of the message to be parsed. The electronic control unit determines the target signal type in the message index information according to the target service type. Then, the electronic control unit determines the target signal index information of the target signal type in each signal index information.
[0086] Specifically, an electronic control unit is provided on the target vehicle. The electronic control unit obtains a signal information file of the target vehicle. The electronic control unit parses the signal information file of the target vehicle to obtain a signal list index header file and a signal list detail header file of the target vehicle. The electronic control unit queries the message index information corresponding to the message to be parsed in the signal list index header file according to the message identifier of the message to be parsed. The electronic control unit determines the target signal type in each signal type of the message index information according to the target service type. Then, the electronic control unit determines the target signal index information of the target signal type in each signal index information.
[0087] Step 106: determine a target signal structure of the target signal type in the signal list detail header file based on the target signal index information, and determine feature information of the message to be parsed based on the target signal structure.
[0088] Among them, the signal list details header file contains the signal structure of all signal types.
[0089] In implementation, the electronic control unit searches for the target signal structure of the target signal type in the signal list detail header file according to the target signal index information. The target signal structure contains the signal location information and signal attribute information of the target signal type. The electronic control unit determines the characteristic information of the message to be parsed according to the signal location information.
[0090] Specifically, the target signal index information indicates the index position of the target signal structure of the target signal type. The signal position information of the target signal type characterizes the position of the signal of the target signal type. The signal position information of the target signal type includes the starting position and length of the signal of the target signal type. The electronic control unit determines the target signal structure in each signal structure of the signal list details header file according to the index position of the target signal structure. Then, the electronic control unit determines the characteristic information of the file to be parsed according to the starting position and length.
[0091] Step 108, constructing target auxiliary information of the message to be analyzed according to the characteristic information of the message to be analyzed and the target signal structure, and analyzing the message to be analyzed according to the target auxiliary information to obtain the target signal data of the message to be analyzed.
[0092] The target auxiliary information is used to assist the electronic control unit in parsing the message to be parsed.
[0093] In implementation, the electronic control unit combines the characteristic information of the message to be parsed and the target signal structure to obtain the target auxiliary information of the message to be parsed. Then, the electronic control unit determines whether the message to be parsed meets the parsing condition based on the target auxiliary information. If the message to be parsed meets the parsing condition, the electronic control unit parses the message to be parsed based on the target auxiliary information to obtain the target signal data of the message to be parsed. The target signal data represents the value of the signal to be parsed. The electronic control unit continues to execute the target business data based on the target signal data.
[0094] Specifically, the electronic control unit combines the characteristic information of the message to be parsed and the target signal structure to obtain the target auxiliary information of the message to be parsed. Then, the electronic control unit determines whether the message to be parsed meets the parsing condition according to the target auxiliary information. If the message to be parsed meets the parsing condition, the electronic control unit calculates the mask value of the signal to be parsed according to the target structure. Then, the electronic control unit extracts the target signal data of the signal to be parsed in the message to be parsed based on the mask value of the signal to be parsed.
[0095] In an optional embodiment, if the message to be parsed does not meet the parsing conditions, the electronic control unit returns 0.
[0096] In the above signal value analysis method, since the signal list details header file contains the signal structure of the full signal type, the target signal structure of the target signal type can be directly determined in the signal list details header file, and the target auxiliary information for assisting the analysis of the message to be analyzed can be quickly obtained by combining the target signal structure and the characteristic information of the message to be analyzed, thereby avoiding spending a lot of time to write the signal positioning program of the target signal type and improving the efficiency of determining the target auxiliary information. Furthermore, based on the target auxiliary information, the message to be analyzed can be quickly analyzed to obtain the target signal data, which improves the efficiency of analyzing the target signal data and also improves the efficiency of the signal value analysis method.
[0097] In an exemplary embodiment, before the signal list index header file queries the message index information, it is necessary to first generate a signal list index header file and a signal list detail header file according to the signal information file. Figure 2 As shown, before step 104 is executed, the specific processing process of the signal value analysis method also includes steps 202 to 206. Among them:
[0098] Step 202, obtaining the signal information file of the target vehicle.
[0099] In the implementation, the electronic control unit obtains the signal information file of the target vehicle. The signal information file includes the full controller area network message used when the electronic control units in the target vehicle exchange data. Each controller area network message includes the message attribute information of the controller area network message, the signal attribute information of each signal type, and the signal position information of each signal type.
[0100] In an exemplary embodiment, the electronic control unit determines a signal information file in the configuration information of the target vehicle and acquires the signal information file.
[0101] Exemplarily, the electronic control unit reads the signal information file from the vehicle terminal according to the path of the signal information file. For example, the signal information file is signal_list.csv. The signal information file contains the message information of each CAN message. The message information contains message attribute information, signal attribute information of each signal type, and signal position information of each signal type. The message attribute information contains the message name (CAN message name) and the message identifier (message identifier). The signal attribute information contains the signal name and the signal identifier. The signal position information contains the starting position of the signal, the length of the signal, the byte order, the factor, the offset, the big and small end, etc.
[0102] Optionally, the format of the signal information file may be, but is not limited to, CSV (Comma-Separated Values), XML (Extensible Markup Language), and JSON (JavaScript Object Notation, JavaScript is a programming language), but the CSV format is relatively concise and easy to process. The embodiment of the present application does not limit the format of the signal information file.
[0103] Step 204, parsing the message information of each controller local area network message in the signal information file to obtain each message structure.
[0104] In implementation, the electronic control unit reads each line of data in the signal information file, and extracts the message information of the controller area network message according to the field to obtain each message structure.
[0105] Specifically, the electronic control unit reads each row of data through the CSV parsing library. Then, for each row of data, the electronic control unit creates an initial message structure for each controller area network message in the row of data, and parses the message information of the controller area network message. The electronic control unit updates the initial message structure according to the parsed message information to obtain a message structure.
[0106] Step 206: Generate a signal list index header file and a signal list detail header file according to each message structure.
[0107] The message structure includes message attribute information of the controller area network message and signal structures of various signal types.
[0108] In implementation, the electronic control unit generates a signal list index header file according to each message structure. Then, the electronic control unit generates a signal list detail header file according to the signal list index header file and each signal structure.
[0109] Specifically, the electronic control unit creates a new initial signal list index header file and initializes the comments and header file references in the signal list index header file. Then, the electronic control unit counts the number of controller area network messages and the number of signal structures. The electronic control unit defines macros to represent the number of controller area network messages and the number of signal structures. Then, the electronic control unit generates a macro for each controller area network message to represent the index position of the controller area network message. The electronic control unit generates a macro for each signal structure to control the index position of the signal structure. The electronic control unit generates a message identifier (CAN ID, Controller Area Network Identity Document) for each controller area network message and represents it with a macro. Then, the electronic control unit updates the initial signal list index header file according to the macro of the number of signal structures, the macro of the number of controller area network messages, the macro of each controller area network message, the macro of each signal structure, and the identifier of each controller area network message to obtain the signal list index header file. The electronic control unit creates a new initial signal list detail header file. Then, the electronic control unit updates each message structure into the initial signal list detail header file according to the macro of each signal structure in the signal index header file and the macro of each controller area network message, thereby obtaining the signal list detail header file.
[0110] In an exemplary embodiment, the electronic control unit parses the signal information file of the target vehicle, and generates a signals.h header file in C language according to the parsed messages dictionary (information dictionary). The signals.h header file is a signal list index header file. The signal list index header file contains macro definitions (such as the number of CAN messages, the number of signal structures, etc.) and index definitions of CAN messages and signal structures. The specific implementation method is as follows: the electronic control unit initializes the header part of the initial signal list index header file. The header part contains comments and header file references. Then, the electronic control unit calculates the number of CAN messages and signal structures, and defines macros (#define) to represent these numbers. The electronic control unit generates a macro for each CAN message, indicating the index position of the CAN message. Then, the electronic control unit generates a macro for each signal structure, identifying the index position of the signal structure. The electronic control unit generates a CAN ID for each CAN message and represents it with a macro definition. Then, the electronic control unit generates a signal_variable.h header file according to the parsed messages dictionary (information dictionary). The signal_variable.h header file is a signal list detail header file. The signal list details header file defines the signal structure (Can_SigConfType), byte order, etc. of each signal type. The specific implementation method is: the parsed information dictionary contains the message structure of each control LAN message. The electronic control unit updates the message structure of each controller LAN message to the initial signal list details header file according to the macro of each signal structure in the signal index header file and the macro of each controller LAN, and obtains the signal list details header file.
[0111] Optionally, in the signal list index header file, if updated custom functions, such as conditional compilation, etc., are required, the electronic control unit may add more macro definitions in the signal list index header file to represent the newly added custom functions. The embodiment of the present application does not limit the macro definitions in the signal list index header file.
[0112] In this embodiment, by parsing the signal information file of the target vehicle, a signal list index header file and a signal list detail header file containing a signal structure of all signal types are obtained, so that the characteristic information of the signals to be parsed of different signal types can be quickly determined through a signal list detail header file, avoiding the installation of a large number of signal positioning programs and saving a large amount of storage space. In addition, the signal list detail header file is applicable to signals to be parsed of various signal types and has strong versatility.
[0113] In an exemplary embodiment, Figure 3 As shown, the specific processing process of step 204 includes steps 302 to 306. Among them:
[0114] Step 302: Create an initial message structure corresponding to each CAN message in the signal information file.
[0115] The message information includes message attribute information, signal attribute information of each signal type, and signal location information.
[0116] In implementation, the electronic control unit creates an initial message structure corresponding to each controller area network message in accordance with a preset structure format for the message information of the controller area network message in the signal information file.
[0117] In an exemplary embodiment, the structure format is a dictionary. The message attribute information includes the message identifier and message name of the controller area network message. The electronic control unit creates a dictionary messages corresponding to the controller area network message for the message information of each controller area network message in each signal information file.
[0118] Step 304: Create an initial signal structure of each signal type, and update each initial signal structure according to the signal attribute information and signal position information of each signal type to obtain a signal structure of each signal type.
[0119] In implementation, the electronic control unit creates an initial signal structure corresponding to each signal type, and then adds the signal attribute information and signal position information of each signal type to the initial signal structure to obtain a signal structure.
[0120] Specifically, the initial signal structure is a dictionary. The signal attribute information includes the signal name and the signal identifier. The signal position information includes the starting position of the signal, the length, byte order, factor, offset, big and small end of the signal, etc. The electronic control unit creates an initial dictionary corresponding to each initial signal type. Then, the electronic control unit determines the signal name of the signal type as the key of the initial dictionary, and determines the signal identifier of the signal type, the starting position of the signal, the length, byte order, factor, offset, big and small end of the signal as the value of the initial dictionary to obtain a dictionary.
[0121] Optionally, the initial message structure and the initial signal structure may be, but are not limited to, dictionaries and classes, etc. If the signal type and byte order are more complex, a more complex enumeration type or a custom type may be used. The embodiment of the present application does not limit the types of the initial message structure and the initial signal structure.
[0122] Step 306: Update the initial message structure according to the message attribute information and the signal structure of each signal type to obtain a message structure.
[0123] In implementation, the electronic control unit builds a signal list of the controller area network message according to the signal structure of each signal type. Then, the electronic control unit adds the signal list and message attribute information to the initial message structure to obtain the message structure.
[0124] Specifically, the electronic control unit creates an initial signal list of the controller area network message, and adds the signal structure of each signal type to the initial signal list to obtain the signal list of the controller area network message. Then, the electronic control unit determines the message name in the message attribute information as the key of the initial message structure, and determines the message identifier and the signal list in the message attribute information as the value of the initial message structure to obtain the message structure.
[0125] In an exemplary embodiment, the electronic control unit defines a signal structure Can_SigConfType for each signal type. The signal structure contains a CAN ID (message identifier of a controller area network message), a signal ID (signal identifier of a signal type), a start bit, a length, an endianness, a signal type, a factor, and an offset. The electronic control unit initializes the Can_Ids array for each controller area network message and fills the Can ID of the CAN message in the Can_Ids array. The electronic control unit initializes the Can_SigConfInfo array (signal list) and fills the signal structure of each signal type. The electronic control unit generates the relevant structure content for each signal type and writes it into the Can_SigConfInfo array.
[0126] In an exemplary embodiment, Figure 4 FIG. 1 is a flow chart of generating a signal structure in an exemplary embodiment. Figure 4 As shown, the process of generating a signal structure includes:
[0127] Step 401: Generate a signal data table according to the CAN matrix table. The signal data packet is a signal information file.
[0128] Step 402, calling a script program to read a signal data table.
[0129] Step 403: Generate a signal structure of each signal type.
[0130] In an optional embodiment, the electronic control unit writes the generated signals.h (signal list index header file) and signal_variable.h (signal list detail header file) contents into a designated output file through a file writing module.
[0131] Optionally, the ECU can choose to directly output signals.h and signal_variable.h to multiple file paths, supporting dynamic selection of output file paths.
[0132] In this embodiment, by parsing the message information of each controller local area network message and generating a message structure according to the parsed message information, it is convenient to subsequently generate a signal list index header file and a signal list detail header file based on the message structure. The signal list detail header file can quickly determine the characteristic information of the to-be-parsed signals of different signal types, avoids the installation of a large number of signal positioning programs, saves a large amount of storage space, and is suitable for embedded systems.
[0133] In an exemplary embodiment, Figure 5 As shown, the specific processing process of step 104 includes steps 502 to 506. Among them:
[0134] Step 502: Search the signal list index header file for message index information corresponding to the message to be parsed according to the message identifier of the message to be parsed.
[0135] The message index information includes each signal type and index information of each signal type.
[0136] In implementation, the electronic control unit searches for message index information containing the message identifier in the signal index header file according to the message identifier of the message to be parsed.
[0137] Specifically, the electronic control unit determines whether the message identifier of the controller area network message is the same as the message identifier of the message to be parsed for each controller area network message in the signal list index header file. If the message identifier of the controller area network message is the same as the message identifier of the message to be parsed, the electronic control unit determines the message index information corresponding to the message identifier as the message index information corresponding to the message to be parsed.
[0138] Step 504: determine a target signal type among various signal types according to the target service type.
[0139] In implementation, the service type in which the target service belongs is the target service type. The electronic control unit determines the target signal type corresponding to the target service type in each signal type according to the target service type.
[0140] In an exemplary embodiment, the target service is temperature timing update. The target service type is temperature update type. The electronic control unit determines the target signal type as temperature signal type among various signal types according to the temperature update type.
[0141] Step 506: Determine in the message index information the signal index information corresponding to the target signal type as the target signal index information.
[0142] In implementation, the electronic control unit determines the index information corresponding to the target signal type in each signal index information as the target signal index information, so as to facilitate subsequent query of the target signal structure of the target signal type.
[0143] In an exemplary embodiment, the target signal type is a temperature signal type. The electronic control unit determines the temperature signal index information corresponding to the temperature signal type as the target signal index information, so as to facilitate subsequent query of the temperature signal structure in the signal list detail header file.
[0144] In this embodiment, since the signal list details header file contains the signal structure of all signal types, the target signal structure of the target signal type can be directly determined in the signal list details header file, thereby quickly constructing the target auxiliary information of the message to be parsed. In addition, the signal structure of the signal to be parsed of different signal types can be determined through the signal list details header file, which expands the scope of application of the signal value parsing method.
[0145] In an exemplary embodiment, the target signal structure includes the starting position and length of the signal of the target signal type, such as Figure 6 As shown, the specific processing process of determining the characteristic information of the message to be parsed based on the target signal structure in step 106 includes steps 602 to 604. Among them:
[0146] Step 602: determine the signal message data of the signal to be parsed in the message to be parsed according to the starting position and the length.
[0147] In implementation, the electronic control unit determines the starting position of the signal message data in the message to be parsed according to the starting position. Then, the electronic control unit starts with the starting position of the signal message data and determines the signal message data in the message to be parsed according to the length.
[0148] Step 604: determine the signal message data of the signal to be analyzed as the characteristic information of the message to be analyzed.
[0149] In implementation, the electronic control unit determines the signal message data of the signal to be analyzed as the characteristic information of the message to be analyzed, so as to facilitate the subsequent analysis of the message to be analyzed according to the characteristic information.
[0150] Specifically, since the signal to be parsed in the message to be parsed belongs to the target signal type, the electronic control unit determines the signal message data of the message to be parsed in the message to be parsed according to the signal position information of the target signal type, and determines the signal message data as the characteristic information of the message to be parsed, so as to facilitate the subsequent parsing of the message to be parsed based on the characteristic information.
[0151] In this embodiment, the target signal structure of the target signal type and the characteristic information of the message to be parsed can be combined to quickly obtain target auxiliary information to assist in parsing the message to be parsed, avoiding spending a lot of time on writing a signal positioning program of the target signal type and improving the efficiency of determining the target auxiliary information.
[0152] In an exemplary embodiment, the target auxiliary information includes signal location information, such as Figure 7 As shown, the specific processing process of parsing the message to be parsed according to the target auxiliary information in step 108 to obtain the target signal data of the message to be parsed includes steps 702 to 708. Among them:
[0153] Step 702: Based on the target auxiliary information, determine whether the message to be parsed meets the parsing condition.
[0154] The target auxiliary information includes characteristic information of the message to be parsed and a target signal structure.
[0155] In implementation, the electronic control unit verifies the message to be parsed according to the characteristic information and the target signal structure to obtain a verification result. Then, the electronic control unit determines whether the message to be parsed meets the parsing condition according to the verification result.
[0156] In an optional embodiment, if the message to be parsed does not meet the parsing conditions, the electronic control unit returns 0 to the target business, so that the target business knows that the message to be parsed is invalid or the characteristic information in the message to be parsed is out of range.
[0157] Step 704: if the message to be parsed meets the parsing condition, an unsigned integer sequence is intercepted from the message to be parsed, and the bit start position of the signal to be parsed is calculated based on the signal position information.
[0158] The signal position information includes the starting position, length, and big and small ends.
[0159] In implementation, if the standby parsing message meets the parsing condition, the electronic control unit intercepts an unsigned integer sequence of a preset length in the message to be parsed. Then, the electronic control unit calculates the bit starting position of the signal to be parsed based on the starting position, length and big and small ends.
[0160] In an exemplary embodiment, if the message to be parsed meets the parsing conditions, the electronic control unit combines the first 8 bytes (each byte is 8 bits) in the message to be parsed into a 64-bit unsigned integer. The combination is in big-endian format (high-order byte first). Then, the electronic control unit calculates the bit start position of the signal based on the start position and the length. The bit start position is the logical start position of the signal to be parsed.
[0161] Step 706, determine whether the sum of the length of the bit start position and the length of the signal position information exceeds a preset length range.
[0162] In implementation, before extracting the target signal data of the signal to be analyzed, the electronic control unit performs an addition operation on the bit start position and the length to obtain an operation result. Then, the electronic control unit determines whether the operation result exceeds a preset length range to determine whether the target signal data of the signal to be analyzed is within the unsigned integer sequence.
[0163] In an exemplary embodiment, the preset length range is 64 bits. The electronic control unit performs an addition operation on the bit start position and the length to obtain an operation result. Then, the electronic control unit determines whether the operation result exceeds 64 bits to determine whether the target signal data of the signal to be parsed is within the unsigned integer sequence. If the operation result does not exceed 64 bits, it means that the target signal data of the signal to be parsed is within the unsigned integer sequence, and the electronic control unit continues to perform the following step 706.
[0164] In an optional embodiment, if the calculation result exceeds 64 bits, it means that the target signal data of the signal to be parsed is not in the unsigned integer sequence, and the electronic control unit returns 0 to the target service, so that the target service can clearly understand that the target signal data in the message to be parsed exceeds the preset length range.
[0165] Step 708: If the sum of the bit start position and the length does not exceed the preset length range, the mask value of the signal to be parsed is calculated, and the target signal data of the signal to be parsed is extracted from the unsigned integer sequence according to the mask value.
[0166] In implementation, if the sum of the bit start position and the length does not exceed the preset length range, the electronic control unit creates a mask value of the signal to be parsed. The length of the mask value is equal to the length of the signal to be parsed. The mask value is used to extract the bit value of the signal to be parsed. Then, the electronic control unit aligns the bit start position of the signal to be parsed to the lowest bit through a bit shift operation, and uses the mask value to extract the bit value of the signal to be parsed. The bit value of the signal to be parsed is the target signal data of the signal to be parsed.
[0167] In an optional embodiment, the electronic control unit feeds back the target signal data of the signal to be analyzed to the target service, so that the electronic control unit continues to execute the target service according to the target signal data.
[0168] In this embodiment, the target auxiliary information can be used to quickly parse the message to be parsed, thereby obtaining the target signal data, thereby improving the efficiency of parsing the target signal data and the efficiency of the signal value parsing method. Moreover, the target auxiliary information of the message to be parsed can accurately locate the target signal data and improve the parsing accuracy. In addition, since the present application extracts the target signal data through bit operations, compared with the traditional traversal method for extracting the target signal data, the calculation efficiency of the target signal data is improved.
[0169] In an exemplary embodiment, Figure 8 As shown, the specific processing process of step 702 includes steps 802 to 806. Among them:
[0170] Step 802: determine whether the length of the characteristic information in the target auxiliary information exceeds a preset signal length threshold.
[0171] Among them, the target auxiliary information includes feature information and target signal structure.
[0172] In implementation, a signal length threshold is pre-set in the electronic control unit, and the electronic control unit determines whether the length of the characteristic information in the target auxiliary information exceeds the signal length threshold.
[0173] In an exemplary embodiment, the characteristic information is the signal message data of the signal to be analyzed. The data transmission of each electronic control unit in the target vehicle follows the standard CAN bus protocol, and the length threshold preset in the electronic control unit is 64 bits. The electronic control unit determines whether the length of the signal message data exceeds 64 bits.
[0174] In an optional embodiment, if the length of the characteristic information exceeds the signal length threshold, the electronic control unit determines that the message to be parsed does not meet the parsing condition.
[0175] Optionally, the length threshold is personalized according to the CAN bus protocol and the data interaction properties of the electronic control unit. The embodiment of the present application does not limit the length threshold.
[0176] Step 804: If the length of the characteristic information does not exceed the signal length threshold, the message to be parsed is verified based on the target signal structure in the target auxiliary information to obtain a verification result.
[0177] In implementation, if the length of the characteristic information does not exceed the signal length threshold, the electronic control unit verifies the message to be parsed according to the target signal structure to obtain a verification result.
[0178] Specifically, the target signal structure includes the signal name, byte order, factor, offset, endianness, etc. of the target signal type. The electronic control unit determines whether the attribute information of the message to be parsed conforms to the signal name, byte order, and endianness of the target signal type.
[0179] Optionally, the electronic control unit can, but is not limited to, verify the signal name, byte order, and big and small ends, and perform personalized settings according to verification requirements. The embodiments of the present application do not limit the verification content.
[0180] Step 806: determine whether the message to be parsed meets the parsing condition based on the verification result.
[0181] In implementation, the verification result includes verification pass and verification fail. If the verification result is verification pass, the electronic control unit determines that the message to be parsed meets the parsing condition. If the verification result is verification fail, the electronic control unit determines that the message to be parsed does not meet the parsing condition.
[0182] In an optional embodiment, if the message to be parsed does not meet the parsing conditions, the electronic control unit returns 0 to the target business, so that the target business knows that the message to be parsed is invalid or the characteristic information in the message to be parsed is out of range.
[0183] In this embodiment, by verifying the message to be parsed, the parsing process can be quickly terminated when the message to be parsed is not suitable for parsing, thereby improving the verification efficiency. In addition, by quickly terminating the message process of the message to be parsed that is not suitable for parsing, the error handling mechanism is improved and the system stability is ensured. In addition, the present application is applicable to a variety of CAN data byte order formats (for example, Motorola (big endian) or Intel (little endian)), which improves the versatility of the signal value parsing method.
[0184] In an exemplary embodiment, Fig. 9 FIG. 1 is a flowchart of an exemplary embodiment for parsing a message to be parsed. Fig. 9 As shown, the process of parsing the message to be parsed includes:
[0185] Step 901: The message to be parsed and target auxiliary information of the message to be parsed are passed into the parsing function.
[0186] Step 902, determine whether the length of the characteristic information of the message to be parsed exceeds the signal length threshold. If the length of the characteristic information exceeds the signal length threshold, restart the parsing of the message to be parsed. If the length of the characteristic information does not exceed the signal length threshold, execute step 903.
[0187] Step 903: Verify the message to be parsed according to the target signal structure in the target auxiliary information. If the verification succeeds, execute step 904. If the verification fails, restart the parsing of the message to be parsed.
[0188] Step 904: extract an unsigned integer sequence from the message to be parsed.
[0189] Step 905, calculating the bit starting position, mask value and starting bit of the signal to be analyzed.
[0190] Step 906 : extracting target signal data of the signal to be analyzed from the unsigned integer sequence according to the bit start position and the mask value.
[0191] Step 907, returning target signal data.
[0192] In an exemplary embodiment, four modules are provided in the electronic control unit to generate a signal list detail header file and a signal list index header file of a target vehicle. The four modules include a data parsing module, a macro definition generation module, a structure definition module and a file generation module. Specifically:
[0193] The data parsing module is used to parse the CSV file (signal information file) and store the data into the messages dictionary (message structure) in the memory. This module works closely with the file reading module and the data storage module.
[0194] The macro definition generation module is used to generate macro definitions in C language based on the data in the messages dictionary, and finally form the signals.h header file (signal list index header file).
[0195] The structure definition module is used to generate the signal structure and fill in the signal configuration information, and finally form the signal_variable.h header file (signal list details header file).
[0196] The file generation module is responsible for writing the contents of the generated C language header file (signal list index header file and signal list detail header file) into the specified output file.
[0197] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0198] Based on the same inventive concept, the embodiment of the present application also provides a signal value analysis device for implementing the signal value analysis method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more signal value analysis device embodiments provided below can refer to the limitations of the signal value analysis method above, and will not be repeated here.
[0199] In an exemplary embodiment, Fig.10 As shown, a signal value analysis device 1000 is provided, comprising: an acquisition module 1001, a query module 1002, a determination module 1003 and an analysis module 1004, wherein:
[0200] The acquisition module 1001 is used to acquire the message to be parsed.
[0201] The query module 1002 is used to query the message index information corresponding to the message to be parsed in the signal list index header file, and determine the target signal type and the target signal index information of the target signal type in the message index information according to the target service type.
[0202] Determination module 1003 is used to determine the target signal structure of the target signal type in the signal list details header file based on the target signal index information, and determine the characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains the signal structure of the full signal type.
[0203] The parsing module 1004 is used to construct target auxiliary information of the message to be parsed according to the characteristic information of the message to be parsed and the target signal structure, and parse the message to be parsed according to the target auxiliary information to obtain the target signal data of the message to be parsed.
[0204] In an exemplary embodiment, the signal value analysis device 1000 further includes:
[0205] The second acquisition module is used to acquire the signal information file of the target vehicle.
[0206] The second parsing module is used to parse the message information of each controller local area network message in the signal information file to obtain each message structure.
[0207] A generation module is used to generate a signal list index header file and a signal list detail header file according to each message structure.
[0208] In an exemplary embodiment, the second parsing module includes:
[0209] The first creation submodule is used to create an initial message structure corresponding to the controller area network message according to the message information of each controller area network message in the signal information file; the message information includes message attribute information, signal attribute information of each signal type and signal position information.
[0210] The second creation submodule is used to create an initial signal structure of each signal type, and update each initial signal structure according to the signal attribute information and signal position information of each signal type to obtain a signal structure of each signal type.
[0211] The first updating submodule is used to update the initial message structure according to the message attribute information and the signal structure of each signal type to obtain a message structure.
[0212] In an exemplary embodiment, the query module 1002 includes:
[0213] The first query submodule is used to query the message index information corresponding to the message to be parsed in the signal list index header file according to the message identifier of the message to be parsed; the message index information includes each signal type and index information of each signal type.
[0214] The first determination submodule is used to determine a target signal type among various signal types according to a target service type.
[0215] The second determining submodule is used to determine the signal index information corresponding to the target signal type in the message index information as the target signal index information.
[0216] In an exemplary embodiment, the target signal structure includes the starting position and length of the signal of the target signal type, and the determination module 1003 includes a third determination submodule and a fourth determination submodule. Among them, the fourth determination submodule includes:
[0217] The fifth determining submodule is used to determine the signal message data of the signal to be parsed in the message to be parsed according to the starting position and the length.
[0218] The sixth determining submodule is used to determine the signal message data of the signal to be analyzed as the characteristic information of the message to be analyzed.
[0219] In an exemplary embodiment, the target auxiliary information includes signal position information, and the parsing module 1004 includes a first construction submodule and a first parsing submodule. The first parsing submodule includes:
[0220] The first judgment submodule is used to judge whether the message to be parsed meets the parsing condition based on the target auxiliary information.
[0221] The interception submodule is used to intercept an unsigned integer sequence in the message to be parsed if the message to be parsed meets the parsing conditions, and calculate the bit starting position of the signal to be parsed based on the signal position information.
[0222] The second judgment submodule is used to judge whether the sum of the length of the bit start position and the length of the signal position information exceeds a preset length range.
[0223] The calculation submodule is used to calculate the mask value of the signal to be analyzed if the sum of the bit starting position and the length does not exceed the preset length range, and extract the target signal data of the signal to be analyzed from the unsigned integer sequence according to the mask value.
[0224] In an exemplary embodiment, the first determination submodule includes:
[0225] The second judgment submodule is used to judge whether the length of the characteristic information in the target auxiliary information exceeds a preset signal length threshold.
[0226] The check submodule is used to check the message to be parsed based on the target signal structure in the target auxiliary information to obtain a check result if the length of the characteristic information does not exceed the signal length threshold.
[0227] The third judgment submodule is used to judge whether the message to be parsed meets the parsing condition according to the verification result.
[0228] Each module in the above-mentioned signal value analysis device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0229] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig.11As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data used in the signal value analysis method. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a signal value analysis method is implemented.
[0230] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0231] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0232] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0233] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0234] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0235] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0236] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A signal value analysis method, characterized in that: The method comprises: Get the message to be parsed; Searching for message index information corresponding to the message to be parsed in the signal list index header file, and determining a target signal type and target signal index information of the target signal type in the message index information according to a target service type; Determine a target signal structure of the target signal type in a signal list details header file based on the target signal index information, and determine characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains a signal structure of a full signal type; According to the characteristic information of the message to be analyzed and the target signal structure, target auxiliary information of the message to be analyzed is constructed, and the message to be analyzed is analyzed according to the target auxiliary information to obtain target signal data of the message to be analyzed.
2. The method according to claim 1, characterized in that Before searching the signal list index header file for message index information corresponding to the message to be parsed, the method further includes: Obtain the signal information file of the target vehicle; Parsing the message information of each controller local area network message in the signal information file to obtain each message structure; A signal list index header file and a signal list detail header file are generated according to each of the message structures.
3. The method according to claim 2, characterized in that The parsing of the message information of each controller local area network message in the signal information file to obtain each message structure includes: For the message information of each controller area network message in the signal information file, an initial message structure corresponding to the controller area network message is created; the message information includes message attribute information, signal attribute information of each signal type and signal location information; Creating an initial signal structure of each signal type, and updating each initial signal structure according to the signal attribute information and signal position information of each signal type to obtain a signal structure of each signal type; The initial message structure is updated according to the message attribute information and the signal structure of each signal type to obtain a message structure.
4. The method according to claim 1, characterized in that: The step of searching the signal list index header file for message index information corresponding to the message to be parsed, and determining the target signal type and target signal index information of the target signal type in the message index information according to the target service type, includes: According to the message identifier of the message to be parsed, query the message index information corresponding to the message to be parsed in the signal list index header file; the message index information includes each signal type and index information of each signal type; Determining a target signal type among the signal types according to the target service type; The signal index information corresponding to the target signal type is determined in the message index information as the target signal index information.
5. The method according to claim 1, characterized in that The target signal structure includes the starting position and length of the signal of the target signal type, and determining the characteristic information of the message to be parsed based on the target signal structure includes: Determine the signal message data of the signal to be parsed in the message to be parsed according to the starting position and the length; The signal message data of the signal to be analyzed is determined as the characteristic information of the message to be analyzed.
6. The method according to claim 1, characterized in that The target auxiliary information includes signal position information, and the parsing of the message to be parsed according to the target auxiliary information to obtain target signal data of the message to be parsed includes: Based on the target auxiliary information, determining whether the message to be parsed meets the parsing condition; If the message to be parsed meets the parsing condition, intercepting an unsigned integer sequence in the message to be parsed, and calculating a bit start position of the signal to be parsed based on the signal position information; Determine whether the sum of the length of the bit start position and the length of the signal position information exceeds a preset length range; If the sum of the bit start position and the length does not exceed a preset length range, a mask value of the signal to be parsed is calculated, and target signal data of the signal to be parsed is extracted from the unsigned integer sequence according to the mask value.
7. The method according to claim 6, characterized in that The determining, based on the target auxiliary information, whether the message to be parsed meets a parsing condition includes: Determining whether the length of the characteristic information in the target auxiliary information exceeds a preset signal length threshold; If the length of the characteristic information does not exceed the signal length threshold, verifying the message to be parsed based on the target signal structure in the target auxiliary information to obtain a verification result; Determine whether the message to be parsed meets the parsing condition according to the verification result.
8. A signal value analysis device, characterized in that: The device comprises: An acquisition module is used to obtain the message to be parsed; A query module, used to query the message index information corresponding to the message to be parsed in the signal list index header file, and determine the target signal type and the target signal index information of the target signal type in the message index information according to the target service type; A determination module, configured to determine a target signal structure of the target signal type in a signal list details header file based on the target signal index information, and determine characteristic information of the message to be parsed based on the target signal structure; the signal list details header file contains a signal structure of a full signal type; The parsing module is used to construct target auxiliary information of the message to be parsed according to the characteristic information of the message to be parsed and the target signal structure, and parse the message to be parsed according to the target auxiliary information to obtain the target signal data of the message to be parsed.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.