Method and device for controlling log output, vehicle and storage medium
By receiving and parsing log output control requests in the vehicle and customizing log output, the problem of inefficient troubleshooting caused by the huge number of log files in the vehicle is solved, and more efficient fault location and repair is achieved.
Patent Information
- Application Number
- CN202411337036.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-02-11
AI Technical Summary
The large number of log files in the vehicle makes the operation and maintenance personnel inefficient in troubleshooting and it is difficult to repair the fault in time.
By receiving the log output control request sent by the electronic device, the target control parameters are parsed and written to the running memory of the log management tool, the customization of the vehicle output log is realized and the output of unnecessary logs is reduced.
The custom function of log output is realized, which reduces the difficulty of troubleshooting for operation and maintenance personnel, improves the efficiency of fault source positioning, is conducive to timely repairing faults, and reduces the storage pressure of designated terminals that store logs.
Smart Images

Figure CN119415349A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle diagnosis technology, and in particular to a method, device, vehicle and storage medium for controlling log output. Background Art
[0002] Currently, more and more applications are installed on the domain controller of the vehicle, and each application generates a corresponding log file when it runs.
[0003] When a vehicle fails, the log files of each of the above applications need to be output to a designated terminal, and the operation and maintenance personnel will check the log files stored in the designated terminal to locate the source of the failure and then repair the failure.
[0004] However, due to the huge number of log files, it is too difficult for operation and maintenance personnel to troubleshoot, the efficiency of locating the source of the fault is low, and vehicle faults cannot be repaired in time. Summary of the invention
[0005] The present application proposes a method, device, vehicle and storage medium for controlling log output.
[0006] In a first aspect, an embodiment of the present application provides a method for controlling log output, which is applied to a vehicle, and the vehicle includes a log management tool. The method includes: receiving a log output control request sent by an electronic device, the log output control request is used to request customization of the log output of the vehicle; parsing the log output control request to obtain a target control parameter, the target control parameter is used to indicate at least one of a target application for the log to be output, a target log level corresponding to the target application, a target log type for the log to be output, and a global log level; updating the value of at least one parameter of the running memory of the log management tool to the target control parameter; and controlling the vehicle output log according to the target control parameter through the log management tool.
[0007] In a second aspect, an embodiment of the present application provides a device for controlling log output, the device comprising: a request receiving module, used to receive a log output control request sent by an electronic device, the log output control request is used to request a customized vehicle output log; a parsing module, used to parse the log output control request to obtain a target control parameter, the target control parameter is used to indicate at least one of a target application for the log to be output, a target log level corresponding to the target application, a target log type for the log to be output, and a global log level; a parameter updating module, used to update the value of at least one parameter of the running memory of the log management tool to the target control parameter; an output control module, used to control the vehicle output log according to the target control parameter through the log management tool.
[0008] In a third aspect, an embodiment of the present application provides a vehicle comprising a plurality of processors coupled to the memory; and one or more programs, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured for the method described in the first aspect.
[0009] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer program instructions are stored. The computer program instructions can be called by a processor to execute the method of the first aspect.
[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when instructions in the computer program product are executed, is used to implement the method of the first aspect.
[0011] Compared with the prior art, the technical solution provided by the embodiment of the present application is that the vehicle can receive a log output control request sent by an electronic device, parse the target control parameters from the request, and then write the above target control parameters into the running memory of the log management tool. The log management tool controls the vehicle to output logs according to the above target control parameters. On the one hand, the log management tool controls the vehicle to output logs according to the target control parameters, thereby realizing the customization function of the vehicle output log. There is no need to output all logs. When a vehicle has a fault, the operation and maintenance personnel can customize the application, log type, log level and other contents that need to output logs according to the fault manifestation, thereby reducing the number of logs that the vehicle needs to output, reducing the difficulty of troubleshooting for the operation and maintenance personnel, improving the efficiency of locating the source of the fault, and facilitating timely repair of the fault. In addition, the storage pressure of the designated terminal that stores the logs can also be reduced. On the other hand, the above target control parameters are written into the running memory of the log management tool, rather than into the log output configuration file. Therefore, the log management tool does not need to be restarted to control the vehicle to output logs according to the target control parameters, thereby improving real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0013] Figure 1 It is a schematic diagram of the implementation environment provided by the embodiment of the present application.
[0014] Figure 2 This is a flowchart of a method for controlling log output provided by an embodiment of the present application.
[0015] Figure 3This is a flowchart of a method for controlling log output provided by another embodiment of the present application.
[0016] Figure 4 This is a flowchart of a method for controlling log output provided by another embodiment of the present application.
[0017] Figure 5 This is a block diagram of a device for controlling log output provided by an embodiment of the present application.
[0018] Figure 6 It is a structural block diagram of a vehicle provided by an embodiment of the present application. DETAILED DESCRIPTION
[0019] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0020] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0021] First, the technical terms involved in the embodiments of the present application are explained.
[0022] Global log level: indicates the log level of logs output by all applications, which can include six levels from low to high, namely VERBASE, INFO, DEBUG, WARN, ERROR, and FATAL. Among them, logs with a log level of VERBASE usually include fine-grained debugging information; logs with a log level of INFO usually include state changes of critical paths; logs with a log level of DEBUG usually include coarse-grained debugging information; logs with a log level of WARN usually include uncertain call behaviors; logs with a log level of ERROR usually include abnormal but recoverable errors; logs with a log level of FATAL usually include fatal, unrecoverable errors. It should be noted that all applications here refer to all applications in the specified domain controller, not all applications in the vehicle.
[0023] Application log level: indicates the log level of the log output by the application. Similarly, it also controls six levels from low to high, namely VERBASE, INFO, DEBUG, WARN, ERROR, and FATAL. When the global log level is in effect, the application log level is also the global log level; when the global log level (the value of the global log level is NULL) is not in effect, the application log level is in effect. For example, when the global log level is ERROR and the application log level is INFO, the log level of the log output by the vehicle for this application is ERROR; for another example, when the global log level is NULL and the application log level is INFO, the log level of the log output by the vehicle for this application is INFO.
[0024] Log type: including application logs, kernel logs, network packet capture tool logs, and core dump logs.
[0025] Application log: A log file generated when an application is running, which mainly records events generated by the application, such as various error messages, warnings, or other events.
[0026] Kernel log: A log file generated when the system kernel is running, which mainly records activities and events related to the system kernel, such as memory management, hardware failure, memory management, etc.
[0027] Network packet capture tool (Tcp dump) log: The log file generated when the network packet capture tool is running is used to record various information of network data packets, such as source and destination IP addresses, source and destination ports, protocol information, timestamp, data packet content, etc.
[0028] Core dump log: refers to the log file generated when a core dump event occurs. A core dump event is an event in which the system automatically generates a core dump file when a serious error occurs in an application. The core dump file includes the memory image of the program at the time of the crash, including the stack, register status, heap memory, stack memory, etc.
[0029] Log output configuration file: includes global parameter configuration information and application log configuration information. Before receiving a log output control request, the log management tool controls the vehicle output log according to the log output configuration file.
[0030] Global parameter configuration information: including the domain controller identification, global log level, application log switch, kernel log switch, network packet capture tool log switch, and core dump log switch. Log switches (including application log switch, kernel log switch, network packet capture tool log switch, and core dump log switch) include two states: open and closed. In the global parameter configuration information, the kernel log switch, network packet capture tool log switch, and core dump log switch are closed by default, and the application log switch is opened by default. In the global parameter configuration information, the global log level is ERROR by default.
[0031] Application log configuration information: includes the application ID and the log level corresponding to the application. In the global parameter configuration information, the log level corresponding to the application defaults to ERROR.
[0032] Please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an embodiment of the present application. The implementation environment includes a vehicle 100 and an electronic device 200. The vehicle 100 and the electronic device 200 establish a communication connection via a wired network or a wireless network. The electronic device 200 may be a vehicle diagnostic device.
[0033] When the applications in each domain controller of the vehicle 100 are running, corresponding log files will be generated. The above log files are stored in the designated terminal. As the number of log files is increasing, it puts a lot of pressure on the storage of the designated terminal. In addition, when a problem occurs in the vehicle 100, the operation and maintenance personnel need to check the log files stored in the designated terminal to locate the source of the fault. Due to the large number of log files, it is difficult for the operation and maintenance personnel to check and the efficiency of locating the source of the fault is very low.
[0034] In this embodiment, a diagnostic tool is set in the electronic device 200, and a vehicle diagnostic component is set in the vehicle 100. The diagnostic tool can interact with the vehicle diagnostic component and send a log output control request to the vehicle diagnostic component to customize the log output by the vehicle 100, for example, to customize the target application of the log to be output, the target log level corresponding to the target application, the target log type of the log to be output, the global log level, etc. After receiving the log output control request, the vehicle diagnostic component parses the target control parameters from the request and sends them to the log management tool. The log management tool controls the log output according to the above target control parameters. In this way, the vehicle 100 does not need to output all the logs, which simplifies the log content output by the vehicle 100 and reduces the storage pressure of the designated terminal for storing logs. In addition, when the vehicle 100 fails, the operation and maintenance personnel can customize the log output by the vehicle 100 according to the fault manifestation, reduce the difficulty of troubleshooting for the operation and maintenance personnel, and improve the efficiency of locating the fault source.
[0035] Please refer to Figure 2 , which shows a flow chart of a method for controlling log output shown in an embodiment of the present application. The method includes the following process.
[0036] S201, receiving a log output control request sent by an electronic device.
[0037] The log output control request is used to request customization of the logs output by the vehicle, such as customizing the target application of the log to be output, the target log level corresponding to the target application, the target log type of the log to be output, the global log level, etc.
[0038] The log output control request carries the identifier of the domain controller and the target control parameters. The identifier of the domain controller is used to uniquely identify the domain controller, which can be a combination of an electronic control unit (ECU) and a letter, such as ECUA, ECUB, etc. After receiving the target log output control request, the vehicle controls the log output of the domain controller based on the identifier of the domain controller it carries. The target control parameters are customized by the operation and maintenance personnel, and the specific setting process will be described in the following embodiments. The log output control request can also carry other information, such as the identifier of the diagnostic tool, the identifier of the electronic device, etc., which is not limited in this embodiment.
[0039] In this embodiment, the vehicle diagnostic component receives the log output control request sent by the diagnostic tool in the electronic device. Optionally, the vehicle diagnostic component and the diagnostic tool exchange data based on the Diagnostic Communication over Internet Protocol (DOIP), so the log output control request is a DOIP message. Among them, the DOIP message carries a diagnostic request encapsulated based on the Unified Diagnostic Services (UDS) protocol.
[0040] S202, parsing the log output control request to obtain target control parameters.
[0041] The target control parameter is used to indicate at least one of a target application program of the log to be output, a target log level corresponding to the target application program, a target log type of the log to be output, and a global log level.
[0042] In this embodiment, the vehicle diagnostic component parses the log output request to obtain the target control parameter, then converts the target control parameter into a specified format, and finally sends the target control parameter in the specified format to the log management component. The process of the vehicle diagnostic component parsing the log output control request will be described in the following embodiment. The specified format can be a lightweight data exchange format (JavaScript Object Notation, JSON) format. The vehicle diagnostic component sends the target control parameter in the specified format to the log management tool through inter-process communication.
[0043] S203: Update the value of at least one parameter in the running memory of the log management tool to the target control parameter.
[0044] In an embodiment of the present application, after receiving the target control parameters in the specified format, the log management tool does not update them to the log output configuration file, but directly writes them into the running memory. In this way, the log output can be controlled according to the target control parameters in the specified format without restarting the log management tool.
[0045] In addition, the next time the log management tool is started, the vehicle output log will still be controlled according to the log output configuration file.
[0046] S204, controlling the vehicle output log according to the target control parameters through the log management tool.
[0047] The log management tool reads the above target control parameters from its own running memory, and then controls the vehicle to output logs to a designated terminal or a designated storage location in the vehicle according to the above target control parameters.
[0048] In other possible embodiments, the log management tool can also update the above-mentioned target control parameters to the log output configuration file, and then restart. After that, the log management tool reads the above-mentioned target control parameters from the log output configuration file, and then controls the vehicle to output logs to a designated terminal or a designated storage location in the vehicle according to the above-mentioned target control parameters.
[0049] To sum up, according to the technical solution provided by the embodiment of the present application, the vehicle can receive a log output control request sent by an electronic device, parse the target control parameters from the request, and then write the above target control parameters into the running memory of the log management tool. The log management tool controls the vehicle to output logs according to the above target control parameters. On the one hand, the log management tool controls the vehicle to output logs according to the target control parameters, thereby realizing the customization function of the vehicle output log. There is no need to output all logs. When a vehicle fails, the operation and maintenance personnel can customize the application, log type, log level and other contents that need to output logs according to the fault manifestation, thereby reducing the number of logs that need to be output by the vehicle, reducing the difficulty of troubleshooting for the operation and maintenance personnel, improving the efficiency of locating the source of the fault, and facilitating timely repair of the fault. In addition, the storage pressure of the designated terminal that stores the logs can also be reduced. On the other hand, the above target control parameters are written into the running memory of the log management tool, rather than into the log output configuration file. Therefore, the log management tool does not need to be restarted to control the vehicle to output logs according to the target control parameters, thereby improving real-time performance.
[0050] Please refer to Figure 3 , which shows a flow chart of a method for controlling log output provided by an embodiment of the present application. In this embodiment, Figure 2 S202 in the embodiment is replaced by S302-S303, and the method includes the following process.
[0051] S301, receiving a log output control request sent by an electronic device.
[0052] The log output control request is used to request customization of the log output by the vehicle. In this embodiment, the log output control request is used to request customization of at least one target application for the log to be output, and the target log level of the target application.
[0053] S302: Split the log output control request to obtain a first message.
[0054] In the above embodiment, it is mentioned that the log output control request is a DOIP message, and the vehicle diagnostic component can read the first message from the payload portion of the above DOIP message. The first message refers to a message encapsulated in a first diagnostic service format. Optionally, the first diagnostic service format is a 2E service. The 2E service is an important service in the DOIP protocol, which is mainly responsible for functions such as vehicle discovery, status query, route activation (including security authentication), and diagnostic data reception and transmission. The process of an electronic device acquiring a first control parameter includes: the electronic device displays a user interface of a diagnostic tool, the user interface includes different services, and after receiving a selection signal for the first diagnostic service, the electronic device displays the user interface of the first diagnostic service, and receives the set first control parameter in the user interface.
[0055] S303: Extract a first control parameter from the first message.
[0056] In this embodiment, the first control parameter includes an identifier of at least one target application to output logs. The identifier of the target application is used to uniquely identify the target application, which can be the name of the target application or the abbreviation of the process name corresponding to the target application. The first control parameter can also include a target log level corresponding to the target application.
[0057] After the vehicle diagnostic component converts the first control parameter into a specified format, the vehicle diagnostic component sends the first control parameter in the specified format to the log management tool through inter-process communication.
[0058] S304: Update the value of at least one parameter in the running memory of the log management tool to the first control parameter.
[0059] Optionally, the running memory of the log management tool includes a target application set, the target application set includes the identifier of the target application to output the log, and the vehicle updates the identifier of the target application to output the log in the first control parameter to the target application set. In addition, the log management tool also stores the identifier of the target application and the target log level in the running memory in correspondence. It should be noted that if the target application to output the log is all applications, a first specified field is added to the target type set, and optionally, the first specified field is ALL.
[0060] S305: Control the vehicle to output logs according to the first control parameter through the log management tool.
[0061] Optionally, the log management tool controls the vehicle to output the log of the target application according to the target log level corresponding to the target application. The log of the target application output by the vehicle according to the target log level corresponding to the target application includes logs with a log level of the target log level and logs with a log level lower than the above target log level. For example, if the target log level is INFO, the log of the target application output by the vehicle includes logs with a log level of INFO and logs with a log level of VERBASE.
[0062] Specifically, the log management tool first detects whether there is an application log in the target type set. If there is no application log in the target type set, the process ends; if there is an application log in the target type set, first detect whether the target application set is empty; if the target application set is empty, the process ends; if the target application set is not empty, detect whether the target application set includes the first specified field. If the target application set includes the first specified field, the vehicle is controlled to output the logs of all applications according to the log levels corresponding to all applications. If the target application set does not include the first specified field, the identifier of the target application is extracted from the target application set, and then the target log level corresponding to the target application is obtained, and the vehicle is controlled to output the log of the target application according to the target log level corresponding to the target application. The first specified field is used to indicate that the logs of all applications need to be output. Optionally, the first specified field is ALL.
[0063] In some embodiments, at least one parameter of the running memory of the target management tool includes a global log level, and the vehicle also detects whether the value of the global log level is a preset value. If the value of the global log level is a preset value, S305 is executed. If the value of the global log level is not a preset value, the log of at least one target application is output separately according to the value of the global log level through the log management tool.
[0064] The default value is used to indicate that the global log level is not effective. Optionally, the default value is NULL.
[0065] The value of the global log level can be the default setting of the log management tool, or it can be dynamically set by the log management tool based on the log output control request.
[0066] In some embodiments, the control parameters also include a third control parameter, and the third control parameter includes a set value of the global log level. The vehicle splits the log output control request to obtain a third message, and the third message refers to a message encapsulated in accordance with the second diagnostic service format; extracts the third control parameter from the third message, and then modifies the value of the global log level in the running memory of the log management tool to the set value. The second diagnostic service format can be 31 services. 31 services are a diagnostic service provided in accordance with the ISO14119-1 standard. It can implement program activities under abnormal conditions for specific test scenarios, as well as other scenarios that require continuous operation. The process of an electronic device obtaining a third control parameter includes: the electronic device displays a user interface of a diagnostic tool, the user interface includes different services, and after receiving a selection signal for the second diagnostic service, the electronic device displays the user interface of the second diagnostic service, and receives the set third control parameter in the user interface.
[0067] The target application logs output by the vehicle according to the value of the global log level include not only the logs with the above-mentioned log level, but also the logs with a log level lower than the above-mentioned log level. For example, if the global log level is INFO, the target application logs output by the vehicle according to the value of the global log level include the logs with the INFO log level and the logs with the VERBASE log level.
[0068] In summary, the technical solution provided by the embodiment of the present application is that after the electronic device sends a log output control request carrying the identification of the target application and the target log level corresponding to the target application to the vehicle, the vehicle can output the log of the target application according to the target log level corresponding to the target application, and can adapt to different debugging scenarios. In addition, the electronic device can also send a log output control request carrying the set value of the global log level to the vehicle to achieve unified management of the log levels of all applications.
[0069] Please refer to Figure 4 , which shows a flow chart of a method for controlling log output provided by an embodiment of the present application. In this embodiment, Figure 2 S202 in the embodiment is replaced by S402-S403, and the method includes the following process.
[0070] S401, receiving a log output control request sent by an electronic device.
[0071] The log output control request is used to request customization of the log output by the vehicle. In this embodiment, the log output control request is used to request customization of the log type of the log to be output.
[0072] S402: Split the log output control request to obtain a second message.
[0073] In the above embodiment, it is mentioned that the log output control request is a DOIP message, and the vehicle diagnostic component can read the second message from the payload portion of the above DOIP message. The second message refers to a message encapsulated in a second diagnostic service format. Optionally, the second diagnostic service format is 31 service. The process of the electronic device acquiring the second control parameter includes: the electronic device displays a user interface of the diagnostic tool, the user interface includes different services, and after receiving a selection signal for the second diagnostic service, the electronic device displays the user interface of the second diagnostic service, and receives the set second control parameter in the user interface.
[0074] S403: Extract a second control parameter from the second message.
[0075] In this embodiment, the second control parameter includes the target log type of the log to be output. After the vehicle diagnosis component converts the second control parameter into a specified format, it sends the second control parameter in the specified format to the log management tool through inter-process communication.
[0076] S404: Update the value of at least one parameter of the running memory of the log management tool to a second control parameter.
[0077] Optionally, the running memory of the log management tool includes the switch status of different log types. The log management tool first sets the target log type to the open state, and then generates a target type set based on the switch status of each log type. The target type set includes the log type of the log to be output. It should be noted that if the log type of the log to be output is all log types, a second specified field is added to the target type set. Optionally, the second specified field is ALL.
[0078] S405, controlling the vehicle to output logs according to the second control parameter through the log management tool.
[0079] In this embodiment, the log management tool controls the vehicle to output logs of the target log type according to the second control parameter. Specifically, there is a log type set in the running memory of the log management component, and the log type set includes the target log type of the log to be output. The log management tool first detects whether the log type is empty. If the log type set is empty, the log output is stopped. If the log type set is not empty, the log type set is detected whether it includes the second specified field. If the log type set includes the second specified field, logs of all log types are output. If the log type set does not include the second specified field, the target log type in the log type set is extracted, and the vehicle is controlled to output the log of the target log type.
[0080] The second designated field is used to indicate that logs of all log types need to be output. For example, the second designated field is ALL.
[0081] To sum up, the technical solution provided by the embodiment of the present application is that after the electronic device sends a log output control request carrying a target log type to the vehicle, the vehicle can output logs of the target log type, so that the logs output by the vehicle are no longer limited to application logs, and the logs output by the vehicle are more comprehensive.
[0082] Please refer to Figure 5 , which shows a structural block diagram of a device for controlling log output provided by an embodiment of the present application. The device includes: a request receiving module 510, a parsing module 520, a parameter updating module 530, and an output control module 540.
[0083] The request receiving module 510 is used to receive a log output control request sent by an electronic device, where the log output control request is used to request customization of the log output by the vehicle.
[0084] The parsing module 520 is used to parse the log output control request to obtain a target control parameter, where the target control parameter is used to indicate at least one of the target application to be output, the log level of the target application, the target log type to be output, and the global log level.
[0085] The parameter updating module 530 is used to update the value of at least one parameter of the running memory of the log management tool to a target control parameter.
[0086] The output control module 540 is used to control the vehicle output log according to the target control parameters through the log management tool.
[0087] In some embodiments, the target control parameters include a first control parameter, which includes an identifier of at least one target application to which the log is to be output, and a target log level corresponding to at least one target application; the output control module 540 is used to output the log of at least one target application according to the target log level corresponding to the at least one target application through a log management tool.
[0088] In some embodiments, at least one parameter of the running memory of the log management tool includes a global log level; an output control module 540 is used to detect whether the value of the global log level is a preset value; if the value of the global log level is the preset value, the log of at least one target application is output respectively according to the log level corresponding to the at least one target application through the log management tool; if the value of the global log level is not the preset value, the log of at least one target application is output respectively according to the value of the global log level through the log management tool.
[0089] In some embodiments, the parsing module 520 is used to split the log output control request to obtain a first message, where the first message refers to a message encapsulated according to a first diagnostic service format; and extract a first control parameter from the first message.
[0090] In some embodiments, the target control parameter also includes a second control parameter, the second control parameter includes a target log type of the log to be output, the target log type includes at least one of the following: kernel log, software application log, network packet capture tool log, core dump log; the output control module 540 is used to control the vehicle output type to be a log of the target log type through a log management tool.
[0091] In some embodiments, the parsing module 520 is used to split the log output control request to obtain a second message, where the second message refers to a message encapsulated according to the second diagnostic service format; and extract the second control parameter from the second message.
[0092] In some embodiments, the target control parameters also include a third control parameter, which includes a set value of the global log level; the parsing module 520 is used to split the log output control request to obtain a third message, which refers to a message encapsulated in the second diagnostic service format; and extract the third control parameter from the third message.
[0093] To sum up, according to the technical solution provided by the embodiment of the present application, the vehicle can receive a log output control request sent by an electronic device, parse the target control parameters from the request, and then write the above target control parameters into the running memory of the log management tool. The log management tool controls the vehicle to output logs according to the above target control parameters. On the one hand, the log management tool controls the vehicle to output logs according to the target control parameters, thereby realizing the customization function of the vehicle output log. There is no need to output all logs. When a vehicle fails, the operation and maintenance personnel can customize the application, log type, log level and other contents that need to output logs according to the fault manifestation, thereby reducing the number of logs that need to be output by the vehicle, reducing the difficulty of troubleshooting for the operation and maintenance personnel, improving the efficiency of locating the source of the fault, and facilitating timely repair of the fault. In addition, the storage pressure of the designated terminal that stores the logs can also be reduced. On the other hand, the above target control parameters are written into the running memory of the log management tool, rather than into the log output configuration file. Therefore, the log management tool does not need to be restarted to control the vehicle to output logs according to the target control parameters, thereby improving real-time performance.
[0094] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0095] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0096] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0097] See also Figure 6, which shows that the embodiment of the present application further provides a vehicle 600, which includes: one or more multi-core processors 610, a memory 620, and one or more applications. Among them, the one or more applications are stored in the memory 620 and are configured to be executed by the one or more multi-core processors 610, and the one or more applications are configured to execute the method described in the above embodiment.
[0098] The multi-core processor 610 may include one or more processing cores. The multi-core processor 610 uses various interfaces and lines to connect various parts of the entire battery management system, and executes various functions and processes data of the battery management system by running or executing instructions, programs, code sets or instruction sets stored in the memory 620, and calling data stored in the memory 620. Optionally, the multi-core processor 610 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The multi-core processor 610 can integrate one or more combinations of a central multi-core processor 610 (Central Processing Unit, CPU), an image multi-core processor 610 (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the multi-core processor 610, and may be implemented separately through a communication chip.
[0099] The memory 620 may include a random access memory 620 (Random Access Memory, RAM), and may also include a read-only memory 620 (Read-Only Memory). The memory 620 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the various method embodiments described below, etc. The data storage area may also store data created by the vehicle map during use (such as a phone book, audio and video data, chat record data), etc.
[0100] Please refer to the figure, which shows that an embodiment of the present application also provides a computer-readable storage medium, in which computer program instructions are stored. The computer program instructions can be called by a processor to execute the method described in the above embodiment.
[0101] The computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk or a ROM. Optionally, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for computer program instructions for executing any method step in the above method. These computer program instructions may be read from or written to one or more computer program products. The computer program instructions may be compressed in an appropriate form.
[0102] The above are only preferred embodiments of the present application, and are not intended to limit the present application in any form. Although the present application has been disclosed as above with preferred embodiments, it is not intended to limit the present application. Any technical personnel in the field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present application. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present application without departing from the content of the technical solution of the present application are still within the scope of the technical solution of the present application.
Claims
1. A method for controlling log output, characterized in that: Applied to a vehicle, the vehicle comprising a log management tool, the method comprising: Receiving a log output control request sent by an electronic device, wherein the log output control request is used to request customization of a log output by the vehicle; Parsing the log output control request to obtain a target control parameter, where the target control parameter is used to indicate at least one of a target application to output the log, a target log level corresponding to the target application, a target log type to output the log, and a global log level; Updating the value of at least one parameter of the running memory of the log management tool to the target control parameter; The vehicle output log is controlled by the log management tool according to the target control parameter.
2. The method according to claim 1, characterized in that The target control parameter includes a first control parameter, wherein the first control parameter includes an identifier of at least one target application program to output logs, and a target log level corresponding to at least one of the target applications; The controlling the vehicle output log according to the target control parameter by the log management tool includes: The log management tool outputs the log of at least one target application program according to the log level corresponding to the at least one target application program.
3. The method according to claim 2, characterized in that At least one parameter of the running memory of the log management tool includes a global log level; Before outputting the log of at least one target application program according to the log level respectively corresponding to at least one target application program through the log management tool, the method further includes: Detecting whether the value of the global log level is a preset value, the preset value is used to indicate that the global log level is not effective; If the value of the global log level is the preset value, the log of at least one target application is outputted respectively by the log management tool according to the target log level respectively corresponding to at least one target application; If the value of the global log level is not the preset value, the log of at least one target application is outputted respectively by the log management tool according to the value of the global log level.
4. The method according to claim 2, characterized in that: The log output control request is parsed to obtain target control parameters, including: Splitting the log output control request to obtain a first message, where the first message refers to a message encapsulated according to a first diagnostic service format; The first control parameter is extracted from the first message.
5. The method according to any one of claims 1 to 4, characterized in that: The target control parameter also includes a second control parameter, wherein the second control parameter represents a target log type of the log to be output, and the target log type includes at least one of the following: a kernel log, a software application log, a network packet capture tool log, and a core dump log; The controlling the vehicle output log according to the target control parameter by the log management tool includes: The log management tool is used to control the vehicle to output a log of the target log type.
6. The method according to claim 5, characterized in that The log output control request is parsed to obtain target control parameters, including: Splitting the log output control request to obtain a second message, where the second message refers to a message encapsulated according to a second diagnostic service format; The second control parameter is extracted from the second message.
7. The method according to any one of claims 1 to 4, characterized in that The target control parameter also includes a third control parameter, and the third control parameter includes a setting value of a global log level; The log output control request is parsed to obtain target control parameters, including: Splitting the log output control request to obtain a third message, where the third message refers to a message encapsulated according to the second diagnostic service format; The third control parameter is extracted from the third message.
8. A device for controlling log output, characterized in that: The device comprises: A request receiving module, used for receiving a log output control request sent by an electronic device, wherein the log output control request is used for requesting customization of the log output by the vehicle; A parsing module, used to parse the log output control request to obtain a target control parameter, wherein the target control parameter is used to indicate at least one of a target application to output the log, a target log level corresponding to the target application, a target log type to output the log, and a global log level; A parameter updating module, used to update the value of at least one parameter of the running memory of the log management tool to the target control parameter; The output control module is used to control the vehicle output log according to the target control parameters through the log management tool.
9. A vehicle, characterized in that: include: Memory; One or more processors coupled to the memory; One or more programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and the computer program instructions can be called by a processor to execute the method according to any one of claims 1 to 7.