Storage method for preventing client logs from losing easily

A client and log technology, which is applied in the input/output process of data processing, digital data information retrieval, special data processing applications, etc., can solve the problems of log information loss, and the log is not easily lost, so as to reduce the problem of freezing and reduce the IO consumption and the effect of improving user experience

Active Publication Date: 2019-07-23
HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF5 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] The purpose of the present invention is to provide a storage method for client logs that are not easy to lose in view of the deficiencies in the prior art above, which solves the problem of log information being lost due to client crashes; IO consumption, reduce the stuck problem caused by writing logs, and improve user experience

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
  • Storage method for preventing client logs from losing easily

Examples

Experimental program
Comparison scheme
Effect test

specific Embodiment approach

[0029] like figure 1 As shown, specifically, specific embodiments of the present invention include:

[0030] (1) If the transitional log file log.0 is not found in the log directory, call the system MMAP to create a 2M MMAP memory when the Android or IOS system is initialized, and map the created MMAP memory to In a text file of the system, the text file is named log.0, and log.0 is used as the log file that plays a transitional role, indicating the latest stored log file. If the transitional log file log.0 is found in the log directory, the log.0 is mapped into the MMAP memory according to the MMAP rule.

[0031] (2) Read the 2K header data Header structure (struct Header) of the mapped MMAP memory space, where the structure is set as follows:

[0032] struct Header {

[0033] int32_t write_len_;

[0034] int32_t free_len_;

[0035] int32_t flag_;

[0036] char ext_data_[2035];

[0037] char magic_flag_;

[0038]};

[0039] In the above settings, write_len_ indicates ...

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 storage method for preventing a client log from losing easily, which comprises the following steps of step A, finding a log file with a transition effect under a log directory, and mapping the log file with the transition effect into an MMAP memory according to an MMAP rule; b, when log data is received, writing the log data into an MMAP memory; c, using the MMAP memory to print the received log data into the log file with the transition effect; and step D, scanning the log files in the log directory, and renaming the scanned log files. According to the method, the problem that the log information is lost due to client crash is solved, and meanwhile, a plurality of log files can be written without increasing the memory, so that the IO consumption caused by log writing of the client can be reduced, the jamming problem caused by log writing is reduced, and the user experience is improved.

Description

technical field [0001] The invention belongs to the field of client log storage methods, and in particular relates to a storage method for client logs that is not easily lost. Background technique [0002] In the prior art, most of the client (Android or IOS system) log storage methods are to open a file handle, and then directly read and write to the file handle, which is equivalent to directly operating the disk. There is a problem that : If the client crashes while writing the log, it is possible that the currently printed key log is not written to the disk, resulting in the loss of log information. In addition, there is a problem of IO waiting when reading and writing files directly, which may cause lag due to log writing. [0003] In the prior art, a small part of the client log storage method is to directly write to the stack space, and after the buffer is full, write to the disk at one time or open a thread to write to the disk. This method also has log information. ...

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/18G06F16/178G06F3/06
CPCG06F16/1815G06F16/178G06F3/0619G06F3/0643G06F3/0676Y02D10/00
Inventor 严斌周吕
Owner HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products