CN110851415A - Log data processing method and device of vehicle-mounted system - Google Patents

Log data processing method and device of vehicle-mounted system Download PDF

Info

Publication number
CN110851415A
CN110851415A CN201911108632.9A CN201911108632A CN110851415A CN 110851415 A CN110851415 A CN 110851415A CN 201911108632 A CN201911108632 A CN 201911108632A CN 110851415 A CN110851415 A CN 110851415A
Authority
CN
China
Prior art keywords
log
log data
key
log file
preset
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
CN201911108632.9A
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.)
Guangzhou Xiaopeng Motors Technology Co Ltd
Original Assignee
Guangzhou Xiaopeng Motors Technology Co Ltd
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 Guangzhou Xiaopeng Motors Technology Co Ltd filed Critical Guangzhou Xiaopeng Motors Technology Co Ltd
Priority to CN201911108632.9A priority Critical patent/CN110851415A/en
Publication of CN110851415A publication Critical patent/CN110851415A/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/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • 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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/162Delete operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a log data processing method and a log data processing device of a vehicle-mounted system, wherein the method comprises the following steps: acquiring log data with preset log entries; the preset log entries comprise entries of key grades, and the key grades represent the key degrees of the log data on the problem of the vehicle-mounted system; determining a log file corresponding to the log data according to the key grade and writing the log file into the log file; determining that the total size of all current log files exceeds a preset storage space threshold; and if the total size of all the current log files exceeds a preset storage space threshold, deleting the log data from low to high according to the key level. According to the embodiment of the invention, the log data with low key level is deleted preferentially, so that the log data with high key level for checking the vehicle-mounted system problem can be kept for a long time as possible, and the occurrence probability that the vehicle-mounted system problem cannot be checked due to deletion of the log data is reduced.

Description

Log data processing method and device of vehicle-mounted system
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a log data processing method and a log data processing apparatus for a vehicle-mounted system.
Background
The log data is a key data basis for analyzing, positioning and solving problems, and for the vehicle-mounted system, all log data cannot be stored due to the limited storage space of the system.
Thus, the existing technical solutions include two types:
the first is to limit the maximum space that can be occupied for storing log data, and when the log data size reaches the maximum storage space upper limit, discard the oldest part to make room, and manage the log data in such a way that old reservations are discarded. The method limits the occupation of the log data to the system storage space within a reasonable range, and ensures that the latest log data is stored, but the method has the defect that the log corresponding to the accident time point is discarded due to the limitation of the storage space, and finally the positioning problem cannot be analyzed.
The second method is to upload log data to a cloud server, which does not occupy more system storage space, but consumes system traffic and easily uses up the system traffic.
Disclosure of Invention
In view of the above, embodiments of the present invention are proposed in order to provide a log data processing method of an in-vehicle system and a corresponding log data processing apparatus of an in-vehicle system that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a log data processing method for a vehicle-mounted system, including:
acquiring log data with preset log entries; the preset log entries comprise entries of key grades, and the key grades represent the key degrees of the log data on the problem of the vehicle-mounted system;
determining a log file corresponding to the log data according to the key grade and writing the log file into the log file;
determining that the total size of all current log files exceeds a preset storage space threshold;
and if the total size of all the current log files exceeds a preset storage space threshold, deleting the log data from low to high according to the key level.
Optionally, the determining and writing the log file corresponding to the log data according to the key level includes:
determining whether a preset available log file with a residual storage space exists or not according to the key level;
if the available log file exists, writing the log data into the available log file;
if no available log file exists, creating a log file according to the key level;
and writing the log data into a newly created log file.
Optionally, the determining whether there is an available log file with a remaining storage space according to the key rank includes:
and determining whether an available log file with a residual storage space exists in a preset log file directory corresponding to the key level of the log data.
Optionally, the creating a log file according to the key rank includes:
and creating a log file in a preset log file directory corresponding to the key level of the log data.
Optionally, the deleting log data according to the order of the key ranks from low to high includes:
determining and deleting the log files with the storage duration exceeding a preset storage duration threshold in all the log files;
and if the deleted log files are smaller than the preset minimum vacated space, deleting the log files from low to high according to the key level until the deleted log files are larger than or equal to the preset minimum vacated space.
Optionally, the deleting log files according to the order of the key rank from low to high until the deleted log files are greater than or equal to the preset minimum vacated space includes:
and deleting the log files in each preset log file directory according to the sequence of the key grades from low to high, and deleting the log files from the front to the back according to the generation time until the deleted log files are more than or equal to the preset minimum vacated space.
The embodiment of the invention also discloses a log data processing device of the vehicle-mounted system, which comprises the following steps:
the log data acquisition module is used for acquiring log data with preset log entries; the preset log entries comprise entries of key grades, and the key grades represent the key degrees of the log data on the problem of the vehicle-mounted system;
the log data writing module is used for determining and writing a log file corresponding to the log data according to the key grade;
the determining module is used for determining that the total size of all current log files exceeds a preset storage space threshold;
and the log data deleting module is used for deleting the log data from low to high according to the key level if the total size of all the current log files exceeds a preset storage space threshold.
Optionally, the log data writing module includes:
the available log file determining submodule is used for determining whether a preset available log file with a residual storage space exists or not according to the key level;
the first log data writing submodule is used for writing the log data into an available log file if the available log file exists;
the log file creating submodule is used for creating a log file according to the key level if no available log file exists;
and the first log data writing submodule is used for writing the log data into a newly created log file.
Optionally, the available log file determination sub-module includes:
and the available log file determining unit is used for determining whether an available log file with a residual storage space exists in a preset log file directory corresponding to the key level of the log data.
Optionally, the log file creating sub-module includes:
and the log file creating unit is used for creating a log file in a preset log file directory corresponding to the key level of the log data.
Optionally, the log data deleting module includes:
the overtime log file deleting submodule is used for determining and deleting the log files with the storage duration exceeding a preset storage duration threshold in all the log files;
and the sequential log file deleting submodule is used for deleting the log files from low to high sequentially according to the key level until the deleted log files are more than or equal to the preset minimum vacated space if the deleted log files are less than the preset minimum vacated space.
Optionally, the sequential log file deletion submodule includes:
and the sequential log file deleting unit is used for deleting the log files in each preset log file directory according to the sequence of the key level from low to high and the sequence of the generation time from front to back until the deleted log files are more than or equal to the preset minimum vacated space.
The embodiment of the invention also discloses a vehicle, which comprises: a processor, a memory and a computer program stored on the memory and being executable on the processor, the computer program, when executed by the processor, implementing the steps of the log data processing method of the in-vehicle system as defined in any one of the above.
The embodiment of the invention also discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by a processor, the steps of the log data processing method of the vehicle-mounted system are realized.
The embodiment of the invention has the following advantages:
according to the embodiment of the invention, the log data does not need to be uploaded to the server, and the storage space configured to the log data does not need to be additionally increased. The embodiment of the invention obtains the log data of the items with the key level; determining a log file corresponding to the log data according to the key grade and writing the log file; and if the total size of all the current log files exceeds a preset storage space threshold, deleting the log data from low to high according to the key level. Because the key degree of the log data with low key level to the problem investigation of the vehicle-mounted system is low, and the key degree of the log data with high key level to the problem investigation of the vehicle-mounted system is high, the log data with high key level to the problem investigation of the vehicle-mounted system can be kept for a long time as possible by preferentially deleting the log data with low key level, and the occurrence probability that the problem of the vehicle-mounted system cannot be investigated due to deletion of the log data is reduced.
Drawings
FIG. 1 is a flowchart illustrating a first embodiment of a method for processing log data of an on-board system according to the present invention;
FIG. 2 is a flowchart illustrating a second embodiment of a method for processing log data of an on-board system according to the present invention;
FIG. 3 is a schematic diagram of a log file directory in an embodiment of the invention;
FIG. 4 is a flowchart illustrating a method for managing log data of an on-board system according to an embodiment of the present invention;
fig. 5 is a block diagram showing an embodiment of a log data processing apparatus of an in-vehicle system according to the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
For the problem troubleshooting of the vehicle-mounted system, because the vehicle-mounted system relates to various complex scenes, the amount of log data is large, and the interval time from the occurrence of the problem to the extraction of the log data is long, the existing log data storage scheme can cause the log data corresponding to the accident time point to be discarded due to the limitation of the storage space, and finally the problem of positioning cannot be analyzed.
One of the core ideas of the embodiment of the invention is that a log entry with a key level is added on the basis of the existing log entry of the log data, and the key level can be used for measuring the key degree of the log data on the problem investigation of the vehicle-mounted system.
When the total size of all current log files of the vehicle-mounted system exceeds a preset storage space threshold, the log data can be deleted from low to high according to the key level, so that the log data with high key degree for checking the problems of the vehicle-mounted system can be reserved for as long as possible.
Referring to fig. 1, a flowchart illustrating a first step of a first embodiment of a log data processing method of a vehicle-mounted system according to the present invention may specifically include the following steps:
step 101, obtaining log data with preset log entries; the preset log entries comprise entries of key grades, and the key grades represent the key degrees of the log data on the problem of the vehicle-mounted system;
in the vehicle, the log data may be generated when a program included in the in-vehicle system is run, and the program included in the in-vehicle system may include programs associated with various devices and actuators of the vehicle.
When a program executes a relevant flow, the program may generate log data describing the current flow. The log data may include data for a variety of log entries. The log entry refers to a detail listed by content in the log data, and in the embodiment of the present invention, the presetting of the log entry may include: date, time, process number, thread number, process name, severity level, criticality level, TAG (TAG), content, and the like.
The severity level may represent the degree of influence of the log data on the program operation, and the greater the influence on the program (such as causing program crash, outputting result error, and the like), the greater the severity level. Generally, log data is output only when serious abnormality occurs, and the log data is not necessarily useful for troubleshooting a problem of a vehicle-mounted system.
The criticality rating may characterize how critical the log data is to troubleshoot on-board system problems. The programs of the on-board system may generate much log data, but not all log data is useful for troubleshooting on-board system problems. The program of the in-vehicle system may determine the key level to be set in the log data according to whether the currently executed flow is useful for troubleshooting the in-vehicle system problem.
The more useful the log data is for troubleshooting vehicle system problems, the greater the criticality and the higher the criticality rank. During specific implementation, which processes are useful for troubleshooting vehicle-mounted system problems, and the size of the useful degree can be preset and configured. During the program running process, the key level to be set in the log data can be determined according to the action relationship to the on-board system to be checked, which is configured in advance.
On the other hand, even if a plurality of log data are all effective in troubleshooting a problem of a certain vehicle-mounted system, the log data are also repeated, that is, only one log in the log data is needed to determine the problem of the vehicle-mounted system, and more other log data serve other functions.
Therefore, if a plurality of log data are all effective in troubleshooting a problem of a certain vehicle-mounted system, only a high key level needs to be set for one log data, and a low key level needs to be set for other log data.
For example, the key rankings may be divided into 6 rankings, 1 to 6, with 1 being the highest and 6 being the lowest. If 5 pieces of log data are all effective in troubleshooting a problem of a certain vehicle-mounted system, the key level of only the first piece of generated log data may be set to 1, and the key level of the rest of log data may be set to 6.
Step 102, determining and writing a log file corresponding to the log data according to the key level;
the log file is a file for storing log data, and the vehicle-mounted system can determine the corresponding log file according to the key level of the log data and write the log data into the log file.
By classifying and storing the log data according to the key levels, the log data can be managed by the vehicle-mounted system according to the key levels.
103, determining that the total size of all current log files exceeds a preset storage space threshold;
the preset storage space threshold is an upper limit of a storage space previously allocated to the log data, for example, 1 GB.
And step 104, if the total size of all the current log files exceeds a preset storage space threshold, deleting the log data from low to high according to the key level.
And if the total size of all the current log files exceeds a preset storage space threshold, deleting the log data from low to high according to the key level.
According to the embodiment of the invention, the log data does not need to be uploaded to the server, and the storage space configured to the log data does not need to be additionally increased. The embodiment of the invention obtains the log data of the items with the key level; determining a log file corresponding to the log data according to the key grade and writing the log file; and if the total size of all the current log files exceeds a preset storage space threshold, deleting the log data from low to high according to the key level. Because the key degree of the log data with low key level to the problem investigation of the vehicle-mounted system is low, and the key degree of the log data with high key level to the problem investigation of the vehicle-mounted system is high, the log data with high key level to the problem investigation of the vehicle-mounted system can be kept for a long time as possible by preferentially deleting the log data with low key level, and the occurrence probability that the problem of the vehicle-mounted system cannot be investigated due to deletion of the log data is reduced.
Referring to fig. 2, a flowchart illustrating steps of a second embodiment of a log data processing method of an on-board system according to the present invention is shown, which may specifically include the following steps:
step 201, obtaining log data with preset log entries; the preset log entries comprise entries of key grades, and the key grades represent the key degrees of the log data on the problem of the vehicle-mounted system;
the more useful the log data is for troubleshooting vehicle system problems, the greater the criticality and the higher the criticality rank.
Step 202, determining and writing a log file corresponding to the log data according to the key level;
the log file is a file for storing log data, and the vehicle-mounted system can determine the corresponding log file according to the key level of the log data and write the log data into the log file.
In an embodiment of the present invention, the step 202 may include the following sub-steps:
a substep S11 of determining whether there is a preset available log file having a remaining storage space according to the key rank;
the preset available log file refers to a log file with a residual storage space created in advance. The same log file stores log data of the same key level. For some key-level log data, corresponding available log files may exist currently; for some key levels of log data, there may not be a corresponding log file available currently.
A substep S12, if there is an available log file, writing the log data into the available log file;
and if the available log file corresponding to the key level exists, writing the log data into the available log file.
A substep S13, if there is no available log file, creating a log file according to the key level;
if an available log file corresponding to the key level exists, creating a log file corresponding to the key level of the log data;
the creation rule of the log file may be: first, the upper limit of the size of the log file, i.e., the upper limit of the size of the log data that can be written in the log file, is set. And when the log data written in a certain log file is larger than the upper limit of the size of the log file, creating a new log file.
And a substep S14, writing the log data into the newly created log file.
In an example of the embodiment of the present invention, the sub-step S11 may specifically be: and determining whether an available log file with a residual storage space exists in a preset log file directory corresponding to the key level of the log data.
The substep S12 may specifically be: if an available log file with a residual storage space exists in a preset log file directory corresponding to the key level of the log data, writing the log data into the available log file of the preset log file directory corresponding to the key level of the log data;
the substep S13 may specifically be: and if the available log file with the residual storage space does not exist in the preset log file directory corresponding to the key level of the log data, creating a log file in the preset log file directory corresponding to the key level of the log data.
The substep S14 may specifically be: and writing the log data into a newly created log file in a preset log file directory corresponding to the key level of the log data.
Fig. 3 is a schematic diagram of a log file directory according to an embodiment of the present invention. The key levels comprise 1-n, each key level is provided with a corresponding log file directory, and the log files in each log file directory are generated according to the following mode: first, the upper limit of the size of the log file, i.e., the upper limit of the size of the log data that can be written in the log file, is set. And creating a log file 1 in the log file directory, and creating a log file 2 when the log data written in the log file 1 is larger than the upper limit of the size of the log file, and so on to generate a log file n.
Step 203, determining that the total size of all current log files exceeds a preset storage space threshold;
the preset storage space threshold is an upper limit of a storage space pre-configured to the log data.
It should be noted that, the log data may be written into the log file first, and then it is determined that the total size of all the current log files exceeds the preset storage space threshold, so that the timeliness of the log data written into the log file can be ensured, and the storage duration of the log data is calculated from the time point of the log data written into the log file.
Step 204, if the total size of all current log files exceeds a preset storage space threshold, determining and deleting the log files with the storage duration exceeding a preset storage duration threshold in all the log files;
the preset storage duration threshold refers to the maximum duration that the log file can be stored, for example, 30 days.
If the total size of all the current log files exceeds a preset storage space threshold, firstly, the log files with the storage time length exceeding a preset storage time length threshold are stored.
In an example, the log files are stored according to a log file directory in a classified manner, and if the total size of all the current log files exceeds a preset storage space threshold, the log files with the storage duration exceeding a preset storage duration threshold can be determined and deleted from all the log file directories.
In step 205, if the deleted log file is smaller than the preset minimum vacated space, the log files are deleted from low to high according to the key rank until the deleted log file is greater than or equal to the preset minimum vacated space.
The preset minimum vacated space refers to the minimum value of the log data, such as 200MB, which needs to be deleted after the total size of all current log files exceeds a preset storage space threshold.
By setting the preset minimum vacated space, the total size of all log files can not exceed the preset storage space threshold value again in a short time after the log data are deleted.
If all the deleted log files with the storage duration exceeding the preset storage duration threshold are still smaller than the preset minimum vacated space, the log files are also required to be deleted from low to high according to the key level until the deleted log files are larger than or equal to the preset minimum vacated space.
The deleted log file includes: all the log files with the storage duration exceeding a preset storage duration threshold value are deleted, and the log removing files are deleted from low to high according to the key level.
In an example of the embodiment of the present invention, the step 205 may include:
and deleting the log files in each preset log file directory according to the sequence of the key grades from low to high, and deleting the log files from the front to the back according to the generation time until the deleted log files are more than or equal to the preset minimum vacated space.
Specifically, according to the sequence of the key levels from low to high, the log files in the preset log file directory are deleted from the log file with the earliest generation time according to the sequence of the generation time of the log files from the front to the back.
And if all the log files in the preset log directory corresponding to the lowest key level are deleted and all the deleted log files are still smaller than the preset minimum vacated space, deleting the log files from the log file with the earliest generation time in the preset file directory corresponding to the next key level according to the sequence of the generation time of the log files from the front to the back until the deleted log files are larger than or equal to the preset minimum vacated space.
The embodiment of the invention obtains the log data of the items with the key level; determining a log file corresponding to the log data according to the key grade and writing the log file; if the total size of all the current log files exceeds a preset storage space threshold, determining and deleting the log files with the storage duration exceeding a preset storage duration threshold in all the log files; and if the deleted log files are smaller than the preset minimum vacated space, deleting the log files from low to high according to the key level until the deleted log files are larger than or equal to the preset minimum vacated space.
The log files with the storage time length exceeding the preset storage time length threshold are used for checking the vehicle-mounted system problems before a certain time, and the log files do not help to check the latest vehicle-mounted system problems, so that the log files can be deleted preferentially to better store log data helpful to the checking of the latest vehicle-mounted system.
Because the key degree of the log data with low key level to the problem investigation of the vehicle-mounted system is low, and the key degree of the log data with high key level to the problem investigation of the vehicle-mounted system is high, the log data with high key level to the problem investigation of the vehicle-mounted system can be kept for a long time as possible by preferentially deleting the log data with low key level, and the occurrence probability that the problem of the vehicle-mounted system cannot be investigated due to deletion of the log data is reduced.
In order to enable a person skilled in the art to better understand the embodiments of the present invention, the following description is given by way of an example:
fig. 4 is a flowchart illustrating a method for managing log data of an on-board system according to an embodiment of the present invention.
First, a corresponding log file directory is created for each key level.
When the log data generated by the program is acquired, the log data is written into the log file of the corresponding log file directory according to the key level of the log data, and the method specifically comprises the following steps.
And judging whether the log file exists in the corresponding log file directory.
And if the corresponding log file directory does not have the log file, creating a new log file in the corresponding log file directory, and writing the log data into the newly created log file.
If the log file exists in the corresponding log file directory, whether the log file has the residual storage space is judged, namely whether the size of the log file reaches a preset upper limit is judged.
If the log file has the residual storage space, the log data is written into the log file;
and if the log file does not have the residual storage space, creating a new log file in the corresponding log file directory, and writing the log data into the newly created log file.
After the log data are written into the log files, whether the total size of all the current log files exceeds a preset storage space threshold value is judged.
And if the total size of all the current log files does not exceed the preset storage space threshold, ending the process.
And if the total size of all the current log files exceeds a preset storage space threshold, deleting the log files exceeding a preset storage time threshold in all the log file directories.
And judging whether the size of the deleted log file is smaller than a preset minimum vacated space or not.
And if the size of the deleted log file is larger than or equal to the preset minimum vacated space, ending.
And if the size of the deleted log file is larger than or equal to the preset minimum vacated space, setting the log file directory corresponding to the lowest key grade as the current log file directory.
Deleting the earliest generated log file in the current log file directory, and determining the size of the deleted log file every time one log file is deleted.
And judging whether the size of the deleted log file is smaller than a preset minimum vacated space or not.
And if the size of the deleted log file is larger than or equal to the preset minimum vacated space, ending.
And if the size of the deleted log file is larger than or equal to the preset minimum vacated space, judging whether no log file exists in the current log file directory.
If the current log file directory contains log files, returning to delete the earliest generated log file in the current log file directory, and determining the size of the deleted log file every time one log file is deleted.
And if no log file exists in the current log file directory, judging whether the current log file directory is the log file directory corresponding to the highest key level.
And if the current log file directory is the log file directory corresponding to the highest key level, ending the process.
If the current log file directory is not the log file directory corresponding to the highest key level, setting the log file directory corresponding to the next key level as the current log file directory, and returning to delete the earliest generated log file in the current log file directory, and determining the size of the deleted log file every time one log file is deleted.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Referring to fig. 5, a block diagram of a log data processing apparatus of an in-vehicle system according to an embodiment of the present invention is shown, and may specifically include the following modules:
a log data obtaining module 501, configured to obtain log data with preset log entries; the preset log entries comprise entries of key grades, and the key grades represent the key degrees of the log data on the problem of the vehicle-mounted system;
a log data writing module 502, configured to determine and write a log file corresponding to the log data according to the key rank;
a determining module 503, configured to determine that the total size of all current log files exceeds a preset storage space threshold;
and the log data deleting module 504 is configured to delete log data from a low level to a high level according to the key level if the total size of all current log files exceeds a preset storage space threshold.
In this embodiment of the present invention, the log data writing module 502 may include:
the available log file determining submodule is used for determining whether a preset available log file with a residual storage space exists or not according to the key level;
the first log data writing submodule is used for writing the log data into an available log file if the available log file exists;
the log file creating submodule is used for creating a log file according to the key level if no available log file exists;
and the first log data writing submodule is used for writing the log data into a newly created log file.
In this embodiment of the present invention, the available log file determining sub-module may include:
and the available log file determining unit is used for determining whether an available log file with a residual storage space exists in a preset log file directory corresponding to the key level of the log data.
In this embodiment of the present invention, the log file creating sub-module may include:
and the log file creating unit is used for creating a log file in a preset log file directory corresponding to the key level of the log data.
In this embodiment of the present invention, the log data deleting module 504 may include:
the overtime log file deleting submodule is used for determining and deleting the log files with the storage duration exceeding a preset storage duration threshold in all the log files;
and the sequential log file deleting submodule is used for deleting the log files from low to high sequentially according to the key level until the deleted log files are more than or equal to the preset minimum vacated space if the deleted log files are less than the preset minimum vacated space.
In this embodiment of the present invention, the sequential log file deleting submodule may include:
and the sequential log file deleting unit is used for deleting the log files in each preset log file directory according to the sequence of the key level from low to high and the sequence of the generation time from front to back until the deleted log files are more than or equal to the preset minimum vacated space.
According to the embodiment of the invention, the log data does not need to be uploaded to the server, and the storage space configured to the log data does not need to be additionally increased. The embodiment of the invention obtains the log data of the items with the key level; determining a log file corresponding to the log data according to the key grade and writing the log file; and if the total size of all the current log files exceeds a preset storage space threshold, deleting the log data from low to high according to the key level. Because the key degree of the log data with low key level to the problem investigation of the vehicle-mounted system is low, and the key degree of the log data with high key level to the problem investigation of the vehicle-mounted system is high, the log data with high key level to the problem investigation of the vehicle-mounted system can be kept for a long time as possible by preferentially deleting the log data with low key level, and the occurrence probability that the problem of the vehicle-mounted system cannot be investigated due to deletion of the log data is reduced.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
An embodiment of the present invention further provides a vehicle, including:
the method comprises a processor, a memory and a computer program which is stored on the memory and can run on the processor, wherein when the computer program is executed by the processor, each process of the log data processing method embodiment of the vehicle-mounted system is realized, the same technical effect can be achieved, and the process is not repeated here to avoid repetition.
The embodiment of the invention also provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when being executed by a processor, the computer program realizes each process of the log data processing method embodiment of the vehicle-mounted system, and can achieve the same technical effect, and is not repeated here to avoid repetition.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The present invention provides a method and a device for processing log data of a vehicle-mounted system, which are introduced in detail, and a specific example is applied to explain the principle and the implementation of the present invention, and the description of the above embodiment is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A log data processing method of a vehicle-mounted system is characterized by comprising the following steps:
acquiring log data with preset log entries; the preset log entries comprise entries of key grades, and the key grades represent the key degrees of the log data on the problem of the vehicle-mounted system;
determining a log file corresponding to the log data according to the key grade and writing the log file into the log file;
determining that the total size of all current log files exceeds a preset storage space threshold;
and if the total size of all the current log files exceeds a preset storage space threshold, deleting the log data from low to high according to the key level.
2. The method of claim 1, wherein determining and writing the log file corresponding to the log data according to the key rank comprises:
determining whether a preset available log file with a residual storage space exists or not according to the key level;
if the available log file exists, writing the log data into the available log file;
if no available log file exists, creating a log file according to the key level;
and writing the log data into a newly created log file.
3. The method of claim 2, wherein determining whether there are available log files with remaining storage space based on the criticality rating comprises:
and determining whether an available log file with a residual storage space exists in a preset log file directory corresponding to the key level of the log data.
4. The method of claim 3, wherein creating a log file according to the key rank comprises:
and creating a log file in a preset log file directory corresponding to the key level of the log data.
5. The method of claim 1, wherein deleting log data according to the order of criticality from low to high comprises:
determining and deleting the log files with the storage duration exceeding a preset storage duration threshold in all the log files;
and if the deleted log files are smaller than the preset minimum vacated space, deleting the log files from low to high according to the key level until the deleted log files are larger than or equal to the preset minimum vacated space.
6. The method of claim 5, wherein deleting log files in order from low to high according to the criticality rating until the deleted log files are greater than or equal to the preset minimum vacation space comprises:
and deleting the log files in each preset log file directory according to the sequence of the key grades from low to high, and deleting the log files from the front to the back according to the generation time until the deleted log files are more than or equal to the preset minimum vacated space.
7. A log data processing apparatus of an in-vehicle system, characterized by comprising:
the log data acquisition module is used for acquiring log data with preset log entries; the preset log entries comprise entries of key grades, and the key grades represent the key degrees of the log data on the problem of the vehicle-mounted system;
the log data writing module is used for determining and writing a log file corresponding to the log data according to the key grade;
the determining module is used for determining that the total size of all current log files exceeds a preset storage space threshold;
and the log data deleting module is used for deleting the log data from low to high according to the key level if the total size of all the current log files exceeds a preset storage space threshold.
8. The apparatus of claim 7, wherein the log data writing module comprises:
the available log file determining submodule is used for determining whether a preset available log file with a residual storage space exists or not according to the key level;
the first log data writing submodule is used for writing the log data into an available log file if the available log file exists;
the log file creating submodule is used for creating a log file according to the key level if no available log file exists;
and the first log data writing submodule is used for writing the log data into a newly created log file.
9. A vehicle, characterized by comprising: processor, memory and a computer program stored on the memory and being executable on the processor, the computer program, when being executed by the processor, realizing the steps of the log data processing method of the in-vehicle system as claimed in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, realizes the steps of the log data processing method of the in-vehicle system according to any one of claims 1 to 6.
CN201911108632.9A 2019-11-13 2019-11-13 Log data processing method and device of vehicle-mounted system Pending CN110851415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911108632.9A CN110851415A (en) 2019-11-13 2019-11-13 Log data processing method and device of vehicle-mounted system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911108632.9A CN110851415A (en) 2019-11-13 2019-11-13 Log data processing method and device of vehicle-mounted system

Publications (1)

Publication Number Publication Date
CN110851415A true CN110851415A (en) 2020-02-28

Family

ID=69600100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911108632.9A Pending CN110851415A (en) 2019-11-13 2019-11-13 Log data processing method and device of vehicle-mounted system

Country Status (1)

Country Link
CN (1) CN110851415A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111694341A (en) * 2020-06-05 2020-09-22 中国第一汽车股份有限公司 Fault data storage method and device, vehicle-mounted equipment and storage medium
CN112181311A (en) * 2020-10-21 2021-01-05 深圳市创维软件有限公司 Cyclic recording method, equipment and storage medium
CN113094333A (en) * 2021-03-18 2021-07-09 智道网联科技(北京)有限公司 Method and device for managing running logs of vehicle-mounted terminal
CN113596375A (en) * 2021-07-15 2021-11-02 深圳昌恩智能股份有限公司 Automobile driving recording system with circulating video recording function
CN113703665A (en) * 2021-07-12 2021-11-26 深圳市有为信息技术发展有限公司 Method and device for reducing loss of control terminal data after gateway breakdown and electronic equipment
CN114579368A (en) * 2022-05-07 2022-06-03 武汉四通信息服务有限公司 Backup management method for continuous data protection, computer equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571827A (en) * 2008-04-30 2009-11-04 国际商业机器公司 Method for saving logs and log system
US20120099136A1 (en) * 2010-10-26 2012-04-26 Konica Minolta Business Technologies, Inc. Log information management apparatus for image forming apparatus, which manages job history performed by user
US20140325010A1 (en) * 2013-04-24 2014-10-30 Kyocera Document Solutions Inc. Electronic apparatus and log information transfer method
CN104834992A (en) * 2015-04-15 2015-08-12 国家电网公司 Emergency command auxiliary decision-making system based on the power grid GIS platform
CN105868340A (en) * 2016-03-28 2016-08-17 乐视控股(北京)有限公司 Log storage method and device
CN106156355A (en) * 2016-07-27 2016-11-23 腾讯科技(深圳)有限公司 Log processing method and device
CN107526674A (en) * 2017-08-31 2017-12-29 郑州云海信息技术有限公司 A kind of method and apparatus of embedded system log recording
CN108319254A (en) * 2018-01-24 2018-07-24 广东远峰汽车电子有限公司 A kind of collection method, car-mounted terminal and the log collecting server of automobile daily record
CN109299045A (en) * 2018-12-17 2019-02-01 郑州云海信息技术有限公司 A kind of log storing method, device, equipment and readable storage medium storing program for executing
CN110320048A (en) * 2018-03-28 2019-10-11 上海擎感智能科技有限公司 A kind of method and apparatus storing log in vehicle automatic on/off test of computer

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101571827A (en) * 2008-04-30 2009-11-04 国际商业机器公司 Method for saving logs and log system
US20120099136A1 (en) * 2010-10-26 2012-04-26 Konica Minolta Business Technologies, Inc. Log information management apparatus for image forming apparatus, which manages job history performed by user
US20140325010A1 (en) * 2013-04-24 2014-10-30 Kyocera Document Solutions Inc. Electronic apparatus and log information transfer method
CN104834992A (en) * 2015-04-15 2015-08-12 国家电网公司 Emergency command auxiliary decision-making system based on the power grid GIS platform
CN105868340A (en) * 2016-03-28 2016-08-17 乐视控股(北京)有限公司 Log storage method and device
CN106156355A (en) * 2016-07-27 2016-11-23 腾讯科技(深圳)有限公司 Log processing method and device
CN107526674A (en) * 2017-08-31 2017-12-29 郑州云海信息技术有限公司 A kind of method and apparatus of embedded system log recording
CN108319254A (en) * 2018-01-24 2018-07-24 广东远峰汽车电子有限公司 A kind of collection method, car-mounted terminal and the log collecting server of automobile daily record
CN110320048A (en) * 2018-03-28 2019-10-11 上海擎感智能科技有限公司 A kind of method and apparatus storing log in vehicle automatic on/off test of computer
CN109299045A (en) * 2018-12-17 2019-02-01 郑州云海信息技术有限公司 A kind of log storing method, device, equipment and readable storage medium storing program for executing

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111694341A (en) * 2020-06-05 2020-09-22 中国第一汽车股份有限公司 Fault data storage method and device, vehicle-mounted equipment and storage medium
CN112181311A (en) * 2020-10-21 2021-01-05 深圳市创维软件有限公司 Cyclic recording method, equipment and storage medium
CN112181311B (en) * 2020-10-21 2023-11-21 深圳市创维软件有限公司 Cyclic recording method, equipment and storage medium
CN113094333A (en) * 2021-03-18 2021-07-09 智道网联科技(北京)有限公司 Method and device for managing running logs of vehicle-mounted terminal
CN113703665A (en) * 2021-07-12 2021-11-26 深圳市有为信息技术发展有限公司 Method and device for reducing loss of control terminal data after gateway breakdown and electronic equipment
CN113596375A (en) * 2021-07-15 2021-11-02 深圳昌恩智能股份有限公司 Automobile driving recording system with circulating video recording function
CN114579368A (en) * 2022-05-07 2022-06-03 武汉四通信息服务有限公司 Backup management method for continuous data protection, computer equipment and storage medium
CN114579368B (en) * 2022-05-07 2022-08-02 武汉四通信息服务有限公司 Backup management method for continuous data protection, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110851415A (en) Log data processing method and device of vehicle-mounted system
US9104796B2 (en) Correlation of source code with system dump information
CN108108127B (en) File reading method and system
EP3076283B1 (en) System and method for managing content deletion
US20170060886A1 (en) File deletion in storage devices based on the deletion priority rules
WO2018006721A1 (en) Method and apparatus for storing log file
CN112416972A (en) Real-time data stream processing method, device, equipment and readable storage medium
CN106878365B (en) data synchronization method and device
CN108108126B (en) Data processing method, device and equipment
CN111539206B (en) Method, device, equipment and storage medium for determining sensitive information
CN112416974A (en) Data processing method, device and equipment and readable storage medium
CN108986256B (en) Train running recording method and device
CN110019168B (en) File merging method and system
CN116010244A (en) Automatic test method, device, electronic equipment and storage medium
JP7291909B2 (en) Information processing device, information processing method and program
CN114338846B (en) Message testing method and device
CN113254269A (en) Method, system, equipment and medium for repairing abnormal event of storage system
CN113613063B (en) Application anomaly reduction method, device and storage medium
CN113377641B (en) Log statistical method and system
CN111294610B (en) Video processing method and device
CN112988190B (en) Application online method, device, computer equipment and storage medium
CN113670324A (en) Navigation processing method and system based on Internet of vehicles big data
US9086860B2 (en) Bi-directional linking of product build information
CN108279990B (en) System checking method and device and electronic equipment
CN116821083A (en) Automatic driving log data processing method and device and related equipment

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200228