Supercharge Your Innovation With Domain-Expert AI Agents!

Method for reducing log file space occupation, storage medium and terminal

A space-occupying and log file technology, applied in the computer field, can solve the problems of high processor computing power consumption, time-consuming, complex algorithm for compressing log data, etc., achieving low time and space complexity, scalability and flexibility Strong, guaranteeing the effect of version consistency

Inactive Publication Date: 2022-03-08
四川创智联恒科技有限公司
View PDF8 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] However, there are two problems with the dot log method. One is that after each update of the source code, the dot log must use an independent index table generator to scan the source code of the entire project and extract all the log statements that exist in the source code. Generate a globally unique index value for each log statement, and finally form an index table file
For large-scale software engineering, the above process is quite time-consuming
Moreover, once the index table is not updated immediately after the source code is updated, the versions of the source code and the index table will be inconsistent, which will make the final generated log file unable to be parsed and displayed normally
The second is that the management log does not have the ability to write string type parameters, which will seriously limit the scalability and flexibility of the log function
However, the algorithm for compressing log data is relatively complex, and the consumption of processor computing power is usually relatively large.
However, we don't want to consume too much processor computing power while reducing the space occupied by log files. After all, processor computing power is the most valuable resource in the entire device.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for reducing log file space occupation, storage medium and terminal
  • Method for reducing log file space occupation, storage medium and terminal
  • Method for reducing log file space occupation, storage medium and terminal

Examples

Experimental program
Comparison scheme
Effect test

Embodiment

[0041] Please refer to figure 1 , the embodiment of the present invention provides a method for reducing log file space occupation.

[0042] In this embodiment, the applicable processor is a 32-bit processor, and the CRC-32 algorithm is used to calculate the CRC code of the string, and the data search structure used is a red-black tree.

[0043] In this embodiment, when the communication base station is started, the base station equipment uses the following statement to record a log as an example, as follows:

[0044] GNB_LOG("gNodeB %s startup at %u s (UTC)", gnb_name, timestamp)

[0045] The log encoding process is as follows:

[0046] First extract the first string "gNodeB", and calculate its CRC-32 encoding value as 4264837701. This value does not exist in the red-black tree, so add it to the red-black tree, add the string "gNodeB" to the index table, and get the index table as Figure 4 shown. At this point, replace the string "gNodeB" in the original statement with...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for reducing log file space occupation, a storage medium and a terminal, and relates to the technical field of computers. The method comprises the following steps: constructing an index table and a data lookup structure; calculating a CRC code of each character string in the log statement, and adding the CRC code to a data search structure; and adding the character string to the index table, and replacing the target character string in the log statement with the index value at the corresponding position in the index table. Compared with a dotting log method, the method has the advantages that the index table does not need to be synchronously updated immediately after the source code is updated each time, the version consistency of the log file and the index table is naturally guaranteed while a large amount of time cost is saved, and the reliability is higher; the method has the capability of writing character string type parameters, and is higher in expansibility and flexibility; compared with a log compression method, the time complexity and the space complexity of the method are lower, and the computing power of a processor is better saved.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a method for reducing log file space occupation, a storage medium and a terminal. Background technique [0002] The log function is an essential basic function for servers, communication base stations, industrial gateways, routers and other devices that need to run continuously for a long time. The perfect log function can help the operation and maintenance personnel to troubleshoot and locate device problems very effectively. However, due to the long-term continuous operation of the device, a large amount of log data will be generated, and these log files will occupy a considerable space. At the same time, whether it is hard disk storage or flash memory, its price is positively correlated with storage capacity, and huge log data files bring a huge cost burden to the production and operation and maintenance of equipment. [0003] It is easy to think that, in order to s...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/13G06F16/172G06F16/18G06F16/22G06F16/23G06F11/10
CPCG06F16/13G06F16/172G06F16/1815G06F16/2282G06F16/2365G06F11/1004
Inventor 胡建伟
Owner 四川创智联恒科技有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More