Information processing method, device, equipment and vehicle
By compressing part of the log file information in different dimensions and generating file association information, the problem of inconvenience in finding the compressed log file is solved, and efficient storage and search are achieved.
Patent Information
- Application Number
- CN202410361478.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-27
- Publication Date
- 2025-09-30
AI Technical Summary
In the prior art, the compression processing of log files causes the process of searching for log files to consume a large amount of processing resources and time. How to compress log files while reducing the inconvenience of using log files has become an urgent problem to be solved.
By obtaining some information from the log file, such as time code, state change code, process ID code and thread ID code, compression processing is performed using different dimensions to generate file association information and store it in a dictionary to represent the relationship between the compressed information and the log file, thereby achieving fast search and decompression.
It effectively reduces the amount of stored data, saves storage costs, improves the search efficiency of log files, and reduces the inconvenience of finding log files.
Smart Images

Figure CN120723740A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of information processing technology, and in particular relates to an information processing method, device, equipment and vehicle. Background Art
[0002] As vehicles become increasingly intelligent, they generate an increasing number of log files. This excessive number of log files not only takes up a significant amount of storage space, but also wastes significant data transmission resources when uploading them to the cloud. Therefore, existing methods often compress log files to reduce their size. However, this leads to the problem that when log files are needed, the sheer number of log files consumes significant processing resources and time when searching for them. Therefore, finding the right log files while compressing them is crucial. Summary of the Invention
[0003] The purpose of the embodiments of the present application is to provide an information processing method, apparatus, device and vehicle, which improve the efficiency of searching log files.
[0004] In a first aspect, an embodiment of the present application provides an information processing method, the method comprising:
[0005] Obtaining at least one piece of file information, where each piece of file information is partial information in a log file corresponding to the file information, and each piece of file information includes at least two sub-file information of time code information, state change code information, process ID code information, and thread ID code information, and dimensions of the at least two sub-file information are different from each other;
[0006] Compressing sub-file information with the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information;
[0007] At least two first compressed information are stored in a dictionary, and file association information is generated based on the at least two first compressed information and the compressed log file. The file association information is used to characterize the relationship between the at least two first compressed information in the dictionary and the compressed log file. The compressed log file includes a compressed file after the log file is compressed.
[0008] In an optional implementation of the first aspect, obtaining at least one piece of file information includes:
[0009] Get at least one log file;
[0010] For each log file in the at least one log file, extracting information to be processed from the log file, where the information to be processed includes at least two of time information, state change information, a process identifier, and a thread identifier;
[0011] The information to be processed is encoded to obtain file information corresponding to the log file.
[0012] In an optional implementation of the first aspect, the information to be processed includes state change information;
[0013] For each log file in the at least one log file, extract information to be processed from the log file, including:
[0014] For each log file in the at least one log file, state change information is extracted from the log file using a text matching algorithm.
[0015] In an optional implementation of the first aspect, before compressing sub-file information having the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information, the method further includes:
[0016] Using a first compression tool to compress at least one file information to obtain second compressed information corresponding to the at least one file information, each second compressed information including dimension information corresponding to at least two sub-file information;
[0017] Compressing sub-file information with the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information includes:
[0018] For each dimension information in the at least two dimension information, extract the dimension information from each second compressed information in the at least one second compressed information to obtain a dimension information group corresponding to the dimension information, where the dimension information group includes at least one dimension information;
[0019] The at least two dimensional information groups are respectively compressed using a second compression tool to obtain first compressed information corresponding to the at least two dimensional information groups. The first compression tool and the second compression tool are different compression tools.
[0020] In an optional implementation of the first aspect, before compressing sub-file information having the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information, the method further includes:
[0021] For each piece of file information in the at least one piece of file information, if a log file corresponding to the file information meets a preset condition, compress the file information based on a streaming compression method to obtain at least one piece of third compressed information, each piece of third compressed information including at least two pieces of sub-compressed information in different dimensions;
[0022] The preset conditions include that the log file is the log file generated by the Android system;
[0023] Compressing sub-file information with the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information includes:
[0024] The sub-compressed information with the same dimension in the at least one third compressed information is compressed according to different dimensions to obtain at least two first compressed information.
[0025] In a second aspect, an embodiment of the present application provides an information processing method, the method comprising:
[0026] Acquire information to be searched, where the information to be searched includes at least one of time search information, state change search information, process search identifier, and thread search identifier;
[0027] Searching the dictionary for target compressed information corresponding to the information to be searched, and searching for the compressed log file corresponding to the target compressed information based on file association information stored in the dictionary, the file association information being used to characterize a relationship between at least two first compressed information and the compressed log file;
[0028] Decompress the compressed log file to obtain the log file corresponding to the information to be searched;
[0029] The dictionary stores at least two pieces of first compression information, and the at least two pieces of first compression information include at least two of time compression information, state change compression information, process ID compression information, and thread ID compression information.
[0030] In a third aspect, an embodiment of the present application provides an information processing device, the device comprising:
[0031] an acquisition module, configured to acquire at least one piece of file information, each piece of file information being partial information in a log file corresponding to the file information, each piece of file information including at least two sub-file information of time code information, state change code information, process ID code information, and thread ID code information, wherein dimensions of the at least two sub-file information are different from each other;
[0032] a compression module, configured to compress sub-file information of the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information;
[0033] The storage module is used to store at least two first compressed information in a dictionary, and generate file association information based on the at least two first compressed information and the compressed log file. The file association information is used to characterize the relationship between the at least two first compressed information in the dictionary and the compressed log file. The compressed log file includes a compressed file after the log file is compressed.
[0034] In a fourth aspect, an embodiment of the present application provides an information processing device, the device comprising:
[0035] an acquisition module, configured to acquire information to be searched, the information to be searched comprising at least one of time search information, state change search information, process search identifier, and thread search identifier;
[0036] A search module, configured to search a dictionary for target compressed information corresponding to the information to be searched, and based on file association information stored in the dictionary, the file association information being used to characterize a relationship between at least two first compressed information and the compressed log file, search for a compressed log file corresponding to the target compressed information;
[0037] A decompression module is used to decompress the compressed log file to obtain the log file corresponding to the information to be searched;
[0038] The dictionary stores at least two pieces of first compression information, and the at least two pieces of first compression information include at least two of time compression information, state change compression information, process ID compression information, and thread ID compression information.
[0039] In a fifth aspect, an electronic device is provided, comprising a memory for storing computer program instructions; and a processor for reading and running the computer program instructions stored in the memory to execute the information processing method provided by any optional implementation method in the first aspect or the second aspect.
[0040] In a sixth aspect, a computer storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the information processing method provided by any optional implementation method in the first aspect or the second aspect is implemented.
[0041] In a seventh aspect, a computer program product is provided, the computer program product including a computer program, which, when executed by a processor, implements the information method provided by any optional implementation of the first aspect or the second aspect.
[0042] In a fifth aspect, a vehicle is provided, comprising at least one of the above-mentioned information processing device, electronic device, computer storage medium and computer program product.
[0043] In an embodiment of the present application, at least one file information can be obtained, each file information being a portion of the log file corresponding to the file information. Each file information includes at least two sub-file information of time code information, state change code information, process identification code information, and thread identification code information. The dimensions of the at least two sub-file information are different. Based on this, the sub-file information of the at least one file information having the same dimension can be compressed according to different dimensions to obtain at least two first compressed information. The at least two first compressed information can then be stored in a dictionary. Based on the at least two first compressed information and the compressed log file, file association information is generated. The file association information is used to characterize the relationship between the at least two first compressed information in the dictionary and the compressed log file. The compressed log file includes the log file after the log file is compressed. In this way, not only can the compressed storage of partial information in the log file significantly reduce the amount of data required for storage and save storage costs, but the generation of file association information can also reduce the inconvenience of subsequent log file search and use, thereby improving the efficiency of log file search. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0045] Figure 1 This is one of the flow charts of an information processing method provided in an embodiment of the present application;
[0046] Figure 2 This is the second flow chart of an information processing method provided in the embodiment of the present application.
[0047] Figure 3 This is a third flow chart of an information processing method provided in an embodiment of the present application;
[0048] Figure 4 This is a schematic diagram of the structure of an information processing device provided in an embodiment of the present application;
[0049] Figure 5 is a structural diagram of another information processing device provided in an embodiment of the present application;
[0050] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0053] To address the problems existing in the prior art, embodiments of the present application provide an information processing method, apparatus, device, and vehicle capable of obtaining at least one file information item. Each file information item is a portion of information from a corresponding log file. Each file information item includes at least two sub-file information items selected from time code information, state change code information, process identification code information, and thread identification code information. The dimensions of the at least two sub-file information items are different. Based on this, sub-file information items with the same dimensions within the at least one file information item can be compressed according to different dimensions to obtain at least two first compressed information items. The at least two first compressed information items can then be stored in a dictionary. File association information is generated based on the at least two first compressed information items and the compressed log file. The file association information is used to characterize the relationship between the at least two first compressed information items in the dictionary and the compressed log file. The compressed log file includes the compressed log file. In this manner, not only can the compressed storage of partial information from the log file significantly reduce the amount of data required for storage and save storage costs, but the generation of the file association information also reduces the inconvenience of subsequent log file search and use, thereby improving log file search efficiency.
[0054] It should be noted that the information processing method provided in the embodiments of the present application can be executed by an information processing device or a control module in the information processing device for executing the information processing method. In the embodiments of the present application, the information processing method provided in the embodiments of the present application is described in detail by taking the information processing device executing the information processing method as an example.
[0055] It should also be noted that the information processing device can be applied to the Compressed Log Processor (CLP) tool. The CLP tool (efficient and scalable compression on compressed text logs) is a tool that can losslessly compress unstructured text logs and can perform fast searches directly on compressed data.
[0056] The information processing method provided in the embodiments of the present application is described in detail below through specific embodiments in conjunction with the accompanying drawings.
[0057] Figure 1 It is a flowchart of an information processing method provided in an embodiment of the present application.
[0058] like Figure 1 As shown, the execution subject of the information processing method can be an information processing device. Based on this, the method can include the following steps:
[0059] S110: Obtain at least one file information.
[0060] In some embodiments, each of the aforementioned file information may include partial information from the log file corresponding to the file information. More specifically, each of the aforementioned file information may include at least two sub-file information items from the log file corresponding to the file information, including time code information, state change code information, process ID code information, and thread ID code information. Furthermore, the dimensions of the at least two sub-file information items are different from each other.
[0061] It should be noted that the above-mentioned time coding information may be information obtained by encoding the time information of the corresponding log file, wherein the above-mentioned time information may be information such as the timestamp of the log file. Correspondingly, the state change coding information may be information obtained by encoding the state change information of the corresponding log file, wherein the above-mentioned state change information may include state information in the log file that represents the system operation process. For example, if the system is a vehicle system, the state change search information may include information such as vehicle speed and acceleration, which is not limited here. The above-mentioned process identification coding information may be information obtained by encoding the process identification of the corresponding log file, wherein the above-mentioned process identification may be the process number in the log file. The above-mentioned thread identification coding information may be information obtained by encoding the thread identification of the corresponding log file, wherein the above-mentioned thread identification may be the thread number in the log file.
[0062] S120: Compress sub-file information with the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information.
[0063] Specifically, after the information processing device obtains at least one file information, since each file information in the at least one file information can include at least two sub-file information, and the dimensions of the at least two sub-file information are different from each other, the information processing device can compress the sub-file information with the same dimension in the obtained at least one file information according to different dimensions to obtain at least two first compressed information.
[0064] S130: Store at least two pieces of first compression information in a dictionary, and generate file association information according to the at least two pieces of first compression information and the compressed log file.
[0065] In some embodiments, the file association information is used to characterize the relationship between at least two first compressed information in the dictionary and the compressed log file, wherein the compressed log file includes a compressed file obtained by compressing the log file.
[0066] Specifically, after obtaining at least two pieces of first compressed information, the information processing device can store the at least two pieces of first compressed information in a dictionary, and can generate file association information according to the at least two pieces of first compressed information and the compressed log file.
[0067] In an embodiment of the present application, at least one file information can be obtained, each file information being a portion of the log file corresponding to the file information. Each file information includes at least two sub-file information of time code information, state change code information, process identification code information, and thread identification code information. The dimensions of the at least two sub-file information are different. Based on this, the sub-file information of the at least one file information having the same dimension can be compressed according to different dimensions to obtain at least two first compressed information. The at least two first compressed information can then be stored in a dictionary. Based on the at least two first compressed information and the compressed log file, file association information is generated. The file association information is used to characterize the relationship between the at least two first compressed information in the dictionary and the compressed log file. The compressed log file includes the log file after the log file is compressed. In this way, not only can the compressed storage of partial information in the log file significantly reduce the amount of data required for storage and save storage costs, but the generation of file association information can also reduce the inconvenience of subsequent log file search and use, thereby improving the efficiency of log file search.
[0068] In one embodiment, the above-mentioned step S110 may specifically include the following steps:
[0069] Get at least one log file;
[0070] For each log file in the at least one log file, extract information to be processed from the log file;
[0071] The information to be processed is encoded to obtain file information corresponding to the log file.
[0072] The information to be processed in each log file may include at least one of the time information, state change information, process ID, and thread ID in the log file, which is not limited here.
[0073] Specifically, the information processing device can obtain at least one log file, and for each log file in the at least one log file, extract information to be processed from the log file, and then encode the information to be processed to obtain file information corresponding to the log file.
[0074] In this embodiment, part of the information in the log file can be extracted from the obtained log file as information to be processed, and the information to be processed can be encoded so as to obtain valid file information corresponding to the log file, which also facilitates the subsequent compression and storage of part of the information in the log file, which not only reduces the amount of data that needs to be stored, but also saves storage costs.
[0075] In one embodiment, if the information to be processed includes state change information, the step of extracting the information to be processed from each log file in at least one log file may specifically include the following steps:
[0076] For each log file in the at least one log file, state change information is extracted from the log file using a text matching algorithm.
[0077] The text matching algorithm may be a related algorithm selected based on actual needs and is not limited here.
[0078] Specifically, in the case where the information to be processed includes state change information, the information processing apparatus can extract corresponding state change information from each log file in the at least one log file using a text matching algorithm.
[0079] In this embodiment, when the information to be processed includes state change information, the corresponding state change information can be extracted from each log file by using a text matching algorithm, thereby effectively improving the efficiency of information acquisition.
[0080] In some embodiments, as Figure 2 As shown, before the above-mentioned S120, the information processing method provided in the embodiment of the present application may further include the following steps:
[0081] S210: Obtain at least one file information. This is the same as the above-mentioned S110 and will not be described in detail here.
[0082] S220: Use the first compression tool to compress the at least one file information to obtain second compressed information corresponding to the at least one file information.
[0083] Each of the second compressed information may include dimension information corresponding to at least two sub-file information in the corresponding file information. That is, each of the second compressed information includes dimension information obtained by compressing at least two sub-file information among the time code information, state change code information, process ID code information, and thread ID code information in the corresponding file information.
[0084] In addition, the first compression tool may be a lightweight compression tool, for example, the clpir tool in the CLP tool, which is used to perform preliminary compression on file information.
[0085] Specifically, after obtaining at least one piece of file information, the information processing device can use a first compression tool to compress the at least one piece of file information to obtain second compressed information corresponding to the at least one piece of file information.
[0086] Based on this, the above S120 may specifically include the following steps:
[0087] S230 : For each dimension information in the at least two dimension information, extract the dimension information from each second compressed information in the at least one second compressed information to obtain a dimension information group corresponding to the dimension information.
[0088] The dimension information group includes at least one dimension information, that is, at least one dimension information corresponding to the at least one file information.
[0089] Specifically, after obtaining at least one second compressed information, since each second compressed information may include at least two dimensional information, the information processing apparatus can extract the dimensional information from each of the at least two dimensional information to obtain a dimensional information group corresponding to the dimensional information. In this way, at least two dimensional information groups can be obtained.
[0090] S240: Use a second compression tool to compress the at least two dimensional information groups respectively to obtain first compressed information corresponding to the at least two dimensional information groups respectively.
[0091] In some embodiments, the first compression tool and the second compression tool are different compression tools, wherein the second compression tool integrates a compression algorithm (Lempel-Ziv-Markovchain-Algorithm, Lzma) that is an improved and optimized compression algorithm of Deflate and LZ77.
[0092] Specifically, after obtaining at least two dimensional information groups, the information processing device can use the second compression tool to compress the at least two dimensional information groups respectively to obtain first compressed information corresponding to the at least two dimensional information groups, that is, it can obtain at least two first compressed information.
[0093] S250: Store at least two first compression information in a dictionary, and generate file association information based on the at least two first compression information and the compressed log file. This is the same as the content of S130 above and will not be described in detail here.
[0094] In this embodiment, the file information can be preliminarily compressed first, and then the compressed information obtained after the preliminarily compression can be compressed again according to different information categories, so that in the subsequent search process, the corresponding compressed information can be searched faster based on actual search needs, and the corresponding log file can be found faster, thereby improving the search efficiency.
[0095] In one embodiment, before S120, the information processing method may further include the following steps:
[0096] For each file information in the at least one file information, when a log file corresponding to the file information meets a preset condition, compression processing is performed on the file information based on a streaming compression method to obtain at least one third compressed information.
[0097] In some embodiments, the preset condition may include that the log file is a log file generated by an Android system. In addition, each of the third compressed information may include sub-compressed information obtained by compressing at least two sub-file information of the time code information, the state change code information, the process identifier code information, and the thread identifier code information in the corresponding file information using a streaming compression method.
[0098] Specifically, after obtaining at least one file information, the information processing device can compress each file information in the at least one file information based on a streaming compression method, when the log file corresponding to the file information is a log file generated by the Android system, to obtain third compressed information corresponding to the at least one file information, that is, to obtain at least one file information.
[0099] Based on this, the above S120 may specifically include the following steps:
[0100] The sub-compressed information with the same dimension in the at least one third compressed information is compressed according to different dimensions to obtain at least two first compressed information.
[0101] Specifically, after obtaining at least one third compressed information, the information processing apparatus can compress sub-compressed information with the same dimension in the at least one third compressed information according to different dimensions to obtain at least two first compressed information.
[0102] It should be noted that the method of compressing sub-compressed information with the same dimension in at least one third compressed information according to different dimensions to obtain at least two first compressed information is similar to the above-mentioned method of compressing sub-file information with the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information, and will not be elaborated here.
[0103] In this embodiment, when the log file meets the preset conditions, the file information corresponding to the log file can be compressed using a streaming compression method. In this way, compared with the traditional compression method, the file information can be compressed in real time while reading the file information, and there is no need to perform compression after the log writing is completed, which is convenient for reducing the amount of data subsequently written to the disk.
[0104] Based on this, the embodiment of the present application also provides a flow chart of an information processing method, as shown in FIG. Figure 3 As shown, the execution subject of the information processing method may be an information processing device, and the method may specifically include the following steps:
[0105] S310: Obtain information to be searched.
[0106] In some embodiments, the aforementioned information to be searched may include at least one of time search information, state change search information, process search identifier, and thread search identifier.
[0107] It should be noted that the aforementioned time search information may include information such as the timestamp of a log file; the aforementioned state change search information may include state information in the log file that represents the system's operation. For example, if the system is a vehicle system, the state change search information may include information such as vehicle speed and acceleration, without further limitation. The process search identifier may be the process number in the log file, and correspondingly, the thread search identifier may be the thread number in the log file, without further elaboration.
[0108] S320: Search the dictionary to obtain target compressed information corresponding to the information to be searched, and search for a compressed log file corresponding to the target compressed information based on the file association information stored in the dictionary.
[0109] In some embodiments, the file association information may be used to characterize the relationship between at least two first compressed information and a compressed log file, wherein the compressed log file includes a compressed file obtained by compressing the log file.
[0110] In addition, the above-mentioned dictionary can be understood as a storage space. Based on this, in some embodiments, the above-mentioned dictionary can store at least two first compressed information, and the at least two first compressed information can include at least two of time compressed information, state change compressed information, process ID compressed information, and thread ID compressed information.
[0111] It should be noted that the compressed time information may include at least one compressed time information, and each compressed time information corresponds to a log file. Accordingly, the compressed state change information may include at least one compressed state change information, and each compressed state change information corresponds to a log file. The compressed process ID information may include at least one compressed process ID, and each compressed process ID corresponds to a log file. The compressed thread ID information may include at least one compressed thread ID. Each compressed thread ID may correspond to a log file.
[0112] It should also be noted that the above-mentioned target compressed information may include part of the information in the log file corresponding to the information to be searched, that is, the target compressed information may include at least one of the compressed information of the time information, state change information, process ID and thread ID in the log file corresponding to the information to be searched.
[0113] Specifically, since at least two first compression information are stored in the dictionary, and the at least two first compression information can include at least two of time compression information, state change compression information, process ID compression information and thread ID compression information, the information processing device can, after obtaining the information to be searched, search for the target compression information corresponding to the information to be searched from at least one first compression information stored in the dictionary, and can search for the compressed log file corresponding to the target compression information based on the file association information stored in the dictionary.
[0114] Since a log file may include information such as time information, state change information, process ID, and thread ID, as well as information such as static text content, in some embodiments, the file association information mentioned above may also include sub-association information, which is used to characterize the relationship between at least two first compressed information and the compressed text. Based on this, the above-mentioned S320 may include the following steps:
[0115] The target compressed information corresponding to the information to be searched is searched from the dictionary, and the compressed text corresponding to the target compressed information is searched based on the file association information stored in the dictionary; the compressed log file is determined based on the target compressed information and the compressed text.
[0116] Specifically, after obtaining the information to be searched, the information processing device can search for the target compression information corresponding to the information to be searched from the dictionary, and based on the file association information stored in the dictionary, search for the compressed text corresponding to the target compression information, and then determine the compressed log file based on the target compression information and the compressed text.
[0117] S330: decompress the compressed log file to obtain a log file corresponding to the information to be searched.
[0118] Specifically, after obtaining the compressed log file through searching, the information processing device can decompress the compressed log file to obtain a log file corresponding to the information to be searched.
[0119] In an embodiment of the present application, it is possible to obtain information to be searched, which may include at least one of time search information, state change search information, process search identifier, and thread identifier search information. Based on this, it is possible to search for target compressed information corresponding to the information to be searched from a dictionary, and based on the file association information stored in the dictionary, it is possible to search for a compressed log file corresponding to the target compressed information, and then it is possible to decompress the compressed log file to obtain a log file corresponding to the information to be searched. In this way, it is possible to directly search for compressed information stored in the dictionary, and decompress the compressed log file obtained by the search to obtain the corresponding log file. Compared with the prior art method of decompressing all log files and then searching for the corresponding log file during the log file search process, this method not only reduces the inconvenience in the use of log files, but also reduces the search resources for log files, and improves the search efficiency and flexibility of log files.
[0120] Based on the same inventive concept, the embodiment of the present application also provides an information processing device, which can be specifically combined with Figure 4 The information processing device provided in the embodiments of the present application is described in detail.
[0121] Figure 4 It is a structural diagram of an information processing device provided in an embodiment of the present application.
[0122] like Figure 4 As shown, the information processing device 400 may include: an acquisition module 410 , a compression module 420 and a storage module 430 .
[0123] An acquisition module 410 is configured to acquire at least one piece of file information, where each piece of file information is a portion of information in a corresponding log file, and each piece of file information includes at least two sub-file information of time code information, state change code information, process ID code information, and thread ID code information, where the dimensions of the at least two sub-file information are different from each other.
[0124] A compression module 420 is configured to compress sub-file information of the same dimension in at least one file information according to different dimensions to obtain at least two first compressed information;
[0125] The storage module 430 is used to store at least two first compressed information in a dictionary, and generate file association information based on the at least two first compressed information and the compressed log file. The file association information is used to characterize the relationship between the at least two first compressed information in the dictionary and the compressed log file. The compressed log file includes a compressed file after the log file is compressed.
[0126] In one embodiment, the above-mentioned information processing device may further include an extraction module and an encoding module.
[0127] An acquisition module, specifically used to acquire at least one log file;
[0128] an extraction module, configured to extract, from each of the at least one log file, information to be processed, the information to be processed comprising at least two of time information, state change information, a process identifier, and a thread identifier;
[0129] The encoding module is used to encode the information to be processed to obtain file information corresponding to the log file.
[0130] In one embodiment, the information to be processed includes state change information. Based on this, the extraction module is specifically configured to:
[0131] For each log file in the at least one log file, state change information is extracted from the log file using a text matching algorithm.
[0132] In one embodiment, the compression module is further configured to compress the at least one file information using the first compression tool to obtain second compressed information corresponding to the at least one file information, each second compressed information including dimension information corresponding to at least two sub-file information.
[0133] Based on this, the information processing device provided in the embodiment of the present application may further include an extraction module.
[0134] an extraction module, configured to extract dimension information from each second compressed information in the at least one second compressed information for each dimension information in the at least two dimension information, to obtain a dimension information group corresponding to the dimension information, the dimension information group including at least one dimension information;
[0135] The compression module is specifically used to compress at least two dimensional information groups respectively using a second compression tool to obtain first compressed information corresponding to the at least two dimensional information groups respectively. The first compression tool and the second compression tool are different compression tools.
[0136] In one embodiment, the compression module is further configured to compress each file information in the at least one file information based on a streaming compression method to obtain at least one third compressed information, where each third compressed information includes at least two sub-compressed information of different dimensions, if the log file corresponding to the file information meets a preset condition; the preset condition includes that the log file is a log file generated by the Android system;
[0137] Based on this, the compression module is specifically configured to compress sub-compressed information with the same dimension in at least one third compressed information according to different dimensions to obtain at least two first compressed information.
[0138] In an embodiment of the present application, at least one file information can be obtained, each file information being a portion of the log file corresponding to the file information. Each file information includes at least two sub-file information of time code information, state change code information, process identification code information, and thread identification code information. The dimensions of the at least two sub-file information are different. Based on this, the sub-file information of the at least one file information having the same dimension can be compressed according to different dimensions to obtain at least two first compressed information. The at least two first compressed information can then be stored in a dictionary. Based on the at least two first compressed information and the compressed log file, file association information is generated. The file association information is used to characterize the relationship between the at least two first compressed information in the dictionary and the compressed log file. The compressed log file includes the log file after the log file is compressed. In this way, not only can the compressed storage of partial information in the log file significantly reduce the amount of data required for storage and save storage costs, but the generation of file association information can also reduce the inconvenience of subsequent log file search and use, thereby improving the efficiency of log file search.
[0139] Each module in the information processing device provided in the embodiment of the present application can be used to implement Figure 1 or Figure 2 The method steps of the illustrated embodiment can achieve the corresponding technical effects, which will not be described in detail here for the sake of brevity.
[0140] Based on the same inventive concept, the embodiment of the present application also provides an information processing device, which can be specifically combined with Figure 5 The information processing device provided in the embodiments of the present application is described in detail.
[0141] Figure 5 It is a structural diagram of an information processing device provided in an embodiment of the present application.
[0142] like Figure 5 As shown, the information processing device 500 may include: an acquisition module 510 , a search module 520 and a decompression module 530 .
[0143] An acquisition module 510 is configured to acquire information to be searched, where the information to be searched includes at least one of time search information, state change search information, process search identifier, and thread search identifier;
[0144] A search module 520 is configured to search a dictionary for target compressed information corresponding to the information to be searched, and based on file association information stored in the dictionary, the file association information being used to characterize a relationship between at least two first compressed information and the compressed log file, search for a compressed log file corresponding to the target compressed information;
[0145] The decompression module 530 is used to decompress the compressed log file to obtain the log file corresponding to the information to be searched;
[0146] The dictionary stores at least two pieces of first compression information, and the at least two pieces of first compression information include at least two of time compression information, state change compression information, process ID compression information, and thread ID compression information.
[0147] In an embodiment of the present application, it is possible to obtain information to be searched, which may include at least one of time search information, state change search information, process search identifier, and thread identifier search information. Based on this, it is possible to search for target compressed information corresponding to the information to be searched from a dictionary, and based on the file association information stored in the dictionary, it is possible to search for a compressed log file corresponding to the target compressed information, and then it is possible to decompress the compressed log file to obtain a log file corresponding to the information to be searched. In this way, it is possible to directly search for compressed information stored in the dictionary, and decompress the compressed log file obtained by the search to obtain the corresponding log file. Compared with the prior art method of decompressing all log files and then searching for the corresponding log file during the log file search process, this method not only reduces the inconvenience in the use of log files, but also reduces the search resources for log files, and improves the search efficiency and flexibility of log files.
[0148] Each module in the information processing device provided in the embodiment of the present application can be used to implement Figure 3 The method steps of the illustrated embodiment can achieve the corresponding technical effects, which will not be described in detail here for the sake of brevity.
[0149] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0150] The electronic device may include a processor 601 and a memory 602 storing computer program instructions.
[0151] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0152] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 602 may include removable or non-removable (or fixed) media. Where appropriate, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.
[0153] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0154] The processor 601 implements any one of the information processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .
[0155] In one example, the electronic device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.
[0156] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0157] Bus 610 includes hardware, software or both, and the parts of online data flow metering equipment are coupled to each other. For example, but not limitation, bus can include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 can include one or more buses. Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.
[0158] In addition, in combination with the information processing method in the above embodiment, the present application embodiment may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, the information processing method provided in the present application embodiment is implemented.
[0159] An embodiment of the present application also provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the information processing method provided in the embodiment of the present application.
[0160] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0161] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0162] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0163] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable information processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable information processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0164] The above is only a specific implementation method of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited to this. Any technician familiar with this technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the scope of protection of this application.
[0165] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article or device. In the absence of further limitations, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device that includes the element.
Claims
1. An information processing method, characterized in that: The method comprises: Acquire at least one file information, where each file information is partial information in a log file corresponding to the file information, and each file information includes at least two sub-file information of time code information, state change code information, process ID code information, and thread ID code information, and dimensions of the at least two sub-file information are different from each other; compressing sub-file information with the same dimension in the at least one file information according to different dimensions to obtain at least two first compressed information; At least two first compressed information are stored in the dictionary, and file association information is generated based on the at least two first compressed information and the compressed log file. The file association information is used to characterize the relationship between the at least two first compressed information in the dictionary and the compressed log file, and the compressed log file includes a compressed file after the log file is compressed.
2. The method according to claim 1, characterized in that The obtaining of at least one piece of file information includes: Get at least one log file; For each log file in the at least one log file, extracting information to be processed from the log file, the information to be processed including at least two of time information, state change information, a process identifier, and a thread identifier; The information to be processed is encoded to obtain file information corresponding to the log file.
3. The method according to claim 2, characterized in that The information to be processed includes state change information; The extracting information to be processed from each log file in the at least one log file includes: For each log file in the at least one log file, the state change information is extracted from the log file using a text matching algorithm.
4. The method according to claim 1, wherein Before compressing the sub-file information of the same dimension in the at least one file information according to different dimensions to obtain at least two first compressed information, the method further includes: Using a first compression tool to compress the at least one file information respectively to obtain second compressed information corresponding to the at least one file information respectively, each second compressed information including dimension information corresponding to the at least two sub-file information respectively; The compressing sub-file information with the same dimension in the at least one file information according to different dimensions to obtain at least two first compressed information includes: For each dimension information in the at least two dimension information, extract the dimension information from each second compressed information in the at least one second compressed information to obtain a dimension information group corresponding to the dimension information, where the dimension information group includes the at least one dimension information; A second compression tool is used to compress at least two dimensional information groups respectively to obtain first compressed information corresponding to the at least two dimensional information groups respectively, and the first compression tool and the second compression tool are different compression tools.
5. The method according to claim 1, wherein Before compressing sub-file information having the same dimension in the at least one file information according to different dimensions to obtain at least two first compressed information, the method further includes: For each piece of file information in the at least one piece of file information, if a log file corresponding to the piece of file information meets a preset condition, compress the piece of file information based on a streaming compression method to obtain at least one piece of third compressed information, each piece of the third compressed information including at least two pieces of sub-compressed information of different dimensions; The preset condition includes that the log file is a log file generated by the Android system; The compressing sub-file information with the same dimension in the at least one file information according to different dimensions to obtain at least two first compressed information includes: The sub-compressed information with the same dimension in the at least one third compressed information is compressed according to different dimensions to obtain at least two first compressed information.
6. An information processing method, characterized in that: The method comprises: Acquire information to be searched, where the information to be searched includes at least one of time search information, state change search information, process search identifier, and thread search identifier; Searching the dictionary for target compressed information corresponding to the information to be searched, and searching for a compressed log file corresponding to the target compressed information based on file association information stored in the dictionary, the file association information being used to characterize a relationship between the at least two first compressed information and the compressed log file; Decompressing the compressed log file to obtain a log file corresponding to the information to be searched; The dictionary stores at least two pieces of first compression information, and the at least two pieces of first compression information include at least two of time compression information, state change compression information, process ID compression information, and thread ID compression information.
7. An information processing device, characterized in that The device comprises: an acquisition module, configured to acquire at least one piece of file information, each piece of file information being partial information in a log file corresponding to the file information, each piece of file information including at least two sub-file information of time code information, state change code information, process ID code information, and thread ID code information, wherein dimensions of the at least two sub-file information are different from each other; a compression module, configured to compress sub-file information of the same dimension in the at least one file information according to different dimensions to obtain at least two first compressed information; A storage module is used to store at least two first compressed information in the dictionary, and generate file association information based on the at least two first compressed information and the compressed log file, wherein the file association information is used to characterize the relationship between the at least two first compressed information in the dictionary and the compressed log file, and the compressed log file includes a compressed file after the log file is compressed.
8. An information processing device, characterized in that The device comprises: an acquisition module, configured to acquire information to be searched, wherein the information to be searched includes at least one of time search information, state change search information, process search identifier, and thread search identifier; a search module configured to search the dictionary for target compressed information corresponding to the information to be searched, and search for a compressed log file corresponding to the target compressed information based on file association information stored in the dictionary, the file association information being used to characterize a relationship between the at least two first compressed information and the compressed log file; A decompression module, configured to decompress the compressed log file to obtain a log file corresponding to the information to be searched; The dictionary stores at least two pieces of first compression information, and the at least two pieces of first compression information include at least two of time compression information, state change compression information, process ID compression information, and thread ID compression information.
9. An electronic device, characterized in that: The apparatus includes a processor and a memory storing computer program instructions; The processor reads and executes the computer program instructions to implement the information processing method according to any one of claims 1 to 6.
10. A vehicle, characterized in that: Include at least one of the following: The information processing device according to claim 7; The information processing device according to claim 8; The electronic device according to claim 9.