Message processing method, device, electronic device and computer-readable storage medium
By analyzing SPI message files and DBC configuration files, the automatic analysis of SPI message is realized, solving the problem of difficulty in obtaining SPI message data information in the existing technology, and improving the convenience of use.
Patent Information
- Application Number
- CN202211699867.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-12-28
AI Technical Summary
The lack of a method for realizing automatic analysis of SPI packets in the prior art makes it difficult for users to obtain data information in SPI packets intuitively and comprehensively, causing inconvenience to users.
By obtaining the SPI message file and its corresponding DBC configuration file, parsing the DBC configuration file in the preset format, obtaining the configuration content of each configuration item, and using these configuration contents to parse the SPI message file to achieve automatic parsing.
It realizes automatic analysis of SPI messages, obtains comprehensive and accurate message content, and improves the convenience of SPI messages.
Smart Images

Figure CN116016721B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message processing method, and also to a message processing device, an electronic device, and a computer-readable storage medium. Background Art
[0002] SPI (Serial Peripheral Interface) is a high-speed, full-duplex, synchronous communication bus that can send and receive data simultaneously. It is often used as a serial expansion interface for microcontroller peripheral chips and has a wide range of applications.
[0003] For SPI messages based on the SPI communication protocol, the prior art does not provide a feasible implementation method to parse or modify the message format, which is inconvenient for users to intuitively and comprehensively obtain the data information carried therein. If a data flag bit in the SPI message needs to be obtained, it can only be found by manually calculating the data bits, which causes a lot of inconvenience to users.
[0004] Therefore, how to realize automatic parsing of SPI messages, thereby obtaining comprehensive and accurate message content, and improving the convenience of using SPI messages is a problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The purpose of the present application is to provide a message processing method, which can realize automatic parsing of SPI messages, help to obtain comprehensive and accurate message content, and improve the convenience of using SPI messages; another purpose of the present application is to provide a message processing device, electronic device and computer-readable storage medium, all of which have the above-mentioned beneficial effects.
[0006] In a first aspect, the present application provides a message processing method, comprising:
[0007] Obtain an SPI message file and a DBC configuration file corresponding to the SPI message file;
[0008] Parsing the DBC configuration file according to a preset format to obtain configuration content of each configuration item;
[0009] The SPI message file is parsed using each of the configuration contents to obtain a parsing result.
[0010] Optionally, before obtaining the SPI message file and the DBC configuration file corresponding to the SPI message file, the method further includes:
[0011] In response to a message recording instruction, performing message recording according to the message recording instruction;
[0012] The recording duration is recorded in real time, and whenever the recording duration reaches a preset duration, the SPI message file is generated based on the recording result within the preset duration.
[0013] Optionally, the responding to the message recording instruction and performing message recording according to the message recording instruction includes:
[0014] Perform real-time monitoring on the device channel, and when the incoming message information is detected, respond to the message recording instruction;
[0015] The SPI message transmitted by the device channel is recorded according to the message recording instruction.
[0016] Optionally, parsing the DBC configuration file according to a preset format to obtain configuration content of each configuration item includes:
[0017] Determining a parsing order of each of the configuration items according to the preset format;
[0018] The DBC configuration file is parsed according to the parsing order to obtain the configuration content of each configuration item.
[0019] Optionally, the message processing method further includes:
[0020] Obtain a first verification file and a preset output template according to a file verification instruction;
[0021] Parsing the first verification file according to the preset format to obtain configuration content of each configuration item;
[0022] For each of the configuration items, verify the configuration content of the DBC configuration file using the configuration content of the first verification file to obtain a verification result; the verification result includes undefined, definition difference, and verification passed;
[0023] Fill the verification result into the preset output template to obtain a verification report.
[0024] Optionally, the configuration items include version and new symbol, baud rate definition, network node definition, message frame definition, signal definition, annotation part, feature part, and value table part.
[0025] Optionally, the message processing method further includes:
[0026] When receiving a message verification instruction, determining the instruction type of the message verification instruction;
[0027] If the message check instruction is a header check instruction, the header information of the SPI message file is obtained by parsing according to the SPI message format, and the header information is checked;
[0028] If the message check instruction is a data segment check instruction, a second check file is obtained according to the data segment check instruction, and the SPI message file is checked using the second check file.
[0029] In a second aspect, the present application further discloses a message processing device, comprising:
[0030] An acquisition module, used to acquire an SPI message file and a DBC configuration file corresponding to the SPI message file;
[0031] A first parsing module, used to parse the DBC configuration file according to a preset format to obtain the configuration content of each configuration item;
[0032] The second parsing module is used to parse the SPI message file using each of the configuration contents to obtain a parsing result.
[0033] In a third aspect, the present application further discloses an electronic device, comprising:
[0034] Memory for storing computer programs;
[0035] A processor is used to implement the steps of any one of the message processing methods described above when executing the computer program.
[0036] In a fourth aspect, the present application further discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the message processing methods described above are implemented.
[0037] The present application provides a message processing method, comprising: obtaining an SPI message file and a DBC configuration file corresponding to the SPI message file; parsing the DBC configuration file according to a preset format to obtain the configuration content of each configuration item; and parsing the SPI message file using each of the configuration contents to obtain a parsing result.
[0038] By applying the technical solution provided in the present application, the automatic parsing of SPI message files is realized with the help of a DBC (Database Container, a file format) configuration file, wherein DBC is a CAN network (Controller Area Network) communication file format, and the DBC file is used to monitor and analyze the message data in the CAN network. Based on this, when performing SPI message parsing, a DBC configuration file can be created in advance, and then the SPI message file is parsed based on the configuration content of each configuration item in the DBC configuration file, thereby realizing automatic parsing of SPI messages, helping to obtain comprehensive and accurate message content, and improving the convenience of using SPI messages.
[0039] The message processing device, electronic device and computer-readable storage medium provided in this application also have the above-mentioned technical effects, which will not be elaborated in this application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the drawings required for use in the description of the prior art and the embodiments of the present application are briefly introduced below. Of course, the drawings described below in relation to the embodiments of the present application are only part of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work, and the obtained other drawings also belong to the protection scope of the present application.
[0041] Figure 1 A flowchart of a message processing method provided by this application;
[0042] Figure 2 A flowchart of a message recording method provided by this application;
[0043] Figure 3 A flowchart of a DBC file parsing method provided in this application;
[0044] Figure 4 A flowchart of a SPI message processing method provided in this application;
[0045] Figure 5 A structural diagram of a message processing system provided by this application;
[0046] Figure 6 A schematic diagram of the structure of a message processing device provided by the present application;
[0047] Figure 7 A schematic diagram of the structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0048] The core of the present application is to provide a message processing method, which can realize automatic parsing of SPI messages, help to obtain comprehensive and accurate message content, and improve the convenience of using SPI messages; another core of the present application is to provide a message processing device, electronic device and computer-readable storage medium, all of which have the above-mentioned beneficial effects.
[0049] In order to describe the technical solutions in the embodiments of the present application more clearly and completely, the technical solutions in the embodiments of the present application will be introduced below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0050] An embodiment of the present application provides a message processing method.
[0051] Please refer to Figure 1 , Figure 1 This is a flowchart of a message processing method provided in the present application. The message processing method may include the following S101 to S103.
[0052] S101: Acquire an SPI message file and a DBC configuration file corresponding to the SPI message file.
[0053] This step aims to achieve the acquisition of SPI message files and their corresponding DBC configuration files, wherein the SPI message file is the message file that needs to be processed, and the DBC configuration file is the configuration file used to parse the SPI message to be processed. When message processing is required, the SPI message file to be processed and its corresponding DBC configuration file can be obtained to facilitate the parsing and processing of the corresponding SPI message file based on the DBC configuration file.
[0054] Among them, there is no unique way to obtain the SPI message file. It can be directly recorded during the SPI message transmission process, or it can be a pre-recorded and saved SPI message file, which can be directly retrieved from the storage space, or it can be a SPI message directly input by the user through the user terminal. Therefore, this application does not limit its acquisition method, and the technician can choose it according to actual needs. In addition, the DBC configuration file corresponding to the SPI message file is pre-configured by the technician according to the actual parsing needs, and can be pre-stored in the corresponding storage space, such as memory, external storage device, etc., and can be directly called when used.
[0055] S102: Parse the DBC configuration file according to a preset format to obtain configuration content of each configuration item.
[0056] This step aims to implement the parsing of the DBC configuration file to obtain the configuration content of each configuration item, so as to implement the parsing of the corresponding SPI message file using the configuration content. In the implementation process, a parsing format for the DBC configuration file, i.e., the above-mentioned preset format, can be created in advance, and then the DBC configuration file is parsed according to the preset format to obtain the configuration content of each configuration item.
[0057] The preset format is set by the technician according to the actual analysis requirements, and this application does not limit the specific content contained therein. In a possible implementation, the above-mentioned parsing of the DBC configuration file according to the preset format to obtain the configuration content of each configuration item may include the following steps:
[0058] Determine the parsing order of each configuration item according to the preset format;
[0059] Parse the DBC configuration file in the parsing order to obtain the configuration content of each configuration item.
[0060] The embodiment of the present application provides a method for parsing a DBC configuration file. First, the specific content of the preset format may include (but is not limited to) various pre-set configuration items and the parsing order of each configuration item in the DBC configuration file parsing process (used to parse in this order to obtain the configuration content of each configuration item), etc., so as to facilitate the parsing operation of the DBC configuration file. Further, in the process of parsing the DBC configuration file using the preset format, the parsing order of each configuration item can be determined according to the preset format, and then each configuration item in the DBC configuration file can be parsed item by item according to the parsing order, so as to obtain the configuration content of each configuration item.
[0061] In addition, the configuration items can also be set by the technicians according to actual needs, and the present application does not limit their number and types. In a possible implementation, the above configuration items may include (but are not limited to) version and new symbol, baud rate definition, network node definition, message frame definition, signal definition, annotation part, feature part, and value table part. The present application embodiment provides several specific types of configuration items as described above, and the configuration content corresponding to each of the above configuration items can be obtained by parsing the DBC configuration file.
[0062] S103: Analyze the SPI message file using each configuration content to obtain a parsing result.
[0063] This step aims to implement the parsing operation of the SPI message file. Specifically, after obtaining the configuration content of each configuration item in the DPC configuration file, the SPI message file can be parsed according to the configuration content, that is, the SPI message file is parsed item by item according to the configuration content of each configuration item to obtain the final parsing result. Furthermore, the parsing results can also be output in the form of a parsing report, so that users can more intuitively understand the various types of message information contained in the SPI message file, and it is also convenient for subsequent storage and tracing.
[0064] It can be seen that the message processing method provided in the embodiment of the present application realizes the automatic parsing of the SPI message file with the help of the DBC configuration file, wherein DBC is a CAN network communication file format, and the DBC file is used to monitor and analyze the message data in the CAN network. Based on this, when performing SPI message parsing, a DBC configuration file can be created in advance, and then the SPI message file is parsed based on the configuration content of each configuration item in the DBC configuration file, thereby realizing the automatic parsing of the SPI message, which helps to obtain comprehensive and accurate message content and improve the convenience of using SPI messages.
[0065] Based on the above embodiments:
[0066] In one embodiment of the present application, before the above-mentioned obtaining of the SPI message file and the DBC configuration file corresponding to the SPI message file, the following steps may also be included:
[0067] In response to the message recording instruction, recording the message according to the message recording instruction;
[0068] The recording duration is recorded in real time. Whenever the recording duration reaches the preset duration, an SPI message file is generated based on the recording results within the preset duration.
[0069] The embodiment of the present application provides an implementation method for obtaining an SPI message file, which can be implemented based on message recording technology. It is understandable that in the prior art, the recording of SPI messages mostly adopts a host computer recording method, that is, the SPI message is recorded using an official host computer. However, this implementation method requires long-term uninterrupted recording. When the recording time is too long due to the SPI message being too large, the host computer is prone to jamming and crashing. Therefore, in order to solve this technical problem, the embodiment of the present application provides an SPI message recording method that automatically splits files.
[0070] First of all, it should be noted that the message recording operation responds to the message recording instruction, and its acquisition method is not unique. It can be initiated by a technician through a terminal device, or it can automatically respond based on a pre-set trigger condition. This application does not limit this. Furthermore, in response to the message recording instruction, the message recording can be started according to the message recording instruction. During the recording process, the recording time can be recorded in real time. Whenever the recording time reaches the preset time, the recording result within the preset time can be saved to a preset file, and an SPI message recording file corresponding to the preset time is generated. Of course, when the recording time reaches the preset time, the recording time automatically returns to zero and the timing starts again.
[0071] The specific value of the preset duration does not affect the implementation of the technical solution, and can be set by the technician according to actual needs, and this application does not limit this. For example, the preset duration can be set to 10 minutes, that is, a recording result is obtained every 10 minutes of recording, and an SPI message file is generated accordingly.
[0072] In one embodiment of the present application, in response to the message recording instruction, performing message recording according to the message recording instruction may include the following steps:
[0073] Monitor the device channel in real time, and respond to the message recording instruction when the message incoming information is detected;
[0074] Record the SPI messages transmitted by the device channel according to the message recording instruction.
[0075] The embodiment of the present application provides a method for obtaining a message recording instruction, that is, an automatic response method based on a preset trigger condition. Specifically, the device channel of the current device can be monitored in real time. Of course, the device channel is a channel in the current device for sending and receiving SPI messages; further, when the message incoming information is monitored in the device channel (it should be noted that the message incoming information may be the information of the SPI message sent by the current device through the device channel, or it may be the information of the SPI message received by the current device through the device channel), the message recording instruction can be automatically responded to, and the SPI message transmitted in the device channel is recorded according to the message recording instruction, so as to obtain the corresponding SPI message recording file.
[0076] In one embodiment of the present application, the message processing method may further include the following steps:
[0077] Obtain a first verification file and a preset output template according to a file verification instruction;
[0078] Parsing the first verification file according to a preset format to obtain configuration content of each configuration item;
[0079] For each configuration item, the configuration content of the DBC configuration file is verified using the configuration content of the first verification file to obtain a verification result; the verification result includes undefined, definition difference, and verification passed;
[0080] Fill the verification results into the preset output template to obtain the verification report.
[0081] The message processing method provided in the embodiment of the present application can further implement a verification operation of the DBC configuration file. The verification operation responds to a file verification instruction. The present application does not limit the acquisition method thereof.
[0082] In the implementation process, when the file verification instruction is obtained, the first verification file and the preset output template can be obtained according to the file verification instruction, wherein the first verification file is used to verify the DBC configuration file, and the preset output template is a pre-created report template for generating a verification report. Further, since the DBC configuration file is verified by the first verification file, the first verification file can be parsed according to the above-mentioned parsing method of the DBC configuration file, that is, the first verification file is parsed according to the above-mentioned preset format to obtain the configuration content of each configuration item in the first verification file. Thus, for each configuration item, the configuration content of the configuration item in the first verification file can be compared and analyzed with the configuration content of the configuration item in the DBC configuration file to obtain a comparison result, that is, the above-mentioned verification result. Obviously, the verification result can include three types: undefined, definition difference, and verification pass, wherein undefined means that the current configuration item does not have the corresponding configuration content; definition difference means that the current configuration item has configuration content but the configuration contents of the two are different; verification pass means that the current configuration item has configuration content and the configuration contents are the same. Finally, the verification result can be filled into the preset output template to generate a verification report on the DBC configuration file.
[0083] In one embodiment of the present application, the message processing method may further include the following steps:
[0084] When receiving a message verification instruction, determining the instruction type of the message verification instruction;
[0085] If the message check instruction is a header check instruction, the header information of the SPI message file is obtained according to the SPI message format analysis, and the header information is checked;
[0086] If the message check instruction is a data segment check instruction, a second check file is obtained according to the data segment check instruction, and the SPI message file is checked using the second check file.
[0087] The message processing method provided in the embodiment of the present application can further implement the verification operation of the SPI message file, which is similar to the verification operation of the above-mentioned DBC configuration file. The verification operation of the SPI message file responds to the message verification instruction, and the present application also does not limit the acquisition method thereof.
[0088] In the implementation process, when a message check instruction is obtained, its instruction type can be determined according to the message check instruction, and the instruction type includes a header check instruction and a data segment check instruction, wherein the header check instruction is used to check the header information of the SPI message file, and the data segment check instruction is used to check the data segment of the SPI message file. When the message check instruction is a header check instruction, a conventional message parsing method can be used to parse the SPI message file according to the SPI message format to obtain its header information, and then verify its header information, thereby realizing header verification. When the message check instruction is a data segment check instruction, a verification file corresponding to the SPI message file, that is, the above-mentioned second verification file, can be obtained according to the data segment check instruction, and then the SPI message file is verified using the second verification file. Among them, in the data segment verification process, since it is necessary to obtain the data segment content in the SPI message file for verification, this process can use the SPI message file parsing method provided in the above embodiment to realize the acquisition of the data segment content, and then use the DBC configuration file verification method provided in the above embodiment to realize the verification of the data segment content in the SPI message file.
[0089] Based on the above embodiments:
[0090] The present application embodiment provides another message processing method, and its implementation process is as follows:
[0091] Step 1: Please refer to Figure 2 , Figure 2 A flow chart of a message recording method provided by the present application, which supports an automatic packet subpackaging mechanism for data packets. When recording SPI messages, the first connected hardware device channel is automatically identified, and the bus status is automatically monitored (to ensure normal communication), and then the SPI message is stored in real time when it is received. The SPI message received every 10 minutes can be set to be stored as a file separately, and multiple SPI message files are obtained during the SPI message recording process.
[0092] Step 2: Please refer to Figure 3 , Figure 3 The flowchart of a DBC file parsing method provided in the present application may include a parsing operation and a verification operation on the DBC file, that is, the DBC file may be parsed and verified, and a corresponding file may be generated.
[0093] During the parsing process, an Excel format file can be generated by default. First, the DBC file to be parsed is read, and then it is parsed in the order of version and new symbol, baud rate definition, network node definition, message frame definition, signal definition, annotation part, feature part, and value table part, and the parsing results are filled into the Excel format file.
[0094] During the verification process, the DBC file to be verified and the comparison file used to implement the DBC file verification (i.e., the above-mentioned first verification file) are first read, and then, according to the above-mentioned parsing order, the DBC file is queried and compared according to the parsed content of the comparison file to obtain the corresponding comparison result, that is, the verification result. The verification result can be divided into three categories: undefined (configuration item does not exist), definition difference (configuration item exists but the configuration content is different), and verification passed (configuration item exists and the configuration content is the same). Finally, the verification result is output into a file of the corresponding format (generating a verification report).
[0095] Step 3: Please refer to Figure 4 , Figure 4 A flow chart of a SPI message processing method provided in the present application may include a parsing operation and a verification operation on the SPI message, wherein the verification operation includes a header verification and a data segment verification on the SPI message file.
[0096] During the parsing process, the configuration file can be relied upon to be implemented. First, the SPI message file to be parsed is read, and the user selects the corresponding configuration file. If the configuration file is a DBC file, the DBC file is parsed first, and the SPI message file is parsed according to the parsing result of the DBC file to obtain the SPI message parsing result; if the configuration file is not a DBC file, the SPI message is parsed item by item using the configuration file in a conventional parsing manner to obtain the SPI message parsing result.
[0097] During the verification process, the SPI message file to be verified is first read, and then the verification content is determined. If it is a header verification, the message CRC, length, time period, ID, etc. of the SPI message file are verified in a conventional manner. If it is a data segment verification, the user selects the corresponding comparison file (i.e., the second verification file mentioned above). If the comparison file is a DBC file, the DBC file is parsed, and the SPI message is parsed using the DBC file, and finally the data segment verification is implemented based on the two parsing results; if the comparison file is not a DBC file, the two are parsed in a conventional manner, and the data segment verification is implemented based on the two parsing results. Finally, the verification result can also be output into a file of the corresponding format (i.e., a verification report is generated).
[0098] Finally, please refer to Figure 5 , Figure 5 This is a structural diagram of a message processing system provided in the present application. The message processing system is divided into the following multiple sub-modules, and the corresponding functions can be selected through the software interface when in use.
[0099] (1) A DBC parsing module, used to parse the DBC file;
[0100] (2) a DBC verification module, used to verify the DBC file;
[0101] (3) SPI recording module, used to record SPI messages.
[0102] (4) SPI parsing module, used to parse SPI messages;
[0103] (5) SPI check module, used to check the header or data segment of the SPI message.
[0104] It is conceivable that the message processing method provided in the embodiment of the present application can be based on Figure 5 The message processing system shown is implemented.
[0105] It can be seen that the message processing method provided in the embodiment of the present application realizes the automatic parsing of the SPI message file with the help of the DBC configuration file, wherein DBC is a CAN network communication file format, and the DBC file is used to monitor and analyze the message data in the CAN network. Based on this, when performing SPI message parsing, a DBC configuration file can be created in advance, and then the SPI message file is parsed based on the configuration content of each configuration item in the DBC configuration file, thereby realizing the automatic parsing of the SPI message, which helps to obtain comprehensive and accurate message content and improve the convenience of using SPI messages.
[0106] An embodiment of the present application provides a message processing device.
[0107] Please refer to Figure 6 , Figure 6 A schematic diagram of the structure of a message processing device provided in the present application, the message processing device may include:
[0108] Acquisition module 1, used to acquire the SPI message file and the DBC configuration file corresponding to the SPI message file;
[0109] The first parsing module 2 is used to parse the DBC configuration file according to a preset format to obtain the configuration content of each configuration item;
[0110] The second parsing module 3 is used to parse the SPI message file using various configuration contents to obtain parsing results.
[0111] It can be seen that the message processing device provided in the embodiment of the present application realizes the automatic parsing of the SPI message file with the help of the DBC configuration file, wherein DBC is a CAN network communication file format, and the DBC file is used to monitor and analyze the message data in the CAN network. Based on this, when performing SPI message parsing, a DBC configuration file can be created in advance, and then the SPI message file is parsed based on the configuration content of each configuration item in the DBC configuration file, thereby realizing the automatic parsing of the SPI message, which helps to obtain comprehensive and accurate message content and improve the convenience of using SPI messages.
[0112] In one embodiment of the present application, the message processing device may also include a recording module, which is used to respond to a message recording instruction and perform message recording according to the message recording instruction before obtaining the SPI message file and the DBC configuration file corresponding to the SPI message file; record the recording time in real time, and whenever the recording time reaches a preset time, generate an SPI message file based on the recording results within the preset time.
[0113] In one embodiment of the present application, the above-mentioned recording module can be specifically used to monitor the device channel in real time, and when the incoming message information is monitored, respond to the message recording instruction; and record the SPI message incoming to the device channel according to the message recording instruction.
[0114] In one embodiment of the present application, the first parsing module 2 may be specifically used to determine the parsing order of each configuration item according to a preset format; parse the DBC configuration file according to the parsing order to obtain the configuration content of each configuration item.
[0115] In one embodiment of the present application, the message processing device may also include a file verification module, which is used to obtain a first verification file and a preset output template according to a file verification instruction; parse the first verification file according to a preset format to obtain the configuration content of each configuration item; for each configuration item, use the configuration content of the first verification file to verify the configuration content of the DBC configuration file to obtain a verification result; the verification result includes undefined, definition difference, and verification passed; fill the verification result into the preset output template to obtain a verification report.
[0116] In one embodiment of the present application, the above configuration items may include version and new symbols, baud rate definition, network node definition, message frame definition, signal definition, annotation part, feature part, and value table part.
[0117] In one embodiment of the present application, the message processing device may also include a message verification module, which is used to determine the instruction type of the message verification instruction when a message verification instruction is received; if the message verification instruction is a header verification instruction, the header information of the SPI message file is obtained according to the SPI message format, and the header information is verified; if the message verification instruction is a data segment verification instruction, a second verification file is obtained according to the data segment verification instruction, and the SPI message file is verified using the second verification file.
[0118] For an introduction to the device provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.
[0119] An embodiment of the present application provides an electronic device.
[0120] Please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in this application, and the electronic device may include:
[0121] Memory for storing computer programs;
[0122] A processor, which is used to implement the steps of any one of the above-mentioned message processing methods when executing a computer program.
[0123] like Figure 7 , which is a schematic diagram of the composition structure of an electronic device, the electronic device may include: a processor 10, a memory 11, a communication interface 12 and a communication bus 13. The processor 10, the memory 11 and the communication interface 12 all communicate with each other through the communication bus 13.
[0124] In the embodiment of the present application, the processor 10 may be a central processing unit (CPU), an application specific integrated circuit, a digital signal processor, a field programmable gate array or other programmable logic devices, etc.
[0125] The processor 10 may call a program stored in the memory 11. Specifically, the processor 10 may execute operations in the embodiment of the message processing method.
[0126] The memory 11 is used to store one or more programs, which may include program codes, and the program codes include computer operation instructions. In the embodiment of the present application, the memory 11 at least stores programs for implementing the following functions:
[0127] Get the SPI message file and the DBC configuration file corresponding to the SPI message file;
[0128] Parse the DBC configuration file according to the preset format to obtain the configuration content of each configuration item;
[0129] Use each configuration content to parse the SPI message file and obtain the parsing result.
[0130] In a possible implementation, the memory 11 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function, etc.; the data storage area may store data created during use.
[0131] In addition, the memory 11 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device.
[0132] The communication interface 12 may be an interface of a communication module, and is used to connect to other devices or systems.
[0133] Of course, it should be noted that Figure 7 The structure shown does not constitute a limitation on the electronic device in the embodiment of the present application. In actual applications, the electronic device may include Figure 7 More or fewer components than shown, or combinations of certain components.
[0134] An embodiment of the present application provides a computer-readable storage medium.
[0135] The computer-readable storage medium provided in the embodiment of the present application stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above-mentioned message processing methods can be implemented.
[0136] The computer-readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0137] For an introduction to the computer-readable storage medium provided in the embodiments of the present application, please refer to the above method embodiments, and the present application will not elaborate on them here.
[0138] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0139] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0140] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, software modules executed by a processor, or a combination of the two. The software modules may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0141] The technical solution provided by the present application is described in detail above. The principle and implementation method of the present application are described in detail using specific examples herein, and the description of the above embodiments is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
Claims
1. A message processing method, characterized in that: include: Obtain an SPI message file and a DBC configuration file corresponding to the SPI message file; Parsing the DBC configuration file according to a preset format to obtain configuration content of each configuration item; the configuration item includes version and new symbol, baud rate definition, network node definition, message frame definition, signal definition, annotation part, feature part, and value table part; Analyze the SPI message file using each of the configuration contents to obtain a parsing result; Obtain a first verification file and a preset output template according to a file verification instruction; Parsing the first verification file according to the preset format to obtain the configuration content of each configuration item; for each configuration item, verifying the configuration content of the DBC configuration file using the configuration content of the first verification file to obtain a verification result; The verification results include undefined, definition difference, and verification passed; Fill the verification result into the preset output template to obtain a verification report; When receiving a message verification instruction, determining the instruction type of the message verification instruction; If the message check instruction is a header check instruction, the header information of the SPI message file is obtained according to the SPI message format analysis, and the header information is checked; if the message check instruction is a data segment check instruction, a second check file is obtained according to the data segment check instruction, and the SPI message file is checked using the second check file.
2. The message processing method according to claim 1, characterized in that: Before obtaining the SPI message file and the DBC configuration file corresponding to the SPI message file, the method further includes: In response to a message recording instruction, performing message recording according to the message recording instruction; The recording duration is recorded in real time, and whenever the recording duration reaches a preset duration, the SPI message file is generated based on the recording result within the preset duration.
3. The message processing method according to claim 2, characterized in that: The step of responding to the message recording instruction and recording the message according to the message recording instruction includes: Perform real-time monitoring on the device channel, and when the incoming message information is detected, respond to the message recording instruction; The SPI message transmitted by the device channel is recorded according to the message recording instruction.
4. The message processing method according to claim 1, characterized in that: The DBC configuration file is parsed according to a preset format to obtain the configuration content of each configuration item, including: Determining a parsing order of each of the configuration items according to the preset format; The DBC configuration file is parsed according to the parsing order to obtain the configuration content of each configuration item.
5. A message processing device, characterized in that: include: An acquisition module, used to acquire an SPI message file and a DBC configuration file corresponding to the SPI message file; A first parsing module is used to parse the DBC configuration file according to a preset format to obtain the configuration content of each configuration item; the configuration items include version and new symbol, baud rate definition, network node definition, message frame definition, signal definition, annotation part, feature part, and value table part; A second parsing module, used to parse the SPI message file using each of the configuration contents to obtain a parsing result; A file verification module, used to obtain a first verification file and a preset output template according to a file verification instruction; Parsing the first verification file according to the preset format to obtain the configuration content of each configuration item; for each configuration item, verifying the configuration content of the DBC configuration file using the configuration content of the first verification file to obtain a verification result; The verification results include undefined, definition difference, and verification passed; Fill the verification result into the preset output template to obtain a verification report; A message checking module, used for determining the instruction type of the message checking instruction when receiving the message checking instruction; If the message check instruction is a header check instruction, the header information of the SPI message file is obtained according to the SPI message format analysis, and the header information is checked; if the message check instruction is a data segment check instruction, a second check file is obtained according to the data segment check instruction, and the SPI message file is checked using the second check file.
6. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the message processing method according to any one of claims 1 to 4 when executing the computer program.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the message processing method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method and device for acquiring CAN signal by TBOX device
CN113726624A