Log file, log storage method and device, wearable device and storage medium

CN115269532BActive Publication Date: 2026-08-28XIAN GOERTEK ELECTRONIC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210249589.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-14
Publication Date
2026-08-28
Estimated Expiration
2042-03-14

AI Technical Summary

Technical Problem

[0004]本发明的主要目的在于提供了一种日志文件、日志存储方法、装置、可穿戴设备及存储介质,旨在解决现有技术可穿戴设备的日志文件占用存储空间大的技术问题

Benefits of technology

[0031] This invention proposes a log file comprising a header information field, a timestamp field, a hash value field, and a parameter information field. The header information field stores log identifier information, the timestamp field stores the log's timestamp, the hash value field stores the log's hash value, and the parameter information field stores the log data. Because the log file proposed in this invention includes header information, timestamp, hash value, and parameter information fields, log-related information is stored in the corresponding fields, reducing the storage space occupied by log files in wearable devices and increasing the log storage capacity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269532B_ABST
    Figure CN115269532B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of wearable devices, and discloses a log file, a log storage method and device, a wearable device and a storage medium, the log file comprises a head information field, a timestamp field, a hash value field and a parameter information field; wherein the head information field is used for storing identification information of the log, the timestamp field is used for storing a timestamp of the log, the hash value field is used for storing a hash value of the log, and the parameter information field is used for storing log data of the log. Since the log file comprises the head information field, the timestamp field, the hash value field and the parameter information field, information related to the log is stored in the corresponding fields, the storage space occupied by the log file in the wearable device is reduced, and the storage capacity of the log is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wearable device technology, and in particular to a log file, log storage method, apparatus, wearable device, and storage medium. Background Technology

[0002] The advent of the Internet of Things era has greatly facilitated our daily lives. Various wearable devices have appeared in our daily lives, and more and more software has been developed for wearable devices. During the operation of the software, the operating system records the logs generated by each software to facilitate subsequent software optimization. However, storing these logs requires a certain amount of storage space. Due to the limitation of storage space in wearable devices, the number of logs stored in wearable devices is relatively small. Therefore, how to increase the number of logs stored in wearable devices has become an urgent technical problem to be solved.

[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this invention is to provide a log file, log storage method, apparatus, wearable device, and storage medium, aiming to solve the technical problem of large storage space occupied by log files in existing wearable devices.

[0005] To achieve the above objectives, the present invention proposes a log file, which includes a header information field, a timestamp field, a hash value field, and a parameter information field;

[0006] The header information field is used to store the log's identification information, the timestamp field is used to store the log's timestamp, the hash value field is used to store the log's hash value, and the parameter information field is used to store the log data.

[0007] Optionally, the header information fields include a hash header information field, a version information field, an offset address field, and a log entry number field.

[0008] The hash header information field is used to store device information of the target software running device, the version information field is used to store software version information of the target software, the offset address field is used to store the offset address of the log in the target memory, and the log number field is used to store the number of log entries in the log file.

[0009] To achieve the above objectives, the present invention provides a log storage method, the method comprising the following steps:

[0010] Determine the trigger information for the target software to generate logs within a preset time period;

[0011] Fold logs with the same trigger information using timestamps;

[0012] The folded timestamp is stored in the timestamp field, and the hash value and log data of each log with the same timestamp are stored in the hash value field and parameter information field corresponding to the timestamp field, respectively.

[0013] Optionally, after storing the folded timestamp in the timestamp field and storing the hash values ​​and log data of each log with the same timestamp in the hash value field and parameter information field corresponding to the timestamp field respectively, the method further includes:

[0014] Get the number of log entries in the log file and the offset address of the log in the target storage;

[0015] The offset address is stored in the offset address field, and the number of log entries is stored in the log entry number field.

[0016] Optionally, the trigger information for determining the target software to generate logs within a preset time period includes:

[0017] Read the hash value corresponding to each log from the logs generated by the target software within a preset time period;

[0018] The trigger information for the corresponding log is determined based on the hash value.

[0019] Optionally, the process of timestamping logs with the same trigger information includes:

[0020] If the hash values ​​corresponding to the logs are the same, it is determined that the corresponding logs have the same trigger information;

[0021] Logs with the same trigger information will be timestamped.

[0022] Optionally, before determining the trigger information for the target software to generate logs within a preset time period, the method further includes:

[0023] When the target software starts, obtain the software version information of the target software and the device information of the device on which the target software runs;

[0024] The device information is stored in the hash header information field, and the software version information is stored in the version information field to generate a log file corresponding to the target software.

[0025] Furthermore, to achieve the above objectives, the present invention also proposes a log storage device, the log storage device comprising:

[0026] The determination module is used to determine the trigger information for the target software to generate logs within a preset time period;

[0027] The folding module is used to fold logs with the same trigger information using timestamps.

[0028] The storage module is used to store the folded timestamp into the timestamp field, and to store the hash value and log data of each log with the same timestamp into the hash value field and parameter information field corresponding to the timestamp field, respectively.

[0029] Furthermore, to achieve the above objectives, the present invention also proposes a wearable device, the wearable device comprising: a memory, a processor, and a log storage program stored in the memory and executable on the processor, the log storage program being configured to implement the steps of the log storage method as described above.

[0030] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a log storage program, which, when executed by a processor, implements the steps of the log storage method described above.

[0031] This invention proposes a log file comprising a header information field, a timestamp field, a hash value field, and a parameter information field. The header information field stores log identifier information, the timestamp field stores the log's timestamp, the hash value field stores the log's hash value, and the parameter information field stores the log data. Because the log file proposed in this invention includes header information, timestamp, hash value, and parameter information fields, log-related information is stored in the corresponding fields, reducing the storage space occupied by log files in wearable devices and increasing the log storage capacity. Attached Figure Description

[0032] Figure 1 This is a schematic diagram of the structure of a wearable device in the hardware operating environment involved in the embodiments of the present invention;

[0033] Figure 2 This is a schematic diagram of the file structure of the first embodiment of the log file of the present invention;

[0034] Figure 3 This is a schematic diagram of the file structure of an embodiment of the log file of the present invention;

[0035] Figure 4 This is a flowchart illustrating the first embodiment of the log storage method of the present invention;

[0036] Figure 5 This is a flowchart illustrating the second embodiment of the log storage method of the present invention;

[0037] Figure 6 This is a schematic diagram of the file structure of a prior art log file in one embodiment of the log storage method of the present invention;

[0038] Figure 7 This is a structural block diagram of the first embodiment of the log storage device of the present invention.

[0039] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0040] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0041] Reference Figure 1 , Figure 1 This is a schematic diagram of the wearable device structure of the hardware operating environment involved in the embodiments of the present invention.

[0042] like Figure 1 As shown, the wearable device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.

[0043] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on wearable devices and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0044] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a log storage program.

[0045] exist Figure 1In the wearable device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the wearable device of the present invention can be set in the wearable device, and the wearable device calls the log storage program stored in the memory 1005 through the processor 1001 and executes the log storage method provided in the embodiment of the present invention.

[0046] This invention provides a log file, referring to... Figure 2 , Figure 2 This is a schematic diagram of the structure of the first embodiment of the log file of the present invention.

[0047] In this embodiment, the log file includes: a header information field, a timestamp field, a hash value field, and a parameter information field; wherein, the header information field is used to store the log's identification information, the timestamp field is used to store the log's timestamp, the hash value field is used to store the log's hash value, and the parameter information field is used to store the log data.

[0048] It is understandable that the identification information includes information such as the software information that generates the log, the device information of the device on which the software runs, the storage location of the log in the memory, and the number of log entries stored in the memory; the hash value can be the hash value obtained by hashing specific descriptive characters; and the log data can be the specific running data of the software recorded by the operating system.

[0049] In a specific implementation, assuming that the log file in this embodiment is used for a wearable device, the header information field of the log file stores information such as the software information that generates the log in the wearable device, the device information of the wearable device, the storage location of the log in the memory of the wearable device, and the number of log entries stored in the memory. The timestamp field is used to store the generation time of the log, the hash value field is used to store the hash value obtained after hashing the description character, and the parameter information field is used to store the specific running data of the software. It should be noted that when the software generates the log, the description character is replaced with the corresponding hash value, and no further hashing is required.

[0050] Furthermore, since this embodiment stores logs using hash values ​​corresponding to descriptive characters, and the hashed string is irreversible, subsequent log analysis requires parsing the logs, i.e., looking up the mapping table between the original descriptive characters and hash values ​​generated during the hash operation. In existing technologies, the log information and the mapping table are loosely coupled, resulting in low efficiency and accuracy in log parsing. (Refer to...) Figure 3To improve the parsing speed and accuracy of logs, the header information field includes a hash header information field, a version information field, an offset address field, and a log entry number field. The hash header information field is used to store the device information of the target software running device, the version information field is used to store the software version information of the target software, the offset address field is used to store the offset address of the log in the target memory, and the log entry number field is used to store the number of log entries in the log file.

[0051] Understandably, device information includes device model, device machine code, and device identification code; the operating device can be a wearable device, such as a smart bracelet, smartwatch, or smart glasses; the header information field may also include a reserved byte field for storing other log-related information, such as the version number of the target software and other device information.

[0052] In a specific implementation, assuming the log file of this embodiment is applied to a smartwatch, the smartwatch model is A001, the software B version information is B2.0, the log generated by software B is located in the memory at position 001-089, the number of log entries is 30, the timestamp is abc, the hash value is 1A2B3C4D, the specific running data of the software is yymmdd, the hash header information field stores information A001, the version information field stores information B2.0, the offset address field stores information 001-089, the log entry number field stores information 30, the timestamp field stores information abc, the hash value field stores information 1A2B3C4D, and the parameter information field stores information yymmdd.

[0053] It should be understood that by storing logs based on the aforementioned log files, the corresponding mapping table can be accurately and quickly found based on the device and software information stored in the hash header information field and the version information field during subsequent log parsing, which can improve the speed and accuracy of log parsing.

[0054] This embodiment proposes a log file that includes a header information field, a timestamp field, a hash value field, and a parameter information field. The header information field stores the log's identifier information, the timestamp field stores the log's timestamp, the hash value field stores the log's hash value, and the parameter information field stores the log data. Because the log file proposed in this embodiment includes header information, timestamp, hash value, and parameter information fields, storing log-related information in the corresponding fields reduces the storage space occupied by log files in wearable devices and increases the log's storage capacity.

[0055] This invention provides a log storage method, referring to... Figure 4, Figure 4 This is a flowchart illustrating the first embodiment of the log storage method of the present invention.

[0056] In this embodiment, the log storage method includes the following steps:

[0057] Step S10: Determine the trigger information for the target software to generate logs within a preset time period.

[0058] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a wearable device, tablet computer, personal computer, mobile phone, etc., or an electronic device or log storage device capable of performing the above functions. The following description uses a wearable device as an example to illustrate this embodiment and the subsequent embodiments.

[0059] It is understandable that the trigger information can be information that triggers the target software to generate logs, and the target software can generate corresponding logs based on the trigger information; within a preset time period, the target software can generate several logs based on the same trigger information.

[0060] Step S20: Timestamp folding of logs with the same trigger information.

[0061] It should be understood that within a preset time period, the target software can generate several logs based on the trigger information. In the prior art, when such several logs exist, a timestamp is generated for each log and the log is stored in the memory of the wearable device. The timestamp folding of logs with the same trigger information can be done by folding several timestamps corresponding to several logs generated based on the same trigger information within a preset time period, and only one timestamp is retained for the several logs after timestamp folding.

[0062] Step S30: Store the folded timestamp in the timestamp field, and store the hash value and log data of each log with the same timestamp in the hash value field and parameter information field corresponding to the timestamp field, respectively.

[0063] Understandably, after timestamp folding, the log retains only one timestamp, which is stored in the timestamp field of the log file. The hash value and log data of each log are then stored in the hash value field and parameter information field corresponding to the timestamp field, respectively.

[0064] In the specific implementation, the wearable device determines the trigger information that triggers the target software to generate logs within a preset time period. Several logs generated by the target software based on the same trigger information within the preset time period are timestamped. Only one timestamp is retained for the several logs after timestamping. This timestamp is stored in the timestamp field of the log file. The hash value and log data of each log are stored sequentially in the hash value field and parameter information field corresponding to the timestamp field.

[0065] For example, the trigger message is: today is%y-%m-%d. The hash value obtained by hashing the trigger message is 1A2B3C4D. The target software is A, and the preset duration is 1 second. During the operation of the target software A, the trigger message today is%y-%m-%d will trigger the target software A to print 3 logs within 1 second. The log data corresponding to the 3 logs are yy mmaa, yy mm bb, and yy mm cc, respectively. The wearable device will fold the timestamps of the 3 logs, keeping only one timestamp, and store the hash value 1A2B3C4D in the 3 hash value fields, and store yy mm aa, yy mm bb, and yy mm cc in the 3 parameter information fields. The final log storage format can be referred to Table 1 below.

[0066] Table 1

[0067]

[0068] Furthermore, in order to improve the efficiency of log lookup, after step S30, the method further includes: obtaining the number of log entries in the log file and the offset address of the log in the target memory; storing the offset address in the offset address field and storing the number of log entries in the log entry number field.

[0069] In a specific implementation, the wearable device obtains the number of log entries generated by the target software stored in the log file and the offset address of the log in the target memory. It stores the number of log entries in the log entry number field and the offset address in the offset address field.

[0070] Furthermore, in order to reduce the storage space occupied by the logs, step S10 includes: reading the hash value corresponding to each log from the logs generated by the target software within a preset time period; and determining the trigger information of the corresponding log based on the hash value.

[0071] It is understandable that if logs have the same trigger information, then the hash values ​​in the logs will be the same.

[0072] In practice, the wearable device reads the hash value from the logs generated by the target software within a preset time period. When the hash values ​​are the same, it is determined that the corresponding logs have the same trigger information.

[0073] Furthermore, in order to reduce the storage space occupied by logs, step S20 includes: when the hash values ​​corresponding to logs are the same, determining that the corresponding logs have the same trigger information; and folding the timestamps of logs with the same trigger information.

[0074] Furthermore, before determining the trigger information for the target software to generate logs within a preset time period, the method further includes: obtaining the software version information of the target software; and determining the log file corresponding to the target software based on the software version information.

[0075] In the specific implementation, the wearable device reads the hash value from the logs generated by the target software within a preset time period. When the hash values ​​are the same, it is determined that the corresponding logs have the same trigger information. Several logs with the same trigger information within the preset time period are timestamped. After the timestamping, only one timestamp is retained for the several logs. This timestamp is stored in the timestamp field. The hash value and log data of each log are stored in the hash value field and parameter information field corresponding to the timestamp, respectively.

[0076] This embodiment determines the trigger information for the target software to generate logs within a preset time period; timestamps are folded into logs with the same trigger information; the folded timestamps are stored in the timestamp field, and the hash values ​​and log data of each log with the same timestamp are stored in the hash value field and parameter information field corresponding to the timestamp field, respectively. Because this embodiment timestamps logs generated by the target software based on the same trigger information within a preset time period, stores the folded timestamps in the timestamp field, and stores the hash values ​​and log data of each log with the same timestamp in the corresponding hash value field and parameter information field, it solves the technical problem in the prior art where each log contains a magic word and a timestamp, resulting in a large storage space occupied by the logs, thus increasing the log storage capacity of wearable devices.

[0077] refer to Figure 5 , Figure 5 This is a flowchart illustrating the second embodiment of the log storage method of the present invention.

[0078] Based on the first embodiment described above, in this embodiment, before step S10, the method further includes:

[0079] Step S01: When the target software starts, obtain the software version information of the target software and the device information of the device on which the target software runs.

[0080] In practice, when the target software starts, the wearable device obtains the software version information of the target software and its own device information, including device signal, device machine number and device identification code.

[0081] Step S02: Store the device information in the hash header information field and the software version information in the version information field to generate a log file corresponding to the target software.

[0082] In practice, when the target software starts, the wearable device stores the software version information of the target software and the device model of the wearable device in the hash header information field and the version information field, respectively, to generate the log file corresponding to the target software.

[0083] For example, log files in existing technologies can be referenced. Figure 6 This includes magic words, timestamps, hash values, and parameter information. Assuming each parameter occupies 4 bytes of storage, a log entry with 4 parameters occupies a total of 4 + 4 + 4 + 1 + 4 * 4 = 29 bytes. If 50,000 log entries need to be stored, the total number of bytes occupied is 1,450,000 bytes. In the log file of this embodiment, the hash header field, version information field, offset address field, and log entry number field exist only once in each document. Therefore, the header field occupies 4 + 128 + 4 + 4 = 140 bytes. The logs generated by the target software within a preset time period based on the same trigger information are then processed... With timestamp folding, assuming three logs are printed within one second based on the same trigger information, and each log still has three parameters, then the number of bytes occupied by the three logs after timestamp folding is 4 + 3 * (4 + 1 + 4 * 4) = 67. Therefore, each log occupies approximately 23 bytes, and the total number of bytes occupied by 50,000 logs is 140 + 50,000 * 23 = 1,150,140. Compared with the log files of the prior art, this embodiment saves 299,860 bytes of storage space. If the number of logs printed within the same time period based on the same trigger information increases, the storage space saved by this embodiment compared with the prior art will further increase.

[0084] In this embodiment, upon startup of the target software, the software version information and the device information of the device on which the target software runs are obtained. The device information is stored in the hash header field, and the software version information is stored in the version information field to generate a log file corresponding to the target software. Because this embodiment stores the obtained software version information and device information in the version information field and hash header field respectively to generate a log file corresponding to the target software, the corresponding mapping table can be quickly found based on the software version information and device information during subsequent log parsing, improving the speed and accuracy of log parsing.

[0085] Furthermore, embodiments of the present invention also propose a storage medium storing a log storage program, wherein the log storage program, when executed by a processor, implements the steps of the log storage method described above.

[0086] Reference Figure 7 , Figure 7 This is a structural block diagram of the first embodiment of the log storage device of the present invention.

[0087] like Figure 7 As shown, the log storage device proposed in this embodiment of the invention includes: a determination module 10, a folding module 20, and a storage module 30.

[0088] The determining module 10 is used to determine the trigger information for the target software to generate logs within a preset time period;

[0089] The folding module 20 is used to fold logs with the same trigger information using timestamps;

[0090] The storage module 30 is used to store the folded timestamp into the timestamp field, and to store the hash value and log data of each log with the same timestamp into the hash value field and parameter information field corresponding to the timestamp field, respectively.

[0091] This embodiment determines the trigger information for the target software to generate logs within a preset time period; timestamps are folded into logs with the same trigger information; the folded timestamps are stored in the timestamp field, and the hash values ​​and log data of each log with the same timestamp are stored in the hash value field and parameter information field corresponding to the timestamp field, respectively. Because this embodiment timestamps logs generated by the target software based on the same trigger information within a preset time period, stores the folded timestamps in the timestamp field, and stores the hash values ​​and log data of each log with the same timestamp in the corresponding hash value field and parameter information field, it solves the technical problem in the prior art where each log contains a magic word and a timestamp, resulting in a large storage space occupied by the logs, thus increasing the log storage capacity of wearable devices.

[0092] Based on the first embodiment of the log storage device of the present invention described above, a second embodiment of the log storage device of the present invention is proposed.

[0093] In this embodiment, the storage module 30 is further configured to obtain the number of log entries in the log file and the offset address of the log in the target memory; store the offset address in the offset address field, and store the number of log entries in the log entry number field.

[0094] The determining module 10 is further configured to read the hash value corresponding to each log from the logs generated by the target software within a preset time period; and determine the trigger information of the corresponding log based on the hash value.

[0095] The folding module 20 is also used to determine that the corresponding logs have the same trigger information when the hash values ​​of the logs are the same; and to fold the logs with the same trigger information by timestamp.

[0096] The determining module 10 is further configured to, when the target software starts, obtain the software version information of the target software and the device information of the device on which the target software runs; store the device information in the hash header information field and the software version information in the version information field, so as to generate a log file corresponding to the target software.

[0097] Other embodiments or specific implementations of the log storage device of the present invention can be referred to the above-described method embodiments, and will not be repeated here.

[0098] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0099] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0101] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A log file, characterized in that, The log file includes header information fields, timestamp fields, hash value fields, and parameter information fields; The header information field is used to store the log's identification information, the timestamp field is used to store the log's timestamp, the hash value field is used to store the log's hash value, the parameter information field is used to store the log data, and the timestamp is the trigger information for determining that the target software generates logs within a preset time period, and is a timestamp that is retained after folding several logs with the same trigger information. In the log file, the hash value and log data of each log with the same timestamp are stored in the hash value field and parameter information field corresponding to the timestamp field, respectively. The header information fields include a hash header information field, a version information field, an offset address field, and a log entry number field. The hash header information field is used to store device information of the target software running device, the version information field is used to store software version information of the target software, the offset address field is used to store the offset address of the log in the target memory, and the log number field is used to store the number of log entries in the log file.

2. A log storage method based on the log file described in claim 1, characterized in that, The method includes: Determine the trigger information for the target software to generate logs within a preset time period; Logs with the same trigger information are timestamped, and several logs after timestamping are retained with one timestamp. The folded timestamp is stored in the timestamp field, and the hash value and log data of each log with the same timestamp are stored in the hash value field and parameter information field corresponding to the timestamp field, respectively. The process of timestamping logs with the same trigger information includes: If the hash values ​​corresponding to the logs are the same, it is determined that the corresponding logs have the same trigger information; Logs with the same trigger information will be timestamped.

3. The method as described in claim 2, characterized in that, After storing the folded timestamp in the timestamp field, and storing the hash values ​​and log data of each log with the same timestamp in the hash value field and parameter information field corresponding to the timestamp field respectively, the method further includes: Get the number of log entries in the log file and the offset address of the log in the target storage; The offset address is stored in the offset address field, and the number of log entries is stored in the log entry number field.

4. The method as described in any one of claims 2 or 3, characterized in that, The trigger information for determining the target software to generate logs within a preset time period includes: Read the hash value corresponding to each log from the logs generated by the target software within a preset time period; The trigger information for the corresponding log is determined based on the hash value.

5. The method as described in claim 2 or 3, characterized in that, Before determining the trigger information for the target software to generate logs within a preset time period, the method further includes: When the target software starts, obtain the software version information of the target software and the device information of the device on which the target software runs; The device information is stored in the hash header information field, and the software version information is stored in the version information field to generate a log file corresponding to the target software.

6. A log storage device based on the log storage method of claim 2, characterized in that, The log storage device includes: The determination module is used to determine the trigger information for the target software to generate logs within a preset time period; The folding module is used to fold logs with the same trigger information by timestamp, and several logs after timestamp folding retain a single timestamp; The storage module is used to store the folded timestamp into the timestamp field, and to store the hash value and log data of each log with the same timestamp into the hash value field and parameter information field corresponding to the timestamp field, respectively. The folding module is also used to determine that the corresponding logs have the same trigger information when the hash values ​​of the logs are the same; and to fold the logs with the same trigger information by timestamp.

7. A wearable device, characterized in that, The device includes: a memory, a processor, and a log storage program stored on the memory and executable on the processor, the log storage program being configured to implement the steps of the log storage method as described in any one of claims 2 to 5.

8. A storage medium, characterized in that, The storage medium stores a log storage program, which, when executed by a processor, implements the steps of the log storage method as described in any one of claims 2 to 5.

Citation Information

Patent Citations

  • Log compression method and device

    CN106021417A

  • Methods, systems, and articles of manufacture for efficient log record access

    US20030055809A1