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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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.
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com