CN105956172A - Log information storage method and apparatus - Google Patents
Log information storage method and apparatus Download PDFInfo
- Publication number
- CN105956172A CN105956172A CN201610346210.5A CN201610346210A CN105956172A CN 105956172 A CN105956172 A CN 105956172A CN 201610346210 A CN201610346210 A CN 201610346210A CN 105956172 A CN105956172 A CN 105956172A
- Authority
- CN
- China
- Prior art keywords
- storage device
- log information
- file
- root directory
- type
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/1805—Append-only file systems, e.g. using logs or journals to store data
- G06F16/1815—Journaling file systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/1734—Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
Abstract
The invention discloses a log information storage method and apparatus. The method comprises the steps of analyzing a file system of a storage device to obtain a system root directory of the storage device after determining that the storage device is powered on; generating a log file in the system root directory; and obtaining log information of the storage device and writing the log information in the log file. According to the method and apparatus, a user can quickly obtain the log information of the storage device and know a usage condition of the storage device in time through the log information, thereby improving the user experience.
Description
Technical field
The present invention relates to field of computer technology, particularly relate to the storage method and device of a kind of log information.
Background technology
Storage device in use, internal flash-management algorithm (Flash Translation Layer,
FTL) continuous each sensor collection information from this storage device, and by the facility information in this information
Preserve in being mapped to the reserved area (service area) of this storage device.Such as, USB flash disk has certain making
With the life-span, in order to allow user can assess use state and the use time of this USB flash disk, FTL will be with this
The use state of USB flash disk and use the information MAP reserved area to this storage device of association in time.Due to
This reserved area is positioned at tens, the foremost physical track of storage device 0 physical surface, relevant by manufacturer's write
Internal control program manages corresponding facility information the third party software pair associated with this storage device
Connect, hence in so that the facility information preserved in this reserved area is carried out by this third party software by obtaining instruction
Obtain, and with self-monitoring, analysis and reporting techniques log information (Self-Monitoring Analysis and
Reporting Technology, S.M.A.R.T), or the form output of other log information, for user
Check.
But, when the poor compatibility of storage device, in the such as edition comparison old times, need specific third party
Software could obtain the facility information preserved in this reserved area, adds in the reserved area obtaining storage device
The difficulty of the facility information preserved.It addition, when storage device does not provides the interface docked with third party software
Time, this third party software then can not obtain the facility information preserved in the reserved area of storage device.Therefore when
The facility information preserved in the front reserved area being obtained storage device by third party software has limitation,
Make to obtain the facility information preserved in the reserved area of this storage device the most convenient, reduce the body of user
Degree of testing.
Summary of the invention
Present invention is primarily targeted at the storage method and device that a kind of log information is provided, it is intended to solve
The facility information preserved in the current reserved area being obtained storage device by third party software has limitation
Problem.
For achieving the above object, the storage method of a kind of log information that the present invention provides, including:
After determining that storage device powers on, resolve the file system of described storage device to obtain described storage
The system root directory of equipment;
Journal file is generated under described system root directory;
Obtain the log information of described storage device, and described log information is write in described journal file.
Preferably, the log information of the described storage device of described acquisition, and described log information is write institute
Also include after stating the step in journal file:
When receiving log information and checking instruction, open described journal file to show described log information.
Preferably, before the described step generating journal file under described system root directory, described daily record
The storage method of information further comprises the steps of:
Judge whether to exist under described system root directory described journal file;
The most then perform the log information of the described storage device of described acquisition, and described log information is write
Enter the step in described journal file;
If it is not, generate the step of journal file described in then performing under described system root directory.
Preferably, the described step generating journal file under described system root directory includes:
After the file system resolving described storage device, obtain the type of described file system;
Type according to described file system revises the system root directory data of described storage device;
Under described system root directory, described daily record literary composition is generated according to amended described system root directory data
Part.
Preferably, described after the file system resolving described storage device, obtain described file system
Also include after the step of type:
Whether the type judging described file system is that in described storage device, flash-management algorithm FTL supports
The type of file system;
The most then perform the described type according to described file system and revise the system root of described storage device
The step of catalogue data;
If it is not, then the log information of the described storage device got is stored consolidating of described storage device
Determine region, read for third party software.
Additionally, for achieving the above object, the present invention also provides for the storage device of a kind of log information, including:
Parsing module, for after determining that storage device powers on, resolves the file system of described storage device
To obtain the system root directory of described storage device;
Generation module, for generating journal file under described system root directory;
Writing module, for obtaining the log information of described storage device, and writes described log information
In described journal file.
Preferably, the storage device of described log information also includes:
Display module, for when receiving log information and checking instruction, opens described journal file and shows
Described log information.
Preferably, the storage device of described log information also includes:
First judge module, is used for judging whether to exist under described system root directory described journal file;
Said write module, if being additionally operable under described system root directory exist described journal file, then obtains
The log information of described storage device, and described log information is write in described journal file;
, if there is not described journal file, then in institute under described system root directory in described generation module
State generation journal file under system root directory.
Preferably, described generation module includes:
Acquiring unit, for, after the file system resolving described storage device, obtaining described file system
Type;
Amendment unit, revises the system root mesh of described storage device for the type according to described file system
Record data;
Signal generating unit, is used for according to amended described system root directory data under described system root directory
Generate described journal file.
Preferably, the storage device of described log information also includes:
Whether the second judge module, be to dodge in described storage device for judging the type of described file system
Deposit the type of the file system that management algorithm FTL supports;
Acquisition module, if the type for described file system is flash-management algorithm in described storage device
The type of the file system that FTL supports, then obtain and deposit described in the amendment of the type according to described file system
The system root directory data of storage equipment;
Memory module, if the type for described file system is not that in described storage device, flash memory management is calculated
The type of the file system that method FTL is supported, then store the log information of the described storage device got
To the fixed area of described storage device, read for third party software.
The present invention is by after determining that storage device powers on, and the file system resolving storage device is deposited to obtain
The system root directory of storage equipment, after generating journal file, obtains the day of storage device under system root directory
Will information, and log information is write in journal file.Due to the file system by resolving storage device
May determine that the situation of the system root directory of this storage device, obtain the system root directory of this storage device,
Under this system root directory, generate journal file, and the log information of this storage device got is write
In this journal file so that user can obtain the log information of this storage device efficiently, by this daily record
Information recognizes the service condition of this storage device timely, thus improves the experience of user.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the first embodiment of the storage method of log information of the present invention;
Fig. 2 is the schematic flow sheet of the second embodiment of the storage method of log information of the present invention;
Fig. 3 is the schematic flow sheet of the 3rd embodiment of the storage method of log information of the present invention;
Fig. 4 is the schematic flow sheet of the refinement step of step S20 in first embodiment shown in Fig. 1 of the present invention;
Fig. 5 is the schematic flow sheet of the 4th embodiment of the storage method of log information of the present invention;
Fig. 6 is the high-level schematic functional block diagram of the first embodiment of the storage device of log information of the present invention;
Fig. 7 is the high-level schematic functional block diagram of the second embodiment of the storage device of log information of the present invention;
Fig. 8 is the high-level schematic functional block diagram of the 3rd embodiment of the storage device of log information of the present invention;
Fig. 9 be the storage device of log information of the present invention the 4th embodiment in the refinement function of generation module
Module diagram;
Figure 10 is the high-level schematic functional block diagram of the 5th embodiment of the storage device of log information of the present invention.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, do referring to the drawings further
Explanation.
Detailed description of the invention
Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not used to limit
Determine the present invention.
Based on the problems referred to above, the present invention provides a kind of storage method of log information.
Schematic flow sheet with reference to the first embodiment of the storage method that Fig. 1, Fig. 1 are log information of the present invention.
In the present embodiment, the storage method of described log information includes:
Step S10, after determining that storage device powers on, resolves the file system of storage device to obtain storage
The system root directory of equipment;
In the present embodiment, this storage device includes USB flash disk, possesses embedded memory standard specifications
The memorizer of (Embedded Multi Media Card, EMMC) and SD card.Determining that storage sets
After powering on, flash-management algorithm FTL resolves the file system of this storage device, obtains this document system
Corresponding logical address A, the system root directory of this storage device and this system root directory of type under
Logical address B that file number is corresponding, thus the type of this document system is obtained according to this logical address A,
File is obtained under the system root directory of this storage device and this system root directory to obtain according to this logical address B
Number, after the type resolving this document system, gets the system root directory of this storage device and is somebody's turn to do
File number under root.Such as, when this storage device powers on, detect in this storage device and deposit
At valid data, then show that this storage device exists file system, logical address A in these valid data
Specifying the type of this document system, what logical address B of these valid data have recorded this storage device is
System root and the file number of this system root directory, resolve this document system that this logical address A is corresponding
The type of system obtains this logical address B, obtains the system root mesh of this storage device according to this logical address B
Record and the file number of this system root directory.Wherein, this document number can be 0,1 or many
Individual.
Step S20, generates journal file under system root directory;
After determining the type of file system of this storage device, flash-management algorithm FTL is according to this document
The preset data that the type of system is corresponding processes rule production journal file under this system root directory.Such as,
After determining the file system that the type of file system of this storage device is FAT32 type, according to this
Preset data process rule generation journal file under the root of this system that FAT32 type is corresponding.Its
In, the form of this journal file is corresponding with the type of this document system.When raw under this system root directory
When becoming journal file, give a storage address to this journal file.
Step S30, obtains the log information of storage device, and is write in journal file by log information.
After generating journal file under system root directory, exist valid data obtain from storage device and be somebody's turn to do
The log information of storage device, and by this log information according to present count corresponding to the type of this document system
Write in this journal file according to processing rule.Wherein, this log information includes the use feelings of this storage device
Condition and the facility information of this storage device.
It is understood that this journal file can be deleted automatically or passively, when this storage device goes up again
During electricity, this journal file being deleted can automatically recover and update.
The present embodiment is determined by after storage device powers on, and the file system resolving storage device is deposited to obtain
The system root directory of storage equipment, after generating journal file, obtains the day of storage device under system root directory
Will information, and log information is write in journal file.Due to the file system by resolving storage device
May determine that the situation of the system root directory of this storage device, obtain the system root directory of this storage device,
Under this system root directory, generate journal file, and the log information of this storage device got is write
In this journal file so that user can obtain the log information of this storage device efficiently, by this daily record
Information recognizes the service condition of this storage device timely, thus improves the experience of user.
Further, based on above-mentioned first embodiment, refer to Fig. 2, propose depositing of log information of the present invention
The schematic flow sheet of the second embodiment of method for storing, in this second embodiment, after step S30, should
The storage method of log information includes:
Step S40, when receiving log information and checking instruction, opens journal file with show log information.
In the present embodiment, after the log information of this storage device got is write this journal file,
When receiving log information and checking instruction, check instruction calls and this journal file according to this log information
This journal file opened by the document viewing software that form is corresponding, then show the daily record letter that this journal file is corresponding
Breath.Such as, when this log file formats is .txt form, then text editor is used to open this journal file;
When this log file formats is .doc form, then use Word word processor application.
Illustrate how said method realizes below by a specific embodiment.
User uses the USB flash disk just bought, owing to not having valid data inside this USB flash disk just bought, and should
Flash-management algorithm FTL None-identified current file system in USB flash disk, so not generating journal file,
If this USB flash disk to be formatted as NTFS type, and copy into film in this USB flash disk, when user is by this U
Dish is pulled up when being again inserted on computer, and the flash-management algorithm FTL in this USB flash disk detects that this USB flash disk powers on
Time, resolve the file system of this USB flash disk, find that this document system is NTFS type, then according to NTFS
The preset data process rule generation journal file that type is corresponding, writes into facility information, when user beats
When opening this USB flash disk, find that USB flash disk root has a journal file, such as DeviceLog.txt, use text journey
Sequence opens this journal file, views the log information of this USB flash disk of this journal file record, such as,
The serial number of equipment: 12345678 (being certified products);Firmware number: ABCD;Equipment state: good;Write
Entering total data volume is: 12000M;Flash memory is averagely worn number of times: 10 times;Can also write data volume:
120GB。
When user copies into data to this USB flash disk again, upper once power on time, user can find DeviceLog.txt
Update (power on every time, FTL meeting instrument of interpretation system, Update log information);When user has used one section
After time, it is again turned on this DeviceLog.txt when seeing, the equipment state of record in this log information:
Abrasion for a long time, is please shifted significant data.
The present embodiment, by when receiving log information and checking instruction, opens journal file with show log
Information.Can directly be opened owing to opening this journal file, generate day without by third party software
Will file, and the log information of this storage device is written in this third party software generation journal file,
Therefore the operating system requirement that must possess relatively highly compatible to this storage device is reduced so that user
The log information of this storage device can be obtained efficiently.
Further, based on above-mentioned first embodiment, refer to Fig. 3, propose depositing of log information of the present invention
The schematic flow sheet of the 3rd embodiment of method for storing, in the 3rd embodiment, before step S20, should
The storage method of log information includes:
Step S50, it is judged that whether there is journal file under system root directory;
In the present embodiment, after the type getting this document system, resolve the type of this document system,
System root directory and this system root mesh of this storage device is obtained according to this document system type after resolving
Logical address B that file number under Lu is corresponding, by what this logical address B obtained this storage device be
File number under system root and this system root directory, thus judge whether deposit under this system root directory
At journal file.
The most then perform step S30, i.e. obtain the log information of storage device, and log information is write
In journal file;
If there is journal file under system root directory, illustrate that user carries out repeatedly logic to this storage device
Data read-write operation, then without again generating new journal file under this system root directory, but can incite somebody to action
The log information of this storage device got writes in this journal file, thus updates in this journal file
Log information.
If it is not, then perform step S20, under system root directory, i.e. generate journal file.
If there is not journal file under system root, illustrate that this storage device does not carries out logical data read-write behaviour
Make or carry out for the first time logical data read-write operation, or this storage device carries out repeatedly logical data and reads
Write operation, but the journal file under this system root directory is the most deleted, then flash-management algorithm FTL according to
The preset data that the type of this document system is corresponding processes rule production daily record literary composition under this system root directory
Part, writes this daily record for this flash-management algorithm FTL by the log information of this storage device got
In file.
The present embodiment by judging whether there is journal file under system root directory, the most then obtains storage
The log information of equipment, and log information is write in journal file, if it is not, then under system root directory
Generate in journal file, the journal file of this storage device that can not only upgrade in time and this journal file and write
The log information entered, and reduce the journal file of generation taking the memory space of this storage device.
Further, refer to Fig. 4, for the stream of the refinement step of step S20 in first embodiment of the invention
Journey schematic diagram, the refinement step of this step S20 includes:
Step S21, after the file system resolving storage device, obtains the type of file system;
Step S22, revises the system root directory data of storage device according to the type of file system;
In the present embodiment, after the file system resolving storage device, by the type of this document system
Corresponding logical address A obtains the type of this document system, determines corresponding pre-of the type of this document system
If data processing rule, this is deposited to process rules modification according to the preset data that the type of this document system is corresponding
The system root directory data of storage equipment.
Step S23, generates journal file according to amended system root directory data under system root directory.
After revising these system root directory data, according to amended system root directory data at system root mesh
Generate journal file under record, and give storage address to the journal file of this generation, make this acquisition simultaneously
To log information be not then stored into certain of this storage device and specify region, and be stored in this daily record literary composition
In part.
The present embodiment, by after the file system resolving storage device, obtains the type of file system, root
Type according to file system revises the system root directory data of storage device, according to amended system root mesh
Record data generate journal file under system root directory.Due to the file system by resolving this storage device
And the system root directory data of amendment storage device so that flash-management algorithm FTL is at this system root mesh
Record data generate journal file under system root directory, generate daily record from without by third party software
File, and then make user can obtain the log information of this storage device efficiently, by this log information
Recognize the service condition of this storage device timely.
Further, refer to Fig. 5, propose the 4th embodiment of the storage method of log information of the present invention
Schematic flow sheet, in the 4th embodiment, after step S21, the storage method bag of this log information
Include:
Step S60, it is judged that whether the type of file system is that in storage device, flash-management algorithm FTL props up
The type of the file system held;
The most then perform step S22, the i.e. type according to file system and revise the system root mesh of storage device
Record data;
In the present embodiment, after the type getting this document system, it is judged that the type of this document system
Whether it is the type of the file system that flash-management algorithm FTL supports in storage device, if file system
Type is the type of the file system that flash-management algorithm FTL supports in storage device, it is determined that this document
The preset data that the type of system is corresponding processes rule, according to the present count that the type of this document system is corresponding
According to the system root directory data of process this storage device of rules modification, and according to amended system root directory
Data generate journal file under system root directory, and give storage address to the journal file of this generation,
Make this log information got not be then stored into certain appointment region of this storage device simultaneously, but
It is stored in this journal file.Wherein, the file system that in this storage device, flash-management algorithm FTL supports
The type of system includes FAT type, NTFS type.
Step S70, if it is not, then store consolidating of storage device by the log information of the storage device got
Determine region, read for third party software.
If the type of file system is not the file system that in storage device, flash-management algorithm FTL supports
Type, stores the fixed area of this storage device by the log information of this storage device got, with
Read for third party software.Such as, the type in the file system determining this USB flash disk is not this flash memory management
During the type of file system that algorithm FTL supports, then this got is deposited by this flash-management algorithm FTL
The log information of storage equipment is mapped to the permanent storage area of this USB flash disk, for third party software from this USB flash disk
Permanent storage area reads this log information.
It is understood that determining that the type of file system of this storage device is not in this storage device
Flash-management algorithm FTL support the type of file system time, if the file that user is to this storage device
When system has demand, the flash-management algorithm FTL in this USB flash disk can increase support this document system newly
The program of type.Such as, when storage device burning flash-management algorithm FTL, burning support is deserved
The flash-management algorithm FTL of the type of preceding document system.
Whether the present embodiment is flash-management algorithm FTL in storage device by judging the type of file system
The type of the file system supported, the most then the type according to file system revises the system of storage device
Root data, if it is not, then store consolidating of storage device by the log information of the storage device got
Determine region, read for third party software, by providing the generation scheme of multiple journal file so that use
The service condition of this storage device is recognized timely based on the log information of write in this journal file in family,
Thus improve the experience of user.
The present invention further provides the storage device of a kind of log information.
Functional module with reference to the first embodiment of the storage device that Fig. 6, Fig. 6 are log information of the present invention is shown
It is intended to.
In the present embodiment, the storage device of described log information includes: parsing module 10, generation module
20, writing module 30.
Described parsing module 10, for after determining that storage device powers on, resolves the file system of storage device
System is to obtain the system root directory of storage device;
In the present embodiment, this storage device includes USB flash disk, possesses embedded memory standard specifications
The memorizer of (Embedded Multi Media Card, EMMC) and SD card.Determining that storage sets
After powering on, flash-management algorithm FTL calls parsing module 10 and resolves the file system of this storage device,
Obtain logical address A corresponding to the type of this document system, the system root directory of this storage device and be somebody's turn to do
Logical address B that file number under system root directory is corresponding, thus obtain according to this logical address A should
The type of file system, obtains the system root directory of this storage device according to this logical address B and this is
File number under system root, after the type resolving this document system, gets this storage device
File number under system root directory and this root.Such as, when this storage device powers on, detection
In this storage device, there are valid data, then show that this storage device exists file system, this significant figure
Logical address A according to specifies the type of this document system, the logical address B record of these valid data
The system root directory of this storage device and the file number of this system root directory, resolve this logical address A
The type of corresponding this document system obtains this logical address B, obtains this storage according to this logical address B
The file number of the system root directory of equipment and this system root directory.Wherein, this document number can be 0
Individual, 1 or multiple.
Described generation module 20, for generating journal file under system root directory;
After determining the type of file system of this storage device, flash-management algorithm FTL calls generation mould
Block 20 processes rule according to the preset data that the type of this document system is corresponding and produces under this system root directory
Journal file.Such as, the type in the file system determining this storage device is the file of FAT32 type
After system, process rule life under the root of this system according to the preset data that this FAT32 type is corresponding
Become journal file.Wherein, the form of this journal file is corresponding with the type of this document system.When at this
When generating journal file under system root directory, give a storage address to this journal file.
Said write module 30, for obtaining the log information of storage device, and writes day by log information
In will file.
After generating journal file under system root directory, there is significant figure in writing module 30 from storage device
According to the log information of middle this storage device of acquisition, and by this log information according to the type pair of this document system
The preset data answered processes rule and writes in this journal file.Wherein, this log information includes that this storage sets
Standby service condition and the facility information of this storage device.
It is understood that this journal file can be deleted automatically or passively, when this storage device goes up again
During electricity, this journal file being deleted can automatically recover and update.
The present embodiment is determined by after storage device powers on, and parsing module 10 resolves the file system of storage device
System is to obtain the system root directory of storage device, and generation module 20 generates journal file under system root directory
After, writing module 30 obtains the log information of storage device, and is write in journal file by log information.
May determine that the feelings of the system root directory of this storage device due to the file system by resolving storage device
Condition, obtains the system root directory of this storage device, generates journal file under this system root directory, and will
The log information of this storage device got writes in this journal file so that user can obtain efficiently
The log information of this storage device, recognizes the use feelings of this storage device timely by this log information
Condition, thus improve the experience of user.
Further, based on above-mentioned first embodiment, propose log information of the present invention storage device the
Two embodiments, in the present embodiment, with reference to Fig. 7, the storage device of described log information also includes: display
Module 40.
Described display module 40, for when receiving log information and checking instruction, open journal file with
Show log information.
In the present embodiment, after the log information of this storage device got is write this journal file,
When receiving log information and checking instruction, display module 40 according to this log information check instruction calls with
This journal file opened by document viewing software corresponding to this log file formats, then show this journal file pair
The log information answered.Such as, when this log file formats is .txt form, then text editor is used to open
This journal file;When this log file formats is .doc form, then use Word word processor application journey
Sequence.
Illustrate how said method realizes below by a specific embodiment.
User uses the USB flash disk just bought, owing to not having valid data inside this USB flash disk just bought, and should
Flash-management algorithm FTL None-identified current file system in USB flash disk, so not generating journal file,
If this USB flash disk to be formatted as NTFS type, and copy into film in this USB flash disk, when user is by this U
Dish is pulled up when being again inserted on computer, and the flash-management algorithm FTL in this USB flash disk detects that this USB flash disk powers on
Time, resolve the file system of this USB flash disk, find that this document system is NTFS type, then according to NTFS
The preset data process rule generation journal file that type is corresponding, writes into facility information, when user beats
When opening this USB flash disk, find that USB flash disk root has a journal file, such as DeviceLog.txt, use text journey
Sequence opens this journal file, views the log information of this USB flash disk of this journal file record, such as,
The serial number of equipment: 12345678 (being certified products);Firmware number: ABCD;Equipment state: good;Write
Entering total data volume is: 12000M;Flash memory is averagely worn number of times: 10 times;Can also write data volume:
120GB。
When user copies into data to this USB flash disk again, upper once power on time, user can find DeviceLog.txt
Update (power on every time, FTL meeting instrument of interpretation system, Update log information);When user has used one section
After time, it is again turned on this DeviceLog.txt when seeing, the equipment state of record in this log information:
Abrasion for a long time, is please shifted significant data.
The present embodiment, by when receiving log information and checking instruction, opens journal file with show log
Information.Can directly be opened owing to opening this journal file, generate day without by third party software
Will file, and the log information of this storage device is written in this third party software generation journal file,
Therefore the operating system requirement that must possess relatively highly compatible to this storage device is reduced so that user
The log information of this storage device can be obtained efficiently.
Further, based on above-mentioned first embodiment, propose log information of the present invention storage device the
Three embodiments, in the present embodiment, with reference to Fig. 8, the storage device of described log information also includes: first
Judge module 50.
Described first judge module 50, is used for judging whether there is journal file under system root directory;
In the present embodiment, after generation module 20 gets the type of this document system, resolve this document
The type of system, according to this document system type after resolving obtain the system root directory of this storage device with
And logical address B that file number under this system root directory is corresponding, being obtained by this logical address B should
File number under the system root directory of storage device and this system root directory, thus call the first judgement
Module 50 judges whether there is journal file under this system root directory.
Said write module 30, if there is journal file under being additionally operable to system root directory, then obtains storage and sets
Standby log information, and log information is write in journal file;
If there is journal file under system root directory, illustrate that user carries out repeatedly logic to this storage device
Data read-write operation, then without again generating new journal file under this system root directory, but can adjust
With writing module 30, the log information of this storage device got is write in this journal file, thus more
Log information in this journal file new.
Described generation module 20, if being additionally operable under system root directory there is not journal file, then at system root
Journal file is generated under catalogue.
If there is not journal file under system root, illustrate that this storage device does not carries out logical data read-write behaviour
Make or carry out for the first time logical data read-write operation, or this storage device carries out repeatedly logical data and reads
Write operation, but the journal file under this system root directory is the most deleted, then and flash-management algorithm FTL calls
Generation module 20 processes rule at this system root directory according to the preset data that the type of this document system is corresponding
Lower production journal file, believes the daily record of this storage device got for this flash-management algorithm FTL
Breath writes in this journal file.
The present embodiment by judging whether there is journal file under system root directory, the most then obtains storage
The log information of equipment, and log information is write in journal file, if it is not, then under system root directory
Generate in journal file, the journal file of this storage device that can not only upgrade in time and this journal file and write
The log information entered, and reduce the journal file of generation taking the memory space of this storage device.
Further, based on above-mentioned first embodiment, propose log information of the present invention storage device the
Four embodiments, in the present embodiment, with reference to Fig. 9, described generation module 20 includes acquiring unit 21, repaiies
Change unit 22 and signal generating unit 23.
Described acquiring unit 21, for after the file system resolving storage device, obtains file system
Type;
Described amendment unit 22, revises the system root directory of storage device for the type according to file system
Data;
In the present embodiment, after the file system resolving storage device, acquiring unit 21 passes through this document
Logical address A corresponding to the type of system obtains the type of this document system, determines the class of this document system
The preset data that type is corresponding processes rule, and amendment unit 22 is according to corresponding the presetting of type of this document system
Data processing rule revises the system root directory data of this storage device.
Described signal generating unit 23, for according to the life under system root directory of amended system root directory data
Become journal file.
After amendment unit 22 revises these system root directory data, signal generating unit 23 is according to amended system
System root data generate journal file under system root directory, and deposit to the journal file imparting of this generation
Storage address, makes this log information got not be then stored into certain appointment district of this storage device simultaneously
Territory, and be stored in this journal file.
The present embodiment, by after the file system resolving storage device, obtains the type of file system, root
Type according to file system revises the system root directory data of storage device, according to amended system root mesh
Record data generate journal file under system root directory.Due to the file system by resolving this storage device
And the system root directory data of amendment storage device so that flash-management algorithm FTL is at this system root mesh
Record data generate journal file under system root directory, generate daily record from without by third party software
File, and then make user can obtain the log information of this storage device efficiently, by this log information
Recognize the service condition of this storage device timely.
Further, based on above-mentioned 4th embodiment, propose log information of the present invention storage device the
Five embodiments, in the present embodiment, with reference to Figure 10, the storage device of described log information includes: second
Judge module 60, acquisition module 70 and memory module 80.
Whether described second judge module 60, be flash memory in storage device for judging the type of file system
The type of the file system that management algorithm FTL supports;
Described acquisition module 70, if the type for file system is flash-management algorithm in storage device
The type of file system that FTL supports, then obtain the storage device of type amendment according to file system
System root directory data;
In the present embodiment, after generation module 20 gets the type of this document system, call second and sentence
Disconnected module 60 judges whether the type of this document system is that in storage device, flash-management algorithm FTL supports
The type of file system, if the type of file system is that in storage device, flash-management algorithm FTL supports
The type of file system, it is determined that the preset data that the type of this document system is corresponding processes rule, according to
Preset data corresponding to the type of this document system processes the system root directory number of this storage device of rules modification
According to, and under system root directory, generate journal file according to amended system root directory data, and to being somebody's turn to do
The journal file generated gives storage address, makes this log information got not be then stored into this simultaneously
Certain of storage device specifies region, and is stored in this journal file.Wherein, in this storage device
The type of the file system that flash-management algorithm FTL supports includes FAT type, NTFS type.
Described memory module 80, if the type for file system is not flash-management algorithm in storage device
The type of file system that FTL supports, then the log information storage of storage device that will get
The fixed area of equipment, reads for third party software.
If the type of file system is not the file system that in storage device, flash-management algorithm FTL supports
Type, the log information of this storage device got is stored consolidating of this storage device by memory module 80
Determine region, read for third party software.Such as, the type in the file system determining this USB flash disk is not
During the type of file system that this flash-management algorithm FTL supports, then this flash-management algorithm FTL will obtain
The log information of this storage device got is mapped to the permanent storage area of this USB flash disk, for third party software
This log information is read from the permanent storage area of this USB flash disk.
It is understood that determining that the type of file system of this storage device is not in this storage device
Flash-management algorithm FTL support the type of file system time, if the file that user is to this storage device
When system has demand, the flash-management algorithm FTL in this USB flash disk can increase support this document system newly
The program of type.Such as, when storage device burning flash-management algorithm FTL, burning support is deserved
The flash-management algorithm FTL of the type of preceding document system.
Whether the present embodiment is flash-management algorithm FTL in storage device by judging the type of file system
The type of the file system supported, the most then the type according to file system revises the system of storage device
Root data, if it is not, then store consolidating of storage device by the log information of the storage device got
Determine region, read for third party software, by providing the generation scheme of multiple journal file so that use
The service condition of this storage device is recognized timely based on the log information of write in this journal file in family,
Thus improve the experience of user.
These are only the preferred embodiments of the present invention, not thereby limit the scope of the claims of the present invention, every
Utilize equivalent structure or equivalence flow process conversion that description of the invention and accompanying drawing content made, or directly or
Connect and be used in other relevant technical fields, be the most in like manner included in the scope of patent protection of the present invention.
Claims (10)
1. the storage method of a log information, it is characterised in that the storage method bag of described log information
Include following steps:
After determining that storage device powers on, resolve the file system of described storage device to obtain described storage
The system root directory of equipment;
Journal file is generated under described system root directory;
Obtain the log information of described storage device, and described log information is write in described journal file.
2. the storage method of log information as claimed in claim 1, it is characterised in that described acquisition institute
State the log information of storage device, and by after the step in the described log information described journal file of write
Also include:
When receiving log information and checking instruction, open described journal file to show described log information.
3. the storage method of log information as claimed in claim 1, it is characterised in that described described
Before generating the step of journal file under system root directory, the storage method of described log information also includes step
Rapid:
Judge whether to exist under described system root directory described journal file;
The most then perform the log information of the described storage device of described acquisition, and described log information is write
Enter the step in described journal file;
If it is not, generate the step of journal file described in then performing under described system root directory.
4. the storage method of log information as claimed in claim 1, it is characterised in that described described
The step generating journal file under system root directory includes:
After the file system resolving described storage device, obtain the type of described file system;
Type according to described file system revises the system root directory data of described storage device;
Under described system root directory, described daily record literary composition is generated according to amended described system root directory data
Part.
5. the storage method of log information as claimed in claim 4, it is characterised in that described in parsing
After the file system of described storage device, also include after the step of the type obtaining described file system:
Whether the type judging described file system is that in described storage device, flash-management algorithm FTL props up
The type of the file system held;
The most then perform the described type according to described file system and revise the system root of described storage device
The step of catalogue data;
If it is not, then the log information of the described storage device got is stored consolidating of described storage device
Determine region, read for third party software.
6. the storage device of a log information, it is characterised in that the storage device bag of described log information
Include:
Parsing module, for after determining that storage device powers on, resolves the file system of described storage device
To obtain the system root directory of described storage device;
Generation module, for generating journal file under described system root directory;
Writing module, for obtaining the log information of described storage device, and writes described log information
In described journal file.
7. the storage device of log information as claimed in claim 6, it is characterised in that described daily record is believed
The storage device of breath also includes:
Display module, for when receiving log information and checking instruction, opens described journal file and shows
Described log information.
8. the storage device of log information as claimed in claim 6, it is characterised in that described daily record is believed
The storage device of breath also includes:
First judge module, is used for judging whether to exist under described system root directory described journal file;
Said write module, if being additionally operable under described system root directory exist described journal file, then obtains
The log information of described storage device, and described log information is write in described journal file;
Described generation module, if being additionally operable under described system root directory not exist described journal file, then exists
Journal file is generated under described system root directory.
9. the storage device of log information as claimed in claim 6, it is characterised in that described generation mould
Block includes:
Acquiring unit, for, after the file system resolving described storage device, obtaining described file system
Type;
Amendment unit, revises the system root mesh of described storage device for the type according to described file system
Record data;
Signal generating unit, is used for according to amended described system root directory data under described system root directory
Generate described journal file.
10. the storage device of log information as claimed in claim 9, it is characterised in that described daily record
The storage device of information also includes:
Whether the second judge module, be to dodge in described storage device for judging the type of described file system
Deposit the type of the file system that management algorithm FTL supports;
Acquisition module, if the type for described file system is flash-management algorithm in described storage device
The type of the file system that FTL supports, then obtain and deposit described in the amendment of the type according to described file system
The system root directory data of storage equipment;
Memory module, if the type for described file system is not that in described storage device, flash memory management is calculated
The type of the file system that method FTL is supported, then store the log information of the described storage device got
To the fixed area of described storage device, read for third party software.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610346210.5A CN105956172B (en) | 2016-05-23 | 2016-05-23 | The storage method and device of log information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610346210.5A CN105956172B (en) | 2016-05-23 | 2016-05-23 | The storage method and device of log information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105956172A true CN105956172A (en) | 2016-09-21 |
CN105956172B CN105956172B (en) | 2019-08-13 |
Family
ID=56909410
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610346210.5A Active CN105956172B (en) | 2016-05-23 | 2016-05-23 | The storage method and device of log information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105956172B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106649068A (en) * | 2016-12-28 | 2017-05-10 | 福建三元达网络技术有限公司 | System fault log recording method and system |
CN108920215A (en) * | 2018-07-18 | 2018-11-30 | 郑州云海信息技术有限公司 | A method of passing through initramfs collection system log |
CN109460390A (en) * | 2018-11-14 | 2019-03-12 | 郑州云海信息技术有限公司 | A kind of log storing method and device |
CN110659251A (en) * | 2018-06-13 | 2020-01-07 | 阿里巴巴集团控股有限公司 | Data processing method and system and electronic equipment |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6571259B1 (en) * | 2000-09-26 | 2003-05-27 | Emc Corporation | Preallocation of file system cache blocks in a data storage system |
US20110295813A1 (en) * | 2010-05-26 | 2011-12-01 | Pickard Jonathan J | Mechanism for Managing and Archiving System and Application Log Files |
CN102467516A (en) * | 2010-11-04 | 2012-05-23 | 北京北方微电子基地设备工艺研究中心有限责任公司 | Method, device and system for recording logs in equipment control process |
CN102594591A (en) * | 2012-02-07 | 2012-07-18 | 大唐移动通信设备有限公司 | Log collection method and device |
CN102955720A (en) * | 2011-08-25 | 2013-03-06 | 北京中科智网科技有限公司 | Method for improving stability of EXT (extended) file system |
CN103514260A (en) * | 2013-08-13 | 2014-01-15 | 中国科学技术大学苏州研究院 | Internal storage log file system and achieving method thereof |
CN104794025A (en) * | 2015-04-27 | 2015-07-22 | 四川效率源信息安全技术有限责任公司 | Method for quick verification on storage device |
-
2016
- 2016-05-23 CN CN201610346210.5A patent/CN105956172B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6571259B1 (en) * | 2000-09-26 | 2003-05-27 | Emc Corporation | Preallocation of file system cache blocks in a data storage system |
US20110295813A1 (en) * | 2010-05-26 | 2011-12-01 | Pickard Jonathan J | Mechanism for Managing and Archiving System and Application Log Files |
CN102467516A (en) * | 2010-11-04 | 2012-05-23 | 北京北方微电子基地设备工艺研究中心有限责任公司 | Method, device and system for recording logs in equipment control process |
CN102955720A (en) * | 2011-08-25 | 2013-03-06 | 北京中科智网科技有限公司 | Method for improving stability of EXT (extended) file system |
CN102594591A (en) * | 2012-02-07 | 2012-07-18 | 大唐移动通信设备有限公司 | Log collection method and device |
CN103514260A (en) * | 2013-08-13 | 2014-01-15 | 中国科学技术大学苏州研究院 | Internal storage log file system and achieving method thereof |
CN104794025A (en) * | 2015-04-27 | 2015-07-22 | 四川效率源信息安全技术有限责任公司 | Method for quick verification on storage device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106649068A (en) * | 2016-12-28 | 2017-05-10 | 福建三元达网络技术有限公司 | System fault log recording method and system |
CN110659251A (en) * | 2018-06-13 | 2020-01-07 | 阿里巴巴集团控股有限公司 | Data processing method and system and electronic equipment |
CN108920215A (en) * | 2018-07-18 | 2018-11-30 | 郑州云海信息技术有限公司 | A method of passing through initramfs collection system log |
CN109460390A (en) * | 2018-11-14 | 2019-03-12 | 郑州云海信息技术有限公司 | A kind of log storing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN105956172B (en) | 2019-08-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105956172A (en) | Log information storage method and apparatus | |
CN104461858B (en) | software compatibility pre-testing method and system | |
US9122580B2 (en) | Flash memory system and managing and collecting methods for flash memory with invalid page messages thereof | |
US9514417B2 (en) | Cloud-based plagiarism detection system performing predicting based on classified feature vectors | |
CN101425039A (en) | Electronic appliance and method for controlling file copy for storage apparatus | |
FR3026512A1 (en) | ||
CN1726496A (en) | System and method for annotating multi-modal characteristics in multimedia documents | |
CN102999430A (en) | Handling unclean shutdowns for system having non-volatile memory | |
CN103608809A (en) | Recommending data enrichments | |
CN104160397A (en) | Location independent files | |
CN105824623A (en) | Android application hotfix method and device | |
CN106528071A (en) | Selection method and device for target code | |
CN110413981A (en) | The based reminding method and device of the quality detecting method of electronic health record, similar case history | |
CN104765849A (en) | Method and system for acquiring copied data source information | |
CN104252247A (en) | Stylus shorthand | |
CN103020187B (en) | Mobile terminal and fast file management method thereof | |
US20160188595A1 (en) | Semantic Network Establishing System and Establishing Method Thereof | |
CN102171696B (en) | The generation method and apparatus of customization data | |
CN104331633A (en) | Medical data system and method | |
US9069884B2 (en) | Processing special attributes within a file | |
CN108897584B (en) | Application starting method and device and intelligent terminal | |
CN109213720A (en) | Page turning method, device and the storage medium of e-book | |
CN114461530A (en) | Intelligent test case recommendation processing system, method, device, processor and computer-readable storage medium for APP | |
CN107526814A (en) | Mobile terminal document storage method and device | |
JP2015522868A (en) | Digital aging system and operation method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: Units 05-2 and 06-08, 6th floor, Changhong Science and Technology Building, 18 Science and Technology South 12 Road, Nanshan District, Shenzhen City, Guangdong Province Applicant after: Shenzhen SiliconGo Semiconductor Co., Ltd. Address before: Units 05-2 and 06-08, 6th floor, Changhong Science and Technology Building, 18 Science and Technology South 12 Road, Nanshan District, Shenzhen City, Guangdong Province Applicant before: SILICONGO MICROELECTRONICS CO., LTD. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |