Log storage method, vehicle, computer equipment and program product
In the log storage system of the vehicle terminal, the log content is stored in different areas according to the level of the target problem and the application correlation, which solves the problem caused by log file overwriting and improves the problem solving efficiency.
Patent Information
- Application Number
- CN202411615457.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-18
AI Technical Summary
When the vehicle terminal does not have a network, the log files cannot be uploaded to the cloud, and when the log files are full, they will be overwritten in order in storage order, resulting in some log files used to solve the problem being overwritten indiscriminately, affecting the efficiency of problem solving.
By determining the level of the target problem and the second application associated with the related application, when the preset level is higher than the preset level, the log content corresponding to the first application and the second application is stored in the second storage area to ensure that the important log content is not overwritten. And high-frequency coverage is performed after the first storage area reaches the maximum storage amount.
It reduces the probability of the log content related to the target problem being lost, and reduces the probability of the log content related to the more important application problem being overwritten, thereby improving the efficiency of problem solving.
Smart Images

Figure CN119473794A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a log storage method, a vehicle, a computer device, and a program product. Background Art
[0002] When a problem occurs in a vehicle terminal, it is usually necessary to troubleshoot the problem through related log files. When the vehicle terminal has no network, the log files cannot be uploaded to the cloud. When the log files of the vehicle terminal are full, they will be overwritten in the order in which they are stored. This may cause some log files used to solve the problem to be indiscriminately overwritten when the vehicle terminal has no network for a long time, thus affecting the efficiency of problem solving. Summary of the invention
[0003] The embodiments of the present disclosure at least provide a log storage method, a vehicle, a computer device, and a program product.
[0004] In a first aspect, an embodiment of the present disclosure provides a log storage method, including:
[0005] In response to a target problem occurring in a first application, determining a target problem level of the target problem and a second application associated with the first application; wherein the second application is an application related to the target problem occurring in the first application;
[0006] When the target problem level is higher than a preset level, first log content corresponding to the first application within a target time period and second log content corresponding to the second application are obtained from log files stored in a first storage area of the log storage space, and the first log content and the second log content are stored in a second storage area of the log storage space; wherein, after the first storage area and the second storage area reach maximum storage capacity, the log coverage frequency of the first storage area is higher than that of the second storage area.
[0007] In a possible implementation manner, storing the first log content and the second log content in the second storage area of the log storage space includes:
[0008] Comparing the first log content and the second log content with the third log content of the log file currently stored in the second storage area respectively;
[0009] When the first log content and the third log content are different, the first log content is stored in the second storage area; and when the second log content and the third log content are different, the second log content is stored in the second storage area.
[0010] In a possible implementation manner, after determining the target problem level of the target problem, the method further includes:
[0011] determining a current problem level of a first log file written in the first storage area;
[0012] When the target problem level is higher than the current problem level of the first log file, the current problem level of the first log file is updated to the target problem level, and the correspondence between the file name of the first log file and the target problem level is stored.
[0013] In a possible implementation manner, the method further includes:
[0014] When the number of log files stored in the first storage area reaches a first target number, determining a first overwriting order of the log files based on the problem level of each log file stored in the first storage area;
[0015] Based on the first log file newly written into the first storage area, the log file is overwritten in accordance with the first overwriting sequence.
[0016] In a possible implementation manner, the method further includes:
[0017] When the number of log files stored in the second storage area reaches a second target number, determining a second overwriting order of the log files based on the writing order of the log files stored in the second storage area;
[0018] Based on the second log file newly written into the second storage area, the log file is overwritten according to the second overwriting sequence.
[0019] In a possible implementation manner, the method further includes:
[0020] In response to satisfying the log file upload condition, after the log file stored in the second storage area is uploaded, uploading the log file stored in the first storage area;
[0021] The log files stored in the first storage area and the second storage area are uploaded according to the order in which the log files are written or the level of the problem.
[0022] In a possible implementation manner, storing the first log content and the second log content in the second storage area of the log storage space includes:
[0023] The first log content and the second log content are written into a second log file currently written in the second storage area, and the current problem level of the second log file is updated based on the target problem level.
[0024] In a second aspect, an embodiment of the present disclosure further provides a vehicle, which is used to execute the steps of the log storage method as described in the first aspect or any possible implementation manner of the first aspect.
[0025] In a third aspect, an embodiment of the present disclosure further provides a computer device, comprising: a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the machine-readable instructions are executed by the processor to perform the steps of the above-mentioned first aspect, or any possible implementation of the first aspect.
[0026] In a fourth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which, when executed, implements the method described in the above-mentioned first aspect, or any possible implementation manner of the first aspect.
[0027] In the log storage method, vehicle, computer equipment and program product provided by the embodiments of the present disclosure, when a target problem is detected in a first application, the problem level of the target problem and the second application associated with the first application can be determined first, and when the problem level of the target problem is higher than a preset level, the first log content corresponding to the first application and the second log content corresponding to the second application are stored in the second storage area. In this way, by backing up and storing the log contents corresponding to the first application and the second application in the second storage area, the probability of losing the log content related to the target problem can be reduced. In addition, after the storage space of the first storage area and the second storage area reaches the maximum storage capacity, the log coverage frequency of the first storage area is higher than that of the second storage area. Therefore, the probability of log content related to more important application problems in the second storage area being overwritten can also be reduced, thereby improving the efficiency of solving the target problem.
[0028] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0030] Figure 1 A flow chart of a log storage method provided by an embodiment of the present disclosure is shown;
[0031] Figure 2 A framework diagram of a log storage method provided by an embodiment of the present disclosure is shown;
[0032] Figure 3 A schematic diagram of a log storage device provided by an embodiment of the present disclosure is shown;
[0033] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure claimed for protection, but merely represents selected embodiments of the present disclosure.
[0035] After research, it was found that after a problem occurs in a vehicle terminal, it is generally necessary to troubleshoot the problem through related log files. When the vehicle terminal has no network, the log files cannot be uploaded to the cloud. When the log files of the vehicle terminal are full, they will be overwritten in the order in which they are stored. This may cause some log files used to solve the problem to be indiscriminately overwritten when the vehicle terminal has no network for a long time, thus affecting the efficiency of problem solving.
[0036] Based on the above research, the present disclosure provides a log storage method, a vehicle, a computer device and a program product. When a target problem is detected in a first application, the problem level of the target problem and the second application associated with the first application can be determined first, and when the problem level of the target problem is higher than a preset level, the first log content corresponding to the first application and the second log content corresponding to the second application are stored in a second storage area. In this way, by backing up and storing the log contents corresponding to the first application and the second application in the second storage area, the probability of losing the log content related to the target problem can be reduced. In addition, after the storage space of the first storage area and the second storage area reaches the maximum storage capacity, the log coverage frequency of the first storage area is higher than that of the second storage area. Therefore, the probability of log content related to more important application problems in the second storage area being overwritten can also be reduced, thereby improving the efficiency of solving the target problem.
[0037] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0038] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.
[0039] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the personal information involved in the present disclosure (including but not limited to attribute information, facial images, etc.) is obtained with the authorization of the user. Specifically, it can be through a pop-up window in the page, information push, etc., sending a prompt message requesting authorization to the user, and obtaining the above personal information after the user agrees to the authorization.
[0040] To facilitate understanding of the present embodiment, a log storage method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the log storage method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the log storage method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0041] The log storage method provided by the embodiment of the present disclosure is described below by taking the execution subject as a terminal device as an example.
[0042] See also Figure 1 FIG. 1 is a flow chart of a log storage method provided by an embodiment of the present disclosure, wherein the method includes steps 101 to 102, wherein:
[0043] Step 101: In response to a target problem occurring in a first application, determine a target problem level of the target problem and a second application associated with the first application; wherein the second application is an application related to the target problem occurring in the first application;
[0044] Step 102: When the target problem level is higher than a preset level, obtain the first log content corresponding to the first application within the target time period and the second log content corresponding to the second application from the log files stored in the first storage area of the log storage space, and store the first log content and the second log content in the second storage area of the log storage space; wherein, after the first storage area and the second storage area reach the maximum storage capacity, the log coverage frequency of the first storage area is higher than that of the second storage area.
[0045] The following is a detailed description of the above steps.
[0046] For step 101,
[0047] The first application and the second application may refer to different functional modules, and the first application and the second application may be used to execute the same target process. For example, if an upgrade process is executed, the first application may be required to download a configuration file, and the second application may be required to parse the second configuration file.
[0048] In a possible implementation, after detecting that a target problem occurs in the first application, a target problem level of the target problem may be determined based on a pre-established mapping relationship between problems and problem levels.
[0049] The problem level of different problems can be used to characterize the severity of the problem. For example, for problems that seriously affect the operation of the terminal device, the corresponding problem level is higher, while for problems that have little impact on the operation of the terminal device, the corresponding problem level is lower. The specific mapping relationship between each problem and the problem level can be set according to the actual situation.
[0050] Optionally, before executing the method provided by the present disclosure, a configuration file may be read first, in which the association relationship between each application and other applications may be configured. After detecting that a target problem occurs in a first application, a second application associated with the first application may be determined based on the configuration file.
[0051] For step 102,
[0052] The log storage control includes a first storage area and a second storage area. The first storage area is an area for normally writing log files, and the second storage area is an area used only to store problem log files. The log content stored in the problem log file is log content related to the problem extracted from the first storage area when a problem occurs in the application of the terminal device. Here, the log content related to the problem can also be understood as the log content corresponding to the application that causes the problem and other applications associated with the application.
[0053] The first storage area may store multiple first log files. For the first log file currently written in the first storage area, the log content generated by each application of the terminal device may be written into the first log file. When the first log file is full, a new first log file may be created, and the log content generated thereafter may be written into the newly created first log file. The second storage area may also store multiple second log files. For the second log file currently written in the second storage area, after obtaining the first log content and the second log content from the first storage area, the first log content and the second log content may be written into the second log file. When the log file is full, a new second log file may be created, and the log content obtained thereafter from the first storage area may be written into the newly created second log file.
[0054] Therefore, the log content in the log file stored in the second storage area is part of the content in the log file stored in the first storage area, and the capacity of the first storage area is larger than that of the second storage area.
[0055] Here, it should be noted that the first storage area and the second storage area are stored independently. Therefore, it may happen that the first storage area needs to be overwritten by logs after reaching the maximum storage capacity, but the second storage area has not yet reached the maximum storage capacity; or the second storage area needs to be overwritten by logs after reaching the maximum storage capacity, but the first storage area has not yet reached the maximum storage capacity.
[0056] In a possible implementation manner, before storing the first log content and the second log content in the second storage area, it is necessary to first perform deduplication processing on the first log content and the second log content to prevent duplicate storage.
[0057] Specifically, the first log content and the second log content can be compared with the third log content of the log file currently stored in the second storage area respectively. When the first log content and the third log content are different, the first log content can be stored in the second storage area. And, when the second log content and the third log content are different, the second log content can be stored in the second storage area.
[0058] Exemplarily, storing the first log content in the second storage area may refer to writing the first log content into the second log file currently written in the second storage area; storing the second log content in the second storage area may refer to writing the second log content into the second log file currently written in the second storage area. The first log content and the second log content may be written into different second log files.
[0059] Correspondingly, after the first log content and the second log content are written into the second log file currently being written, the current problem level of the second log file may also be updated based on the target problem level.
[0060] Specifically, the current problem level of the second log file may be determined first. If the target problem level is higher than the current problem level of the second log file, the current problem level of the second log file may be updated to the target problem level. Otherwise, no modification may be made.
[0061] In a possible implementation, after the first storage area reaches the maximum storage capacity, when overwriting logs, the overwriting order may be determined based on the level of the problem corresponding to each log file.
[0062] The problem level corresponding to the log file may refer to the highest problem level of the log content contained in the log file. Specifically, after determining the problem level of the target problem, the current problem level of the first log file written in the first storage area may be determined first, and if the target problem level of the target problem is higher than the current problem level of the first log file, the current problem level of the first log file is updated to the target problem level, and the correspondence between the file name of the first file and the target problem level is stored.
[0063] When the target problem level of the target problem is lower than or equal to the current problem level of the first log file, no operation may be performed.
[0064] The first log file may refer to a log file currently being written to the first storage area. The initial problem level of the first log file is a default level. If, during the writing process of the first log file, the log contents written are all log contents generated when no problems occur, then the problem level of the first log file may be the default level.
[0065] The current problem level of the first log file may refer to the highest problem level of the log content currently written to the first log file. If the first log file writes log content of a certain problem level during the process of writing log content, the current problem level of the first log file may be determined as that problem level. If, in the process of writing other log content thereafter, the problem levels of other log levels are higher, the current problem level of the first log file may be determined as the higher problem level.
[0066] For example, if when the first log file writes log content 1, the problem level of log content 1 is level 1, then the problem level of the first log file can be determined as level 1; if when the first log file writes log content 2 afterwards, the problem level of log content 2 is level 2, and level 2 is higher than level 1, then the problem level of the first log file can be determined as level 2.
[0067] Accordingly, the above correspondence can be used for log file overwriting in the first storage area. Exemplarily, when the number of log files stored in the first storage area reaches the first target number, the first overwriting order of each log file is determined based on the problem level of each log file stored in the first storage area; then, based on the first log file newly written into the first storage area, the log file is overwritten according to the first overwriting order.
[0068] The first overwriting order of each log file is determined by the problem level of the log file, so that when the logs are overwritten later, the log files with lower problem levels can be overwritten first, and the log files with higher problem levels can be retained, so as to better solve more serious problems.
[0069] In a possible implementation, when the number of log files stored in the second storage area reaches the second target number, a second overwrite order for each log file can be determined based on the write order of the log files stored in the second storage area, and then the log files can be overwritten according to the second overwrite order based on the second log files newly written into the second storage area.
[0070] For log files of the same level, the order in which the log files are written may be determined according to the order in which the log files are written.
[0071] In another possible implementation, when the number of log files stored in the second storage area reaches the second target number, a second overwrite order for each log file can be determined based on the problem level of the log files stored in the second storage area, and then the log files can be overwritten according to the second overwrite order based on the second log files newly written to the second storage area.
[0072] It should be noted that the frequency of log overwriting in the first storage area is higher than that in the second storage area. Since the first storage area stores log files that are written normally, the number of log files that need to be written to the first storage area is relatively large. After the storage space of the first storage area and the second storage area reaches the maximum storage capacity, each time a log file is written to the first storage area, other log files need to be overwritten, and this overwriting operation does not necessarily cause the log file of the second storage area to be overwritten. After the second storage area reaches the maximum storage capacity, the reasons that may cause the second storage area to overwrite logs may be, for example: the application of the terminal device has a problem that is higher than the preset level.
[0073] Optionally, after the terminal device meets the log file upload conditions, the log files stored in the first storage area and the second storage area can be uploaded to the cloud. After uploading the log files to the cloud, the first storage area and the second storage area can delete the stored log files.
[0074] Specifically, in response to meeting the log file upload conditions, the log file stored in the first storage area can be uploaded after the log file stored in the second storage area is uploaded, wherein the log files stored in the first storage area and the second storage area are uploaded in the order in which the log files are written or according to the level of the problem.
[0075] Optionally, the order in which the first storage area and the second storage area upload log files may be different. For example, the first storage area may upload log files according to the problem levels of the log files. Since the problem levels of the log files stored in the second storage area are all higher than the preset levels, the application problems corresponding to the file contents of the log files stored in the second storage area are all more serious. The second storage area may upload log files in the order in which they are written.
[0076] Exemplarily, the log file upload condition may refer to the network being restored after a network interruption, or the time from the last log upload reaching a preset time length, etc.
[0077] The following is an introduction to the above log storage method in combination with the overall framework. Figure 2 As shown, it is a framework diagram of a log storage method provided by an embodiment of the present disclosure. The log management module (i.e., the illustrated log) first reads a configuration file, which includes each application and other applications associated with each application. Then, after a problem occurs in app1, the logger unit in the log module can be notified first. The logger unit can determine the target problem level of app1, and then synchronize the target problem level to the log storage space, and store the target problem level and the file name of the first log file currently being written in the database. Then, the logger unit can send an analysis instruction to the log rewriting unit. The analysis instruction can carry the application identifier of app1, as well as the application identifiers of other second applications associated with app1. After receiving the analysis instruction, the log rewriting unit can read the first log content and the second log content from the first storage area, and write the first log content and the second log content to the second storage area.
[0078] In addition, the log management module may further include an uploading unit, which may read the problem level of each log file from the database, and then upload the log file controlled by the log storage to the cloud according to the problem level.
[0079] In the log storage method provided by the present disclosure, when a target problem is detected in a first application, the problem level of the target problem and the second application associated with the first application can be determined first, and when the problem level of the target problem is higher than a preset level, the first log content corresponding to the first application and the second log content corresponding to the second application are stored in the second storage area. In this way, by backing up and storing the log contents corresponding to the first application and the second application in the second storage area, the probability of losing the log content related to the target problem can be reduced. In addition, after the storage space of the first storage area and the second storage area reaches the maximum storage capacity, the log coverage frequency of the first storage area is higher than that of the second storage area. Therefore, the probability of log content related to more important application problems in the second storage area being overwritten can also be reduced, thereby improving the efficiency of solving the target problem.
[0080] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0081] Based on the same inventive concept, a log storage device corresponding to the log storage method is also provided in the embodiment of the present disclosure. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned log storage method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0082] Reference Figure 3 , which is a schematic diagram of the architecture of a log storage device provided by an embodiment of the present disclosure, the device includes: a determination module 301, a storage module 302 and an upload module 303; wherein,
[0083] The determination module 301 is used to determine, in response to a target problem occurring in a first application, a target problem level of the target problem and a second application associated with the first application; wherein the second application is an application related to the target problem occurring in the first application;
[0084] The storage module 302 is used to obtain, when the target problem level is higher than a preset level, the first log content corresponding to the first application within a target time period and the second log content corresponding to the second application from the log files stored in the first storage area of the log storage space, and store the first log content and the second log content in the second storage area of the log storage space; wherein, after the first storage area and the second storage area reach the maximum storage capacity, the log coverage frequency of the first storage area is higher than that of the second storage area.
[0085] In a possible implementation manner, the storage module 302 is used to:
[0086] Comparing the first log content and the second log content with the third log content of the log file currently stored in the second storage area respectively;
[0087] When the first log content and the third log content are different, the first log content is stored in the second storage area; and when the second log content and the third log content are different, the second log content is stored in the second storage area.
[0088] In a possible implementation, the storage module 302 is used to:
[0089] determining a current problem level of a first log file written in the first storage area;
[0090] When the target problem level is higher than the current problem level of the first log file, the current problem level of the first log file is updated to the target problem level, and the correspondence between the file name of the first log file and the target problem level is stored.
[0091] In a possible implementation manner, the storage module 302 is used to:
[0092] When the number of log files stored in the first storage area reaches a first target number, determining a first overwriting order of the log files based on the problem level of each log file stored in the first storage area;
[0093] Based on the first log file newly written into the first storage area, the log file is overwritten in accordance with the first overwriting sequence.
[0094] In a possible implementation manner, the storage module 302 is used to:
[0095] When the number of log files stored in the second storage area reaches a second target number, determining a second overwriting order of the log files based on the writing order of the log files stored in the second storage area;
[0096] Based on the second log file newly written into the second storage area, the log file is overwritten according to the second overwriting sequence.
[0097] In a possible implementation manner, the device further includes an uploading module 303, which is used to:
[0098] In response to satisfying the log file upload condition, after the log file stored in the second storage area is uploaded, uploading the log file stored in the first storage area;
[0099] The log files stored in the first storage area and the second storage area are uploaded according to the order in which the log files are written or the level of the problem.
[0100] In a possible implementation manner, the storage module 302 is used to:
[0101] The first log content and the second log content are written into a second log file currently written in the second storage area, and the current problem level of the second log file is updated based on the target problem level.
[0102] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference may be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0103] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Figure 4 As shown, it is a schematic diagram of the structure of a computer device 400 provided in an embodiment of the present disclosure, including a processor 401, a memory 402, and a bus 403. Among them, the memory 402 is used to store execution instructions, including a memory 4021 and an external memory 4022; the memory 4021 here is also called an internal memory, which is used to temporarily store the operation data in the processor 401, and the data exchanged with the external memory 4022 such as a hard disk. The processor 401 exchanges data with the external memory 4022 through the memory 4021. When the computer device 400 is running, the processor 401 communicates with the memory 402 through the bus 403, so that the processor 401 executes the following instructions:
[0104] In response to a target problem occurring in a first application, determining a target problem level of the target problem and a second application associated with the first application; wherein the second application is an application related to the target problem occurring in the first application;
[0105] When the target problem level is higher than a preset level, first log content corresponding to the first application within a target time period and second log content corresponding to the second application are obtained from log files stored in a first storage area of the log storage space, and the first log content and the second log content are stored in a second storage area of the log storage space; wherein, after the first storage area and the second storage area reach maximum storage capacity, the log coverage frequency of the first storage area is higher than that of the second storage area.
[0106] In a possible implementation manner, in the instruction executed by the processor 401, storing the first log content and the second log content in the second storage area of the log storage space includes:
[0107] Comparing the first log content and the second log content with the third log content of the log file currently stored in the second storage area respectively;
[0108] When the first log content and the third log content are different, the first log content is stored in the second storage area; and when the second log content and the third log content are different, the second log content is stored in the second storage area.
[0109] In a possible implementation manner, the instructions executed by the processor 401, after determining the target problem level of the target problem, further include:
[0110] determining a current problem level of a first log file written in the first storage area;
[0111] When the target problem level is higher than the current problem level of the first log file, the current problem level of the first log file is updated to the target problem level, and the correspondence between the file name of the first log file and the target problem level is stored.
[0112] In a possible implementation manner, the instructions executed by the processor 401 further include:
[0113] When the number of log files stored in the first storage area reaches a first target number, determining a first overwriting order of the log files based on the problem level of each log file stored in the first storage area;
[0114] Based on the first log file newly written into the first storage area, the log file is overwritten in accordance with the first overwriting sequence.
[0115] In a possible implementation manner, the instructions executed by the processor 401 further include:
[0116] When the number of log files stored in the second storage area reaches a second target number, determining a second overwriting order of the log files based on the writing order of the log files stored in the second storage area;
[0117] Based on the second log file newly written into the second storage area, the log file is overwritten according to the second overwriting sequence.
[0118] In a possible implementation manner, the instructions executed by the processor 401 further include:
[0119] In response to satisfying the log file upload condition, after the log file stored in the second storage area is uploaded, uploading the log file stored in the first storage area;
[0120] The log files stored in the first storage area and the second storage area are uploaded according to the order in which the log files are written or the level of the problem.
[0121] In a possible implementation manner, in the instruction executed by the processor 401, storing the first log content and the second log content in the second storage area of the log storage space includes:
[0122] The first log content and the second log content are written into a second log file currently written in the second storage area, and the current problem level of the second log file is updated based on the target problem level.
[0123] The disclosed embodiments also provide a vehicle, which can be used to execute the steps of the log storage method described in the above embodiments.
[0124] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the log storage method described in the above method embodiment are executed. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0125] The embodiment of the present disclosure also provides a computer program product, which carries a program code. The instructions included in the program code can be used to execute the steps of the log storage method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0126] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0127] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0129] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0130] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0131] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be based on the protection scope of the claims.
Claims
1. A log storage method, characterized in that: include: In response to a target problem occurring in a first application, determining a target problem level of the target problem and a second application associated with the first application; wherein the second application is an application related to the target problem occurring in the first application; When the target problem level is higher than a preset level, first log content corresponding to the first application within a target time period and second log content corresponding to the second application are obtained from log files stored in a first storage area of the log storage space, and the first log content and the second log content are stored in a second storage area of the log storage space; wherein, after the first storage area and the second storage area reach maximum storage capacity, the log coverage frequency of the first storage area is higher than that of the second storage area.
2. The method according to claim 1, characterized in that The storing the first log content and the second log content in the second storage area of the log storage space includes: Comparing the first log content and the second log content with the third log content of the log file currently stored in the second storage area respectively; When the first log content and the third log content are different, the first log content is stored in the second storage area; and when the second log content and the third log content are different, the second log content is stored in the second storage area.
3. The method according to claim 1, characterized in that: After determining the target problem level of the target problem, the method further includes: determining a current problem level of a first log file written in the first storage area; When the target problem level is higher than the current problem level of the first log file, the current problem level of the first log file is updated to the target problem level, and the correspondence between the file name of the first log file and the target problem level is stored.
4. The method according to claim 3, characterized in that The method further comprises: When the number of log files stored in the first storage area reaches a first target number, determining a first overwriting order of the log files based on the problem level of each log file stored in the first storage area; Based on the first log file newly written into the first storage area, the log file is overwritten in accordance with the first overwriting sequence.
5. The method according to claim 3, characterized in that: The method further comprises: In response to satisfying the log file upload condition, after the log file stored in the second storage area is uploaded, uploading the log file stored in the first storage area; The log files stored in the first storage area and the second storage area are uploaded according to the order in which the log files are written or the level of the problem.
6. The method according to claim 1, characterized in that The method further comprises: When the number of log files stored in the second storage area reaches a second target number, determining a second overwriting order of the log files based on the writing order of the log files stored in the second storage area; Based on the second log file newly written into the second storage area, the log file is overwritten according to the second overwriting sequence.
7. The method according to claim 1, characterized in that The storing the first log content and the second log content in the second storage area of the log storage space includes: The first log content and the second log content are written into a second log file currently written in the second storage area, and the current problem level of the second log file is updated based on the target problem level.
8. A vehicle, characterized in that: The vehicle is used to execute the steps of the log storage method as described in any one of claims 1 to 7 above.
9. A computer device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the machine-readable instructions are executed by the processor to perform the steps of the log storage method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed, the steps of the log storage method according to any one of claims 1 to 7 are implemented.