CN113568878A - Method and device for collecting and exporting system logs and vehicle - Google Patents

Method and device for collecting and exporting system logs and vehicle Download PDF

Info

Publication number
CN113568878A
CN113568878A CN202110854916.3A CN202110854916A CN113568878A CN 113568878 A CN113568878 A CN 113568878A CN 202110854916 A CN202110854916 A CN 202110854916A CN 113568878 A CN113568878 A CN 113568878A
Authority
CN
China
Prior art keywords
log
partition
target
vehicle
logs
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110854916.3A
Other languages
Chinese (zh)
Inventor
杨宇
王兴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
FAW Group Corp
Original Assignee
FAW Group Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by FAW Group Corp filed Critical FAW Group Corp
Priority to CN202110854916.3A priority Critical patent/CN113568878A/en
Publication of CN113568878A publication Critical patent/CN113568878A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C5/00Registering or indicating the working of vehicles
    • G07C5/08Registering or indicating performance data other than driving, working, idle, or waiting time, with or without registering driving, working, idle or waiting time
    • G07C5/0841Registering performance data
    • G07C5/085Registering performance data using electronic data carriers

Abstract

The invention discloses a method and a device for collecting and exporting system logs and a vehicle, which are applied to a vehicle-mounted infotainment system and comprise the following steps: collecting current system logs generated by a child entertainment system in real time through a log collecting tool, and storing the current system logs in log partitions corresponding to the child entertainment system; compressing, by a log management tool, the current log stored in the log partition, so that the log collection tool stores the collected new system log in the log partition. The technical scheme of the embodiment of the invention can reduce the labor cost required in the log collection process and improve the collection efficiency of the system logs in the vehicle-mounted information entertainment system.

Description

Method and device for collecting and exporting system logs and vehicle
Technical Field
The embodiment of the invention relates to the technical field of vehicle-mounted infotainment hosts, in particular to a method and a device for collecting and exporting system logs and a vehicle.
Background
With the rapid development of the car networking technology, the vehicle-mounted infotainment host is an important component of modern vehicles as a terminal product of the car networking, and a vehicle-mounted infotainment system is installed in the vehicle-mounted infotainment host. At present, a vehicle-mounted information entertainment system develops towards virtualization and multiple systems, can support a digital virtual instrument, a central control entertainment system, a copilot entertainment system and the like, and realizes an intelligent cabin scheme.
Because the vehicle-mounted infotainment system has more integrated functions, more bugs may be generated in the system, and the probability of the vehicle-mounted infotainment host machine being out of order is higher. In order to repair the bugs quickly, developers need to collect system logs in a vehicle-mounted information entertainment system in real time, then the collected system logs are analyzed, the reasons of the faults of the host are found out, and the faults are repaired quickly.
After the existing vehicle-mounted infotainment host computer fails, developers need to go to actual vehicles to acquire system logs, so that a large amount of human resources are consumed, and a vehicle owner needs to cooperate, so that the repair process is difficult, and the user experience is poor; secondly, if the system logs are not obtained timely, the system logs related to the fault are easily covered by other logs, so that developers cannot obtain the system logs related to the fault, and further the fault cannot be repaired.
Disclosure of Invention
The embodiment of the invention provides a method and a device for collecting and exporting system logs and a vehicle, which can improve the efficiency of collecting and exporting the system logs in a vehicle-mounted information entertainment system and reduce the labor cost required in the process of exporting the logs.
In a first aspect, an embodiment of the present invention provides a method for collecting system logs, which is applied to each sub-entertainment system included in a vehicle-mounted infotainment system, and the method includes:
collecting current system logs generated by the sub-entertainment systems in real time through a log collecting tool, and storing the current system logs in log partitions corresponding to the sub-entertainment systems;
compressing, by a log management tool, the current log stored in the log partition, so that the log collection tool stores the collected new system log in the log partition.
In a second aspect, an embodiment of the present invention further provides a method for deriving a system log, which is applied to a central control entertainment system in a vehicle-mounted infotainment system, and the method includes:
after receiving a log obtaining instruction sent by a server, obtaining a first target log matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system;
sending the log obtaining instruction to at least one non-central control entertainment system connected with the central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition;
and sending the first target log and the second target log to the server so that a user can obtain the first target log and the second target log according to the server.
In a third aspect, an embodiment of the present invention further provides a system log collecting device, which is applied to each sub-entertainment system included in a vehicle-mounted infotainment system, and includes:
the log collection module is used for collecting the current system logs generated by the sub-entertainment systems in real time through a log collection tool and storing the current system logs in log partitions corresponding to the sub-entertainment systems;
and the log storage module is used for compressing the current log stored in the log partition through a log management tool so as to enable the log collection tool to store the collected new system log in the log partition.
In a fourth aspect, an embodiment of the present invention further provides an apparatus for deriving a system log, which is applied to a central control entertainment system in a vehicle-mounted infotainment system, and the apparatus includes:
the instruction receiving module is used for receiving a log obtaining instruction sent by a server and then obtaining a first target log matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system;
the instruction sending module is used for sending the log obtaining instruction to at least one non-central control entertainment system connected with the central control entertainment system so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition;
and the log sending module is used for sending the first target log and the second target log to the server so that a user can obtain the first target log and the second target log according to the server.
In a fifth aspect, the embodiment of the present invention further provides a vehicle, where the vehicle includes an in-vehicle infotainment host; the vehicle-mounted infotainment host comprises:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors execute the programs, so that the method for collecting the system logs or the method for exporting the system logs provided by any embodiment of the invention is implemented.
According to the technical scheme of the embodiment of the invention, the log collection tool is used for collecting the current system log generated by the sub-entertainment system in real time in the vehicle-mounted information entertainment system, the current system log is stored in the log partition corresponding to the sub-entertainment system, and then the log management tool is used for compressing the current log stored in the log partition so as to enable the log collection tool to store the collected new system log in the log partition, so that the labor cost required in the log collection process can be reduced, and the collection efficiency of the system log in the vehicle-mounted information entertainment system is improved.
Drawings
FIG. 1 is a flowchart of a method for collecting system logs according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for exporting a system log according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a method for exporting a system log according to a third embodiment of the present invention;
fig. 4 is a block diagram of a system log collection apparatus according to a fourth embodiment of the present invention;
fig. 5 is a block diagram of an apparatus for exporting a system log according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a vehicle in a sixth embodiment of the invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a system log collection method according to an embodiment of the present invention, where the embodiment is applicable to a case of collecting system logs generated by a vehicle-mounted infotainment system, and the method may be executed by a system log collection device, which may be implemented by software and/or hardware, and may be generally integrated in each sub-entertainment system included in the vehicle-mounted infotainment system, and specifically includes the following steps:
and 110, collecting the current system log generated by the sub-entertainment system in real time through a log collecting tool, and storing the current system log in a log partition corresponding to the sub-entertainment system.
In the embodiment, the vehicle-mounted infotainment system is installed in the vehicle-mounted infotainment host and comprises a plurality of sub-entertainment systems which can be divided into a central control entertainment system and a non-central control entertainment system. In this step, the current system log generated by each sub-entertainment system in real time may be collected by a log collection tool matched to each sub-entertainment system, and stored in the log partition corresponding to the sub-entertainment system.
In one particular embodiment, assume that the in-vehicle infotainment system includes the following sub-entertainment systems: two Android systems and a Linux system. The digital virtual instrument adopts a Linux system, and the central control entertainment system and the auxiliary driving entertainment system adopt an Android system.
Taking the above-mentioned vehicle-mounted infotainment system as an example, when the sub-entertainment system is an Android system, the native log collection tool logcat of the Android system may be called to collect the current system log generated by the sub-entertainment system in real time, and store the current system log in a log partition of an Embedded multimedia controller (EMMC) built in the Android system.
The system logs generated by the Android system may include a kernel dmesg log, a kernel global log, a tomstone log, an Application Not Responding (ANR) log, and the like. Optionally, a log obtaining tool diagnostics may be used to capture a dmesg log (kernel log) in the Android system, then the kernel log is output through an Android native printing log interface, and finally the log is stored to the corresponding log partition by the logcat module.
In another specific embodiment, when the child entertainment system is a Linux system, the Linux system native log collection tool Ulogcat may be called to collect the current system log generated by the child entertainment system in real time, and store the current system log in the log partition of the built-in EMMC of the Linux system.
Optionally, when the Ulogcat process is started, first detecting whether an old log file exists in a log partition in the Linux system, if so, renaming the log file as log _ last, and then backing up the collected system log to the log partition in the built-in EMMC.
The system logs generated by the Linux system may include kernel dmesg logs, kernel global logs, process coast logs and the like.
And step 120, compressing the current log stored in the log partition through a log management tool, so that the log collection tool stores the collected new system log in the log partition.
In this embodiment, in order to save the storage space occupied by the system log in the log partition and improve the utilization rate of the log partition, the current log stored in the log partition may be compressed by the log management tool, and then the collected new system log is stored in the log partition by the log collection tool.
In a specific embodiment, when the entertainment subsystem is an Android system, a UsbLog module in the Android system may be called to compress a current log stored in the log partition. After the UsbLog module is started, firstly checking whether an uncompressed log file exists in a log partition, if so, firstly compressing the uncompressed log file, and then calling an Android system native logcat module to store the collected new system log in the log partition.
In another specific embodiment, when the child entertainment system is a Linux system, a logMgr module within the Linux system may be invoked to compress the current log stored in the log partition. When the logMgr module is started, whether a log file named log _ last exists in the log partition is checked, if so, the log file named log _ last is compressed, and then the native Ulogcat module of the Linux system is called to store the collected new system log in the log partition.
In this embodiment, optionally, when the sub-entertainment system is an Android system, the size of the corresponding log partition may be 256 MB; when the child entertainment system is a Linux system, the corresponding log partition may be 128MB in size.
In the prior art, when a bug occurs in the in-vehicle infotainment system, a developer needs to collect system logs in the in-vehicle infotainment system in real time, and in the embodiment, the system logs are collected by using the log collection tool corresponding to the sub-infotainment system and are stored in the corresponding log partition, so that the labor cost required in the log collection process can be reduced, and the collection efficiency of the system logs in the in-vehicle infotainment system is improved.
In the embodiment, after the current system logs generated by the sub-entertainment system in real time are collected by the log collection tool, invalid logs are screened from the collected system logs, and after the invalid logs are removed, the remaining system logs are stored in the log partitions corresponding to the sub-entertainment system; secondly, in order to reduce the printing amount of the system logs, the log collection tool may output the collected logs to the log partition according to a preset batch number, for example, the log collection tool may count the number of the collected current system logs, and if the number of the collected current system logs is greater than or equal to 100, the collected current system logs may be output in batch. Specifically, the format of the system log stored in the log partition may be "log _ serial number _ year, month, day, hour, minute, and second".
According to the technical scheme of the embodiment of the invention, the log collection tool is used for collecting the current system log generated by the sub-entertainment system in real time in the vehicle-mounted information entertainment system, the current system log is stored in the log partition corresponding to the sub-entertainment system, and then the log management tool is used for compressing the current log stored in the log partition so as to enable the log collection tool to store the collected new system log in the log partition, so that the labor cost required in the log collection process can be reduced, and the collection efficiency of the system log in the vehicle-mounted information entertainment system is improved.
On the basis of the above embodiment, after compressing the current log stored in the log partition by the log management tool, the method further includes:
and step 130, acquiring the log capacity of all the system logs stored in the log partition through the log management tool.
And 140, judging whether the log capacity is larger than a preset capacity or not, and whether the log partition meets a log coverage condition or not.
In an implementation manner of the embodiment of the present invention, when the log management tool obtains log capacities of all system logs stored in a log partition, the method further includes: and acquiring the number of the system logs stored in the log partition and the residual storage space of the log partition by the log management tool.
Wherein, judging whether the log partition meets the log coverage condition comprises: judging whether the number of the system logs stored in the log partition is larger than a preset number or not, or whether the residual storage space of the log partition is smaller than a preset threshold value or not; and if so, confirming that the log partition meets the log coverage condition.
In a specific embodiment, if the number of the system logs stored in the log partition is greater than 100, or the remaining storage space of the log partition is less than 30MB, it is determined that the log partition satisfies the log coverage condition. The preset number and the preset threshold are set according to actual conditions, which is not limited in this embodiment.
And 150, if the log capacity is larger than the preset capacity and the log partition does not meet the log coverage condition, compressing all the system logs stored in the log partition by the log management tool, and returning to execute the operation of collecting the current system log generated by the sub-entertainment system in real time by the log collection tool in the step 110.
In the present embodiment, the preset capacity may be set to 10MB, and the specific value is set in practical situations, which is not limited by the present embodiment. Wherein, if the log capacity of all the system logs stored in the log partition is greater than 10MB but the log partition does not satisfy the log coverage condition, all the system logs stored in the log partition can be compressed by the log management tool (the compression rate can be set to 5% -10%).
And 160, if the log capacity is larger than the preset capacity and the log partition meets the log coverage condition, deleting the first system log stored in the log partition according to the storage time corresponding to each system log in the log partition, and returning to execute the operation of collecting the current system log generated by the child entertainment system in real time through the log collection tool in the step 110.
In this embodiment, if the log capacity of all the system logs stored in the log partition is greater than 10MB and the log partition meets the log coverage condition (i.e. the number of the system logs is greater than 100, or the remaining storage space of the log partition is less than 30MB), the system log stored first in the log partition is deleted.
The method has the advantage that developers can conveniently obtain the latest log generated by the vehicle-mounted infotainment system in time so as to analyze the current fault of the vehicle-mounted infotainment system.
Example two
Fig. 2 is a flowchart of a method for exporting a system log according to a second embodiment of the present invention, where the method is applicable to a case of exporting a system log generated by a vehicle-mounted infotainment system, and the method may be executed by a device for exporting a system log, where the device may be implemented by software and/or hardware, and may be generally integrated in a central control entertainment system in a vehicle-mounted infotainment system, and specifically includes the following steps:
and step 210, after receiving a log obtaining instruction sent by a server, obtaining a first target log matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system.
In this embodiment, a vehicle-mounted infotainment system including two Android systems and one Linux system is taken as an example, in the vehicle-mounted infotainment system, a central control infotainment system adopts the Android system, and a non-central control infotainment system includes a copilot entertainment system adopting the Android system and a digital virtual instrument adopting the Linux system.
In the present embodiment, each Vehicle has a unique Vehicle Identification Number (VIN). When a vehicle-mounted infotainment host in a certain vehicle breaks down, a developer can send a log obtaining instruction to the vehicle-mounted infotainment host through a server according to the VIN of the vehicle so as to obtain a system log generated in a specified time period by a vehicle-mounted infotainment system in a specified vehicle. The server can send a log acquisition instruction to the vehicle-mounted infotainment host through a Message Queue Telemetry Transport (MQTT) protocol.
After the instruction is sent, the server regularly monitors whether the vehicle is connected with the network or not, and if the condition that the vehicle is connected with the network is detected, the log time period needing to be collected is sent to the Android application of the central control entertainment system. After receiving the log obtaining instruction and the log time period, the central control entertainment system can screen the log matched with the log time period in the corresponding log partition as a first target log.
Step 220, sending the log obtaining instruction to at least one non-central control entertainment system connected with the central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition.
In this embodiment, after receiving the log obtaining instruction sent by the server, the central control entertainment system may create a client (i.e., an FTP client) using a File Transfer Protocol (FTP), and then connect the created FTP client with an FTP server created by another non-central control entertainment system in the in-vehicle infotainment system. After the connection is successful, the central control entertainment system sends a log obtaining instruction to each connected non-central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition.
Step 230, sending the first target log and the second target log to the server, so that the user can obtain the first target log and the second target log according to the server.
In this embodiment, after each non-central control entertainment system acquires the second target log matched with the log acquisition instruction in the corresponding log partition, the second target log may be sent to the central control entertainment system. And after receiving the second target logs sent by the non-central control entertainment systems, the central control entertainment system sends the first target logs and the second target logs to the server.
In this embodiment, after the server obtains the first target log and the second target log through remote connection, the server may notify the developer of successful log obtaining through an automatic mail notification; if the server cannot acquire the log within the specified time, the developer can be notified of the failure of log acquisition in the same way.
In a specific embodiment, after the server acquires the first target log and the second target log through the remote connection, a developer may export the first target log and the second target log through a Universal Serial Bus (USB) interface in the server.
In this embodiment, if the vehicle-mounted infotainment host fails, a developer can export the log generated by the vehicle-mounted infotainment system through the remote server, and compared with the mode that the developer obtains the system log from an actual vehicle in the prior art, the method provided by the embodiment does not need the cooperation of a vehicle owner, can reduce the difficulty of the fault repairing process, and improves the experience of the user on the vehicle; secondly, a log obtaining instruction is sent to the vehicle-mounted infotainment host through the server, the system log generated by the vehicle-mounted infotainment system can be quickly obtained, and the problem that the fault cannot be repaired due to the fact that a developer cannot timely obtain the system log related to the fault can be avoided.
The technical scheme of the embodiment of the invention obtains the first target log matched with the log obtaining instruction in the log partition corresponding to the central control entertainment system after receiving the log obtaining instruction sent by the server, the log retrieval instructions are then sent to at least one non-central entertainment system connected to the central entertainment system, so that each non-central control entertainment system acquires a second target log matched with the log acquisition instruction in a corresponding log partition, and finally sends the first target log and the second target log to the server, a technical means for making the user obtain the first target log and the second target log according to the server, the method can reduce the labor cost required by the log exporting process, reduce the difficulty of the fault repairing process and improve the exporting efficiency of the system log in the vehicle-mounted information entertainment system.
EXAMPLE III
This embodiment is a further refinement of the above embodiment, and the same or corresponding terms as those of the above embodiment are explained, and this embodiment is not described again. Fig. 3 is a flowchart of a method for exporting a system log provided in a third embodiment, in the third embodiment, a technical solution of the present embodiment may be combined with one or more methods in the solutions of the foregoing embodiments, as shown in fig. 3, the method provided in the present embodiment may further include:
and 310, after receiving a log obtaining instruction sent by a server, obtaining an alternative log matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system according to a target time period included in the log obtaining instruction and a preset target log grade.
In this embodiment, since too much system log output may affect the performance of the entire in-vehicle infotainment system, this embodiment further provides an implementation manner of obtaining the target log according to the target log level. Wherein, the target log level is preset in the vehicle-mounted infotainment system by a developer according to the actual development condition of the vehicle. The target log level includes Error (Error), Warning (Warning), normal (Info), and Debug (Debug), among others.
In the present embodiment, if the in-vehicle infotainment host in the vehicle is in the trouble shooting period after production, the target log level may be set to the normal level; the target log level may be set to an error or warning level if the in-vehicle infotainment host in the vehicle is in a product stable period after production.
In a specific embodiment, the setting criteria of each log level may specifically be as follows:
debug: after the log level is set to Debug for the log level used by the vehicle-mounted infotainment host, the log stream printed by a developer in the development and debugging stage and the information output by the log are the most;
info: compared with the debugg grade log, the method has the advantages that the key and necessary log which is beneficial to problem recall is printed, the log which is not necessary for problem recall is removed, the vehicle-mounted infotainment host adopts the log grade after mass production, and the information output by the log is less than the debugg grade.
Turning: the log is used for recording the log which can cause the application program to be abnormal, but can automatically recover the application program and does not cause abnormal actions, and the information output by the log is less compared with the information level;
error: the information used to record any critical error operations and abnormal states found by an Application (APP) is less in the amount of information logged than the Warning level.
In this embodiment, after the completion of the setting of the log level in the in-vehicle infotainment system, the in-vehicle infotainment system needs to be restarted to validate the set log level.
In an implementation manner of the embodiment of the present invention, in a log partition corresponding to the central entertainment system, acquiring an alternative log matching the log acquisition instruction according to a target time period included in the log acquisition instruction and a preset target log level includes:
and 311, in a log partition corresponding to the central control entertainment system, screening a plurality of system logs matched with the target time period according to the target time period included in the log obtaining instruction and the storage time of each system log included in the log partition.
And step 312, taking the system log with the log grade greater than or equal to the target log grade as the alternative log in the plurality of system logs matched with the target time period.
In this embodiment, each log level corresponds to a priority, and the log levels may be arranged from high to low according to the priorities, where the arranged log levels are Error, Warning, Info, and Debug.
In this step, among the plurality of system logs that match the target time period, the system log whose log level is greater than or equal to the target log level is output as the candidate log, that is, only the system log whose log level is greater than or equal to the set log level.
In a specific embodiment, assuming that the preset target log level in the in-vehicle infotainment system is the Info level, because the Debug level is not greater than the Info level, the system logs related to the Debug level are not output, and only the system logs related to the Error, Warning and Info levels are output.
In another specific embodiment, a developer may set a target log level in an in-vehicle infotainment system to a Debug level prior to mass production of in-vehicle infotainment hosts in a vehicle; after mass production is carried out on the vehicle-mounted infotainment host in the vehicle, developers can set the target log level in the vehicle-mounted infotainment system as the Info level; after one year of mass production of in-vehicle infotainment hosts in vehicles, developers may set a target logging level in an in-vehicle infotainment system to a Warning level.
And 320, removing the invalid logs in the alternative logs according to a preset log filtering rule to obtain a first target log.
In a specific embodiment, whether a system log related to user privacy information (such as user account information, picture information, contact information and the like) exists in the alternative logs can be detected, and if yes, the system log is taken as an invalid log; secondly, whether a system log which is not related to the current fault of the vehicle-mounted infotainment host exists in the alternative logs can be detected, and if yes, the system log is used as an invalid log.
In this embodiment, an embodiment is further provided for limiting a log level in a third party application Development Kit (SDK) and an Android Application Package (APK) installed in the in-vehicle infotainment host according to a target log level preset in the in-vehicle infotainment system. For example, when the target log level preset in the in-vehicle infotainment system is the Info level, the log level in the third-party application should also be the Info level.
And step 330, sending the log obtaining instruction to at least one non-central control entertainment system connected with the central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition.
In this embodiment, after the non-central control entertainment system receives the log obtaining instruction sent by the central control entertainment system, the same implementation manner as in step 310 and step 320 may be adopted to obtain the second target log matched with the log obtaining instruction in the corresponding log partition.
Step 340, sending the first target log and the second target log to the server, so that a user can obtain the first target log and the second target log according to the server.
According to the technical scheme of the embodiment of the invention, after a log obtaining instruction sent by a server is received, an alternative log matched with the log obtaining instruction is obtained in a log partition corresponding to a central control entertainment system according to a target time period included in the log obtaining instruction and a preset target log grade, then an invalid log is removed from the alternative log according to a preset log filtering rule to obtain a first target log, the log obtaining instruction is sent to at least one non-central control entertainment system connected with the central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in the corresponding log partition, and finally the first target log and the second target log are sent to the server, so that a user obtains the first target log and the second target log according to the server, the method can reduce the labor cost required by the log exporting process, reduce the difficulty of the fault repairing process and improve the exporting efficiency of the system log in the vehicle-mounted information entertainment system.
Example four
Fig. 4 is a block diagram of a system log collecting apparatus according to a fourth embodiment of the present invention, which is applied to each sub-entertainment system included in a vehicle-mounted infotainment system, and includes: a log collection module 410 and a log storage module 420.
The log collection module 410 is used for collecting the current system log generated by the child entertainment system in real time through a log collection tool, and storing the current system log in the log partition corresponding to the child entertainment system;
a log storage module 420, configured to compress, by a log management tool, the current log stored in the log partition, so that the log collection tool stores the collected new system log in the log partition.
According to the technical scheme of the embodiment of the invention, the log collection tool is used for collecting the current system log generated by the sub-entertainment system in real time in the vehicle-mounted information entertainment system, the current system log is stored in the log partition corresponding to the sub-entertainment system, and then the log management tool is used for compressing the current log stored in the log partition so as to enable the log collection tool to store the collected new system log in the log partition, so that the labor cost required in the log collection process can be reduced, and the collection efficiency of the system log in the vehicle-mounted information entertainment system is improved.
On the basis of the foregoing embodiments, the log storage module 420 may include:
a capacity acquisition unit configured to acquire log capacities of all system logs stored in the log partition by the log management tool;
the capacity judging unit is used for judging whether the log capacity is larger than a preset capacity or not and whether the log partition meets a log coverage condition or not;
the compression unit is used for compressing all system logs stored in the log partition through the log management tool and returning to execute the operation of collecting the current system log generated by the sub-entertainment system in real time through the log collection tool if the log capacity is larger than the preset capacity and the log partition does not meet the log coverage condition;
the storage space acquisition unit is used for acquiring the number of the system logs stored in the log partition and the residual storage space of the log partition through the log management tool;
the condition judgment unit is used for judging whether the number of the system logs stored in the log partition is larger than a preset number or not, or whether the residual storage space of the log partition is smaller than a preset threshold value or not;
the condition confirming unit is used for confirming that the log partition meets the log covering condition when the number of the system logs stored in the log partition is larger than a preset number or the residual storage space of the log partition is smaller than a preset threshold value;
and the deleting unit is used for deleting the first system log stored in the log partition according to the storage time corresponding to each system log in the log partition when the log capacity is larger than the preset capacity and the log partition meets the log coverage condition, and returning to execute the operation of collecting the current system log generated by the sub-entertainment system in real time through a log collecting tool.
The system log collecting device provided by the embodiment of the invention can execute the system log collecting method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the executing method.
EXAMPLE five
Fig. 5 is a block diagram of an apparatus for deriving a system log according to a fifth embodiment of the present invention, where the apparatus is applied to a central control entertainment system in a vehicle-mounted infotainment system, and includes: an instruction receiving module 510, an instruction transmitting module 520, and a log transmitting module 530.
The instruction receiving module 510 is configured to, after receiving a log obtaining instruction sent by a server, obtain, in a log partition corresponding to the central control entertainment system, a first target log matched with the log obtaining instruction;
the instruction sending module 520 is configured to send the log obtaining instruction to at least one non-central control entertainment system connected to the central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition;
a log sending module 530, configured to send the first target log and the second target log to the server, so that a user obtains the first target log and the second target log according to the server.
The technical scheme of the embodiment of the invention obtains the first target log matched with the log obtaining instruction in the log partition corresponding to the central control entertainment system after receiving the log obtaining instruction sent by the server, the log retrieval instructions are then sent to at least one non-central entertainment system connected to the central entertainment system, so that each non-central control entertainment system acquires a second target log matched with the log acquisition instruction in a corresponding log partition, and finally sends the first target log and the second target log to the server, a technical means for making the user obtain the first target log and the second target log according to the server, the method can reduce the labor cost required by the log exporting process, reduce the difficulty of the fault repairing process and improve the exporting efficiency of the system log in the vehicle-mounted information entertainment system.
On the basis of the foregoing embodiments, the instruction receiving module 510 may include:
the alternative log obtaining unit is used for obtaining alternative logs matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system according to a target time period included in the log obtaining instruction and a preset target log grade;
the log removing unit is used for removing invalid logs from the alternative logs according to a preset log filtering rule to obtain a first target log;
the log screening unit is used for screening a plurality of system logs matched with the target time period according to the target time period included in the log acquisition instruction and the storage time of each system log included in the log partition corresponding to the central control entertainment system;
and the alternative log determining unit is used for taking the system log with the log grade greater than or equal to the target log grade as the alternative log in the plurality of system logs matched with the target time period.
The system log collecting device provided by the embodiment of the invention can execute the system log collecting method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the executing method.
EXAMPLE six
Fig. 6 is a schematic structural diagram of a vehicle according to a sixth embodiment of the present invention, and as shown in fig. 6, the vehicle includes an in-vehicle infotainment host 600. The in-vehicle infotainment host 600 includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of processors 610 in the in-vehicle infotainment host 600 may be one or more, and one processor 610 is exemplified in fig. 6; the processor 610, memory 620, input device 630, and output device 640 in the in-vehicle infotainment host 600 may be connected by a bus or other means, as exemplified by the bus connection in fig. 6.
The memory 620 is used as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to a system log collection method in the embodiment of the present invention (for example, the log collection module 410 and the log storage module 420 in a system log collection device). The processor 610 executes various functional applications and data processing of the in-vehicle infotainment host by executing software programs, instructions and modules stored in the memory 620, namely, implements one of the above-described system log collection methods. That is, the program when executed by the processor implements:
collecting current system logs generated by the sub-entertainment systems in real time through a log collecting tool, and storing the current system logs in log partitions corresponding to the sub-entertainment systems;
compressing, by a log management tool, the current log stored in the log partition, so that the log collection tool stores the collected new system log in the log partition.
The memory 620, as a computer-readable storage medium, may also be used to store program instructions/modules corresponding to a method for exporting a system log according to an embodiment of the present invention (for example, the instruction receiving module 510, the instruction sending module 520, and the log sending module 530 in a device for exporting a system log). The processor 610 executes various functional applications and data processing of the in-vehicle infotainment host by executing software programs, instructions and modules stored in the memory 620, namely, the method for exporting the system log is realized. That is, the program when executed by the processor implements:
after receiving a log obtaining instruction sent by a server, obtaining a first target log matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system;
sending the log obtaining instruction to at least one non-central control entertainment system connected with the central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition;
and sending the first target log and the second target log to the server so that a user can obtain the first target log and the second target log according to the server.
The memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 620 may further include memory located remotely from processor 610, which may be connected to an in-vehicle infotainment host through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the in-vehicle infotainment host, and may include a keyboard and mouse, etc. The output device 640 may include a display device such as a display screen.
EXAMPLE seven
The seventh embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the method according to any embodiment of the present invention. Of course, the embodiment of the present invention provides a computer-readable storage medium, which can perform relevant operations in a system log collection method provided by any embodiment of the present invention. That is, the program when executed by the processor implements:
collecting current system logs generated by the sub-entertainment systems in real time through a log collecting tool, and storing the current system logs in log partitions corresponding to the sub-entertainment systems;
compressing, by a log management tool, the current log stored in the log partition, so that the log collection tool stores the collected new system log in the log partition.
The computer-readable storage medium provided by the embodiment of the present invention may further perform related operations in the method for exporting a system log provided by any embodiment of the present invention. That is, the program when executed by the processor implements:
after receiving a log obtaining instruction sent by a server, obtaining a first target log matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system;
sending the log obtaining instruction to at least one non-central control entertainment system connected with the central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition;
and sending the first target log and the second target log to the server so that a user can obtain the first target log and the second target log according to the server.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes instructions for enabling an onboard infotainment host to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the collecting device of the system log and the deriving device of the system log, the included units and modules are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for collecting system logs is applied to each sub-entertainment system in a vehicle-mounted infotainment system, and is characterized by comprising the following steps:
collecting current system logs generated by the sub-entertainment systems in real time through a log collecting tool, and storing the current system logs in log partitions corresponding to the sub-entertainment systems;
compressing, by a log management tool, the current log stored in the log partition, so that the log collection tool stores the collected new system log in the log partition.
2. The method of claim 1, after compressing, by a log management tool, a current log stored in the log partition, further comprising:
acquiring the log capacity of all system logs stored in a log partition through the log management tool;
judging whether the log capacity is larger than a preset capacity or not and whether the log partition meets a log coverage condition or not;
if the log capacity is larger than the preset capacity and the log partition does not meet the log coverage condition, compressing all system logs stored in the log partition through the log management tool and returning to execute the operation of collecting the current system log generated by the sub-entertainment system in real time through the log collection tool.
3. The method of claim 2, while obtaining the log capacity of all system logs stored in the log partition by the log management tool, further comprising:
acquiring the number of system logs stored in a log partition and the residual storage space of the log partition by the log management tool;
judging whether the log partition meets the log coverage condition or not, including:
judging whether the number of the system logs stored in the log partition is larger than a preset number or not, or whether the residual storage space of the log partition is smaller than a preset threshold value or not;
and if so, confirming that the log partition meets the log coverage condition.
4. The method of claim 2, after determining whether the log capacity is greater than a preset capacity and whether the log partition meets a log coverage condition, further comprising:
and if so, deleting the first system log stored in the log partition according to the storage time corresponding to each system log in the log partition, and returning to execute the operation of collecting the current system log generated by the sub-entertainment system in real time through a log collecting tool.
5. A method for exporting a system log is applied to a central control entertainment system in a vehicle-mounted infotainment system, and is characterized by comprising the following steps:
after receiving a log obtaining instruction sent by a server, obtaining a first target log matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system;
sending the log obtaining instruction to at least one non-central control entertainment system connected with the central control entertainment system, so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition;
and sending the first target log and the second target log to the server so that a user can obtain the first target log and the second target log according to the server.
6. The method of claim 5, wherein obtaining, in a log partition corresponding to the central entertainment system, a first target log that matches the log obtaining instructions comprises:
in a log partition corresponding to the central control entertainment system, acquiring an alternative log matched with the log acquisition instruction according to a target time period included in the log acquisition instruction and a preset target log grade;
and according to a preset log filtering rule, removing invalid logs from the alternative logs to obtain a first target log.
7. The method of claim 6, wherein in a log partition corresponding to the central entertainment system, acquiring an alternative log matching the log acquisition instruction according to a target time period included in the log acquisition instruction and a preset target log level comprises:
in a log partition corresponding to the central control entertainment system, screening a plurality of system logs matched with the target time period according to the target time period included in the log acquisition instruction and the storage time of each system log included in the log partition;
and taking the system log with the log grade greater than or equal to the target log grade as the alternative log in the plurality of system logs matched with the target time period.
8. A system log collecting apparatus for use in each sub-entertainment system included in an in-vehicle infotainment system, the apparatus comprising:
the log collection module is used for collecting the current system logs generated by the sub-entertainment systems in real time through a log collection tool and storing the current system logs in log partitions corresponding to the sub-entertainment systems;
and the log storage module is used for compressing the current log stored in the log partition through a log management tool so as to enable the log collection tool to store the collected new system log in the log partition.
9. An apparatus for deriving system log, applied to a central control entertainment system in a vehicle-mounted infotainment system, the apparatus comprising:
the instruction receiving module is used for receiving a log obtaining instruction sent by a server and then obtaining a first target log matched with the log obtaining instruction in a log partition corresponding to the central control entertainment system;
the instruction sending module is used for sending the log obtaining instruction to at least one non-central control entertainment system connected with the central control entertainment system so that each non-central control entertainment system obtains a second target log matched with the log obtaining instruction in a corresponding log partition;
and the log sending module is used for sending the first target log and the second target log to the server so that a user can obtain the first target log and the second target log according to the server.
10. A vehicle comprising an in-vehicle infotainment host;
the vehicle-mounted infotainment host comprises:
one or more processors;
storage means for storing one or more programs;
the one or more programs when executed by the one or more processors cause the one or more processors to implement the method of collecting a system log according to any one of claims 1-4 or the method of exporting a system log according to any one of claims 5-7 when the program is executed.
CN202110854916.3A 2021-07-28 2021-07-28 Method and device for collecting and exporting system logs and vehicle Pending CN113568878A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110854916.3A CN113568878A (en) 2021-07-28 2021-07-28 Method and device for collecting and exporting system logs and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110854916.3A CN113568878A (en) 2021-07-28 2021-07-28 Method and device for collecting and exporting system logs and vehicle

Publications (1)

Publication Number Publication Date
CN113568878A true CN113568878A (en) 2021-10-29

Family

ID=78168281

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110854916.3A Pending CN113568878A (en) 2021-07-28 2021-07-28 Method and device for collecting and exporting system logs and vehicle

Country Status (1)

Country Link
CN (1) CN113568878A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277780A (en) * 2022-07-30 2022-11-01 重庆长安汽车股份有限公司 Vehicle-end log obtaining method and device, electronic equipment and computer-readable storage medium
CN115314408A (en) * 2022-06-22 2022-11-08 中国第一汽车股份有限公司 Method and system for automatically collecting log information and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130073532A1 (en) * 2011-09-21 2013-03-21 International Business Machines Corporation Coordination of event logging operations and log management
US20140280197A1 (en) * 2013-03-13 2014-09-18 Genesys Telecommunications Laboratories, Inc. Log file management tool
US10360251B1 (en) * 2009-11-05 2019-07-23 Netapp Inc. Efficient compression of system logs through metadata-based grouping
US20200073981A1 (en) * 2018-08-31 2020-03-05 International Business Machines Corporation Optimizing data entries in a log
CN213069791U (en) * 2020-07-30 2021-04-27 湖北亿咖通科技有限公司 Fault detection system of vehicle-mounted information entertainment system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10360251B1 (en) * 2009-11-05 2019-07-23 Netapp Inc. Efficient compression of system logs through metadata-based grouping
US20130073532A1 (en) * 2011-09-21 2013-03-21 International Business Machines Corporation Coordination of event logging operations and log management
US20140280197A1 (en) * 2013-03-13 2014-09-18 Genesys Telecommunications Laboratories, Inc. Log file management tool
US20200073981A1 (en) * 2018-08-31 2020-03-05 International Business Machines Corporation Optimizing data entries in a log
CN213069791U (en) * 2020-07-30 2021-04-27 湖北亿咖通科技有限公司 Fault detection system of vehicle-mounted information entertainment system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
裴加富;张怡;胡恩华;: "基于CBTC系统车载日志远程下载及离线分析的研究", 铁道通信信号, no. 04, 17 April 2016 (2016-04-17) *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115314408A (en) * 2022-06-22 2022-11-08 中国第一汽车股份有限公司 Method and system for automatically collecting log information and electronic equipment
CN115277780A (en) * 2022-07-30 2022-11-01 重庆长安汽车股份有限公司 Vehicle-end log obtaining method and device, electronic equipment and computer-readable storage medium
CN115277780B (en) * 2022-07-30 2023-11-14 重庆长安汽车股份有限公司 Method and device for acquiring vehicle-end log, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN213069791U (en) Fault detection system of vehicle-mounted information entertainment system
CN113568878A (en) Method and device for collecting and exporting system logs and vehicle
CN106789306B (en) Method and system for detecting, collecting and recovering software fault of communication equipment
CN106649071B (en) Method and device for reporting log in process
WO2007126683A2 (en) Code installation decisions for improving aggregate functionality
CN111046011A (en) Log collection method, system, node, electronic device and readable storage medium
CN110928561B (en) Vehicle controller software version management method and device, vehicle and storage medium
CN112860466B (en) Vehicle-mounted entertainment system restart fault diagnosis method and system
CN110895488B (en) Task scheduling method and device
US8086909B1 (en) Automatic core file upload
CN112988679B (en) Log acquisition control method and device, storage medium and server
CN111966603A (en) Memory leak detection method and device, readable storage medium and electronic equipment
CN115277409A (en) Method and device for collecting and reporting buried point data in real time, acquisition system and terminal
CN110943865A (en) Method and device for diagnosing equipment fault time and related equipment
CN111008107A (en) Big data cluster log storage method, device, equipment and storage medium
CN110011854A (en) MDS fault handling method, device, storage system and computer readable storage medium
CN112306871A (en) Data processing method, device, equipment and storage medium
CN111240923A (en) Automatic test method and device for recurring problems of vehicle navigation system and storage medium
CN109992476A (en) A kind of analysis method of log, server and storage medium
CN114978885A (en) Log management method and device, computer equipment and system
CN114116407A (en) Vehicle machine error log analysis uploading method, device, equipment and storage medium
CN114610567A (en) Container monitoring method, network device and storage medium
CN113434473A (en) Distributed log processing method, device, medium and electronic equipment
CN111611142A (en) Information collection method, device and storage medium
CN113645056B (en) Method and system for positioning fault of intelligent network card

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination