Vehicle log analysis method, system, apparatus, medium, and vehicle

By analyzing vehicle logs using a finite state machine model, the problems of high professional knowledge requirements and low efficiency in existing technologies are solved, and automated vehicle log analysis and status monitoring are achieved.

CN113886202BActive Publication Date: 2026-05-29NIO TECH ANHUI CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NIO TECH ANHUI CO LTD
Filing Date
2021-09-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The existing vehicle log analysis process requires a high level of expertise, is inefficient, and cannot be automated, resulting in low efficiency in fault diagnosis and status monitoring.

Method used

A finite state machine model is used to analyze vehicle logs. By determining log keywords and transition conditions, a finite state machine model is created to automatically analyze vehicle status and output relevant log lines.

Benefits of technology

It reduces the need for specialized knowledge, improves the efficiency and accuracy of vehicle log analysis, and enables automated fault diagnosis and status monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113886202B_ABST
    Figure CN113886202B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of vehicle control, and specifically provides a vehicle log analysis method, system, device, medium and vehicle, aiming to solve the problem of high professional knowledge requirement and low efficiency in the existing vehicle log analysis process. To this end, the present application creates a corresponding finite state machine model according to different vehicle state analysis services, so as to facilitate the analysis of vehicle logs, judge whether the vehicle is in the vehicle state corresponding to the vehicle state analysis service, and output the log line indicating that the vehicle is in the vehicle state, avoiding the process of manually confirming the vehicle log when the vehicle fails or needs to be confirmed, and also reducing the requirement for professional knowledge in the process of analyzing the vehicle log, making the vehicle log analysis process more accurate and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle control technology, specifically providing a method, system, device, medium, and vehicle for analyzing vehicle logs. Background Technology

[0002] Logs are data generated by in-vehicle software systems, primarily recording detailed information about the vehicle's operating status and the work of various modules. They serve as crucial evidence for vehicle maintenance, troubleshooting, and operational safety monitoring. For intelligent vehicles, analyzing in-vehicle logs is even more essential for timely monitoring of the vehicle's actual condition. In practical applications, vehicle maintenance, troubleshooting, and safety monitoring often require comprehensive analysis of multiple types of logs from various modules to reach conclusions. This comprehensive analysis often necessitates manual log review to determine faults or vehicle status, demanding that technicians have a thorough understanding of the logs from each module. Furthermore, manual log review cannot be automated, resulting in low overall efficiency. Additionally, the high skill requirements for technicians in analyzing vehicle logs prevent early problem resolution, necessitating feedback to the manufacturer and further reducing the efficiency of vehicle log analysis.

[0003] Accordingly, there is a need in this field for a new vehicle log analysis scheme to solve the above problems. Summary of the Invention

[0004] The present invention aims to solve the above-mentioned technical problems, namely, to solve the problems of high requirements for professional knowledge and low efficiency in the existing vehicle log analysis process.

[0005] In a first aspect, the present invention provides a method for analyzing vehicle logs, the method comprising:

[0006] For each vehicle status analysis service, determine the log keywords of the vehicle logs related to the vehicle status analysis service and the transition conditions between different log keywords, and create a finite state machine model of the vehicle status analysis service with the log keywords as states and the transition conditions as state transition events.

[0007] Collect actual vehicle logs related to the vehicle status analysis service, and analyze the actual vehicle logs using the finite state machine model of the vehicle status analysis service;

[0008] Based on the analysis results, determine whether the vehicle is in the vehicle state corresponding to the vehicle state analysis service; if so, output the log line in the actual vehicle log that indicates that the vehicle is in the vehicle state.

[0009] In one technical solution of the above-mentioned vehicle log analysis method, the step of "analyzing the actual vehicle log using the finite state machine model of the vehicle state analysis service" includes:

[0010] Based on the log keywords of the vehicle logs related to the vehicle status analysis service, the actual vehicle logs are extracted to obtain the log lines in the actual vehicle logs that contain the log keywords.

[0011] The log lines are analyzed using the finite state machine model.

[0012] In one technical solution of the above-mentioned vehicle log analysis method, the step of "analyzing the log lines using the finite state machine model" includes:

[0013] The finite state machine model is analyzed to obtain a directed cyclic graph with the states as nodes and the state transition events as directed edges.

[0014] Obtain the expected and unexpected condition sets of the directed cyclic graph;

[0015] The log lines are analyzed based on the expected and unexpected condition sets.

[0016] The expected condition set includes at least one expected condition, which is a condition determined based on a state transition event that enables a state transition between adjacent states; the unexpected condition set includes at least one unexpected condition, which is a condition determined based on a state transition event that prevents a state transition between adjacent states.

[0017] In one technical solution of the above-mentioned vehicle log analysis method, the method further includes analyzing each log line sequentially according to the expected and unexpected condition sets, following the steps below:

[0018] Step S1: Obtain the first state of the directed cyclic graph and use the first state as the current state;

[0019] Step S2: Match the current log line with the expected conditions and unexpected conditions corresponding to the current state in the expected condition set and the unexpected condition set respectively; if the current log line matches the expected conditions successfully, proceed to step S3; if the current log line matches the unexpected conditions successfully, record the matching error information according to the current log line and proceed to step S4.

[0020] Step S3: Perform a state transition query on the directed cyclic graph according to the expected conditions; if a next state from the current state is found, then the next state is taken as the new current state and the process proceeds to step S4; if no next state from the current state is found, then match the error information recorded in the current log line and proceed to step S4.

[0021] Step S4: Reacquire the expected condition set and the unexpected condition set, read in the next log line, and use the next log line as the new current log line before proceeding to step S2.

[0022] In one technical solution of the above vehicle log analysis method, the step of "determining whether the vehicle is in the vehicle state corresponding to the vehicle state analysis service based on the analysis results; if so, outputting the log line in the actual vehicle log indicating that the vehicle is in the vehicle state" includes:

[0023] Based on the analysis results, determine whether there is a successfully matched log line for each expected condition. If so, determine the vehicle status corresponding to the vehicle status analysis service and output the log line.

[0024] In a second aspect, the present invention provides a vehicle log analysis system, the analysis system comprising:

[0025] A finite state machine creation module is configured to, for each vehicle state analysis service, determine the log keywords of the vehicle logs related to the vehicle state analysis service and the transition conditions between different log keywords, and create a finite state machine model of the vehicle state analysis service with the log keywords as states and the transition conditions as state transition events.

[0026] The vehicle log analysis module is configured to collect actual vehicle logs related to the vehicle status analysis service and analyze the actual vehicle logs using the finite state machine model of the vehicle status analysis service.

[0027] The vehicle status determination module is configured to determine whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service based on the analysis results; if so, it outputs the log line in the actual vehicle log that indicates that the vehicle is in the vehicle status.

[0028] In one technical solution of the aforementioned vehicle log analysis system, the vehicle log analysis module includes:

[0029] The vehicle log extraction unit is configured to extract keywords from the actual vehicle logs based on log keywords of vehicle logs related to the vehicle status analysis service, and obtain log lines in the actual vehicle logs that contain the log keywords.

[0030] The vehicle log analysis unit is configured to analyze the log lines using the finite state machine model.

[0031] In one technical solution of the aforementioned vehicle log analysis system, the vehicle log analysis unit includes:

[0032] A directed cyclic graph acquisition sub-unit is configured to parse the finite state machine model and acquire a directed cyclic graph with the states as nodes and the state transition events as directed edges.

[0033] A subunit for obtaining expected and unexpected condition sets is configured to obtain the expected and unexpected condition sets of the directed cyclic graph.

[0034] A log line analysis subunit is configured to analyze the log lines based on the expected condition set and the unexpected condition set;

[0035] The expected condition set includes at least one expected condition, which is a condition determined based on a state transition event that enables a state transition between adjacent states; the unexpected condition set includes at least one unexpected condition, which is a condition determined based on a state transition event that prevents a state transition between adjacent states.

[0036] In one technical solution of the aforementioned vehicle log analysis system, the system is further configured to analyze each log line sequentially according to the expected and unexpected condition sets, following the steps below:

[0037] Step S1: Obtain the first state of the directed cyclic graph and use the first state as the current state;

[0038] Step S2: Match the current log line with the expected conditions and unexpected conditions corresponding to the current state in the expected condition set and the unexpected condition set respectively; if the current log line matches the expected conditions successfully, proceed to step S3; if the current log line matches the unexpected conditions successfully, record the matching error information according to the current log line and proceed to step S4.

[0039] Step S3: Perform a state transition query on the directed cyclic graph according to the expected conditions; if a next state from the current state is found, then the next state is taken as the new current state and the process proceeds to step S4; if no next state from the current state is found, then match the error information recorded in the current log line and proceed to step S4.

[0040] Step S4: Reacquire the expected condition set and the unexpected condition set, read in the next log line, and use the next log line as the new current log line before proceeding to step S2.

[0041] In one technical solution of the aforementioned vehicle log analysis system, the vehicle status determination module is further configured to determine whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service according to the following steps:

[0042] Based on the analysis results, determine whether there is a successfully matched log line for each expected condition. If so, determine the vehicle status corresponding to the vehicle status analysis service and output the log line.

[0043] In a third aspect, a control device is provided, comprising a processor and a storage device, the storage device being adapted to store a plurality of program codes, the program codes being adapted to be loaded and run by the processor to execute the vehicle log analysis method described in any of the above-described technical solutions.

[0044] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored therein, the program codes being adapted to be loaded and run by a processor to perform the vehicle log analysis method described in any of the above-described technical solutions.

[0045] Fifthly, a vehicle is provided, the vehicle comprising the vehicle log analysis system described in any of the above-described technical solutions for the vehicle log analysis system.

[0046] By adopting the above technical solution, this invention can create a finite state machine model for vehicle status analysis based on the log keywords of vehicle logs related to vehicle status analysis services and the transition conditions between different log keywords. The finite state machine model is then applied to analyze the actual vehicle logs. Based on the analysis results, it determines whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service. If so, a log line indicating that the vehicle is in that status is output. Through this configuration, this invention can create corresponding finite state machine models for different vehicle status analysis services, facilitating the analysis of vehicle logs, determining whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service, and outputting a log line indicating that the vehicle is in that status. This avoids the need for manual verification of vehicle logs when a vehicle malfunctions or when vehicle status confirmation is required. It also reduces the professional knowledge required for vehicle log analysis, making the analysis process more accurate and efficient.

[0047] Solution 1. A method for analyzing vehicle logs, characterized in that the analysis method includes:

[0048] For each vehicle status analysis service, determine the log keywords of the vehicle logs related to the vehicle status analysis service and the transition conditions between different log keywords, and create a finite state machine model of the vehicle status analysis service with the log keywords as states and the transition conditions as state transition events.

[0049] Collect actual vehicle logs related to the vehicle status analysis service, and analyze the actual vehicle logs using the finite state machine model of the vehicle status analysis service.

[0050] Based on the analysis results, determine whether the vehicle is in the vehicle state corresponding to the vehicle state analysis service; if so, output the log line in the actual vehicle log that indicates that the vehicle is in the vehicle state.

[0051] Solution 2. According to the analysis method described in Solution 1, the step of "analyzing the actual vehicle log using the finite state machine model of the vehicle state analysis service" includes:

[0052] Based on the log keywords of the vehicle logs related to the vehicle status analysis service, the actual vehicle logs are extracted to obtain the log lines in the actual vehicle logs that contain the log keywords.

[0053] The log lines are analyzed using the finite state machine model.

[0054] Solution 3. The analysis method according to Solution 2, characterized in that the step of "analyzing the log line using the finite state machine model" includes:

[0055] The finite state machine model is analyzed to obtain a directed cyclic graph with the states as nodes and the state transition events as directed edges.

[0056] Obtain the expected and unexpected condition sets of the directed cyclic graph;

[0057] The log lines are analyzed based on the expected and unexpected condition sets.

[0058] The expected condition set includes at least one expected condition, which is a condition determined based on a state transition event that enables a state transition between adjacent states; the unexpected condition set includes at least one unexpected condition, which is a condition determined based on a state transition event that prevents a state transition between adjacent states.

[0059] Solution 4. The analysis method according to Solution 3, characterized in that the method further includes analyzing each log line sequentially according to the expected condition set and the unexpected condition set, and through the following steps:

[0060] Step S1: Obtain the first state of the directed cyclic graph and use the first state as the current state;

[0061] Step S2: Match the current log line with the expected conditions and unexpected conditions corresponding to the current state in the expected condition set and the unexpected condition set respectively; if the current log line matches the expected conditions successfully, proceed to step S3; if the current log line matches the unexpected conditions successfully, record the matching error information according to the current log line and proceed to step S4.

[0062] Step S3: Perform a state transition query on the directed cyclic graph according to the expected conditions; if a next state from the current state is found, then the next state is taken as the new current state and the process proceeds to step S4; if no next state from the current state is found, then match the error information recorded in the current log line and proceed to step S4.

[0063] Step S4: Reacquire the expected condition set and the unexpected condition set, read in the next log line, and use the next log line as the new current log line before proceeding to step S2.

[0064] Solution 5. According to the analysis method described in Solution 4, the step of "determining whether the vehicle is in the vehicle state corresponding to the vehicle state analysis service based on the analysis result; if so, outputting the log line in the actual vehicle log indicating that the vehicle is in the vehicle state" includes:

[0065] Based on the analysis results, determine whether there is a successfully matched log line for each expected condition. If so, determine the vehicle status corresponding to the vehicle status analysis service and output the log line.

[0066] Solution 6. A vehicle log analysis system, characterized in that the analysis system comprises:

[0067] A finite state machine creation module is configured to, for each vehicle state analysis service, determine the log keywords of the vehicle logs related to the vehicle state analysis service and the transition conditions between different log keywords, and create a finite state machine model of the vehicle state analysis service with the log keywords as states and the transition conditions as state transition events.

[0068] The vehicle log analysis module is configured to collect actual vehicle logs related to the vehicle status analysis service and analyze the actual vehicle logs using the finite state machine model of the vehicle status analysis service.

[0069] The vehicle status determination module is configured to determine whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service based on the analysis results; if so, it outputs the log line in the actual vehicle log that indicates that the vehicle is in the vehicle status.

[0070] Solution 7. The analysis system according to Solution 6, characterized in that the vehicle log analysis module includes:

[0071] The vehicle log extraction unit is configured to extract keywords from the actual vehicle logs based on log keywords of vehicle logs related to the vehicle status analysis service, and obtain log lines in the actual vehicle logs that contain the log keywords.

[0072] The vehicle log analysis unit is configured to analyze the log lines using the finite state machine model.

[0073] Solution 8. The analysis system according to Solution 7, characterized in that the vehicle log analysis unit includes:

[0074] A directed cyclic graph acquisition sub-unit is configured to parse the finite state machine model and acquire a directed cyclic graph with the states as nodes and the state transition events as directed edges.

[0075] A subunit for obtaining expected and unexpected condition sets is configured to obtain the expected and unexpected condition sets of the directed cyclic graph.

[0076] A log line analysis subunit is configured to analyze the log lines based on the expected condition set and the unexpected condition set;

[0077] The expected condition set includes at least one expected condition, which is a condition determined based on a state transition event that enables a state transition between adjacent states; the unexpected condition set includes at least one unexpected condition, which is a condition determined based on a state transition event that prevents a state transition between adjacent states.

[0078] Solution 9. The analysis system according to Solution 8, characterized in that the system is further configured to analyze each log line sequentially according to the expected condition set and the unexpected condition set, and through the following steps, in chronological order of log line time:

[0079] Step S1: Obtain the first state of the directed cyclic graph and use the first state as the current state;

[0080] Step S2: Match the current log line with the expected conditions and unexpected conditions corresponding to the current state in the expected condition set and the unexpected condition set respectively; if the current log line matches the expected conditions successfully, proceed to step S3; if the current log line matches the unexpected conditions successfully, record the matching error information according to the current log line and proceed to step S4.

[0081] Step S3: Perform a state transition query on the directed cyclic graph according to the expected conditions; if a next state from the current state is found, then the next state is taken as the new current state and the process proceeds to step S4; if no next state from the current state is found, then match the error information recorded in the current log line and proceed to step S4.

[0082] Step S4: Reacquire the expected condition set and the unexpected condition set, read in the next log line, and use the next log line as the new current log line before proceeding to step S2.

[0083] Solution 10. The analysis system according to Solution 9, characterized in that the vehicle status determination module is further configured to determine whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service according to the following steps:

[0084] Based on the analysis results, determine whether there is a successfully matched log line for each expected condition. If so, determine the vehicle status corresponding to the vehicle status analysis service and output the log line.

[0085] Scheme 11. A control device comprising a processor and a storage device, the storage device being adapted to store a plurality of program codes, characterized in that the program codes are adapted to be loaded and run by the processor to perform the vehicle log analysis method as described in any one of Schemes 1 to 5.

[0086] Scheme 12. A computer-readable storage medium storing a plurality of program codes, characterized in that the program codes are adapted to be loaded and run by a processor to perform the vehicle log analysis method of any one of Schemes 1 to 5.

[0087] Option 13: A vehicle, characterized in that the vehicle includes a vehicle log analysis system as described in any one of Options 6 to 10. Attached Figure Description

[0088] The disclosure of this invention will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Wherein:

[0089] Figure 1 This is a schematic flowchart of the main steps of a vehicle log analysis method according to an embodiment of the present invention;

[0090] Figure 2 This is a schematic flowchart illustrating the main steps of analyzing the log lines of each vehicle log sequentially according to an expected condition set and an unexpected condition set, as described in one embodiment of the present invention.

[0091] Figure 3 This is a main structural block diagram of a vehicle log analysis system according to an embodiment of the present invention;

[0092] Figure 4 This is a schematic diagram illustrating the process of pushing and popping states onto and off the stack when analyzing log lines of each vehicle log according to an expected condition set and an unexpected condition set, according to one embodiment of the present invention. Detailed Implementation

[0093] Some embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0094] In the description of this invention, "module" and "processor" can include hardware, software, or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, memory, and may also include software components, such as program code, or a combination of software and hardware. A processor can be a central processing unit, a microprocessor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing capabilities. The processor can be implemented in software, in hardware, or a combination of both. Non-transitory computer-readable storage media include any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The terms "at least one A or B" or "at least one of A and B" have a similar meaning to "A and / or B" and can include only A, only B, or A and B. The singular terms "a" or "this" can also include plural forms.

[0095] During vehicle maintenance, troubleshooting, and safety monitoring, comprehensive analysis of various types of vehicle logs from multiple modules is often required to reach conclusions. Currently, fault or vehicle status is typically determined manually by reviewing vehicle logs, demanding that technicians have a thorough understanding of the logs from each module. Furthermore, the manual review process cannot be automated, resulting in low overall efficiency. Additionally, the high skill requirements for technicians in analyzing vehicle logs prevent early resolution of many issues, necessitating feedback to the manufacturer and further reducing the efficiency of vehicle log analysis.

[0096] This invention provides a method, system, device, medium, and vehicle for analyzing vehicle logs to solve the above-mentioned problems.

[0097] See appendix Figure 1 , Figure 1 This is a schematic flowchart illustrating the main steps of a vehicle log analysis method according to an embodiment of the present invention. Figure 1 As shown, the vehicle log analysis method in this embodiment of the invention mainly includes the following steps S101-S103.

[0098] Step S101: For each vehicle status analysis service, determine the log keywords of the vehicle logs related to the service and the transition conditions between different log keywords. Using the log keywords as states and the transition conditions as state transition events, create a finite state machine model for the vehicle status analysis service. A finite state machine model is a tool used for object behavior modeling. It describes the sequence of states an object experiences during its lifecycle and how it responds to various external events. A finite state machine model generally includes states and state transition events. Vehicle status analysis services may include routine maintenance of the vehicle as a whole, routine maintenance of the vehicle's functional modules, vehicle fault diagnosis, vehicle operational safety monitoring, and vehicle function analysis.

[0099] In this embodiment, log keywords and transition conditions between different keywords for vehicle logs related to each vehicle status analysis service can be determined. Log keywords are set as states in a finite state machine model, and transition conditions are set as state transition events in the finite state machine model, thus constructing finite state machine models for different vehicle status analysis services. Furthermore, in this embodiment, log keywords may also include component names, module names, etc. A component refers to a reusable program unit, and a module refers to a collection of components that can independently perform a certain function after reuse. The module name is the name of a module in an ECU (Electronic Control Unit), and the component name is the name of a component in the ECU. Software functions in an ECU can be implemented by multiple modules. The software log lines contain the component name and module name to which the log belongs. The component name or module name can be used as a log keyword to extract the actual vehicle logs. The actual vehicle logs extracted based on the component name or module name as the log keyword are the vehicle logs related to a specific function of the vehicle corresponding to the component name or module name. When it's necessary to analyze a specific vehicle function corresponding to a component name or module name, the component name or module name can be used as the log keyword for the vehicle logs related to the vehicle status analysis business. The transition condition between different log keywords refers to the condition for moving from one log keyword to its associated next log keyword. For example, if one log keyword is an error code and the next log keyword is a module name, the condition could be whether the error code matches the module name.

[0100] Step S102: Collect actual vehicle logs related to the vehicle status analysis business, and analyze the actual vehicle logs using the finite state machine model of the vehicle status analysis business.

[0101] In this embodiment, actual vehicle logs related to the vehicle status analysis service can be collected, and the finite state machine model of the vehicle status analysis service created in step S101 can be obtained. The actual vehicle logs can then be analyzed using the finite state machine model.

[0102] Step S103: Determine whether the vehicle is in the vehicle status analysis business according to the analysis results; if so, output the log line in the actual vehicle log that indicates that the vehicle is in the vehicle status.

[0103] In this embodiment, based on the analysis results obtained from analyzing the actual vehicle logs in step S102, it can be determined whether the vehicle is in the vehicle state corresponding to the vehicle state analysis service; if so, the log lines of the vehicle logs indicating that the vehicle is in the vehicle state in the actual vehicle logs will be output.

[0104] Based on steps S101-S103 above, this invention can create a finite state machine model for vehicle status analysis based on the log keywords of vehicle logs related to vehicle status analysis services and the transition conditions between different log keywords. The finite state machine model is then applied to analyze the actual vehicle logs. Based on the analysis results, it is determined whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service. If so, a log line indicating that the vehicle is in that status is output. Through this configuration method, this invention can create corresponding finite state machine models for different vehicle status analysis services, facilitating the analysis of vehicle logs, determining whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service, and outputting a log line indicating that the vehicle is in that status. This avoids the need for manual verification of vehicle logs when a vehicle malfunctions or when vehicle status confirmation is required. It also reduces the professional knowledge required for vehicle log analysis, making the vehicle log analysis process more accurate and efficient.

[0105] The following provides a further explanation of steps S102 and S103.

[0106] In one embodiment of the present invention, step S102 further includes:

[0107] Step S1021: Based on the log keywords of the vehicle logs related to the vehicle status analysis business, extract keywords from the actual vehicle logs to obtain the log lines in the actual vehicle logs that contain the log keywords.

[0108] In this embodiment, the actual vehicle logs can be extracted by extracting keywords from the log keywords of the vehicle logs related to the vehicle status analysis business, so as to obtain the log lines containing the log keywords in the actual vehicle logs.

[0109] In one implementation, the actual vehicle logs can be system logs from the vehicle software, vehicle ECU (Electronic Control Unit) logs, vehicle application logs, and vehicle alarm logs, etc. Actual vehicle logs from different sources can be categorized, larger logs can be segmented, and the logs can be processed to achieve a uniform format. Furthermore, after obtaining log lines containing log keywords, these log lines can be annotated to improve the speed of subsequent vehicle log analysis.

[0110] Step S1022: Analyze the log lines using a finite state machine model.

[0111] In this embodiment, a finite state machine model can be used to analyze the log lines containing log keywords obtained in step S1021.

[0112] In one implementation, the finite state machine model can analyze one type of vehicle log, including system logs of the in-vehicle software, vehicle ECU logs, vehicle application logs, and vehicle alarm logs, or it can analyze multiple vehicle logs simultaneously. That is, it can analyze vehicle logs from a single file, or from vehicle logs of the same component in different modules within the same ECU, the same component or module in different ECUs, or the same component in different modules within different ECUs. In other words, based on log keywords, it can extract vehicle logs of the same component in different modules within the same ECU, the same component or module in different ECUs, and the same component in different modules within different ECUs, and further analyze the extracted log lines using the finite state machine model.

[0113] In one embodiment of the present invention, step S1022 further includes:

[0114] Step S10221: Analyze the finite state machine model to obtain a directed cyclic graph with states as nodes and state transition events as directed edges;

[0115] Step S10222: Obtain the expected condition set and the unexpected condition set of the directed cyclic graph;

[0116] Step S10223: Analyze the log lines based on the expected and unexpected condition sets;

[0117] The expected condition set includes at least one expected condition, which is a condition determined by a state transition event that enables a state transition between adjacent states. The unexpected condition set includes at least one unexpected condition, which is a condition determined by a state transition event that prevents a state transition between adjacent states. For example, if the state transition event is whether an error code and module code match successfully, then the expected condition could be that the error code and module code match successfully, and the unexpected condition could be that the error code and module code do not match successfully.

[0118] In this embodiment, the finite state machine model created in step S101 can be parsed to obtain a directed cyclic graph with the states of the finite state machine model as nodes and the state transition events of the finite state machine as directed edges. The directed cyclic graph consists of a set of nodes and a set of directed edges, with each directed edge connecting an ordered pair of nodes. An expected condition set and an unexpected condition set can be obtained from the directed cyclic graph. The expected condition set may include at least one expected condition, which is a condition determined by the state transition events that enables state transitions between adjacent states. The unexpected condition set may include at least one unexpected condition, which is a condition determined by the state transition events that prevents state transitions between adjacent states. Furthermore, the log lines extracted in step S1021 can be analyzed based on the expected and unexpected condition sets.

[0119] See appendix Figure 2 , Figure 2 This is a schematic flowchart illustrating the main steps of analyzing each vehicle log line sequentially based on an expected condition set and an unexpected condition set, according to one embodiment of the present invention. Figure 2 As shown, in one implementation, each log line can be analyzed sequentially according to the expected and unexpected condition sets, following the steps S201-S208, in chronological order of log line time:

[0120] Step S201: Obtain the first state of the directed cyclic graph and use the first state as the current state.

[0121] Step S202: Match the current log line with the expected and unexpected conditions corresponding to the current state in the expected and unexpected condition sets respectively.

[0122] In this implementation, the current log line can be matched with the expected and unexpected conditions corresponding to the current state in the expected and unexpected condition sets respectively.

[0123] Step S203: Determine whether the current log line matches the expected condition or the unexpected condition. If the current log line matches the expected condition, proceed to step S204; if the current log line matches the unexpected condition, proceed to step S208.

[0124] In this embodiment, it can be determined whether the current log line in step S202 matches the expected condition or the unexpected condition. If the current log line matches the expected condition, the process jumps to step S204; if the current log line matches the unexpected condition, the process jumps to step S208.

[0125] Step S204: Perform a state transition query on the directed cyclic graph according to the expected conditions.

[0126] In this embodiment, a state transition query can be performed on a directed cyclic graph based on expected conditions.

[0127] Step S205: Determine whether a next state from the current state has been found. If yes, proceed to step S206; otherwise, proceed to step S208.

[0128] In this embodiment, it can be determined whether the state query of the directed cycle graph in step S204 has been found to be the next state from the current state. If yes, it means that the current state is not the last state of the directed cycle graph, and the process jumps to step S206; if no, it means that the current state is the last state of the directed cycle graph, and the process jumps to step S208.

[0129] Step S206: Set the next state as the new current state, and then proceed to step S207.

[0130] In this embodiment, the next state queried in step S204 can be set as the new current state.

[0131] Step S207: Reacquire the expected and unexpected condition sets, read the next log line, set the next log line as the new current log line, and then jump to step S202.

[0132] In this embodiment, the expected and unexpected condition sets can be re-acquired, and after reading the next log line, the process jumps to step S202 to continue matching the next log line. That is, if the current log line successfully matches the expected condition and the directed cyclic graph still has a next state, the next log line is read, and it is determined whether the next log line successfully matches the expected condition or the unexpected condition.

[0133] Step S208: After recording the matching error information based on the current log line, proceed to step S207. That is, if the current log line successfully matches an unexpected condition, it indicates that this current log line may be the log line where a matching error occurred. Therefore, the matching error information can be recorded based on this current log line, and then the next log line is read. The next log line is then matched with the expected and unexpected conditions corresponding to the current state (the first state of the directed cyclic graph) determined in step S201 (execute step S202). Simultaneously, if the current log line successfully matches the expected condition, and the directed cyclic graph does not have a next state, it also indicates that this current log line may be the log line where a matching error occurred. Therefore, the matching error information can be recorded based on this current log line, and then the next log line is read. The next log line is then matched with the expected and unexpected conditions corresponding to the current state (the first state of the directed cyclic graph) determined in step S201 (execute step S202).

[0134] In one implementation, see Appendix Figure 4 , Figure 4 This is a schematic diagram illustrating the process of pushing and popping states onto and off the stack when analyzing log lines of each vehicle log according to an expected and unexpected condition set, as per an embodiment of the present invention. Figure 4 As shown, C p For the expected condition set, C u For an unexpected condition set, V i For state, L i For log lines, the normal form P (directed graph) is a directed cyclic graph. A directed cyclic graph includes a state set V and a condition set C. The state set V (vertices set) is the sum of the states V. i The set of nodes in a directed cyclic graph; the condition set C (directed edge transformation set) refers to the set of conditions used to determine whether a vehicle log matches a log line during analysis, which is the set of conditions for transformation by directed edges in the directed cyclic graph. This can be determined based on... Figure 2The method shown analyzes the vehicle logs. If the expected condition set of the current state matches the current log line, the current state is pushed onto the stack, and the next state to transition from the current state is found. If found, the found state is used as the current state, and the expected condition set of the current state is retrieved again. If the expected condition set of the current state matches the current log line, the current state is pushed onto the stack again. This process continues until the current state is the last state. All previously pushed states are popped from the stack, and matching error information is recorded according to the current log line. If the unexpected condition set of the current state matches the current log line, all pushed states are popped from the stack. Regardless of whether the match is successful with the expected or unexpected condition set, after a state is popped from the stack, the next log line is read.

[0135] In one embodiment of the present invention, step S103 further includes the following steps:

[0136] Based on the analysis results, determine whether there are successfully matched log lines for each expected condition. If so, determine the vehicle status corresponding to the vehicle status analysis business and output the log line.

[0137] In this embodiment, based on the analysis results of each log line analyzed in steps S201-S208, it can be determined whether there are successfully matched log lines for each expected condition of the vehicle. If so, it means that these successfully matched log lines are the log lines indicating the vehicle status corresponding to the vehicle status analysis service. These successfully matched log lines can then be output to facilitate subsequent analysis and processing.

[0138] In one embodiment of the present invention, log keywords and / or log keywords containing component names and module names related to vehicle status analysis services can be stored in a preset keyword library. Those skilled in the art and users can add, delete, and update log keywords as needed. Expected condition sets and log lines indicating the vehicle's status can be stored in a preset analysis result library, and the expected condition sets and log lines indicating the vehicle's status can be displayed through a preset display interface. Those skilled in the art can edit, add, or delete finite state machine models created for different vehicle status analysis services according to actual application needs.

[0139] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effects of the present invention, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders, and these variations are all within the scope of protection of the present invention.

[0140] Furthermore, the present invention also provides a vehicle log analysis system.

[0141] See appendix Figure 3 , Figure 3 This is a main structural block diagram of a vehicle log analysis system according to an embodiment of the present invention. Figure 3 As shown, the vehicle log analysis system in this embodiment of the invention may include a finite state machine creation module, a vehicle log analysis module, and a vehicle state determination module. In this embodiment, the finite state machine creation module can be configured to, for each vehicle state analysis service, determine the log keywords of the vehicle logs related to the vehicle state analysis service and the transition conditions between different log keywords, and create a finite state machine model for the vehicle state analysis service using the log keywords as states and the transition conditions as state transition events. The vehicle log analysis module can be configured to collect actual vehicle logs related to the vehicle state analysis service and analyze the actual vehicle logs using the finite state machine model of the vehicle state analysis service. The vehicle state determination module can be configured to determine whether the vehicle is in the vehicle state corresponding to the vehicle state analysis service based on the analysis results; if so, it outputs the log line in the actual vehicle log indicating that the vehicle is in the vehicle state.

[0142] In one embodiment, the vehicle log analysis module may include a vehicle log extraction unit and a vehicle log analysis unit. In this embodiment, the vehicle log extraction unit may be configured to extract keywords from the actual vehicle logs based on log keywords related to the vehicle status analysis service, thereby obtaining log lines in the actual vehicle logs that contain the log keywords. The vehicle log analysis unit may be configured to analyze the log lines using a finite state machine model.

[0143] In one embodiment, the vehicle log analysis unit may include a directed cycle graph acquisition subunit, an expected and unexpected condition set acquisition subunit, and a log line analysis subunit. In this embodiment, the directed cycle graph acquisition subunit may be configured to parse a finite state machine model to obtain a directed cycle graph with states as nodes and state transition events as directed edges. The expected and unexpected condition set acquisition subunit may be configured to obtain the expected and unexpected condition sets of the directed cycle graph. The log line analysis subunit may be configured to analyze log lines based on the expected and unexpected condition sets. The expected condition set may include at least one expected condition, which can be a condition determined based on state transition events that enables state transitions between adjacent states; the unexpected condition set may include at least one unexpected condition, which can be a condition determined based on state transition events that prevents state transitions between adjacent states.

[0144] In one implementation, the vehicle log analysis system can also be configured to analyze each log line sequentially according to the expected and unexpected condition sets, following the steps below:

[0145] Step S1: Obtain the first state of the directed cyclic graph and use the first state as the current state;

[0146] Step S2: Match the current log line with the expected and unexpected conditions corresponding to the current state in the expected and unexpected condition sets respectively; if the current log line matches the expected condition successfully, proceed to step S3; if the current log line matches the unexpected condition successfully, record the matching error information according to the current log line and proceed to step S4.

[0147] Step S3: Perform a state transition query on the directed cyclic graph according to the expected conditions; if the next state from the current state is found, then the next state is taken as the new current state and the process proceeds to step S4; if the next state from the current state is not found, then the error information is matched according to the current log line record and the process proceeds to step S4.

[0148] Step S4: Reacquire the expected and unexpected condition sets, read the next log line, set the next log line as the new current log line, and then proceed to step S2.

[0149] In one implementation, the vehicle status determination module can be further configured to determine whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service based on the following steps:

[0150] Based on the analysis results, determine whether there is a successfully matched log line for each expected condition. If so, determine the vehicle status corresponding to the vehicle status analysis business and output the log line.

[0151] The aforementioned vehicle log analysis system is used for execution Figure 1 and Figure 2 The vehicle log analysis method embodiments shown are similar in technical principle, the technical problems solved, and the technical effects produced. Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the vehicle log analysis system can be found in the embodiments of the vehicle log analysis method, which will not be repeated here.

[0152] Those skilled in the art will understand that all or part of the processes in the method of the above embodiment of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable storage medium can include any entity or device capable of carrying the computer program code, a medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable storage medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.

[0153] Furthermore, the present invention also provides a control device. In one embodiment of the control device according to the present invention, the control device includes a processor and a storage device. The storage device can be configured to store a program for executing the vehicle log analysis method of the above-described method embodiments, and the processor can be configured to execute the program in the storage device. This program includes, but is not limited to, the program for executing the vehicle log analysis method of the above-described method embodiments. For ease of explanation, only the parts related to the embodiments of the present invention are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. This control device can be a control device device comprising various electronic devices.

[0154] Furthermore, the present invention also provides a computer-readable storage medium. In one embodiment of the computer-readable storage medium according to the present invention, the computer-readable storage medium can be configured to store a program for performing the vehicle log analysis method of the above-described method embodiment. This program can be loaded and run by a processor to implement the above-described vehicle log analysis method. For ease of explanation, only the parts related to the embodiments of the present invention are shown; for specific technical details not disclosed, please refer to the method section of the embodiments of the present invention. The computer-readable storage medium can be a storage device comprising various electronic devices. Optionally, in the embodiments of the present invention, the computer-readable storage medium is a non-transitory computer-readable storage medium.

[0155] Furthermore, the present invention also provides a vehicle. In an embodiment of a vehicle according to the present invention, the vehicle includes the vehicle log analysis system described in any of the above-described vehicle log analysis systems. In this embodiment, the vehicle includes, but is not limited to, intelligent vehicles, etc.

[0156] Furthermore, it should be understood that since the various modules are only provided to illustrate the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the processor's software, hardware, or a combination of software and hardware. Therefore, the number of modules shown in the figures is merely illustrative.

[0157] Those skilled in the art will understand that the various modules in the device can be adaptively split or combined. Such splitting or combining of specific modules will not cause the technical solution to deviate from the principles of the present invention; therefore, the technical solutions after splitting or combining will fall within the protection scope of the present invention.

[0158] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A method for analyzing vehicle logs, characterized in that, The analytical method includes: For each vehicle status analysis service, determine the log keywords of the vehicle logs related to the vehicle status analysis service and the transition conditions between different log keywords, and create a finite state machine model of the vehicle status analysis service with the log keywords as states and the transition conditions as state transition events. Collect actual vehicle logs related to the vehicle status analysis business, extract keywords from the actual vehicle logs based on the log keywords of the vehicle logs related to the vehicle status analysis business, and obtain the log lines in the actual vehicle logs that contain the log keywords; The finite state machine model is analyzed to obtain a directed cyclic graph with the states as nodes and the state transition events as directed edges. Obtain the expected and unexpected condition sets of the directed cyclic graph; The log lines are analyzed based on the expected and unexpected condition sets. The expected condition set includes at least one expected condition, which is a condition determined based on a state transition event that enables a state transition between adjacent states; the unexpected condition set includes at least one unexpected condition, which is a condition determined based on a state transition event that prevents a state transition between adjacent states. The method further includes analyzing each log line sequentially according to the expected and unexpected condition sets, following the steps below: Step S1: Obtain the first state of the directed cyclic graph and use the first state as the current state; Step S2: Match the current log line with the expected conditions and unexpected conditions corresponding to the current state in the expected condition set and the unexpected condition set respectively; if the current log line matches the expected conditions successfully, proceed to step S3; if the current log line matches the unexpected conditions successfully, record the matching error information according to the current log line and proceed to step S4. Step S3: Perform a state transition query on the directed cyclic graph according to the expected conditions; if a next state from the current state is found, then the next state is taken as the new current state and the process proceeds to step S4; if no next state from the current state is found, then match the error information recorded in the current log line and proceed to step S4. Step S4: Reacquire the expected condition set and the unexpected condition set, read in the next log line, use the next log line as the new current log line, and then proceed to step S2; Based on the analysis results, determine whether the vehicle is in the vehicle state corresponding to the vehicle state analysis service; if so, output the log line in the actual vehicle log that indicates that the vehicle is in the vehicle state.

2. The analytical method according to claim 1, characterized in that, "Based on the analysis results, determine whether the vehicle is in the vehicle status analysis service corresponding to the vehicle status." If so, the step of "outputting the log line in the actual vehicle log that indicates the vehicle is in the vehicle state" includes: Based on the analysis results, determine whether there is a successfully matched log line for each expected condition. If so, determine the vehicle status corresponding to the vehicle status analysis service and output the log line.

3. A vehicle log analysis system, characterized in that, The analysis system includes: A finite state machine creation module is configured to, for each vehicle state analysis service, determine the log keywords of the vehicle logs related to the vehicle state analysis service and the transition conditions between different log keywords, and create a finite state machine model of the vehicle state analysis service with the log keywords as states and the transition conditions as state transition events. The vehicle log analysis module is configured to collect actual vehicle logs related to the vehicle status analysis service and analyze the actual vehicle logs using the finite state machine model of the vehicle status analysis service. The vehicle status determination module is configured to determine whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service based on the analysis results; if so, it outputs the log line in the actual vehicle log that indicates that the vehicle is in the vehicle status. The vehicle log analysis module includes: The vehicle log extraction unit is configured to extract keywords from the actual vehicle logs based on log keywords of vehicle logs related to the vehicle status analysis service, and obtain log lines in the actual vehicle logs that contain the log keywords. A vehicle log analysis unit is configured to analyze the log lines using the finite state machine model; The vehicle log analysis unit includes: A directed cyclic graph acquisition sub-unit is configured to parse the finite state machine model and acquire a directed cyclic graph with the states as nodes and the state transition events as directed edges. A subunit for obtaining expected and unexpected condition sets is configured to obtain the expected and unexpected condition sets of the directed cyclic graph. A log line analysis subunit is configured to analyze the log lines based on the expected condition set and the unexpected condition set; The expected condition set includes at least one expected condition, which is a condition determined based on a state transition event that enables a state transition between adjacent states; the unexpected condition set includes at least one unexpected condition, which is a condition determined based on a state transition event that prevents a state transition between adjacent states. The system is also configured to analyze each log line sequentially according to the expected and unexpected condition sets, following the steps below, in chronological order of log line time: Step S1: Obtain the first state of the directed cyclic graph and use the first state as the current state; Step S2: Match the current log line with the expected conditions and unexpected conditions corresponding to the current state in the expected condition set and the unexpected condition set respectively; if the current log line matches the expected conditions successfully, proceed to step S3; if the current log line matches the unexpected conditions successfully, record the matching error information according to the current log line and proceed to step S4. Step S3: Perform a state transition query on the directed cyclic graph according to the expected conditions; if a next state from the current state is found, then the next state is taken as the new current state and the process proceeds to step S4; if no next state from the current state is found, then match the error information recorded in the current log line and proceed to step S4. Step S4: Reacquire the expected condition set and the unexpected condition set, read in the next log line, and use the next log line as the new current log line before proceeding to step S2.

4. The analysis system according to claim 3, characterized in that, The vehicle status determination module is further configured to determine whether the vehicle is in the vehicle status corresponding to the vehicle status analysis service according to the following steps: Based on the analysis results, determine whether there is a successfully matched log line for each expected condition. If so, determine the vehicle status corresponding to the vehicle status analysis service and output the log line.

5. A control device, comprising a processor and a storage device, said storage device being adapted to store multiple lines of program code, characterized in that, The program code is adapted to be loaded and run by the processor to perform the vehicle log analysis method according to any one of claims 1 to 2.

6. A computer-readable storage medium storing a plurality of program codes, characterized in that, The program code is adapted to be loaded and run by a processor to perform the vehicle log analysis method according to any one of claims 1 to 2.

7. A vehicle, characterized in that, The vehicle includes the vehicle log analysis system according to any one of claims 3 to 4.