Log processing method, device, and computer-readable storage medium

By generating log encoding for the log data of IoT devices, the problem of insufficient storage space and excessive power consumption of the device is solved, efficient storage and transmission of log data is achieved, and the efficiency of device operation and analysis is improved.

CN114490542BActive Publication Date: 2025-08-22SHENZHEN JIMI SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111680169.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-08-22
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

The log files generated by IoT devices are too large, resulting in insufficient storage space for unconnected devices, and the power consumption of connected devices is too high, so that a large number of logs cannot be effectively stored or transmitted.

Method used

The log data of the Internet of Things device is obtained through the log interface, and a log encoding is generated for each log line based on the file name, line number, and log content, and the target log encoding is determined to reduce the log data size.

Benefits of technology

Effectively reduce the log storage space requirements of IoT devices, improve transmission efficiency, save power consumption, and improve device operation analysis efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490542B_ABST
    Figure CN114490542B_ABST
Patent Text Reader

Abstract

The present invention discloses a log processing method, apparatus, and computer-readable storage medium. The method comprises: obtaining operation log data of an IoT device through a log interface; determining a log code corresponding to each operation log line in the operation log data based on the file name, line number, and log content corresponding to each operation log line; and determining a target log code. The present invention aims to reduce the size of log data generated by IoT devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet of Things technology, and in particular to a log processing method, device, and computer-readable storage medium. Background Art

[0002] With the development of IoT technology, a wide variety of hardware devices are being used in real life. Common internet servers and app development often require dedicated log collection channels and processing service platforms, as logs are an effective method and means of locating problems. Similarly, the IoT market has similar requirements.

[0003] However, in the Internet of Things and embedded systems, for devices that are not connected to the Internet, the local storage space of the microcontroller may be small and cannot store a large number of logs. For devices that can be connected to the Internet, power consumption considerations may not allow a large number of logs to be uploaded. In this way, only some logs can be generated or extracted. The root cause of the above problems is that the log files generated by IoT devices are too large.

[0004] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention

[0005] The main purpose of the present invention is to provide a log processing method, device and computer-readable storage medium, aiming to achieve the effect of reducing the size of log data generated by IoT devices.

[0006] To achieve the above object, the present invention provides a log processing method comprising the following steps:

[0007] Obtain the operation log data of IoT devices through the log interface;

[0008] Determine the log code corresponding to each operation log line according to the file name, line number, and log content corresponding to each operation log line of the operation log data;

[0009] Determine the target log encoding.

[0010] Optionally, before the step of obtaining the operation log data of the IoT device through the log interface, the method further includes:

[0011] Obtain the compiled log data of the IoT device through the log interface;

[0012] Determine the log code corresponding to each compilation log line according to the file name, line number, and log content corresponding to each compilation log line of the compilation log data;

[0013] Generate a full log feature file according to the log codes corresponding to all the compilation log lines of the compilation log data;

[0014] The IoT device and the full log feature file are associated and saved.

[0015] Optionally, the step of associating and saving the IoT device and the full log feature file includes:

[0016] Obtaining a device identifier of the IoT device;

[0017] associating the device identifier with the full log feature file and storing it in a local memory; and / or

[0018] The device identification and the full log feature file are sent to a server, and the server associates and stores the device identification and the full log feature file.

[0019] Optionally, the step of determining the target log code includes:

[0020] When an abnormal operation of the IoT device is detected, a log code generated within a preset time period before and / or after the abnormality occurs is determined as a target log code.

[0021] Optionally, after the step of determining the target log code, the method further includes:

[0022] Determine the target log data corresponding to the target log code according to the full log feature file; or

[0023] The target log code is sent to the server, so that the server determines the target log data corresponding to the target log code according to the full log feature file.

[0024] Optionally, after the step of determining the target log data according to the full log feature file and the target log code, the method further includes:

[0025] Determine the running status of the software program in the IoT device based on the target log data.

[0026] Optionally, before the step of obtaining the operation log data of the IoT device through the log interface, the method further includes:

[0027] Obtaining project information, wherein the project information refers to relevant information of the IoT device;

[0028] Determine log parameters according to the project information, wherein the log parameters include log type and maximum number of log entries;

[0029] The log interface is set according to the log parameters.

[0030] In addition, to achieve the above-mentioned purpose, the present invention also provides a log processing device, which includes a memory, a processor, and a log processing program stored on the memory and runnable on the processor. When the log processing program is executed by the processor, the steps of the log processing method described above are implemented.

[0031] In addition, to achieve the above-mentioned purpose, the present invention further provides a log processing device, the log processing device comprising:

[0032] The acquisition module is used to obtain the operation log data of the IoT device through the log interface;

[0033] An encoding module, configured to determine a log code corresponding to each of the operation log lines according to the file name, line number, and log content corresponding to each of the operation log lines of the operation log data;

[0034] The determination module is used to determine the target log encoding.

[0035] The present invention proposes a log processing method, device, and computer-readable storage medium. The method first obtains the operation log data of an IoT device through a log interface; determines the log code corresponding to each operation log line based on the file name, line number, and log content corresponding to each operation log line in the operation log data; and finally determines the target log code. This method obtains the operation log data of an IoT device during program execution through the log interface and encodes each log line of the operation log data. The storage size of the log code is smaller than the original compiled log data, thereby reducing the storage size of the log generated by the IoT device. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention;

[0037] Figure 2 A flow chart of an embodiment of a log processing method of the present invention;

[0038] Figure 3 A flow chart of another embodiment of the log processing method of the present invention;

[0039] Figure 4 This is a simplified diagram of the log processing device architecture involved in an embodiment of the present invention.

[0040] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0041] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0042] In related technologies, IoT devices generate log files for management purposes. For devices that are not connected to the Internet, the local storage space of the microcontroller may be small and cannot store a large number of logs. For devices that can connect to the Internet, power consumption considerations may not allow a large number of logs to be uploaded. The fundamental problem leading to the above problems is that the log files of IoT devices are too large.

[0043] To reduce the size of log files of IoT devices, embodiments of the present invention provide a log processing method, apparatus, and computer-readable storage medium. The main steps of the method include:

[0044] Obtain the operation log data of IoT devices through the log interface;

[0045] Determine the log code corresponding to each operation log line according to the file name, line number, and log content corresponding to each operation log line of the operation log data;

[0046] Determine the target log encoding.

[0047] In this way, the running log data of the IoT device when running the program is obtained through the log interface, and each log line of the running log data is encoded accordingly. The storage size of the log encoding is smaller than the original compiled log data, thereby reducing the storage size of the log generated by the IoT device and solving storage, transmission and other problems.

[0048] The content to be protected by the claims of the present invention will be described in detail below with reference to the accompanying drawings.

[0049] like Figure 1 As shown, Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment involved in the embodiment of the present invention.

[0050] The terminal in the embodiment of the present invention may be a log processing device.

[0051] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a memory 1003, and a communication bus 1002. Communication bus 1002 is used to enable communication between these components. Memory 1003 may be a high-speed RAM memory or a non-volatile memory, such as a disk drive. Memory 1003 may also optionally be a storage device independent of processor 1001.

[0052] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation to the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0053] like Figure 1 As shown, the memory 1003 as a computer storage medium may include an operating system and a log processing program.

[0054] exist Figure 1 In the terminal shown, the processor 1001 can be used to call the log processing program stored in the memory 1003 and perform the following operations:

[0055] Obtain the operation log data of IoT devices through the log interface;

[0056] Determine the log code corresponding to each operation log line according to the file name, line number, and log content corresponding to each operation log line of the operation log data;

[0057] Determine the target log encoding.

[0058] Furthermore, the processor 1001 may call the log processing program stored in the memory 1003 and perform the following operations:

[0059] Obtain the compiled log data of the IoT device through the log interface;

[0060] Determine the log code corresponding to each compilation log line according to the file name, line number, and log content corresponding to each compilation log line of the compilation log data;

[0061] Generate a full log feature file according to the log codes corresponding to all the compilation log lines of the compilation log data;

[0062] The IoT device and the full log feature file are associated and saved.

[0063] Furthermore, the processor 1001 may call the log processing program stored in the memory 1003 and perform the following operations:

[0064] Obtaining a device identifier of the IoT device;

[0065] associating the device identifier with the full log feature file and storing it in a local memory; and / or

[0066] The device identification and the full log feature file are sent to a server, and the server associates and stores the device identification and the full log feature file.

[0067] Furthermore, the processor 1001 may call the log processing program stored in the memory 1003 and perform the following operations:

[0068] When an abnormal operation of the IoT device is detected, a log code generated within a preset time period before and / or after the abnormality occurs is determined as a target log code.

[0069] Furthermore, the processor 1001 may call the log processing program stored in the memory 1003 and perform the following operations:

[0070] Determine the target log data corresponding to the target log code according to the full log feature file; or

[0071] The target log code is sent to the server, so that the server determines the target log data corresponding to the target log code according to the full log feature file.

[0072] Furthermore, the processor 1001 may call the log processing program stored in the memory 1003 and perform the following operations:

[0073] Determine the running status of the software program in the IoT device based on the target log data.

[0074] Furthermore, the processor 1001 may call the log processing program stored in the memory 1003 and perform the following operations:

[0075] Obtaining project information, wherein the project information refers to relevant information of the IoT device;

[0076] Determine log parameters according to the project information, wherein the log parameters include log type and maximum number of log entries;

[0077] The log interface is set according to the log parameters.

[0078] The Internet of Things (IoT) connects any object to a network through information sensing devices and agreed-upon protocols. Objects exchange and communicate information through information media to achieve intelligent identification, positioning, tracking, and monitoring. Unlike the Internet, the IoT's terminals are no longer computers (PCs, servers), but embedded computer systems and their associated sensors.

[0079] With the development of Internet of Things (IoT) technology, various hardware devices are used in real life. In common Internet servers and app development, there are dedicated log collection channels and processing service platforms. Logs are an effective method and means of locating problems. Similarly, the IoT market has the same demand.

[0080] However, in the Internet of Things and embedded systems, for devices that are not connected to the Internet, the local storage space of the microcontroller may be small and cannot store a large number of logs. For devices connected to the Wi-Fi network, power consumption considerations may not allow a large number of logs to be uploaded. For 2G / 4G IoT devices, not only are power consumption requirements high, but they are also limited by the monthly data traffic of SIM packages, making it basically impossible to upload a large number of logs. In this way, only some logs can be generated or extracted. The root cause of the above problems is that the log files generated by IoT devices are too large.

[0081] Therefore, it can be seen that the above-mentioned defects exist in the relevant log processing methods. To address the above-mentioned defects, the embodiments of the present invention propose a log processing method, which aims to generate a log code corresponding to each log line of the operation log data, thereby reducing the log file size of the IoT device.

[0082] The following is an explanation of the content claimed in the claims of the present invention through specific exemplary schemes, so that those skilled in the art can better understand the scope of protection of the claims of the present invention. It should be understood that the following exemplary schemes do not limit the scope of protection of the present invention, but are only used to explain the present invention.

[0083] For example, referring to Figure 2 In one embodiment of the log processing method of the present invention, the log processing method includes the following steps:

[0084] Step S10: Obtain the operation log data of the IoT device through the log interface;

[0085] In this embodiment, an IoT device is a terminal device in the Internet of Things (IoT). A simple understanding of the IoT is that everything is connected to the Internet. Therefore, IoT devices are mostly hardware devices, and they contain software programs. For an IoT device, there are two stages: first, compiling the software program on a computer and burning it to the IoT device, and second, running the software program on the IoT device. Both stages generate log data based on project requirements. The log data is generated based on the software program code. Since the software programs involved in the first stage include those running in the second stage, the range of log data generated in the first stage is larger than the range of log data generated in the second stage. The log data generated in the first stage is called compilation log data, and the log data generated in the second stage is called operation log data. The log data includes several log lines, generally error logs used to analyze and locate problems, or critical operation logs used to understand the operating status of the device.

[0086] Optionally, in order to obtain the operation log data of the IoT device, it is necessary to set up a log interface with a special format and string encapsulation to facilitate the triggering of the operation log encoding process during operation. The operation log data obtained through the log interface will enter the log encoding process.

[0087] Furthermore, project information is obtained, and the project information refers to relevant information of the IoT device; log parameters are determined based on the project information, and the log parameters include log type and maximum number of log entries; and the log interface is set based on the log parameters. Operation log data that meets the log parameters can be obtained through the log interface. Project information refers to relevant information of the IoT device. When designing and configuring the IoT device, project information will be configured to indicate the hardware installation requirements and software operation requirements of the IoT device. The log generation requirements of the IoT device software program can be determined based on the project information, and the log parameters can be determined based on the log generation requirements. The log parameters can include log type (alarm log, error log, and specific log output switch) and maximum number of log entries, etc. By setting the log interface based on the log parameters, log data with the actual required log characteristics can be filtered out, reducing the calculation of log data encoding.

[0088] Step S20: determining a log code corresponding to each of the operation log lines according to the file name, line number, and log content corresponding to each of the operation log lines of the operation log data.

[0089] In this embodiment, the operation log data obtained through the log interface needs to be encoded and processed. This processing can be completed through the SDK (Software Development Kit). During the process of running the software program, the operation log data generated is line by line, so the encoding processing of the log data is also encoded according to each line. The compilation log data corresponding to each compilation log line will generate a corresponding log code. Each compilation log line uses the encoding algorithm to generate a unique log code corresponding to the file name, line number, and log content. The log code size can be 4 bytes and can be adjusted according to the specific project information. For example, since the program of the single-chip microcomputer device is short, the encoding algorithm can be adjusted and the encoding size can be set to 2 bytes to save memory space and reduce the amount of calculation. The encoding algorithm can be determined according to the project information and can be a custom MD5, hash, crc, summation, etc. algorithm.

[0090] It's understandable that general log data is primarily useful for error logs and alarm logs. In actual code projects, error log lines are generally printed by functions called at different levels. The actual source code call levels are not nested too much. Even if there are more errors, the most useful for locating them are the 10 or so logs closest to the error point. If a project has 10,000 different logs (errors and normal logs together), but for a 4-byte representation range (2 to the power of 32), the probability of collision is still very low. Secondly, considering the collision of specific encoding algorithms themselves, such as crc32, the collision probability is less than 1 / 100 with 10,000 entries. With such a small collision probability, it can be assumed that for a physical network device, the log encoding generated by each compiled log line of its running log data will not cause a collision.

[0091] Optionally, the log code generation time corresponding to each operation log line of the operation log data is recorded and deleted after exceeding the limit to save storage space.

[0092] Optionally, if the log code exceeds a preset code quantity or storage capacity, a portion of the previously generated log codes is deleted to save storage space.

[0093] Step S30: Determine the target log code;

[0094] In this embodiment, the operation log data includes several operation log lines, and each operation log line will generate a corresponding log code. According to actual needs, the target log code can be determined, and the target operation log line in the operation log data can be determined according to the target log code. According to the target log code, the target log data corresponding to the target operation log line in the operation log data can be determined. It can be understood that the target log code can be determined forwardly or reversely, that is, to determine the target operation log data; determine the operation log line corresponding to the operation log data as the target operation log line; determine the log code corresponding to each target operation log line by corresponding file name, line number, and log content, and this log code is the target log code.

[0095] Optionally, when an abnormal operation of the IoT device is detected, the log code generated within a preset time period before and / or after the abnormality occurs is determined to be a target log code. When the IoT device operates abnormally, the code operation status can be judged by the operation log data. Since the operation log data has been processed into a log code, the log code generated within a preset time (such as ten minutes) before and / or after the abnormality occurs is used as the target log code. The target log code file is stored in a local memory or sent to a server, and the cause of the abnormality can be determined through the target log code.

[0096] Optionally, the target log data corresponding to the target log coding file is determined based on the full log feature file; or the target log coding file is sent to the server so that the server determines the target log data corresponding to the target log coding file based on the full log feature file. The full log feature file is a file that stores all log codes and original compiled log data generated during the compilation of the software program of the Internet of Things device. After determining a log code, the full log feature file is matched according to the encoding value of the log code, and the file name, line number, and log content of the original log data are indexed. It can be understood that the original log data is compiled log data, but the compiled log data is the same as the running log data corresponding to the target log code. Therefore, after determining the target log code, the target log data determined according to the full log feature file can be used to view the running status of the software program.

[0097] Furthermore, the storage location of the full log feature file is determined. The storage location can be a local memory or a server. The local server is the memory in the main body of the log processing method. If the storage location is a local memory, the full log feature file can be directly called, and the target log data corresponding to the target log coding file is determined according to the full log feature file; if the storage location is a server, the target log coding file is sent to the server so that the server determines the target log data corresponding to the target log coding file according to the full log feature file. Since the project information of the Internet of Things devices is different, the storage location of the full log feature file is also different. In order to adapt to different Internet of Things devices, different target log data determination methods are proposed.

[0098] Furthermore, the running status of the software program in the IoT device can be determined based on the target log data, and the code vulnerability can be determined based on the running status of the software program.

[0099] In the technical solution disclosed in this embodiment, the operation log data of the Internet of Things device is obtained through the log interface; the log code corresponding to each operation log line is determined according to the file name, line number, and log content corresponding to each operation log line of the operation log data; and the target log code is determined. The operation log data is obtained through the log interface, the operation log data is converted into a log code, and the target log code is determined. The target log data can be determined through the full log feature file. In this way, when the log data is needed, only the target log code needs to be obtained. The storage size of the target log code is smaller than the original log data, which achieves the effect of reducing the size of the log generated by the Internet of Things device. The log code not only occupies a small storage space, but also has the advantages of high efficiency, short time consumption, and saving transmission resources during transmission.

[0100] Optionally, refer to Figure 3Based on any of the above embodiments, in another embodiment of the log processing method of the present invention, the log processing method further includes:

[0101] Step S40: Obtaining compilation log data of the IoT device through a log interface;

[0102] In this embodiment, compilation log data is log data generated when compiling a software program. For IoT devices, there are two stages in which log data can be generated: compiling the software program on a computer and then burning it to the IoT device, and running the software program on the IoT device. It should be noted that in the first stage, obtaining business compilation log data through a specially configured log interface during the software program compilation process is also an important improvement in the embodiment of the present invention. Unlike the software program running stage, running the software program conditionally executes the software program code on the IoT device, while compiling the software program involves the entire software code. Therefore, the scope of the operation log data generated when running the software program is smaller than the scope of the compilation log data generated when compiling the software program.

[0103] It is understandable that the software program can only be run after it is compiled and burned on the IoT device. The log interface for generating compilation log data is not necessarily the same as the log interface for generating operation log data. However, the filtering mechanism (or generation mechanism) of the log interface for generating compilation log data should be looser than the log interface for generating operation log data to ensure that the compilation log data contains all the operation log data.

[0104] Step S50: determining a log code corresponding to each compilation log line according to the file name, line number, and log content corresponding to each compilation log line of the compilation log data;

[0105] In this embodiment, the compilation log data obtained through the log interface needs to be encoded. The encoding algorithm should be the same as the encoding algorithm for the operation log data. This process can be completed through the SDK (Software Development Kit). During the stage of compiling the software program, the log data is generated line by line, so the encoding of the log data is encoded according to each line. The operation log data corresponding to each operation log line will generate a corresponding log code. Each operation log line uses the encoding algorithm to generate a unique log code corresponding to the file name, line number, and log content. It should be noted that the encoding process of the compilation log data in this step is the same as the encoding process of the operation log data described above.

[0106] Step S60: Generate a full log feature file according to the log codes corresponding to all the compilation log lines of the compilation log data;

[0107] In this embodiment, a corresponding log code will be generated for each compilation log line. Since the compilation log data is generated by the hardware device during the process of compiling the software program, and the running stage is to run the software program according to conditions, the log data range generated in the compilation stage covers the log data range of the running stage, so the log feature file generated according to the log code generated by the compilation log data can be called a full log feature file.

[0108] Optionally, all log codes and corresponding original compilation log data are associated and saved to generate a full log feature file.

[0109] It is understandable that the full log signature file does not necessarily contain all compiled log data of the IoT device. Depending on the settings of the log interface, the full log signature file can correspond to alarm log data or error log data. This is determined by the configuration file of the log SDK.

[0110] Step S70: Associate and save the IoT device and the full log feature file.

[0111] In this embodiment, the generated full log feature file can be used for comparison with the operation log code generated during the operation phase, so the Internet of Things device and the full log feature file need to be associated and saved. It can be understood that the full log feature file is generated when a specific Internet of Things device software program is compiled, so the compiled Internet of Things device should be associated and saved with the full log feature file.

[0112] Optionally, the storage location and storage method may be determined based on the project information of the IoT device.

[0113] Furthermore, the device identification of the IoT device is obtained; the device identification is associated with the full log feature file and saved in a local memory; and / or the device identification and the full log feature file are sent to a server, and the server associates and saves the device identification and the full log feature file.

[0114] According to the storage location and storage method determined by the project information, it can be determined that the storage location of the full log feature file is the local storage and / or server. The device identifier can be the unique identity identifier of the IoT device, which can be an SN code (Serial Number product). After determining the device identifier, the full feature file belonging to it can be determined. The target log code generated when the IoT device runs the software program can call the corresponding full feature file after determining the IoT device identifier to match the target log data. In addition, the generation time of the full log feature file can also be associated with the full log feature file and the device identifier for storage. For an IoT device, there will be additional compilation processes such as upgrading the software program, which will generate new compilation log data, and correspondingly, a new full feature file will also be generated. Therefore, it is necessary to determine the generation time of the full feature file to update the full feature file of the IoT device.

[0115] In the technical solution disclosed in this embodiment, the compilation log data of the Internet of Things device is obtained through the log interface; the log code corresponding to each compilation log line of the compilation log data is determined according to the file name, line number, and log content corresponding to each compilation log line of the compilation log data; a full log feature file is generated according to the log codes corresponding to all the compilation log lines of the compilation log data; and the Internet of Things device and the full log feature file are associated and saved. In this way, the log code corresponding to each compilation log line of the compilation log data generated when compiling the software program of the Internet of Things device is generated through the log interface, and a full log file can be generated according to the log code. The process encoding algorithm is consistent with the running log data encoding algorithm. The log code range when compiling the program is larger than the log code when running the program, so the target log code can be indexed to the original running log data according to the full log file, achieving the effect that the running log data of the Internet of Things device can be reduced to log codes for storage and transmission, and also improving the efficiency of users in determining the running status of physical network devices.

[0116] In addition, an embodiment of the present invention also proposes a log processing device, which includes a memory, a processor, and a log processing program stored on the memory and runnable on the processor. When the log processing program is executed by the processor, the steps of the log processing method described in the above embodiments are implemented.

[0117] In addition, the embodiment of the present invention also proposes a log processing device, exemplarily, referring to Figure 4 The log processing device 100 includes:

[0118] An acquisition module 101, an encoding module 102 and a determination module 103, wherein the acquisition module 101 is used to obtain the operation log data of the Internet of Things device through the log interface; the encoding module 102 is used to determine the log code corresponding to each operation log line according to the file name, line number and log content corresponding to each operation log line of the operation log data; and the determination module 103 is used to determine the target log code.

[0119] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a log processing program is stored. When the log processing program is executed by a processor, the steps of the log processing method described in the above embodiments are implemented.

[0120] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising 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 system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0121] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform; of course, it 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 is essentially or the part that contributes to the existing technology can be embodied in the form of a software product, which is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disk), including several instructions for enabling the log processing device to execute the methods described in each embodiment of the present invention.

[0123] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A log processing method, characterized in that: The log processing method comprises the following steps: Obtaining project information, wherein the project information refers to relevant information of the IoT device; Determine log parameters according to the project information, wherein the log parameters include log type and maximum number of log entries; Setting the log interface according to the log parameters; Obtain the operation log data of IoT devices through the log interface; Encode the file name, line number, and log content of each operation log line of the operation log data using an encoding algorithm to determine the log code corresponding to each operation log line, wherein the encoding algorithm is any one of a custom MD5, hash, crc, and sum algorithm; Determine the target log encoding.

2. The log processing method according to claim 1, wherein: Before the step of obtaining the operation log data of the IoT device through the log interface, the method further includes: Obtain the compiled log data of the IoT device through the log interface; Determine the log code corresponding to each compilation log line according to the file name, line number, and log content corresponding to each compilation log line of the compilation log data; Generate a full log feature file according to the log codes corresponding to all the compilation log lines of the compilation log data; The IoT device and the full log feature file are associated and saved.

3. The log processing method according to claim 2, wherein: The step of associating and saving the IoT device and the full log feature file includes: Obtaining a device identifier of the IoT device; associating the device identifier with the full log feature file and storing it in a local memory; and / or The device identification and the full log feature file are sent to a server, and the server associates and stores the device identification and the full log feature file.

4. The log processing method according to claim 1, wherein: The step of determining the target log code includes: When an abnormal operation of the IoT device is detected, a log code generated within a preset time period before and / or after the abnormality occurs is determined as a target log code.

5. The log processing method according to claim 1, wherein: After the step of determining the target log code, the method further includes: Determine the target log data corresponding to the target log code according to the full log feature file; or The target log code is sent to the server, so that the server determines the target log data corresponding to the target log code according to the full log feature file.

6. The log processing method according to claim 5, wherein: After the step of determining the target log data according to the full log feature file and the target log code, the method further includes: Determine the running status of the software program in the IoT device based on the target log data.

7. A log processing device, characterized in that: The log processing device includes: a memory, a processor, and a log processing program stored in the memory and executable on the processor. When the log processing program is executed by the processor, the steps of the log processing method according to any one of claims 1 to 6 are implemented.

8. A log processing device, characterized in that: The log processing device includes: A log interface determination module is configured to obtain project information, wherein the project information refers to relevant information of an IoT device; determine log parameters based on the project information, wherein the log parameters include a log type and a maximum number of log entries; and set the log interface based on the log parameters. The acquisition module is used to obtain the operation log data of the IoT device through the log interface; An encoding module is used to encode the file name, line number, and log content of each operation log line of the operation log data through an encoding algorithm to determine the log code corresponding to each operation log line. The encoding algorithm is any one of a custom MD5, hash, crc, and sum algorithm; The determination module is used to determine the target log encoding.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a log processing program, which, when executed by a processor, implements the steps of the log processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data processing method, medical management system and terminal

    CN112768046A

  • Log information storage method

    CN1842021A