CN107016054A - A kind of method and device of log information storage - Google Patents

A kind of method and device of log information storage Download PDF

Info

Publication number
CN107016054A
CN107016054A CN201710122964.7A CN201710122964A CN107016054A CN 107016054 A CN107016054 A CN 107016054A CN 201710122964 A CN201710122964 A CN 201710122964A CN 107016054 A CN107016054 A CN 107016054A
Authority
CN
China
Prior art keywords
journal file
log information
stored
cursor position
parameter
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.)
Pending
Application number
CN201710122964.7A
Other languages
Chinese (zh)
Inventor
张伟彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Comba Network Systems Co Ltd
Original Assignee
Comba Telecom Technology Guangzhou Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Comba Telecom Technology Guangzhou Ltd filed Critical Comba Telecom Technology Guangzhou Ltd
Priority to CN201710122964.7A priority Critical patent/CN107016054A/en
Publication of CN107016054A publication Critical patent/CN107016054A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems

Abstract

The present invention relates to the method and device of communication technical field, more particularly to a kind of storage of log information, to facilitate inquiry log information, the efficiency of reduction diagnosis investigation problem, and then the performance of system is improved, including:The parameter of journal file is obtained, parameter includes the cursor position of journal file, and cursor position is used for the storage location for indicating log information;It is the memory space for not storing log information from cursor position to log file trailer to judge whether the size L of log information to be stored is more than the first storage value X, the first storage value X;If so, the then afterbody by the preceding X data of log information to be stored since being stored cursor position to journal file, and by the rear L X data of log information to be stored since being stored the stem of journal file to L X sizes;It is that, since the stem of journal file at L X sizes, therefore the embodiment of the present invention can be realized and facilitate inquiry log information, the efficiency of reduction diagnosis investigation problem to update cursor position, and then improves the performance of system.

Description

A kind of method and device of log information storage
Technical field
The present invention relates to the method and device of communication technical field, more particularly to a kind of storage of log information.
Background technology
The software systems of nearly all device product, are required for preserving daily record in real time or regularly, carry out operation note, be Running status of uniting record, abnormal conditions record etc., while being also the important means that problem diagnosis is carried out to system.
A kind of method stored in current device product to log information, method of use is to utilize multiple daily records File automatic cycle is stored, if current log file reaches the journal file storage maximum of setting, closes current log File, and certain rule and policy, newly-built or the next journal file of opening, start recording log information are utilized, and periodically follow Ring detects total log file size, ensures no more than total setting daily record storage maximum.Also using other methods, example Such as, disclosed, the journal file operated has been scanned in CN1361489A patents by timer module timing.But These methods when detecting total log file size, it is necessary to travel through all log file sizes, and when checking log information, also Each journal file is spliced or is stitched together using instrument and is checked, it has not been convenient to inquiry log information, diagnosis investigation is reduced The efficiency of problem, and then reduce the performance of system.
In summary, the efficiency of diagnosis investigation problem is reduced, is entered in the presence of inconvenient inquiry log information in the prior art And the performance issue of system is reduced, it is, therefore, desirable to provide the effective ways solved the above problems.
The content of the invention
The present invention provides a kind of method and device of log information storage, is inconvenient to look into solve to exist in the prior art Log information is ask, the efficiency of diagnosis investigation problem is reduced, and then reduce the performance issue of system.
On the one hand, the embodiment of the present invention provides a kind of method of log information storage, including:
The parameter of journal file is obtained, parameter includes the cursor position of journal file, and cursor position is used to indicate that daily record is believed The storage location of breath;
It is from cursor position to judge whether the size L of log information to be stored is more than the first storage value X, the first storage value X Put to the memory space for not storing log information of log file trailer;
If so, the then afterbody by the preceding X data of log information to be stored since being stored cursor position to journal file, And store the rear L-X data of log information to be stored to L-X sizes since the stem of journal file;
It is since the stem of journal file at L-X sizes to update cursor position.
Alternatively, in addition to:
If the size L of log information to be stored is not more than the first storage value X, storage is to be stored since the cursor position Log information;
It is since cursor position at L sizes to update cursor position.
Alternatively, parameter also includes the daily record rank of journal file;
Judge whether the size L of log information to be stored is more than before the first storage value X, in addition to:
Judge whether log information to be stored meets the other requirement of journal stage;
If meeting, judge whether the size L of log information to be stored is more than the first storage value X.
Alternatively, before the parameter for obtaining journal file, in addition to:
Judge whether it is to first switch on journal file;
If so, then setting the parameter of journal file, and parameter is preserved into journal file;
If it is not, then reading the parameter of journal file from journal file.
Alternatively, before the parameter for obtaining journal file, in addition to:
It is journal file to judge whether the current stored value N of journal file is more than the second storage value M, the second storage value M Maximum storage value;
If so, then deleting in journal file the earliest log information of storage time until the current stored value N of journal file Less than or equal to the second storage value M and Update log file cursor position.
Second aspect, the embodiment of the present invention also provides a kind of device of log information storage, including:
Acquiring unit is used for:The parameter of journal file is obtained, parameter includes the cursor position of journal file, and cursor position is used In the storage location for indicating log information;
Judging unit is used for:Judge whether the size L of log information to be stored is more than the first storage value X, the first storage Value X is the memory space for not storing log information from cursor position to log file trailer;
If so, the then afterbody by the preceding X data of log information to be stored since being stored cursor position to journal file, And store the rear L-X data of log information to be stored to L-X sizes since the stem of journal file;
Updating block is used for:It is since the stem of journal file at L-X sizes to update cursor position.
Alternatively, judging unit is additionally operable to:
If the size L of log information to be stored is not more than the first storage value X, storage is to be stored since the cursor position Log information;
Updating block is additionally operable to:
It is since cursor position at L sizes to update cursor position.
Alternatively, parameter also includes the daily record rank of journal file;
Judging unit specifically for:Judge whether log information to be stored meets the other requirement of journal stage;
If meeting, judge whether the size L of log information to be stored is more than the first storage value X.
Alternatively, judging unit is specifically additionally operable to:
Judge whether it is to first switch on journal file;
If so, then setting the parameter of journal file, and parameter is preserved into journal file;
If it is not, then reading the parameter of journal file from journal file.
Alternatively, judging unit is specifically additionally operable to:
It is journal file to judge whether the current stored value N of journal file is more than the second storage value M, the second storage value M Maximum storage value;
If so, then deleting in journal file the earliest log information of storage time until the current stored value N of journal file Less than or equal to the second storage value M and Update log file cursor position.
The embodiments of the invention provide a kind of method and device of log information storage, the parameter of journal file, ginseng are obtained Number includes the cursor position of journal file, and cursor position is used for the storage location for indicating log information;Judge daily record to be stored It is not storing from cursor position to log file trailer that whether the size L of information, which is more than the first storage value X, the first storage value X, The memory space of log information;If so, then by the preceding X data of log information to be stored since being stored cursor position to daily record The afterbody of file, and by the rear L-X data of log information to be stored since being stored the stem of journal file to L-X sizes Place;It is since the stem of journal file at L-X sizes to update cursor position.The embodiment of the present invention obtains the ginseng of journal file After number, if the size L of log information to be stored is more than the first storage value X, by the preceding X numbers of log information to be stored According to the afterbody since being stored cursor position to journal file, and the rear L-X data of log information to be stored are literary from daily record The stem of part starts to store to L-X sizes, so as to realize that automatic cycle stores log information in same journal file, has Effect control disk storage space, improves the performance of system, due to being to store log information in same journal file, if after It is continuous to need to be also convenient for inquiry when inquiry log information, be not in as being stored in the prior art in multiple journal files Each journal file, is also stitched together and inquires about and occur being inconvenient to inquire about day by log information when inquiry log information The problem of will information, in addition, when also updating cursor position after same journal file has stored log information, can conveniently under The position that log information to be stored is stored in journal file is found according to the position of cursor during secondary storage log information.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, makes required in being described below to embodiment Accompanying drawing is briefly introduced, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for this For the those of ordinary skill in field, without having to pay creative labor, it can also be obtained according to these accompanying drawings His accompanying drawing.
Fig. 1 is a kind of method schematic diagram of log information storage provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic flow sheet of journal file initialization procedure provided in an embodiment of the present invention;
Fig. 3 is the schematic flow sheet of another journal file initialization procedure provided in an embodiment of the present invention;
Fig. 4 is a kind of holistic approach flow chart of log information storage provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic device of log information storage provided in an embodiment of the present invention.
Embodiment
In order that the object, technical solutions and advantages of the present invention are clearer, below in conjunction with accompanying drawing the present invention is made into One step it is described in detail, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole implementation Example.Based on the embodiment in the present invention, what those of ordinary skill in the art were obtained under the premise of creative work is not made All other embodiment, belongs to the scope of protection of the invention.
It should be understood that present invention may apply to the journal file in the software systems of various equipment, such as the daily record of base station Journal file of file, various terminals such as mobile phone etc..
The embodiment of the present invention is described in further detail with reference to Figure of description.
Fig. 1 illustrates a kind of method schematic diagram of log information storage provided in an embodiment of the present invention, such as Fig. 1 institutes Show, this method comprises the following steps:
S101:The parameter of journal file is obtained, parameter includes the cursor position of journal file, and cursor position is used to indicate day The storage location of will information;
S102:It is from light to judge whether the size L of log information to be stored is more than the first storage value X, the first storage value X Cursor position to log file trailer the memory space for not storing log information;
S103:If so, then by the preceding X data of log information to be stored since being stored cursor position to journal file Afterbody, and the rear L-X data of log information to be stored are stored to L-X sizes since the stem of journal file;
S104:It is since the stem of journal file at L-X sizes to update cursor position.
Before above-mentioned S101, that is, before the parameter of journal file is obtained, in addition to the initial of journal file The process of change, be in particular:Alternatively, before the parameter for obtaining journal file, in addition to:Judge whether it is to first switch on day Will file;If so, then setting the parameter of journal file, and parameter is preserved into journal file;If it is not, then from journal file Read the parameter of journal file.
Alternatively, before the parameter for obtaining journal file, in addition to:Judge whether the current stored value N of journal file is big In maximum storage values of second the storage value M, the second storage value M for journal file;If so, then deleting storage time in journal file Earliest log information is less than or equal to the light of the second storage value M and Update log file until the current stored value N of journal file Cursor position.
Specifically, the process initialized to journal file is as shown in Fig. 2 Fig. 2 schematically illustrates a kind of daily record text The schematic flow sheet of part initialization procedure, in specific implementation, in being software systems to the process that journal file is initialized Log management module is carried out, and the schematic flow sheet comprises the following steps:
S201:Start;
S202:Judge whether it is to first switch on journal file, if so, then performing S203, otherwise, then perform S204;
S203:The parameter of journal file is set, and parameter is preserved into journal file;S204:Read from journal file Take the parameter of journal file;
S205:Judge whether the current stored value N of journal file is more than the second storage value M, if so, S206 is then performed, it is no Then, then S208 is performed;
S206:The earliest log information of storage time is deleted in journal file until the current stored value N of journal file is small In equal to the second storage value M;
S207:The cursor position of Update log file;
S208:Terminate.
In above-mentioned S202, in specific implementation, judge whether it is that the standard for first switching on journal file can be:When When opening the journal file, if not having the parameter information of log file in journal file, then, the journal file is It is opened for the first time;When opening journal file, if the parameter information of journal file has been have recorded in journal file, but day Parameter information in will file is not parameter set in advance, at this moment, and the parameter information of the journal file, which is likely to be, to be hacked Visitor attacked, and was provided with the parameter of journal file by hacker, at this moment also it is also possible to the journal file is by hacker It has recorded junk information.
If not having the parameter information of log file in the journal file, it is first time quilt to illustrate the journal file Open, then, it is necessary to which to the journal file arrange parameter, the parameter set in specific implementation can include in S203:Daily record The cursor position of file, daily record rank, the second storage value M of journal file, and by the daily record rank and journal file in parameter The second storage value M be saved in the journal file;If system opens journal file, but the journal file is protected by hacker Parameter has been deposited, and parameter information is not parameter set in advance, is at this moment considered to first switch on, this is accomplished by hacker The journal file parameter of setting is deleted, and log management module protects the parameter of setting again to the journal file arrange parameter It is stored in journal file.
Wherein, in specific implementation, the second storage value M of daily record rank and journal file in the parameter of setting can be protected It is that the preceding several character positions most started that parameter storage is specially reserved can also be that journal file is parameter to be stored to journal file The parameter of several character positions at ending that storage is specially reserved, specific save location and preservation needs to take daily record text How many characters of part can be set depending on specific implementation situation.The other log information of journal stage is only met to be possible to be deposited Store up in journal file.In addition, set parameter recorded in journal file, without again into database individually The parameter of journal file is stored, the step of can so saving the resource of network, reduce operation can also be because of conveniently seeing day The parameter of will file and the memory space for efficiently controlling journal file immediately, and then improve the reliability of system.
If not journal file is first switched on, because being already provided with this when journal file is first switched on The parameter of journal file, so in S204, it is only necessary to which the parameter that journal file is directly read from journal file just can be with.
In S205, it is day to judge whether the current stored value N of journal file is more than the second storage value M, the second storage value M The maximum storage value of will file, in specific implementation, if the newly-built journal file of system, then, at this moment daily record text Part is probably an empty journal file, that is, does not store the journal file of any log information, although being also possible to just Individual journal file has been built, but junk information is stored by hacker, so, no matter journal file is empty still to have rubbish Whether information, will be more than the second storage value M judgement to the current stored value N of journal file, wherein the second storage value M is pair The maximum storage value that journal file is set.
In S206, if so, then deleting the earliest log information of storage time working as until journal file in journal file Preceding storage value N is less than or equal to the second storage value M, specifically, if whether the current stored value N of journal file deposits more than second Stored Value M, such as, the second storage value M are 20G, and hacker stores 25G junk information in journal file, then, it is necessary to delete Except the earliest log information of storage time in journal file until journal file current stored value 25G be less than or equal to 20G, this Outside, in specific implementation, as such case, directly junk information all can also be deleted, and not necessarily only by storage time Earliest junk information is deleted.
In S207, the cursor position of Update log file, specifically, if junk information all deleted, then, The cursor position of journal file is the stem of journal file, certainly, if the stem position of journal file stores journal file Parameter information, cursor position is exactly the latter one character position of parameter information, if storage parameter information not in stem, The cursor position so updated is exactly the stem of journal file;If junk information is deleted to making the memory space of journal file Equal to 20G, then cursor position is the afterbody of journal file;If junk information is deleted to making the memory space of journal file Less than 20G, then cursor position is at last junk information.
It should be noted is that, in specific implementation, although judged that the current stored value N of journal file is less than second Storage value M, still, at this moment has the assault journal file again, some junk information is have recorded in journal file, this is just Need to delete some or all of junk information, the cursor position of Update log file, then, based on this point, flow signal In Fig. 2, if the current stored value N of journal file is no more than the second storage value M, the cursor position of Update log file, As shown in Figure 3.Fig. 3 schematically illustrates the schematic flow sheet of another journal file initialization procedure.
In S102, S103 and S104, judge whether the size L of log information to be stored is more than the first storage value X, the One storage value X is the memory space for not storing log information from cursor position to log file trailer;If so, then will be to be stored Log information afterbody of the preceding X data since being stored cursor position to journal file, and by log information to be stored L-X data are stored to L-X sizes since the stem of journal file afterwards, and it is to be opened from the stem of journal file to update cursor position Begin to L-X sizes, specifically, such as, the size L of log information to be stored is 9G, from cursor position to journal file The memory space for not storing log information of afterbody is 8G, then opens the preceding 8G data of log information to be stored from cursor position Beginning store to the afterbody of journal file, by the rear 1G data of log information to be stored since stored the stem of journal file to At 1G sizes, and by the data since before being stored the stem of journal file to 1G sizes by log information to be stored 1G data covers fall afterwards, thus complete the storage of this log information, and cursor position is updated into the head from journal file Portion starts to 1G sizes.S103 and S104 ensure that the log information of storage is the Jin Erke in same journal file Inquiry log information is needed in the future to facilitate, without being also needed to as prior art by the log information splicing of multiple journal files Get up to check, and log information is that automatic cycle storage does not need manual maintenance, can effectively control the storage of disk empty Between.
Alternatively, in addition to:If the size L of log information to be stored is not more than the first storage value X, from cursor position Start to store log information to be stored;It is since cursor position at L sizes to update cursor position.Specifically, such as, If the size L of log information to be stored is 7G, the first storage value X is 9G, then storage is to be stored since the cursor position Log information until by log information to be stored stored and update cursor position be since cursor position to 7G sizes Place.
Before S102, alternatively, parameter also includes the daily record rank of journal file;Judge log information to be stored Whether size L is more than before the first storage value X, in addition to:Judge log information to be stored whether meet journal stage it is other will Ask;If meeting, judge whether the size L of log information to be stored is more than the first storage value X.Specifically, such as daily record The daily record rank of file have typically, it is warning, serious, when setting the daily record rank of journal file for warning, judge to be stored Whether log information meets requirement of the daily record rank for warning, if log information to be stored is alert level, then performs S102.First, set the need for the logging level of journal file is according to equipment, secondly, according to the logging level of setting To judge whether log information to be stored also meets the other requirement of journal stage, if met, be subsequently possible to wait to deposit The log information of storage is stored into journal file, is so on the one hand avoided unnecessary log information and is also stored on daily record text In part, and then the log information of journal file is more simplified, on the other hand can also improve the efficiency diagnosed to system problem, enter And improve the performance of system.
In order to more fully understand this programme, a kind of the overall of log information storage provided in an embodiment of the present invention is thought below Road is described in detail, and a kind of general thought of log information storage provided in an embodiment of the present invention includes two large divisions, first It is divided into the initialization procedure to journal file, Part II is the method for the log information storage to journal file, wherein first Part is having been described above, namely such as Fig. 2 and 3, then, the overall think of of the log information storage of journal file is described below Road, Fig. 4 schematically illustrates a kind of holistic approach flow chart of log information storage, as shown in figure 4, comprising the following steps:
S301:Start;
S302:The parameter of journal file is obtained, parameter includes the cursor position, daily record rank, the first storage of journal file Value X;
S303:Judge whether log information to be stored meets the other requirement of journal stage, if so, S304 is then performed, otherwise, Then perform S309;
S304:Judge whether the size L of log information to be stored is more than the first storage value X, if so, S305 is then performed, Otherwise, then S306 is performed;
S305:Afterbody by the preceding X data of log information to be stored since being stored cursor position to journal file, and The rear L-X data of log information to be stored are stored to L-X sizes since the stem of journal file;
S306:Log information to be stored is stored since the cursor position;
S307:It is since the stem of journal file at L-X sizes to update cursor position;
S308:It is since cursor position at L sizes to update cursor position;
S309:Terminate.
The embodiments of the invention provide a kind of method and device of log information storage, the parameter of journal file, ginseng are obtained Number includes the cursor position of journal file, and cursor position is used for the storage location for indicating log information;Judge daily record to be stored It is not storing from cursor position to log file trailer that whether the size L of information, which is more than the first storage value X, the first storage value X, The memory space of log information;If so, then by the preceding X data of log information to be stored since being stored cursor position to daily record The afterbody of file, and by the rear L-X data of log information to be stored since being stored the stem of journal file to L-X sizes Place;It is since the stem of journal file at L-X sizes to update cursor position.The embodiment of the present invention obtains the ginseng of journal file After number, if the size L of log information to be stored is more than the first storage value X, by the preceding X numbers of log information to be stored According to the afterbody since being stored cursor position to journal file, and the rear L-X data of log information to be stored are literary from daily record The stem of part starts to store to L-X sizes, so as to realize that automatic cycle stores log information in same journal file, has Effect control disk storage space, improves the performance of system, due to being to store log information in same journal file, if after It is continuous to need to be also convenient for inquiry when inquiry log information, be not in as being stored in the prior art in multiple journal files Each journal file, is also stitched together and inquires about and occur being inconvenient to inquire about day by log information when inquiry log information The problem of will information, in addition, when also updating cursor position after same journal file has stored log information, can conveniently under The position that log information to be stored is stored in journal file is found according to the position of cursor during secondary storage log information.
Based on identical technical concept, the embodiment of the present invention also provides a kind of device of log information storage, and Fig. 5 is exemplary Ground shows a kind of schematic device of log information storage, as shown in figure 5, including:Acquiring unit 401, judging unit 402, Updating block 403.Wherein,
Acquiring unit 401 is used for:The parameter of journal file is obtained, parameter includes the cursor position of journal file, cursor position Put the storage location for indicating log information;
Judging unit 402 is used for:Judge whether the size L of log information to be stored is more than the first storage value X, first deposits Stored Value X is the memory space for not storing log information from cursor position to log file trailer;
If so, the then afterbody by the preceding X data of log information to be stored since being stored cursor position to journal file, And store the rear L-X data of log information to be stored to L-X sizes since the stem of journal file;
Updating block 403 is used for:It is since the stem of journal file at L-X sizes to update cursor position.
Alternatively, judging unit 402 is additionally operable to:
If the size L of log information to be stored is not more than the first storage value X, storage is to be stored since the cursor position Log information;
Updating block 403 is additionally operable to:
It is since cursor position at L sizes to update cursor position.
Alternatively, parameter also includes the daily record rank of journal file;
Judging unit 402 specifically for:Judge whether log information to be stored meets the other requirement of journal stage;
If meeting, judge whether the size L of log information to be stored is more than the first storage value X.
Alternatively, judging unit 402 is specifically additionally operable to:
Judge whether it is to first switch on journal file;
If so, then setting the parameter of journal file, and parameter is preserved into journal file;
If it is not, then reading the parameter of journal file from journal file.
Alternatively, judging unit 402 is specifically additionally operable to:
It is journal file to judge whether the current stored value N of journal file is more than the second storage value M, the second storage value M Maximum storage value;
If so, then deleting in journal file the earliest log information of storage time until the current stored value N of journal file Less than or equal to the second storage value M and Update log file cursor position.
The embodiments of the invention provide a kind of device of log information storage, the parameter of journal file is obtained, parameter includes The cursor position of journal file, cursor position is used for the storage location for indicating log information;Judge log information to be stored Whether size L is more than the first storage value X, the first storage value X not store daily record letter from cursor position to log file trailer The memory space of breath;If so, then by the preceding X data of log information to be stored since being stored cursor position to journal file Afterbody, and the rear L-X data of log information to be stored are stored to L-X sizes since the stem of journal file;Update Cursor position is since the stem of journal file at L-X sizes.The embodiment of the present invention is obtained after the parameter of journal file, If the size L of log information to be stored is more than the first storage value X, by the preceding X data of log information to be stored from light Cursor position starts to store to the afterbody of journal file, and by the rear L-X data of log information to be stored from the head of journal file Portion starts to store to L-X sizes, so as to realize that automatic cycle stores log information, effectively control in same journal file Disk storage space, improves the performance of system, due to being to store log information in same journal file, if follow-up need Inquiry is also convenient for when inquiry log information, is not in as storing daily record letter in multiple journal files in the prior art Each journal file, is also stitched together and inquires about and inconvenient inquiry log information occur by breath when inquiry log information The problem of, in addition, when also to update cursor position after same journal file has stored log information, can conveniently storage next time The position that log information to be stored is stored in journal file is found according to the position of cursor during log information.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
, but those skilled in the art once know basic creation although preferred embodiments of the present invention have been described Property concept, then can make other change and modification to these embodiments.So, appended claims are intended to be construed to include excellent Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to comprising including these changes and modification.

Claims (10)

1. a kind of method of log information storage, it is characterised in that including:
The parameter of journal file is obtained, the parameter includes the cursor position of journal file, and the cursor position is used to indicate day The storage location of will information;
It is from the light to judge whether the size L of log information to be stored is more than the first storage value X, the first storage value X Cursor position to the log file trailer the memory space for not storing log information;
If so, then that the preceding X data of the log information to be stored are literary since being stored the cursor position to the daily record The afterbody of part, and the rear L-X data of the log information to be stored are stored to L-X since the stem of the journal file At size;
The cursor position is updated to be described since the stem of the journal file at L-X sizes.
2. the method as described in claim 1, it is characterised in that also include:
If the size L of the log information to be stored is not more than the first storage value X, deposit since the cursor position Store up the log information to be stored;
The cursor position is updated to be described since the cursor position at L sizes.
3. the method as described in claim 1, it is characterised in that the parameter also includes the daily record rank of journal file;
Whether the size L for judging log information to be stored is more than before the first storage value X, in addition to:
Judge whether the log information to be stored meets the other requirement of the journal stage;
If meeting, judge whether the size L of the log information to be stored is more than the first storage value X.
4. the method as described in claim 1, it is characterised in that before the parameter of the acquisition journal file, in addition to:
Judge whether it is to first switch on the journal file;
If so, then setting the parameter of the journal file, and the parameter is preserved into the journal file;
If it is not, then reading the parameter of the journal file from the journal file.
5. method as claimed in claim 4, it is characterised in that before the parameter for obtaining journal file, in addition to:
It is the day to judge whether the current stored value N of the journal file is more than the second storage value M, the second storage value M The maximum storage value of will file;
If so, it is currently stored until the journal file then to delete the earliest log information of storage time in the journal file Value N is less than or equal to the second storage value M and updates the cursor position of the journal file.
6. a kind of device of log information storage, it is characterised in that including:
Acquiring unit, the parameter for obtaining journal file, the parameter includes the cursor position of journal file, the cursor position Put the storage location for indicating log information;
Judging unit, for judging whether the size L of log information to be stored is more than the first storage value X, first storage Value X is the memory space for not storing log information from the cursor position to the log file trailer;
If so, then that the preceding X data of the log information to be stored are literary since being stored the cursor position to the daily record The afterbody of part, and the rear L-X data of the log information to be stored are stored to L-X since the stem of the journal file At size;
Updating block, for updating the cursor position to be described since the stem of the journal file at L-X sizes.
7. device as claimed in claim 6, it is characterised in that
The judging unit, if the size L for being additionally operable to the log information to be stored is not more than the first storage value X, The storage log information to be stored since the cursor position;
The updating block, is additionally operable to update the cursor position to be described since the cursor position at L sizes.
8. device as claimed in claim 6, it is characterised in that the parameter also includes the daily record rank of journal file;
The judging unit, specifically for judging whether the log information to be stored meets the other requirement of the journal stage;
If meeting, judge whether the size L of the log information to be stored is more than the first storage value X.
9. device as claimed in claim 6, it is characterised in that
The judging unit, is specifically additionally operable to judge whether be to first switch on the journal file;
If so, then setting the parameter of the journal file, and the parameter is preserved into the journal file;
If it is not, then reading the parameter of the journal file from the journal file.
10. device as claimed in claim 9, it is characterised in that
The judging unit, is specifically additionally operable to judge whether the current stored value N of the journal file is more than the second storage value M, The second storage value M is the maximum storage value of the journal file;
If so, it is currently stored until the journal file then to delete the earliest log information of storage time in the journal file Value N is less than or equal to the second storage value M and updates the cursor position of the journal file.
CN201710122964.7A 2017-03-03 2017-03-03 A kind of method and device of log information storage Pending CN107016054A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710122964.7A CN107016054A (en) 2017-03-03 2017-03-03 A kind of method and device of log information storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710122964.7A CN107016054A (en) 2017-03-03 2017-03-03 A kind of method and device of log information storage

Publications (1)

Publication Number Publication Date
CN107016054A true CN107016054A (en) 2017-08-04

Family

ID=59440541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710122964.7A Pending CN107016054A (en) 2017-03-03 2017-03-03 A kind of method and device of log information storage

Country Status (1)

Country Link
CN (1) CN107016054A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920349A (en) * 2018-06-25 2018-11-30 郑州云海信息技术有限公司 The management method and device of daily record data
CN112965833A (en) * 2021-02-23 2021-06-15 新华三信息安全技术有限公司 Log processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1361489A (en) * 2000-12-28 2002-07-31 深圳市中兴通讯股份有限公司 Automatic circular daily record information storing method and system
CN1725728A (en) * 2004-07-22 2006-01-25 华为技术有限公司 Buffer management method based on signaling protocol
CN102981944A (en) * 2012-12-12 2013-03-20 青岛海信宽带多媒体技术有限公司 Log storage method based on file system
CN103605485A (en) * 2013-11-29 2014-02-26 深圳市道通科技有限公司 Variable-length data storing method and device
CN103902434A (en) * 2012-12-29 2014-07-02 北京谊安医疗系统股份有限公司 Alarm log management method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1361489A (en) * 2000-12-28 2002-07-31 深圳市中兴通讯股份有限公司 Automatic circular daily record information storing method and system
CN1725728A (en) * 2004-07-22 2006-01-25 华为技术有限公司 Buffer management method based on signaling protocol
CN102981944A (en) * 2012-12-12 2013-03-20 青岛海信宽带多媒体技术有限公司 Log storage method based on file system
CN103902434A (en) * 2012-12-29 2014-07-02 北京谊安医疗系统股份有限公司 Alarm log management method and system
CN103605485A (en) * 2013-11-29 2014-02-26 深圳市道通科技有限公司 Variable-length data storing method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920349A (en) * 2018-06-25 2018-11-30 郑州云海信息技术有限公司 The management method and device of daily record data
CN112965833A (en) * 2021-02-23 2021-06-15 新华三信息安全技术有限公司 Log processing method and device

Similar Documents

Publication Publication Date Title
CN103559299B (en) Method, device and mobile terminal for cleaning up files
CN103559054B (en) Realization, delet method and the device of intelligent terminal multi-operation system
CN101673192B (en) Method for time-sequence data processing, device and system therefor
CN105989076A (en) Data statistical method and device
CN105245360A (en) Data center operation and maintenance monitoring and alarming white list system
CN113542263B (en) Firewall policy migration method and device
CN107491322A (en) A kind of control method and device of parameter storage
CN106874342A (en) A kind of page display method and device
CN108804207A (en) A kind of process management-control method based on android system
CN106528000A (en) Data storage device and read-write performance optimization method and system thereof
CN110851280A (en) Automatic data acquisition method based on distributed intelligent edge computing technology
CN109324918A (en) Processing method and processing device, terminal and the storage medium of application exception
CN105867962A (en) System upgrading method and device
CN106648796A (en) Application processing method and device
CN107016054A (en) A kind of method and device of log information storage
CN105893471A (en) Data processing method and electronic equipment
CN109782736A (en) Vehicle data read method, device, mobile unit
CN110187895A (en) Allocating operating system method, apparatus, equipment and computer readable storage medium
CN104268193A (en) Advertisement webpage intercepting method and device
CN105045542B (en) A kind of method and device for realizing snapshot management
CN113806594A (en) Business data processing method, device, equipment and storage medium based on decision tree
CN107229421A (en) The establishment of video data storage systems, file write and read method and device
CN106502588A (en) A kind of memory space management and storage device
CN106550423A (en) A kind of access point management method and terminal
CN104331948B (en) Tachographs upgrade information sending method, method of reseptance, apparatus and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180222

Address after: 510663 Shenzhou Road, Guangzhou Science City, Guangzhou, Guangzhou economic and Technological Development Zone, Guangdong Province, No. 10

Applicant after: Comba Telecom System (China) Co., Ltd.

Applicant after: Comba Telecom Systems (Guangzhou) Co., Ltd.

Applicant after: Jingxin Communication Technology (Guangzhou) Co., Ltd.

Applicant after: TIANJIN COMBA TELECOM SYSTEMS CO., LTD.

Address before: 510663 Guangdong city of Guangzhou province Guangzhou economic and Technological Development Zone Jinbi Road No. 6

Applicant before: Jingxin Communication Technology (Guangzhou) Co., Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200103

Address after: 510663 Shenzhou Road 10, Guangzhou Science City, Guangzhou economic and Technological Development Zone, Guangzhou, Guangdong

Applicant after: Jingxin Communication System (China) Co., Ltd.

Address before: 510663 Shenzhou Road, Guangzhou Science City, Guangzhou, Guangzhou economic and Technological Development Zone, Guangdong Province, No. 10

Applicant before: Jingxin Communication System (China) Co., Ltd.

Applicant before: Jingxin Communication System (Guangzhou) Co., Ltd.

Applicant before: Jingxin Communication Technology (Guangzhou) Co., Ltd.

Applicant before: TIANJIN COMBA TELECOM SYSTEMS CO., LTD.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170804