Programming log analysis method and device based on unified diagnostic service protocol, equipment and storage medium
Through the programming log analysis method based on the unified diagnostic service agreement, the problem of low programming log analysis efficiency in the existing technology is solved, and the correctness of the flashing software version is quickly checked, and the efficiency and accuracy of fault diagnosis are improved.
Patent Information
- Application Number
- CN202411760113.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-03-28
AI Technical Summary
The existing programming log analysis methods are inefficient and it is difficult to quickly identify error points in programming operations. Especially when flashing the software version, it is inefficient to verify the accuracy of the version.
The programming log analysis method based on the unified diagnostic service protocol is adopted. By obtaining the programming logs generated by the host computer, traversing the file list, log analysis, request response processing and data transmission verification, the target data is determined, and the file containing the target data is generated for correct transmission comparison, and verifying whether the software version is correct.
It improves the efficiency of flashing software versions, reduces the incidence of error version software problems caused by operational errors, improves fault diagnosis efficiency, saves time in analyzing logs, and quickly and accurately locates to error points.
Smart Images

Figure CN119719042A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automobile fault diagnosis, and in particular to a programming log analysis method, device, equipment and storage medium based on a unified diagnostic service protocol. Background Art
[0002] With the rapid development of automotive electronic technology, the Unified Diagnostic Service (UDS) protocol has become an indispensable part of the automotive industry. The UDS protocol provides a standardized communication interface for problem diagnosis, software development and update of automotive electronic control units (ECUs). In the development and update of ECU software, flash programming is a key step. Usually, the host computer is used to write the application code into the non-volatile memory of the ECU to fix known problems or introduce new functions. Generally, the host computer will synchronously generate a programming log, which contains detailed information about the programming operation, such as message time, type, content, etc. However, due to various reasons, such as communication errors, password mismatch, etc., flash programming will fail. It is necessary to check the log to identify the cause of the failure and take measures to solve the problem.
[0003] Today's programming logs are mostly asc format files, which represent data in ASCII text form, including time, transmission direction, message ID, etc. The information is very comprehensive, but it becomes complicated and redundant when it is necessary to analyze the logs. In particular, when errors occur in the transmitted data stream, it is difficult to quickly identify the error point.
[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present invention is to provide a programming log analysis method, device, equipment and storage medium based on a unified diagnostic service protocol, aiming to solve the technical problem of low efficiency in verifying whether the flashed software version is correct.
[0006] To achieve the above object, the present invention provides a programming log analysis method based on a unified diagnostic service protocol, and the programming log analysis method based on a unified diagnostic service protocol comprises the following steps:
[0007] Get the programming log generated after the host computer completes the software flashing;
[0008] Traversing the file list of the programming log, reading the data in the file list and performing log analysis, request response processing and data transmission verification on the data in the file list to determine the target data;
[0009] A file containing the target data is generated according to the target data, and a correctness transmission comparison is performed on the file containing the target data to obtain an analysis result.
[0010] In one embodiment, the step of traversing the file list of the programming log, reading the data of the file list and performing log analysis, request response processing and data transmission verification on the data of the file list to determine the target data includes:
[0011] Open the file list of the programming log in sequence to obtain the current file in the file list;
[0012] Read the current file line by line to obtain the current line;
[0013] Performing log analysis on the current row;
[0014] When the current row passes the log analysis, performing request response processing on the current row;
[0015] When the current row passes the request response process, performing data transmission verification on the current row;
[0016] When the current line passes the data transmission verification, returning to the step of reading the current file line by line to obtain the current line until all lines in the current file are traversed;
[0017] When all the lines of the current file are traversed, return to the step of opening the file list of the programming log in sequence to obtain the current file in the file list, until the file list of the programming log is traversed, and determine the target data based on all the lines that have passed the log analysis, the request response processing and the data transmission verification.
[0018] In one embodiment, the step of performing log analysis on the current row includes:
[0019] Performing data analysis on the current line to determine whether the format of the current line matches a preset regular expression;
[0020] When the format of the current row matches the preset regular expression, determining whether the identifier of the current row is within a validity range;
[0021] When the identifier of the current row is within the validity range, determining whether the current row includes a request or a response for a 3E service;
[0022] When the current row includes the request or response of the 3E service, it is determined that the current row passes the log analysis.
[0023] In one embodiment, the step of performing request response processing on the current row includes:
[0024] According to the order of request or response, determine whether the processing status is request information or response information;
[0025] When the processing state is request information, executing a first request response process;
[0026] When the processing status is response information, a second request response process is executed.
[0027] In one embodiment, when the processing state is request information, the step of performing first request response processing includes:
[0028] Obtain the format of the frame of the current row and the processing status of the frame;
[0029] Determining whether the format of the frame of the current row and the processing status of the frame are consistent;
[0030] When the format and the processing status are consistent, determining whether the service ID of the frame is valid;
[0031] When the service ID of the frame is valid and is a request, determining a service type;
[0032] When it is determined that the service is a data transmission service, it is determined that the current row is processed through a request response.
[0033] In one embodiment, when the processing status is response information, the step of performing a second request response process includes:
[0034] Obtain the format of the frame of the current row and the processing status of the frame;
[0035] Determining whether the format of the frame of the current row and the processing status of the frame are consistent;
[0036] When the format and the processing status are consistent, determining whether the service ID of the frame is valid;
[0037] When the service ID of the frame is valid and the response is positive, determining the service type;
[0038] When it is determined that the service is a data transmission service, it is determined that the current row is processed through a request response.
[0039] In one embodiment, the step of generating a file containing the target data according to the target data, performing a transmission comparison for correctness of the file containing the target data, and obtaining an analysis result includes:
[0040] Generate a file containing the target data and a preset file intended to be flashed based on the target data;
[0041] The preset file is compared with the file containing the target data to determine whether the flashed version of the software is correct, and obtain an analysis result.
[0042] In addition, to achieve the above purpose, the present invention also proposes a programming log analysis device based on a unified diagnostic service protocol, the device comprising:
[0043] The log acquisition module is used to obtain the programming log generated after the upper computer completes the software flashing;
[0044] A diagnostic module, used to traverse the file list of the programming log, read the data of the file list and perform log analysis, request response processing and data transmission verification on the data of the file list to determine the target data;
[0045] The comparison module is used to generate a file containing the target data according to the target data, and to perform a transmission correctness comparison on the file containing the target data to obtain an analysis result.
[0046] In addition, to achieve the above-mentioned objectives, the present invention also proposes a programming log analysis device based on a unified diagnostic service protocol, the device comprising: a memory, a processor, and a programming log analysis program based on the unified diagnostic service protocol stored in the memory and executable on the processor, the programming log analysis program based on the unified diagnostic service protocol being configured to implement the steps of the programming log analysis method based on the unified diagnostic service protocol as described above.
[0047] In addition, to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which a programming log analysis program based on a unified diagnostic service protocol is stored. When the programming log analysis program based on the unified diagnostic service protocol is executed by a processor, the steps of the programming log analysis method based on the unified diagnostic service protocol as described above are implemented.
[0048] One or more technical solutions proposed in this application have at least the following technical effects:
[0049] Obtain the programming log generated by the host computer after the software is flashed; traverse the file list of the programming log, read the data in the file list and perform log analysis, request response processing and data transmission verification on the data in the file list to determine the target data; generate a file containing the target data according to the target data, perform a correctness transmission comparison on the file containing the target data, and obtain the analysis result. Through the comparison, it is possible to verify whether the flashed software version is correct, reduce the occurrence rate of the problem of flashing the wrong version of software due to operational errors, improve fault diagnosis efficiency, save time in analyzing logs, and quickly and accurately locate the error point. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0052] Figure 1 A flowchart of a first embodiment of a programming log analysis method based on a unified diagnostic service protocol of the present application is provided;
[0053] Figure 2 A flowchart of the first embodiment of the programming log analysis method based on the unified diagnostic service protocol of the present application;
[0054] Figure 3 A flowchart diagram of a second embodiment of a programming log analysis method based on a unified diagnostic service protocol of the present application is provided;
[0055] Figure 4 A flowchart diagram of a third embodiment of a programming log analysis method based on a unified diagnostic service protocol of the present application is provided;
[0056] Figure 5 This is a schematic diagram of the module structure of a programming log analysis device based on a unified diagnostic service protocol according to an embodiment of the present application;
[0057] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the programming log analysis method based on the unified diagnostic service protocol in the embodiment of the present application.
[0058] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0059] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0060] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0061] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a programming log analysis device based on a unified diagnostic service protocol, etc. The following takes a programming log analysis device based on a unified diagnostic service protocol as an example to illustrate this embodiment and the following embodiments.
[0062] Based on this, the embodiment of the present application provides a programming log analysis method based on a unified diagnostic service protocol, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the programming log analysis method based on the unified diagnostic service protocol of the present application.
[0063] In this embodiment, the programming log analysis method based on the unified diagnostic service protocol includes steps S10 to S30:
[0064] Step S10, obtaining a programming log generated after the upper computer completes software flashing;
[0065] It should be noted that the programming log is a programming log in asc format generated by the host computer for flash programming;
[0066] UDS stands for Unified Diagnostic Service Protocol. Flash programming means writing the application code into the non-volatile memory of the ECU during the ECU software update.
[0067] It should be understood that before starting to analyze the log file, the system needs to ensure that there is enough input data (i.e., .asc log files). Without this input data, the system cannot perform its analysis task, so it will notify the user or caller that there is a problem by throwing an exception; therefore, a list of all file names ending with asc in the current directory is passed in. If there is no asc file, an exception is thrown, indicating that there is no programming log to be analyzed. If there is an asc file, this strategy will continue to be executed.
[0068] Step S20, traversing the file list of the programming log, reading the data in the file list and performing log analysis, request response processing and data transmission verification on the data in the file list to determine the target data;
[0069] In the specific implementation, the system retrieves all files ending with .asc in the current directory, which contain detailed log information during the ECU programming process; the system opens each .asc file in sequence and reads the file content line by line for further analysis; for each line of log, the system uses regular expressions and other methods to check whether its format meets the expectations and extracts useful information such as CAN ID, service ID, frame format, etc.; the system tracks the processing status according to the order of requests and responses to ensure that requests and responses are processed correctly; the system checks whether the status and request / response IDs are consistent, ensures that the order of data transmission is correct, and generates a bin file containing all transmitted data; through the above analysis and verification steps, the system can determine which data is the target data, that is, the data that is successfully transmitted and verified to be correct.
[0070] Step S30, generating a file containing the target data according to the target data, performing a transmission and comparison of the correctness of the file containing the target data, and obtaining an analysis result.
[0071] It should be noted that the file containing the target data is the bin file, which contains all the data to be transferred;
[0072] Correctness transmission comparison means that the system compares the generated bin file with the preset hex file. This comparison process will check whether the two files are completely consistent in content to ensure that each part of the data is correct.
[0073] It should be understood that the services are successful during the flashing process, but one or more of the transmitted data values may be incorrect. The data transmitted in the flash programming can be newly generated into a separate bin file and compared with the preset hex file to verify whether the flashed software version is incorrect and analyze whether the transmitted data part is incorrect.
[0074] In a feasible implementation manner, step S30 includes steps A11 to A12:
[0075] Step A11: generating a file containing the target data and a preset file intended to be flashed based on the target data;
[0076] In the specific implementation, the system generates a bin file based on the determined target data, which contains the data actually transmitted to the ECU; the system prepares a preset hex file, which contains the data expected to be transmitted to the ECU, that is, the original firmware or software version.
[0077] Step A12: Compare the preset file with the file containing the target data to determine whether the flashed version of the software is correct and obtain the analysis result.
[0078] It should be noted that, through comparison, it is possible to verify whether the flashed software version is correct, thereby reducing the occurrence rate of problems caused by flashing the wrong version of software due to operational errors.
[0079] In the specific implementation, when the flash programming is successful, the system generates a bin file based on the determined target data, which contains the data actually transmitted to the ECU; the system prepares a preset hex file, which contains the data expected to be transmitted to the ECU, that is, the original firmware or software version.
[0080] Furthermore, when flash programming fails, the prompt information generated in the above steps can be used to quickly locate which service the error occurred in, analyze the cause, and solve the problem.
[0081] like Figure 2 As shown in the figure, the process starts when the host computer completes the software flashing operation on the ECU; the system creates a processing instance and obtains all the file names ending with .asc in the current working directory. These files contain programming logs; the system checks whether the obtained file list is empty. If it is empty, it means that there is no log file to analyze, and an exception is thrown at this time; if the file list is not empty, the system will traverse each file in the list and open them one by one for analysis; for each opened file, the system reads the content line by line and processes each line as the current line; the system uses regular expressions to check whether the format of the current line is correct to ensure data consistency; if the current line format does not match, CAN If the ID is not in the valid range (0x700-0x7FF), or the current line is a request or response for a 3E service, the system will skip the current line or report an error and continue to process the next line; the system determines whether the current line is a request or a response based on the context, and processes it accordingly based on the status; the system further checks the frame format of the current line (single frame, first frame, flow control frame, continuous frame) and ensures that it is consistent with the current processing status; the system checks whether the service ID in the frame is valid, and processes it accordingly based on the service ID and flash status; if the service ID is 77, indicating that the flash programming is successful, the system will generate a bin file containing all the transmitted data; finally, the system compares the generated bin file with the expected hex file to verify the correctness of the software version and data transmission; in any step, if an error occurs, the system will report an error and prompt the user; if there is no error and the service ID is not 77, the system will process it according to the service type and prompt the user after success. Comprehensive analysis of the flash programming log is ensured, including format verification, service identification, data transmission verification, and error handling, thereby improving the reliability and accuracy of the ECU programming process.
[0082] The present embodiment provides a programming log analysis method based on a unified diagnostic service protocol, which obtains the programming log generated by the upper computer after the software is flashed; traverses the file list of the programming log, reads the data in the file list and performs log analysis, request response processing and data transmission verification on the data in the file list to determine the target data; generates a file containing the target data according to the target data, performs a correctness transmission comparison on the file containing the target data to obtain an analysis result, and through the comparison, it is possible to verify whether the flashed software version is correct, reduce the occurrence rate of the problem of flashing the wrong version of software due to operational errors, improve fault diagnosis efficiency, save time in analyzing logs, and quickly and accurately locate the error point.
[0083] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S20 includes steps S201 to S207:
[0084] Step S201, opening the file list of the programming log in sequence, and obtaining the current file in the file list;
[0085] In a specific implementation, the system opens each file in the file list of the programming log in turn, and takes the current file in the list as an analysis object.
[0086] Step S202, read the current file line by line to obtain the current line;
[0087] In the specific implementation, for each opened file, the system reads the content line by line and processes each line as the current line.
[0088] Step S203, performing log analysis on the current row;
[0089] It should be noted that log analysis is to filter out data that does not belong to the flashing process.
[0090] In a feasible implementation manner, step S203 includes steps A21 to A24:
[0091] Step A21: Analyze the data of the current row to determine whether the format of the current row matches the preset regular expression;
[0092] It should be noted that the log obtained after the upper computer is flashed with software usually contains a lot of information under normal circumstances, such as timestamp, channel, direction, data, etc. This step is used to filter out logs in normal format (excluding abnormal records) and then extract the data from each normal format log (excluding time and other information).
[0093] In the specific implementation, it is determined whether the format of the current line matches the custom regular expression format, and the information in the fixed asc format is extracted into data, so as to facilitate the subsequent splitting and recombining of the data for analysis.
[0094] Step A22: when the format of the current row matches the preset regular expression, determine whether the identifier of the current row is within the validity range;
[0095] It should be noted that the diagnostic CAN ID has a valid range. If it is invalid, it means that this log is not diagnostic information, that is, it is not a flashing process, and it will be filtered out.
[0096] In the specific implementation, it is determined whether the CAN ID is within the valid range of 0x700-0x7FF.
[0097] Step A23: When the identifier of the current row is within the validity range, determine whether the current row contains a request or response for a 3E service;
[0098] Step A24: When the current row contains a request or response for a 3E service, determine that the current row passes log analysis.
[0099] It should be noted that the 3E service is to maintain the current state of the ECU. The ECU needs to perform software updates in the programming session state. The programming session has a duration and will automatically switch to the default session when the time is up. Therefore, it is necessary to keep sending 3E to maintain the programming session state.
[0100] In the specific implementation, it is determined whether it is a request or response for a 3E service. If the current row does not contain a request or response for a 3E service, it is determined that the current row does not pass the log analysis and has no data transmission, so it is screened out.
[0101] Step S204, when the current row passes the log analysis, the current row is subjected to request response processing;
[0102] It should be noted that the entire software flashing process involves many UDS services, such as 0x10 diagnostic session control, 0x27 security access, 0x31 routine control, etc.
[0103] Flashing is divided into pre-programming, programming, and post-programming. Pre-programming is used for session switching, flashing condition checking, communication and DTC closing, etc.
[0104] Programming to flash drivers and applications is data transmission, which is flashed inside the ECU (0x34, 0x36, 0x37); later programming to do reset, communication and DTC, etc.
[0105] The programming log will contain all the diagnostic communication information in the above process. This strategy can quickly locate which service has an error by analyzing the log, or when programming is successful, it will extract the data flashed to the ECU during the programming process to verify whether it is consistent with the data of the target version, to avoid errors in some data during the process or operating errors that cause the wrong version to be flashed.
[0106] Step S205, when the current row passes the request response process, the current row is subjected to data transmission verification;
[0107] In the specific implementation, the status and request / response ID are judged to be consistent, which is in the following order: request to download - request to download successfully - transmit data - transmit data successfully - request to exit transmission - request to exit transmission successfully. After completion, a bin file is generated, which contains all the transmitted data.
[0108] It should be noted that the above status is in the big status of expecting to receive a request / response, and a small status is set for the data transmission process, that is, the status of "request to download-request to download successfully-transmit data-transmit data successfully-request to exit transmission", and the ID is the service, for example, the request to download is 0x34, and the request to download successfully is 0x74. Check whether the status and ID match.
[0109] Step S206, when the current line passes the data transmission verification, return to the step of reading the current file line by line to obtain the current line, until all lines in the current file are traversed;
[0110] In a specific implementation, after the current line passes the data transmission verification, the system returns to the step of reading the current file line by line, and continues to process the next line until all lines in the current file are traversed.
[0111] Step S207, when all the lines of the current file have been traversed, return to the step of opening the file list of the programming log in sequence to obtain the current file in the file list, until the file list of the programming log is traversed, and the target data is determined based on all the lines that have passed the log analysis, request response processing and data transmission verification.
[0112] It should be understood that all files in the programming log need to be traversed to prevent omissions.
[0113] It should be noted that when the current line does not meet the preset conditions, the process returns to the step of reading the current file line by line to obtain the current line until all lines in the current file are traversed;
[0114] When all the lines of the current file do not meet the preset condition, the process returns to the step of sequentially opening the file list of the programming log to obtain the current file in the file list until the traversal of the file list of the programming log is completed.
[0115] This embodiment provides a programming log analysis method based on a unified diagnostic service protocol, which ensures a comprehensive analysis of the programming log file, thereby improving the reliability and accuracy of the ECU programming process. Through this method, possible problems can be quickly diagnosed and resolved, ensuring that the firmware or software update of the ECU can be successfully completed.
[0116] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiments can be referred to the above introduction, and will not be described in detail later. Figure 4 , step S204 includes steps S2041 to S2043:
[0117] Step S2041, judging whether the processing status is request information or response information according to the order of request or response;
[0118] In the specific implementation, the order of request and response is comprehensively considered, and the default processing state is expected to receive a request. After receiving the request information, it is switched to expected to receive a response to determine whether the processing state is a request.
[0119] Step S2042, when the processing status is request information, executing the first request response processing;
[0120] It should be noted that the first request response processing and the second request response processing refer to two different processing logics for request information and response information;
[0121] The first request response process is used to verify and process the request frame from the external device (such as a host computer or a diagnostic tool).
[0122] In the specific implementation, the format of the frame is judged, single frame / first frame / flow control frame / continuous frame, the status is divided into single frame processing and multi-frame (first frame / flow control frame / continuous frame) processing, and whether the status and frame format are consistent is judged. If they are inconsistent, an error is reported and the process continues. It is judged whether the service ID in the frame is valid. If it is valid and it is a request, relevant processing is performed. Services related to 34 / 36 / 37 data are processed separately and step S30 is executed; if it is valid and it is a response, the service is considered to be successful / failed / not yet completed; other cases are considered to be unrecognizable frame formats.
[0123] In a feasible implementation manner, step S2042 includes steps A31 to A34:
[0124] Step A31: Obtain the format of the frame of the current row and the processing status of the frame;
[0125] It should be noted that the frame formats include: single frame / first frame / flow control frame / continuous frame, and the frame processing status is divided into single frame processing and multi-frame (first frame / flow control frame / continuous frame) processing.
[0126] Step A32: determining whether the format of the frame of the current row and the processing status of the frame are consistent;
[0127] It should be noted that the frame format refers to how data is packaged in communication, such as single frame, first frame, flow control frame or continuous frame; the processing state refers to the type of data that the system currently expects to receive, such as request or response.
[0128] Step A33: When the format and the processing status are consistent, determining whether the service ID of the frame is valid;
[0129] It should be noted that the service ID is a code used to identify a specific service in the UDS protocol, such as 0x34 for data transmission service.
[0130] Step A34: When the service ID of the frame is valid and is a request, determine the service type;
[0131] It should be noted that the data transmission services include 0x34, 0x36, and 0x37, i.e., service identifiers, which represent different service types;
[0132] 0x34, Request Download: It is used to establish the start of a data transmission session between an external device (such as a diagnostic tool) and the ECU. When the external device is ready to send data to the ECU, it sends a 0x34 service request to notify the ECU that it is ready to receive data.
[0133] 0x36, Request Upload: Used to request data transfer from the ECU to an external device; this can be used to read the ECU's memory contents, such as calibration data, fault codes, or other diagnostic information.
[0134] 0x37 is for transmitting data: it is used to transmit data blocks between ECU and external devices. After the 0x34 service initializes the data transmission session, the 0x37 service is used for actual data transmission, transmitting larger data blocks and supporting block transmission to adapt to the storage and processing capabilities of the ECU.
[0135] Step A35: When it is determined that the service is a data transmission service, it is determined that the current row is processed through a request response.
[0136] Step S2043: when the processing status is response information, execute the second request response processing.
[0137] It should be noted that the second request response processing is to verify and process the response frame from the ECU.
[0138] In the specific implementation, the format of the frame is determined, single frame / first frame / flow control frame / continuous frame, the status is divided into single frame processing and multi-frame (first frame / flow control frame / continuous frame) processing, and the status and frame format are determined to be consistent. If they are inconsistent, an error is reported and the process continues. It is determined whether the service ID in the frame is valid. If it is valid and a positive response is given, relevant processing is performed. Services related to 34 / 36 / 37 data are processed separately and step S30 is executed; if it is valid and a negative response is given, it means that the service has failed; if it is valid and a request is given, it means that the previous request has not been replied and it is received again as a request; in other cases, it is considered that the frame format is unrecognizable;
[0139] In a feasible implementation manner, step S2043 includes steps A41 to A45:
[0140] Step A41: Obtain the format of the frame of the current row and the processing status of the frame;
[0141] It should be noted that the frame formats include: single frame / first frame / flow control frame / continuous frame, and the frame processing status is divided into single frame processing and multi-frame (first frame / flow control frame / continuous frame) processing.
[0142] Step A42: determining whether the format of the frame of the current row and the processing status of the frame are consistent;
[0143] It should be noted that the frame format refers to how data is packaged in communication, such as single frame, first frame, flow control frame or continuous frame; the processing state refers to the type of data that the system currently expects to receive, such as request or response.
[0144] Step A43: When the format and the processing status are consistent, determining whether the service ID of the frame is valid;
[0145] It should be noted that the service ID is a code used to identify a specific service in the UDS protocol, such as 0x34 for data transmission service.
[0146] Step A44: When the service ID of the frame is valid and the response is positive, determine the service type;
[0147] Step A45: When it is determined that the service is a data transmission service, it is determined that the current row is processed through a request response.
[0148] This embodiment provides a programming log analysis method based on a unified diagnostic service protocol. By detailed processing of request and response sequences and verification of frame formats and status, it ensures that requests and responses in the ECU software flashing process are correctly processed, and data transmission services receive special attention and processing, thereby improving the reliability and accuracy of the flashing process.
[0149] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the programming log analysis method based on the unified diagnostic service protocol of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0150] This application also provides a programming log analysis device based on a unified diagnostic service protocol, please refer to Figure 5 , the programming log analysis device based on the unified diagnostic service protocol includes:
[0151] The log acquisition module 10 is used to obtain the programming log generated after the upper computer completes the software flashing;
[0152] The diagnostic module 20 is used to traverse the file list of the programming log, read the data in the file list and perform log analysis, request response processing and data transmission verification on the data in the file list to determine the target data;
[0153] The comparison module 30 is used to generate a file containing the target data according to the target data, and to perform a transmission correctness comparison on the file containing the target data to obtain an analysis result.
[0154] The programming log analysis device based on the unified diagnostic service protocol provided by the present application adopts the programming log analysis method based on the unified diagnostic service protocol in the above-mentioned embodiment, which can solve the technical problem of low efficiency in verifying whether the flashed software version is correct. Compared with the prior art, the beneficial effects of the programming log analysis device based on the unified diagnostic service protocol provided by the present application are the same as the beneficial effects of the programming log analysis method based on the unified diagnostic service protocol provided by the above-mentioned embodiment, and the other technical features in the programming log analysis device based on the unified diagnostic service protocol are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0155] In one embodiment, the diagnostic module 20 is further used to sequentially open the file list of the programming log to obtain the current file in the file list;
[0156] Read the current file line by line to get the current line;
[0157] Perform log analysis on the current line;
[0158] When the current line passes the log analysis, the current line is processed for request response;
[0159] When the current row passes the request response processing, the current row is subjected to data transmission verification;
[0160] When the current line passes the data transmission verification, return to the step of reading the current file line by line to obtain the current line until all lines in the current file are traversed;
[0161] When all the lines of the current file are traversed, return to the step of opening the file list of the programming log in sequence to obtain the current file in the file list until the file list of the programming log is traversed and the target data is determined based on all the lines that have passed the log analysis, request response processing and data transmission verification.
[0162] In one embodiment, the diagnosis module 20 is further used to perform data analysis on the current line to determine whether the format of the current line matches a preset regular expression;
[0163] When the format of the current row matches the preset regular expression, determine whether the identifier of the current row is within the validity range;
[0164] When the identifier of the current row is within the validity range, determining whether the current row contains a request or response for a 3E service;
[0165] When the current row contains a request or response of a 3E service, it is determined that the current row passes the log analysis.
[0166] In one embodiment, the diagnosis module 20 is further used to determine whether the processing status is request information or response information according to the order of request or response;
[0167] When the processing state is request information, executing the first request response processing;
[0168] When the processing status is response information, the second request response processing is executed.
[0169] In one embodiment, the diagnostic module 20 is further used to obtain the format of the frame of the current row and the processing status of the frame;
[0170] Determine whether the format of the frame of the current row and the processing status of the frame are consistent;
[0171] When the format and processing status are consistent, determine whether the service ID of the frame is valid;
[0172] When the service ID of the frame is valid and it is a request, determine the service type;
[0173] When the service is determined to be a data transfer service, the current row is determined to be processed through a request response.
[0174] In one embodiment, the diagnostic module 20 is further used to obtain the format of the frame of the current row and the processing status of the frame;
[0175] Determine whether the format of the frame of the current row and the processing status of the frame are consistent;
[0176] When the format and processing status are consistent, determine whether the service ID of the frame is valid;
[0177] When the service ID of the frame is valid and it is a positive response, determine the service type;
[0178] When the service is determined to be a data transfer service, the current row is determined to be processed through a request response.
[0179] In one embodiment, the comparison module 30 is further used to generate a file containing the target data and a preset file intended to be flashed based on the target data;
[0180] Compare the preset file with the file containing the target data to determine whether the flashed version of the software is correct and obtain the analysis result.
[0181] The present application provides a programming log analysis device based on a unified diagnostic service protocol, and the programming log analysis device based on a unified diagnostic service protocol includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the programming log analysis method based on the unified diagnostic service protocol in the above-mentioned embodiment one.
[0182] Reference below Figure 6 , which shows a schematic diagram of the structure of a programming log analysis device based on a unified diagnostic service protocol suitable for implementing an embodiment of the present application. The programming log analysis device based on a unified diagnostic service protocol in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The programming log analysis device based on the unified diagnostic service protocol shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0183] like Figure 6As shown, the programming log analysis device based on the unified diagnostic service protocol may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the programming log analysis device based on the unified diagnostic service protocol are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the programming log analysis device based on the unified diagnostic service protocol to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a programming log analysis device based on the unified diagnostic service protocol with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0184] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0185] The programming log analysis device based on the unified diagnostic service protocol provided by the present application adopts the programming log analysis method based on the unified diagnostic service protocol in the above embodiment, which can solve the technical problem of low efficiency in verifying whether the flashed software version is correct. Compared with the prior art, the beneficial effects of the programming log analysis device based on the unified diagnostic service protocol provided by the present application are the same as the beneficial effects of the programming log analysis method based on the unified diagnostic service protocol provided by the above embodiment, and the other technical features in the programming log analysis device based on the unified diagnostic service protocol are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0186] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0187] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0188] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the programming log analysis method based on the unified diagnostic service protocol in the above-mentioned embodiment.
[0189] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0190] The computer-readable storage medium may be included in the programming log analysis device based on the unified diagnostic service protocol; or may exist independently without being assembled into the programming log analysis device based on the unified diagnostic service protocol.
[0191] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by a programming log analysis device based on a unified diagnostic service protocol, the programming log analysis device based on the unified diagnostic service protocol: obtains the programming log generated after the upper computer completes the software flashing; traverses the file list of the programming log, reads the data in the file list and performs log analysis, request response processing and data transmission verification on the data in the file list to determine the target data; generates a file containing the target data according to the target data, compares the correctness of the transmission of the file containing the target data, and obtains the analysis result.
[0192] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0193] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0194] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0195] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned programming log analysis method based on the unified diagnostic service protocol, and can solve the technical problem of low efficiency in verifying whether the flashed software version is correct. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the programming log analysis method based on the unified diagnostic service protocol provided by the above-mentioned embodiment, and will not be repeated here.
[0196] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the programming log analysis method based on the unified diagnostic service protocol as described above.
[0197] The computer program product provided by the present application can solve the technical problem of low efficiency in verifying whether the flashed software version is correct. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the programming log analysis method based on the unified diagnostic service protocol provided by the above embodiment, which will not be repeated here.
[0198] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A programming log analysis method based on a unified diagnostic service protocol, characterized in that: The programming log analysis method based on the unified diagnostic service protocol includes the following steps: Get the programming log generated after the host computer completes the software flashing; Traversing the file list of the programming log, reading the data in the file list and performing log analysis, request response processing and data transmission verification on the data in the file list to determine the target data; A file containing the target data is generated according to the target data, and a correctness transmission comparison is performed on the file containing the target data to obtain an analysis result.
2. The programming log analysis method based on the unified diagnostic service protocol according to claim 1, characterized in that: The step of traversing the file list of the programming log, reading the data in the file list and performing log analysis, request response processing and data transmission verification on the data in the file list to determine the target data includes: Open the file list of the programming log in sequence to obtain the current file in the file list; Read the current file line by line to obtain the current line; Performing log analysis on the current row; When the current row passes the log analysis, performing request response processing on the current row; When the current row passes the request response process, performing data transmission verification on the current row; When the current line passes the data transmission verification, returning to the step of reading the current file line by line to obtain the current line until all lines in the current file are traversed; When all the lines of the current file are traversed, return to the step of opening the file list of the programming log in sequence to obtain the current file in the file list, until the file list of the programming log is traversed, and determine the target data based on all the lines that have passed the log analysis, the request response processing and the data transmission verification.
3. The programming log analysis method based on the unified diagnostic service protocol as claimed in claim 2, characterized in that: The step of performing log analysis on the current row includes: Performing data analysis on the current line to determine whether the format of the current line matches a preset regular expression; When the format of the current row matches the preset regular expression, determining whether the identifier of the current row is within a validity range; When the identifier of the current row is within the validity range, determining whether the current row includes a request or a response for a 3E service; When the current row includes the request or response of the 3E service, it is determined that the current row passes the log analysis.
4. The programming log analysis method based on the unified diagnostic service protocol as claimed in claim 2, characterized in that: The step of performing request response processing on the current row includes: According to the order of request or response, determine whether the processing status is request information or response information; When the processing state is request information, executing a first request response process; When the processing status is response information, a second request response process is executed.
5. The programming log analysis method based on the unified diagnostic service protocol as claimed in claim 4, characterized in that: The step of executing the first request response process when the processing state is request information includes: Obtain the format of the frame of the current row and the processing status of the frame; Determining whether the format of the frame of the current row and the processing status of the frame are consistent; When the format and the processing status are consistent, determining whether the service ID of the frame is valid; When the service ID of the frame is valid and is a request, determining a service type; When it is determined that the service is a data transmission service, it is determined that the current row is processed through a request response.
6. The programming log analysis method based on the unified diagnostic service protocol according to claim 4, characterized in that: When the processing state is a response message, the step of performing a second request response process comprises: Obtain the format of the frame of the current row and the processing status of the frame; Determining whether the format of the frame of the current row and the processing status of the frame are consistent; When the format and the processing status are consistent, determining whether the service ID of the frame is valid; When the service ID of the frame is valid and the response is positive, determining the service type; When it is determined that the service is a data transmission service, it is determined that the current row is processed through a request response.
7. The programming log analysis method based on the unified diagnostic service protocol according to claim 1, characterized in that: The step of generating a file containing the target data according to the target data, performing a transmission comparison for correctness of the file containing the target data, and obtaining an analysis result comprises: Generate a file containing the target data and a preset file intended to be flashed based on the target data; The preset file is compared with the file containing the target data to determine whether the flashed version of the software is correct, and obtain an analysis result.
8. A programming log analysis device based on a unified diagnostic service protocol, characterized in that: The device comprises: The log acquisition module is used to obtain the programming log generated after the upper computer completes the software flashing; A diagnostic module, used to traverse the file list of the programming log, read the data of the file list and perform log analysis, request response processing and data transmission verification on the data of the file list to determine the target data; The comparison module is used to generate a file containing the target data according to the target data, and to perform a transmission correctness comparison on the file containing the target data to obtain an analysis result.
9. A programming log analysis device based on a unified diagnostic service protocol, characterized in that: The device includes: a memory, a processor, and a programming log analysis program based on a unified diagnostic service protocol stored in the memory and executable on the processor, wherein the programming log analysis program based on a unified diagnostic service protocol is configured to implement the steps of a programming log analysis method based on a unified diagnostic service protocol as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium stores a programming log analysis program based on a unified diagnostic service protocol, and when the programming log analysis program based on a unified diagnostic service protocol is executed by a processor, the steps of the programming log analysis method based on a unified diagnostic service protocol as described in any one of claims 1 to 7 are implemented.