Log data writing method and log system

A technology of data writing and logging, applied in the direction of input/output to record carrier, sustainable building, energy-saving computing, etc., can solve the problems of time waste, increase system power consumption, etc., to reduce power consumption, reduce the number of times, reduce the effect of time

Inactive Publication Date: 2012-12-05
深圳市金蝶精斗云网络科技有限公司
View PDF2 Cites 24 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0005] In view of this, the present invention provides a log data writing method and a log system to overcome the problems of wasting time and increasing system power consumption due to frequent disk I / O operations when log data is written in the prior art. question

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
  • Log data writing method and log system
  • Log data writing method and log system
  • Log data writing method and log system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0034] Please refer to the attached figure 1 , which is a flowchart of a log data writing method disclosed in an embodiment of the present invention, mainly includes the following steps:

[0035] Step S101, acquiring generated log data, and writing the log data into memory.

[0036] Step S102, judging whether the log data stored in the internal memory has reached the preset number, if yes, execute step S103; if no, end.

[0037] Step S103, writing all the log data stored in the internal memory to the disk for archiving.

[0038] When performing the above steps S101 to S103, at first, the log data generated in the computer is continuously stored in the internal memory; All log data in is written to disk in batches.

[0039] The embodiment of the present invention uses the above method based on the fact that when writing data, the speed of writing to memory is faster (about 1000 times or more) than the speed of writing to disk. Once log data is generated, it is written into m...

Embodiment 2

[0043] On the basis of the log data writing method proposed in Embodiment 1 of the present invention, the present invention also discloses a log data writing method. Please refer to the attached figure 2 , mainly including the following steps:

[0044] Step S201, acquiring generated log data, and writing the log data into memory.

[0045] Step S202, waiting for an event, judging whether the preset time for disk writing has been reached, if yes, execute step S203, if not, continue to wait for the event.

[0046] Step S203, determine whether there is log data in the internal memory, if yes, execute step S205, if not, return to step S202 and continue to wait for events.

[0047] Step S204, judging whether the log data stored in the internal memory has reached the preset number, if yes, execute step S205; if no, end.

[0048] Step S205, writing all the log data stored in the internal memory to the disk for archiving.

[0049] In the implementation of the above steps S201 to S2...

Embodiment 3

[0057] Please refer to the attached image 3 It is a structural schematic diagram of a log system disclosed in an embodiment of the present invention, which is characterized by including: a first writing unit 301 , a first judging unit 302 and a second writing unit 303 .

[0058] The first writing unit 301 is configured to acquire generated log data and write the log data into memory.

[0059] The first judging unit 302 is configured to judge whether the log data stored in the internal memory reaches a preset amount.

[0060] The second writing unit 303 is configured to write all the log data stored in the memory to a disk when the log data in the memory reaches a preset amount.

[0061] In the log system disclosed in the above-mentioned embodiments of the present invention, each unit thereof corresponds to the method disclosed in Embodiment 1 in the process of executing log writing, so details are not described here again.

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 log data writing method and a log system. The method comprises the following steps of: obtaining generated log data and writing the log data into a memory; when the log data in the memory reach a preset number, writing all log data stored in the memory into a disk; or, after obtaining the generated log data and writing the log data into the memory and before writing all log data into the disk, writing all log data into the disk if the log data stored in the memory exist when a preset disk writing time is finished. Through the adoption of the log data writing method and the log system disclosed by an embodiment of the invention, the operation of immediately writing the generated log data into the disk once the log data are generated in the prior art can be reduced, I / O (Input / Output) operations of the disk are reduced, and the frequency of writing the log data into the disk for filing under a high-concurrency application of the log data is reduced, so that the time of writing the log into the disk is reduced; meanwhile, the power consumption of the system during writing the data into the disk is reduced and finally a purpose of quick response is achieved.

Description

technical field [0001] The invention relates to the fields of databases and computers, and more specifically relates to a method for writing log data and a log system. Background technique [0002] In the computer, the log is an essential part of the software, which is mainly used to save the information and data in the computer. In daily computer applications, as long as a piece of log data is generated, it is immediately written to the disk for archiving. Usually, this method can already meet the needs of computer applications. [0003] However, in the case of high concurrency of log data, when a piece of log data is generated by the method of the prior art, it is immediately written to the disk archive, which will inevitably lead to frequent disk I / O (input and output) operations, which not only wastes too much time, but also increases the power consumption of the system. [0004] Therefore, in order to achieve fast response and reduce time waste and power consumption o...

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
IPC IPC(8): G06F3/06G06F11/34
CPCY02B60/165Y02D10/00
Inventor 谢鸿锋
Owner 深圳市金蝶精斗云网络科技有限公司
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