CN110334064A - A kind of processing method and relevant apparatus of journal file - Google Patents
A kind of processing method and relevant apparatus of journal file Download PDFInfo
- Publication number
- CN110334064A CN110334064A CN201910530733.9A CN201910530733A CN110334064A CN 110334064 A CN110334064 A CN 110334064A CN 201910530733 A CN201910530733 A CN 201910530733A CN 110334064 A CN110334064 A CN 110334064A
- Authority
- CN
- China
- Prior art keywords
- journal file
- client
- server
- operation information
- log
- 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
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/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- 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
Abstract
The embodiment of the present application provides the processing method and relevant apparatus of a kind of journal file, the method is applied to server, the described method includes: server creates N number of journal file within one day, and save the N number of journal file in memory, journal file i is used to save can be with operation information of the M client of server communication in the corresponding time interval of the journal file i;N and M is the integer greater than 1, and journal file i is any journal file in N number of journal file;Server obtains the operation information of M client and obtains the acquisition moment of any operation information, and the operation information of client j is triggered by the user of operation client j to be generated, and client j is any client in M client;The operation information of M client is saved in journal file corresponding with the operation information acquisition moment by server.Using technical solution provided by the embodiments of the present application, journal file inquiry and processing speed can be improved.
Description
Technical field
This application involves field of computer technology, and in particular to a kind of processing method and relevant apparatus of journal file.
Background technique
In Internet application, the corresponding server of usual multiple client, the operation information of multiple client is with day
The mode of will file saves in the server, when client encounters problems, can be convenient positioning by query log files and produces
The reason of raw problem, the create-rule of journal file is the journal file generated based on the date, daily all logs at present
It will be recorded in a file, with riseing for portfolio, log increases at geometric index, and individual log file is increasingly
Greatly, can be slow when checking and searching for journal file since journal file is too big, it has seriously affected test and production environment is fixed
The efficiency of position problem, and limited by server disk space, journal file needs timing to clear up, the deletion speed of single big file
Degree is slow, also inconvenient to restore.
Summary of the invention
The embodiment of the present application provides the processing method and relevant apparatus of a kind of journal file, can be improved journal file and looks into
Inquiry and processing speed.
In a first aspect, the embodiment of the present application provides a kind of processing method of journal file, the method is applied to service
Device, described method includes following steps.
The server creates N number of journal file within one day, and N number of journal file is stored in memory
In, journal file i is used to save can be with M client of server communication in the journal file i corresponding time
Operation information in section;The N is the integer greater than 1, and the M is the integer greater than 1, and the journal file i is described N number of
Any journal file in journal file;
The server obtains the operation information of the M client and obtains the acquisition moment of any operation information,
The operation information of client j is triggered by the user for operating the client j and is generated, and the client j is in the M client
Any client;
The operation information of the M client is saved in corresponding with the operation information acquisition moment by the server
In journal file.
Implement the embodiment of the present application, server creates multiple journal files within one day, any journal file save with
The operation information for the multiple client that server is communicated, the processing method of this journal file, due to each journal file
A period is respectively corresponded, when integration time point is inquired, target journaling file can be found quickly.Additionally, due to
Individual log file is smaller, is conducive to quickly handle the journal file found.
In some possible embodiments of the application, the server creates N number of journal file within one day, packet
It includes:
The server creates N number of journal file daily, and N number of journal file respectively corresponds (24/N) within one day
Hour, each journal file is used to save the operation information of the M client in its corresponding time interval.Some
In possible embodiment, server can create 24 log texts at the daily zero point moment, and each journal file saves multiple clients
It holds and corresponds to the operation information of time interval generation in journal file.
In some possible embodiments of the application, the server creates N number of journal file within one day, packet
It includes:
The server creates a journal file, the log at any preset time point ((24/N) * p- (24/N))
File is used to save the operation information that any preset time point is generated to any client between next preset time point, p
For integer, and 1≤p≤N.
In some possible embodiments of the application, the method also includes:
The server obtains log query request, include in the log query request for position journal file when
Between information;
The server is according to log query request determination and the matched journal file of the temporal information.
The embodiment of the present application provides a kind of querying method of multiple journal files, when server obtains log query request
Afterwards, server according to log query request in temporal information it is determining with the matched journal file of temporal information.It should be understood that
It include temporal information in log query request, shown temporal information is used for the journal file of locating query.
In some possible embodiments of the application, if quick including what is specified in the operation information of the M client
Feel information, the server obtains log query solicited message and determined and the matched journal file of the temporal information
Afterwards, the method also includes:
The server will be replaced with the preset character of sensitive information in the matched journal file of the temporal information
And feed back to inquiring client terminal.
When the embodiment of the present application inquires journal file, if including the case where in journal file, sensitive information is carried out
It limits, server will be replaced with the preset character of sensitive information in the matched journal file of inquiry request.
In some possible embodiments of the application, the method also includes:
The server obtains the Permission Levels for triggering the user of the log query request, the user of different rights grade
When checking journal file, the corresponding preset character of the specified sensitive information is different.
When the embodiment of the present application inquires journal file, the different rights of user are defined, different rights
For the user of grade when checking journal file, the corresponding preset character of specified sensitive information is different.
In some possible embodiments of the application, the method also includes:
The server obtains the request of the promotion search access right grade of user's triggering;
If the requests verification for promoting search access right grade passes through, the server will be matched with the temporal information
Journal file in the sensitive information shown with character corresponding with the permission after upgrading.
The embodiment of the present application is defined to search access right is promoted, specifically, if promoting the request of search access right grade
After being verified, server by with sensitive information in the matched journal file of temporal information with the corresponding character of permission after upgrading
It is shown.
In some possible embodiments of the application, the method also includes:
The server obtains the information of residual storage capacity in the memory;
The residual storage capacity of the server in the memory is deleted in the memory most when being less than preset value
The K journal file early created, the K are the integer greater than 1 or equal to 1.
The embodiment of the present application is defined the deletion of journal file, specifically, the residual storage capacity in memory
One or more earliest created journal file in memory is deleted when less than preset value.
Second aspect, the embodiment of the present application provide a kind of journal file processing unit, are applied to server, described device
Include:
Processing unit is stored in storage for creating N number of journal file within one day, and by N number of journal file
In device, journal file i is used to save the M client that can be communicated with the server when the journal file i is corresponding
Between operation information in section;The N is the integer greater than 1, and the M is the integer greater than 1, and the journal file i is the N
Any journal file in a journal file;
Acquiring unit, when for obtaining the operation information of the M client and obtain the acquisition of any operation information
It carves, the operation information of client j is triggered by the user for operating the client j to be generated, and the client j is the M client
Any client in end;
Storage unit, the operation information of the M client for obtaining the acquiring unit be saved in it is described
In operation information acquisition moment corresponding journal file.
Implement the embodiment of the present application, server creates multiple journal files within one day, any journal file save with
The operation information for the multiple client that server is communicated, the processing method of this journal file, due to each journal file
A period is respectively corresponded, when integration time point is inquired, target journaling file can be found quickly.Additionally, due to
Individual log file is smaller, is conducive to quickly handle the journal file found
In some possible embodiments of the application, the processing unit creates N number of journal file side within one day
Face, specifically for creating N number of journal file daily, N number of journal file respectively corresponds (24/N) hour within one day, often
A journal file is used to save the operation information of the M client in its corresponding time interval.Some possible
In embodiment, N can be 24, and processor can 24 log texts of zero point moment creation daily.24 journal files difference
A hour within one day corresponding, each journal file is for saving the M client in its corresponding time interval
The operation information at end.
In some possible embodiments of the application, the processing unit creates N number of journal file side within one day
Face has for creating a journal file at any preset time point ((24/N) * p- (24/N)), and the journal file is used for
The operation information that any preset time point is generated to any client between next preset time point is saved, p is integer, and
1≤p≤N。
In some possible embodiments of the application,
The acquiring unit is also used to, and is obtained log query solicited message, is included for fixed in the log query request
The temporal information of position journal file;
The processing unit is also used to, the log query solicited message determination obtained according to the acquiring unit and institute
State the matched journal file of temporal information.
The embodiment of the present application provides a kind of querying method of multiple journal files, when server obtains log query request
Afterwards, server according to log query request in temporal information it is determining with the matched journal file of temporal information.
In some possible embodiments of the application, the processing unit is also used to, if the operation of the M client
It include specified sensitive information in information, the server obtains log query solicited message and determined and the time
After the journal file of information matches, it will be replaced with the sensitive information in the matched journal file of the temporal information with preset character
It changes and feeds back to inquiring client terminal.
When the embodiment of the present application inquires journal file, if including the case where in journal file, sensitive information is carried out
It limits, server will be replaced with the preset character of sensitive information in the matched journal file of inquiry request.
In some possible embodiments of the application, the acquiring unit is also used to, and is obtained and is triggered the log query
The Permission Levels of the user of request, the user of different rights grade is when checking journal file, the specified sensitive information pair
The preset character answered is different.
When the embodiment of the present application inquires journal file, the different rights of user are defined, different rights
For the user of grade when checking journal file, the corresponding preset character of specified sensitive information is different.
In some possible embodiments of the application, the acquiring unit is also used to, and obtains mentioning for user's triggering
Rise the request of search access right grade;
The processing unit is also used to, if the requests verification for promoting search access right grade passes through, the sensitive letter
Breath is shown with character corresponding with the permission after upgrading.
The embodiment of the present application is defined to search access right is promoted, specifically, if promoting the request of search access right grade
After being verified, server by with sensitive information in the matched journal file of temporal information with the corresponding character of permission after upgrading
It is shown.
In some possible embodiments of the application, the processing unit is also used to, and is obtained remaining in the memory
The information of memory capacity;
Described device further include: unit is deleted,
The deletion unit deletes the storage when being less than preset value for residual storage capacity in the memory
Earliest created K journal file in device, the K are the integer greater than 1 or equal to 1.
The embodiment of the present application is defined the deletion of journal file, specifically, the residual storage capacity in memory
One or more earliest created journal file in memory is deleted when less than preset value.
The third aspect, the embodiment of the present application provide a kind of terminal, including processor, input equipment, output equipment and deposit
Reservoir, the processor, input equipment, output equipment and memory are connected with each other, wherein the memory is calculated for storing
Machine program, the computer program include program instruction, and the processor is configured for calling described program instruction, execute the
Method described in one side or any possible embodiment of first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer readable storage medium, the computer storage medium
It is stored with computer program, the computer program includes program instruction, and described program instruction, which is worked as, is executed by processor first party
Method described in face or any possible embodiment of first aspect.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of corresponding system architecture schematic diagram of processing method of journal file provided by the embodiments of the present application.
Fig. 2A is a kind of flow diagram of the processing method of journal file provided by the embodiments of the present application.
Fig. 2 B is a kind of flow diagram of the processing method for journal file that another embodiment of the application provides.
Fig. 2 C is a kind of flow diagram of the processing method for journal file that another embodiment of the application provides.
Fig. 2 D is a kind of flow diagram of the processing method for journal file that another embodiment of the application provides.
Fig. 3 A is a kind of structural schematic diagram of the processing unit of journal file provided by the embodiments of the present application.
Fig. 3 B is a kind of structural schematic diagram of the processing unit for journal file that another embodiment of the application provides.
Fig. 4 is a kind of structural schematic diagram of terminal provided by the embodiments of the present application.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, instead of all the embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
The description and claims of this application and term " first " in above-mentioned attached drawing, " second " etc. are for distinguishing
Different objects, are not use to describe a particular order.In addition, term " includes " and " having " and their any deformations, it is intended that
It is to cover and non-exclusive includes.Such as the process, method, system, product or equipment for containing a series of steps or units do not have
It is defined in listed step or unit, but optionally further comprising the step of not listing or unit, or optionally also wrap
Include other step or units intrinsic for these process, methods, product or equipment.
" embodiment " mentioned in this application is it is meant that a particular feature, structure, or characteristic described can be in conjunction with the embodiments
Included at least one embodiment of the application.The phrase, which occurs, in each position in the description might not each mean phase
Same embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art are explicitly
Implicitly understand, embodiments described herein can be combined with other embodiments.
Server involved by the embodiment of the present application can be desktop computer, server etc. with communication and processing function
Equipment.Client can be the terminal devices such as mobile phone, plate, notebook, and client software, server etc. are mounted in client
Server software is installed in equipment, the operation of client is recorded in the log of server, in the prior art, by user to client
When the operation at end is recorded, the method for use is the daily operation information for generating a log recording same day client, in this way
Operation log Documents Comparison is big, the time required to scanning for the content in journal file or being handled journal file all
It is long.Multiple journal files are arranged in technical solution provided by the present application in one day.
In order to better understand the embodiment of the present application, first below to a kind of journal file provided by the embodiments of the present application
Processing method is briefly introduced.
Refering to Figure 1, being related to server 101 and multiple client when implementing the processing method of journal file
102.As shown in Figure 2 A, a kind of processing method of journal file is applied to server, and described method includes following steps:
S201, server create N number of journal file within one day, and N number of journal file is stored in memory
In, journal file i is used to save can be with M client of server communication in the journal file i corresponding time
Operation information in section;The N is the integer greater than 1, and the M is the integer greater than 1, and the journal file i is described N number of
Any journal file in journal file.
In some possible embodiments, server creates N number of journal file within one day, comprising: server is every
It creates N number of journal file, and N number of journal file respectively corresponds (24/N) hour within one day, each log text
Part is used to save the operation information of the M client in its corresponding time interval.For example, N can be 24, server
24 journal files are created in daily zero point, 24 journal files respectively correspond a hour within one day, Mei Gesuo
Journal file is stated for saving the operation information of the M client in its corresponding time interval.
For example 24 journal files are created when daily zero point, a journal file is small for saving specified one
Log information in Shi Shichang, log information include operation information of the user in client for being server acquisition.For example, first
A journal file is used to save 0 point to 1 point of log information, and second journal file is used to save 1 point to 2 points of log letter
Breath, third journal file are used to save 2 points to 3 points of log information.
Server obtain client operation triggering operation information, if obtain operation information time be 9 points 10 minutes,
Operation information can be saved in the tenth journal file.For example user is carried out by the login that client obtains user, then is taken
The information such as the user name of business device record user's input and login password.
It should be noted that journal file is also possible to the journal file that server is generated in the triggering of preset time point, than
Such as, server creates a journal file at any preset time point ((24/N) * p- (24/N)), and p is integer, and 1≤p≤N,
By taking N is 24 as an example, the journal file of integral point triggering generation.For example the 11st log is generated at 10, when 15 o'clock sharp, triggers the
16 logs.For example, 13 points of operations in 15 minutes are stored in the 14th log.
For example user is carried out by the login that client obtains user, then the user name and step on that server record user inputs
Record the information such as password.
In some possible embodiments, server creates N number of journal file within one day, comprising:
The server creates a journal file in any preset time point, and the journal file is for saving described appoint
The operation information that 1 preset time point is generated to any client between next preset time point.For example, wound can be preset
At the time of building journal file, can specifically feel amount of access determine creation journal file at the time of, when business access amount is big,
The time interval for creating journal file is shorter, and business access amount hour, the time interval for creating journal file is longer, for example, logical
A journal file can be created with per half an hour more than threshold value if crossing statistics and obtaining 9 points to 11 business access amounts, for example divided
Journal file is not created in, 9 thirty, 10 thirty at 9 points at 10 points, remaining period is per one journal file of creation every other hour.
S202, the server obtain the operation information of the M client and obtain the acquisition of any operation information
At the moment, the operation information of client j is triggered by the user for operating the client j to be generated, and the client j is the M visitor
Any client in the end of family.
The operation information of the M client is saved in and the operation information acquisition moment by S203, the server
In corresponding journal file.
Since individual log file is smaller, when searching for log query problem, search speed is many fastly, increases solution and asks
The efficiency of topic, and when clearing up journal file, the speed of small documents cleaning is more many fastly than the speed for clearing up single especially big file.
As shown in Figure 2 B, a kind of processing method of journal file is applied to server, and described method includes following steps:
S201, server create N number of journal file within one day, and N number of journal file is stored in memory
In, journal file i is used to save can be with M client of server communication in the journal file i corresponding time
Operation information in section;The N is the integer greater than 1, and the M is the integer greater than 1, and the journal file i is described N number of
Any journal file in journal file.
In some possible embodiments, server creates N number of journal file within one day, comprising:
Server creates 24 journal files in daily zero point, and 24 journal files respectively correspond one within one day
A hour, each journal file are used to save the operation information of the M client in its corresponding time interval.
For example 24 journal files are created when daily zero point, a journal file is small for saving specified one
Log information in Shi Shichang, log information include operation information of the user in client for being server acquisition.For example, first
A journal file is used to save 0 point to 1 point of log information, and second journal file is used to save 1 point to 2 points of log letter
Breath, third journal file are used to save 2 points to 3 points of log information.
Server obtain client operation triggering operation information, if obtain operation information time be 9 points 10 minutes,
Operation information can be saved in the 9th journal file.For example user is carried out by the login that client obtains user, then is taken
The information such as the user name of business device record user's input and login password.
It should be noted that journal file is also possible to the journal file that the triggering of server integral point generates.Such as at 10
Generate the 11st log, when 15 o'clock sharp triggers the 16th log.For example, 13 points of operations in 15 minutes were stored in for the 14th day
In will.
For example user is carried out by the login that client obtains user, then the user name and step on that server record user inputs
Record the information such as password.
In some possible embodiments, server creates N number of journal file within one day, comprising:
The server creates a journal file in any preset time point, and the journal file is for saving described appoint
The operation information that 1 preset time point is generated to any client between next preset time point.
S202, the server obtain the operation information of the M client and obtain the acquisition of any operation information
At the moment, the operation information of client j is triggered by the user for operating the client j to be generated, and the client j is the M visitor
Any client in the end of family.
The operation information of the M client is saved in and the operation information acquisition moment by S203, the server
In corresponding journal file.
S204, the server obtain log query request, include for positioning log text in the log query request
The temporal information of part.
In some possible embodiments, server can also obtain the request for deleting log, according to deletion log
Request, server can delete the journal file saved in memory.
S205, the server are according to log query request determination and the matched journal file of the temporal information.
In order to improve the safety of system, information leakage is prevented, in some possible embodiments, if the M client
Include specified sensitive information in the operation information at end, the server obtain log query solicited message and determined with
After the matched journal file of temporal information, the method also includes:
The server will be replaced with the preset character of sensitive information in the matched journal file of the temporal information
And feed back to inquiring client terminal.Such as when opening includes the log of user name and user login code, in the log of display, use
The login password at family can be shown with preset * * * * * * * * to replace user name.
It can be the different search access right of different grades of user setting, different grades of user to improve safety
In query log files, the result that specified sensitive information shows different grades of user can be different.Such as it can be with
Be arranged user grade include A B tri- ranks of C.User can inquire some period corresponding journal file, such as can be with
Inquire the log in 9 points to 10 points of December 1 in 2018.Show that content there can be area when different grades of user query journal file
Not, for example, when grade is the user query journal file of A, the name of the user being queried, ID card No., login password are all
It is shown with * * * *.When grade is the user query journal file of B, the name for the user being queried shows that surname does not show name, body
Part card number only shows last two, and login password is shown with * * * *.When grade is the user query journal file of C, it is queried
User name ID card No. login password can all show.
Since individual log file is smaller, when query log files, search speed is many fastly, improves the effect solved the problems, such as
Rate improves the safety of system by the search access right different for different grades of user setting.
As shown in Figure 2 C, a kind of processing method of journal file is applied to server, and described method includes following steps:
S201, server create N number of journal file within one day, and N number of journal file is stored in memory
In, journal file i is used to save can be with M client of server communication in the journal file i corresponding time
Operation information in section;The N is the integer greater than 1, and the M is the integer greater than 1, and the journal file i is described N number of
Any journal file in journal file.
In some possible embodiments, server creates N number of journal file within one day, comprising:
Server creates 24 journal files in daily zero point, and 24 journal files respectively correspond one within one day
A hour, each journal file are used to save the operation information of the M client in its corresponding time interval.
For example 24 journal files are created when daily zero point, a journal file is small for saving specified one
Log information in Shi Shichang, log information include operation information of the user in client for being server acquisition.For example, first
A journal file is used to save 0 point to 1 point of log information, and second journal file is used to save 1 point to 2 points of log letter
Breath, third journal file are used to save 2 points to 3 points of log information.
Server obtain client operation triggering operation information, if obtain operation information time be 9 points 10 minutes,
Operation information can be saved in the 9th journal file.For example user is carried out by the login that client obtains user, then is taken
The information such as the user name of business device record user's input and login password.
It should be noted that journal file is also possible to the journal file that the triggering of server integral point generates.Such as at 10
Generate the 11st log, when 15 o'clock sharp triggers the 16th log.For example, 13 points of operations in 15 minutes were stored in for the 14th day
In will.
For example user obtains the log-on message of user by client, then the user name and step on that server record user inputs
Record the information such as password.
In some possible embodiments, server creates N number of journal file within one day, comprising:
The server creates a journal file in any preset time point, and the journal file is for saving described appoint
The operation information that 1 preset time point is generated to any client between next preset time point.
S202, the server obtain the operation information of the M client and obtain the acquisition of any operation information
At the moment, the operation information of client j is triggered by the user for operating the client j to be generated, and the client j is the M visitor
Any client in the end of family.
The operation information of the M client is saved in and the operation information acquisition moment by S203, the server
In corresponding journal file.
S204, the server obtain log query request, include for positioning log text in the log query request
The temporal information of part.
In some possible embodiments, server can also obtain the request for deleting log, according to deletion log
Request, server can delete the journal file saved in memory.
In some possible embodiments, server can also obtain the power for triggering the user of the log query request
Grade is limited, the user of different rights grade is when checking journal file, the corresponding preset character of the specified sensitive information
It is different.
It should be noted that journal file provided by the embodiments of the present application can be accessed in real time.
Log content is recorded in real time in journal file, and journal file is stored in linux server, logs in linux clothes
Being engaged in device can be with real time access journal file, when it is implemented, can pass through different order real time inspection files.For example, Linux
Tail order can be used under server, file can be write into standard since specified point with real time inspection log, tail order
Output, the journal file changed using the access that-f option of tail order can be convenient, tail-f filename can be
The content of most tail portion is displayed on the screen in filename, and is constantly refreshed, it can be seen that newest file content.It checks
Journal file is, can check different contents, be exemplified below by setting different parameters:
Tail-n 5log2014.log checks the last 5 row content of file
Tail-f test.log checks the content of file most tail portion, and constantly refreshes, and is checked with Ctrl+c to terminate
Tail-n+5log2014.log shows file since the 5th row
Using cat order under linux, it is to look at entire file.
Cat filename checks entire file
Cat file | grep keyword, by grep order according to the entire file of keyword search
S205, the server are according to log query request determination and the matched journal file of the temporal information.
In some possible embodiments, as an improvement, after user query log, if the content of display is not able to satisfy it
Demand, can trigger promoted Permission Levels request, such as active user grade when A, be queried in inquiry log
The title of user, ID card No., login password are all shown with * * * *, are not able to satisfy the query demand of user, at this moment can be touched
Hair promotes the request of Permission Levels, for example user can trigger preset promotion Permission Levels key, and then pop-up promotes permission
Level authentication window can promote rank corresponding with grade is verified if being verified, for example the grade of user has A
Grade, which is promoted, arrives B grades.
S206, the server obtain the request of the promotion search access right grade of user's triggering.
If S207, the requests verification for promoting search access right grade pass through, the server will be believed with the time
The sensitive information in matched journal file is ceased to be shown with character corresponding with the permission after upgrading.
Since individual log file is smaller, when query log files, search speed is many fastly, improves the effect solved the problems, such as
Rate, user can promote the request of search access right grade by triggering, promote the permission of inquiry.
The program generates multiple journal files within one day, for example generates journal file by the hour, and filename is with current
Date and current time are ending, are equivalent in this way daily single big file declustering into 24 files, when inquiry log
The log for the time search response for only needing to be generated according to log.Since each journal file only had recorded within the scope of 1 hour
Log, file size reduces the efficiency for much considerably increasing blog search, clears up when clearing up journal file multiple small
The speed of file also can be more many fastly than clearing up the speed of single especially big file.
It please refers to shown in Fig. 2 D, when implementing the processing method of journal file, is related to server 101 and multiple client
102.As shown in Figure 2 D, a kind of processing method of journal file is applied to server, and described method includes following steps:
S201, server create N number of journal file within one day, and N number of journal file is stored in memory
In, journal file i is used to save can be with M client of server communication in the journal file i corresponding time
Operation information in section;The N is the integer greater than 1, and the M is the integer greater than 1, and the journal file i is described N number of
Any journal file in journal file.
In some possible embodiments, server creates N number of journal file within one day, comprising: server exists
Daily zero point creates 24 journal files, and 24 journal files respectively correspond a hour within one day, each described
Journal file is used to save the operation information of the M client in its corresponding time interval.
For example 24 journal files are created when daily zero point, a journal file is small for saving specified one
Log information in Shi Shichang, log information include operation information of the user in client for being server acquisition.For example, first
A journal file is used to save 0 point to 1 point of log information, and second journal file is used to save 1 point to 2 points of log letter
Breath, third journal file are used to save 2 points to 3 points of log information.
Server obtain client operation triggering operation information, if obtain operation information time be 9 points 10 minutes,
Operation information can be saved in the tenth journal file.For example user is carried out by the login that client obtains user, then is taken
The information such as the user name of business device record user's input and login password.
It should be noted that journal file is also possible to the journal file that the triggering of server integral point generates.Such as at 10
Generate the 11st log, when 15 o'clock sharp triggers the 16th log.For example, 13 points of operations in 15 minutes were stored in for the 14th day
In will.
For example user is carried out by the login that client obtains user, then the user name and step on that server record user inputs
Record the information such as password.
In some possible embodiments, server creates N number of journal file within one day, comprising:
The server creates a journal file in any preset time point, and the journal file is for saving described appoint
The operation information that 1 preset time point is generated to any client between next preset time point.For example, wound can be preset
At the time of building journal file, can specifically feel amount of access determine creation journal file at the time of, when business access amount is big,
The time interval for creating journal file is shorter, and business access amount hour, the time interval for creating journal file is longer, for example, logical
A journal file can be created with per half an hour more than threshold value if crossing statistics and obtaining 9 points to 11 business access amounts, for example divided
Journal file is not created in, 9 thirty, 10 thirty at 9 points at 10 points, remaining period is per one journal file of creation every other hour.
S202, the server obtain the operation information of the M client and obtain the acquisition of any operation information
At the moment, the operation information of client j is triggered by the user for operating the client j to be generated, and the client j is the M visitor
Any client in the end of family.
The operation information of the M client is saved in and the operation information acquisition moment by S203, the server
In corresponding journal file.
S204, the server obtain the information of residual storage capacity in the memory;
S205, the residual storage capacity of the server in the memory delete the memory when being less than preset value
In earliest created K journal file, the K is integer greater than 1 or equal to 1.
Since individual log file is smaller, when clearing up journal file, the speed of small documents cleaning is single more especially big than clearing up
The speed of file is many fastly, and by deleting one or more journal file more early created in memory, it is ensured that
Subsequent journal file has enough memory spaces.
It should be understood that the above method is not limited to the deletion of journal file in memory space, it can also be periodically clear daily
Journal file is managed, for example can be set daily 0: 10 and distinguish log of the reason before seven days.It can be under linux when specific implementation
By writing shell script, setting cron, which is dispatched, to be executed, and Lai Shixian log timing is cleared up.Successively execute following three step:
S1, creation shell script and distribution can run permission, for example can write following code: touch/opt/soft/
Bin/auto-del-30-days-ago-log.sh, chmod+x auto-del-30-days-ago-log.sh.
S2, editor's shell script, and save.Following code: vi auto-del-30-days-ago- can be write
Log.sh, #!/bin/sh.
S3, plan target.Following code: #crontab-e, 10 0***/opt/soft/log/auto- can be write
Del-7-days-ago-log.sh, setting here are 0 point of 10 minutes execution auto-del-7-days-ago- of daily morning
Log.sh file carries out data scrubbing task.
Above three steps are completed, timing may be implemented and clear up journal file, never again by server hard disc insufficient space
Warning message
Fig. 3 A is please referred to, Fig. 3 A is a kind of journal file processing unit provided by the embodiments of the present application, it is applied to server,
Journal file processing unit 300 includes:
Processing unit 301 for creating N number of journal file within one day, and N number of journal file is stored in and is deposited
In reservoir, journal file i is used to save can be corresponding in the journal file i with the server M client communicated
Operation information in time interval;The N is the integer greater than 1, and the M is the integer greater than 1, and the journal file i is institute
State any journal file in N number of journal file.
In some possible embodiments, server creates N number of journal file within one day, comprising: server is every
It creates N number of journal file, and N number of journal file respectively corresponds (24/N) hour within one day, for example, server can be every
Its zero point creates 24 journal files, and 24 journal files respectively correspond a hour within one day, each day
Will file is used to save the operation information of the M client in its corresponding time interval.
For example 24 journal files are created when daily zero point, a journal file is small for saving specified one
Log information in Shi Shichang, log information include operation information of the user in client for being server acquisition.For example, first
A journal file is used to save 0 point to 1 point of log information, and second journal file is used to save 1 point to 2 points of log letter
Breath, third journal file are used to save 2 points to 3 points of log information.
In further embodiments, server can create one at any preset time point ((24/N) * p- (24/N))
Journal file, journal file are generated for saving any preset time point to any client between next preset time point
Operation information, p is integer, and 1≤p≤N.
Acquiring unit 302, for obtaining the operation information of the M client and obtaining obtaining for any operation information
The moment is taken, the operation information of client j is triggered by the user for operating the client j to be generated, and the client j is the M
Any client in client.
The operation information of storage unit 303, the M client for obtaining the acquiring unit is saved in and institute
It states in operation information acquisition moment corresponding journal file.
Since individual log file is smaller, when searching for log query problem, search speed is many fastly, increases solution and asks
The efficiency of topic, and when clearing up journal file, the speed of small documents cleaning is more many fastly than the speed for clearing up single especially big file.
In some possible embodiments, in terms of processing unit created N number of journal file within one day, have and be used for
A journal file is created in any preset time point, the journal file is for saving any preset time point to next
The operation information that any client generates between preset time point.For example, at the time of creation journal file can be preset, tool
Amount of access can be felt to body when business access amount is big, to create the time of journal file at the time of determining creation journal file
Interval is shorter, and business access amount hour, the time interval for creating journal file is longer, if for example, obtaining 9 points to 11 by statistics
Point business access amount be more than threshold value, then can with per half an hour create a journal file, such as respectively 9 points, 9 thirty, 10 points,
10 thirty created journal file, remaining period is per one journal file of creation every other hour.
In some possible embodiments, acquiring unit 302 is also used to, and obtains log query solicited message, the day
It include the temporal information for positioning journal file in will inquiry request;
Processing unit 301 is also used to, the log query solicited message determination obtained according to the acquiring unit and institute
State the matched journal file of temporal information.
In some possible embodiments, processing unit 301 is also used to, if in the operation information of the M client
Including specified sensitive information, the server obtains log query solicited message and has determined and the temporal information
After the journal file matched, it will be replaced with the sensitive information in the matched journal file of the temporal information with preset character and anti-
It feeds inquiring client terminal.
In some possible embodiments, acquiring unit 302 is also used to, and obtains the use for triggering the log query request
The Permission Levels at family, for the user of different rights grade when checking journal file, the specified sensitive information is corresponding default
Character it is different.
In some possible embodiments, acquiring unit 302 is also used to, and obtains the promotion inquiry power of user's triggering
Limit the request of grade;Processing unit 301 is also used to, described quick if the requests verification for promoting search access right grade passes through
Sense information is shown with character corresponding with the permission after upgrading.
In some possible embodiments, as shown in Figure 3B, journal file processing unit 300 further includes deleting unit
304.Processing unit 301 is also used to, and obtains the information of residual storage capacity in the memory;Unit 304 is deleted, in institute
It states when the residual storage capacity in memory is less than preset value and deletes earliest created K journal file, institute in the memory
Stating K is the integer greater than 1 or equal to 1.
The embodiment of the present application also provides a kind of terminals, as shown in figure 4, terminal 400 is used as server, it may include: place
Manage device 401, input equipment 402, output equipment 403 and memory 404, processor 401, input equipment 402, output equipment 403
It is connected with each other with memory 404, specifically, is of coupled connections by bus 405, wherein memory 404 is for storing computer journey
Sequence, computer program include program instruction, and processor is configured for calling described program instruction, execute either method embodiment
The processing method of the journal file.
The embodiment of the present application also provides a kind of computer storage mediums, wherein the computer storage medium storage is used for
The computer program of electronic data interchange, the computer program execute computer as that records in above method embodiment appoints
A kind of some or all of what processing method of journal file step.
The embodiment of the present application also provides a kind of computer program product, and the computer program product includes storing calculating
The non-transient computer readable storage medium of machine program, the computer program make computer execute such as above method embodiment
Some or all of the processing method of any journal file of middle record step.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because
According to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily the application
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed device, it can be by another way
It realizes.For example, the apparatus embodiments described above are merely exemplary, such as the division of the unit, it is only a kind of
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of device or unit,
It can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, applying for that each functional unit in bright each embodiment can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also be realized in the form of software program module.
If the integrated unit is realized in the form of software program module and sells or use as independent product
When, it can store in a computer-readable access to memory.Based on this understanding, the technical solution of the application substantially or
Person says that all or part of the part that contributes to existing technology or the technical solution can body in the form of software products
Reveal and, which is stored in a memory, including some instructions are used so that a computer equipment
(can be personal computer, server or network equipment etc.) executes all or part of each embodiment the method for the application
Step.And memory above-mentioned includes: USB flash disk, read-only memory (read-only memory, ROM), random access memory
The various media that can store program code such as (random access memory, RAM), mobile hard disk, magnetic or disk.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can store in a computer-readable memory, memory
It may include: flash disk, read-only memory, random access device, disk or CD etc..
The embodiment of the present application is described in detail above, specific case used herein to the principle of the application and
Embodiment is expounded, the description of the example is only used to help understand the method for the present application and its core ideas;
At the same time, for those skilled in the art can in specific embodiments and applications according to the thought of the application
There is change place, in conclusion the contents of this specification should not be construed as limiting the present application.
Claims (10)
1. a kind of processing method of journal file, which is characterized in that the method is applied to server, which comprises
The server creates N number of journal file within one day, and N number of journal file is saved in memory, day
Will file i is used to save can be with M client of server communication in the corresponding time interval of the journal file i
Operation information;The N is the integer greater than 1, and the M is the integer greater than 1, and the journal file i is N number of log text
Any journal file in part;
The server obtains the operation information of the M client and obtains the acquisition moment of any operation information, client
It holds the operation information of j to be triggered by the user for operating the client j to generate, the client j is appointing in the M client
One client;
The operation information of the M client is saved in log corresponding with the operation information acquisition moment by the server
In file.
2. the method according to claim 1, wherein the server creates N number of journal file within one day,
Include:
The server creates N number of journal file daily, and it is small that N number of journal file respectively corresponds (24/N) within one day
When, each journal file is used to save the operation information of the M client in its corresponding time interval.
3. the method according to claim 1, wherein the server creates N number of journal file within one day,
Include:
The server creates a journal file, the journal file at any preset time point ((24/N) * p- (24/N))
The operation information generated for saving any preset time point to any client between next preset time point, p are whole
Number, and 1≤p≤N.
4. the method according to claim 1, wherein the method also includes:
The server obtains log query request, includes believing for positioning the time of journal file in the log query request
Breath;
The server is according to log query request determination and the matched journal file of the temporal information.
5. according to the method described in claim 4, it is characterized in that, if including specified in the operation information of the M client
Sensitive information, the server obtains log query solicited message and determined and the matched log of the temporal information
After file, the method also includes:
The server will be replaced with the sensitive information in the matched journal file of the temporal information with preset character and anti-
It feeds inquiring client terminal.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
The server obtains the Permission Levels for triggering the user of the log query request, and the user of different rights grade is looking into
When seeing journal file, the corresponding preset character of the specified sensitive information is different.
7. according to claim 1 to method described in 6 any one, which is characterized in that the method also includes:
The server obtains the information of residual storage capacity in the memory;
The residual storage capacity of the server in the memory is deleted when being less than preset value and is created earliest in the memory
The K journal file built, the K are the integer greater than 1 or equal to 1.
8. a kind of journal file processing unit, which is characterized in that be applied to server, described device is for realizing claim 1
To method described in 7 any one.
9. a kind of terminal, which is characterized in that the processor, defeated including processor, input equipment, output equipment and memory
Enter equipment, output equipment and memory to be connected with each other, wherein the memory is for storing computer program, the computer
Program includes program instruction, and the processor is configured for calling described program instruction, is executed such as any one of claim 1-7
The method.
10. a kind of computer readable storage medium, which is characterized in that the computer storage medium is stored with computer program,
The computer program includes program instruction, and described program instruction makes the processor execute such as right when being executed by a processor
It is required that the described in any item methods of 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910530733.9A CN110334064A (en) | 2019-06-18 | 2019-06-18 | A kind of processing method and relevant apparatus of journal file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910530733.9A CN110334064A (en) | 2019-06-18 | 2019-06-18 | A kind of processing method and relevant apparatus of journal file |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110334064A true CN110334064A (en) | 2019-10-15 |
Family
ID=68142498
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910530733.9A Pending CN110334064A (en) | 2019-06-18 | 2019-06-18 | A kind of processing method and relevant apparatus of journal file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110334064A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111683051A (en) * | 2020-05-13 | 2020-09-18 | 深圳市元征科技股份有限公司 | Log processing method and related equipment |
CN111931203A (en) * | 2020-07-15 | 2020-11-13 | 深信服科技股份有限公司 | Sensitive data analysis method, device, equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103001796A (en) * | 2012-11-13 | 2013-03-27 | 北界创想(北京)软件有限公司 | Method and device for processing weblog data by server |
US20140172813A1 (en) * | 2012-12-14 | 2014-06-19 | Microsoft Corporation | Processing user log sessions in a distributed system |
CN108829789A (en) * | 2018-06-01 | 2018-11-16 | 平安普惠企业管理有限公司 | Log processing method, device, computer equipment and storage medium |
CN108984705A (en) * | 2018-07-06 | 2018-12-11 | 合肥明高软件技术有限公司 | A kind of on-line study system and method for pushing with focus push function |
CN109309579A (en) * | 2018-01-30 | 2019-02-05 | 深圳壹账通智能科技有限公司 | Log recording processing method, device, computer equipment and storage medium |
CN109726590A (en) * | 2018-12-24 | 2019-05-07 | 平安普惠企业管理有限公司 | System log desensitization method, desensitization system, computer equipment and storage medium |
-
2019
- 2019-06-18 CN CN201910530733.9A patent/CN110334064A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103001796A (en) * | 2012-11-13 | 2013-03-27 | 北界创想(北京)软件有限公司 | Method and device for processing weblog data by server |
US20140172813A1 (en) * | 2012-12-14 | 2014-06-19 | Microsoft Corporation | Processing user log sessions in a distributed system |
CN109309579A (en) * | 2018-01-30 | 2019-02-05 | 深圳壹账通智能科技有限公司 | Log recording processing method, device, computer equipment and storage medium |
CN108829789A (en) * | 2018-06-01 | 2018-11-16 | 平安普惠企业管理有限公司 | Log processing method, device, computer equipment and storage medium |
CN108984705A (en) * | 2018-07-06 | 2018-12-11 | 合肥明高软件技术有限公司 | A kind of on-line study system and method for pushing with focus push function |
CN109726590A (en) * | 2018-12-24 | 2019-05-07 | 平安普惠企业管理有限公司 | System log desensitization method, desensitization system, computer equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111683051A (en) * | 2020-05-13 | 2020-09-18 | 深圳市元征科技股份有限公司 | Log processing method and related equipment |
CN111931203A (en) * | 2020-07-15 | 2020-11-13 | 深信服科技股份有限公司 | Sensitive data analysis method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5890308B2 (en) | Automatic discovery of contextually related task items | |
US7634509B2 (en) | Personal information space management system and method | |
US10956684B2 (en) | Topic kernelization for real-time conversation data | |
RU2343537C2 (en) | Computer search with help of associative links | |
US20120166438A1 (en) | System and method for recommending queries related to trending topics based on a received query | |
US10417265B2 (en) | High performance parallel indexing for forensics and electronic discovery | |
US10007894B2 (en) | Maintaining a custodian directory by analyzing documents | |
CN109960686A (en) | The log processing method and device of database | |
Wen et al. | Probabilistic model for contextual retrieval | |
US8620946B2 (en) | Storage and searching of temporal entity information | |
EP2725534A1 (en) | Method and system for building an entity profile from email address and name information | |
Freeman | The lifestreams software architecture | |
US20210303537A1 (en) | Log record identification using aggregated log indexes | |
CN110737682A (en) | cache operation method, device, storage medium and electronic equipment | |
CN110162522A (en) | A kind of distributed data search system and method | |
US20230100501A1 (en) | Dynamically generated knowledge graphs | |
CN102662570B (en) | Information processing method and device | |
CN110334064A (en) | A kind of processing method and relevant apparatus of journal file | |
CN103595747A (en) | User-information recommending method and system | |
US20190377829A1 (en) | Hyperlink visual indicator | |
US9286349B2 (en) | Dynamic search system | |
US20080059538A1 (en) | Method and system for synchronizing offline records | |
CN113722007A (en) | Configuration method, device and system of VPN branch equipment | |
CN106980685A (en) | Data processing method and data processing equipment | |
US20210056120A1 (en) | In-stream data load in a replication environment |
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 |