CN106776622A - The querying method and device of access log - Google Patents

The querying method and device of access log Download PDF

Info

Publication number
CN106776622A
CN106776622A CN201510813316.7A CN201510813316A CN106776622A CN 106776622 A CN106776622 A CN 106776622A CN 201510813316 A CN201510813316 A CN 201510813316A CN 106776622 A CN106776622 A CN 106776622A
Authority
CN
China
Prior art keywords
server
access
mark
data
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510813316.7A
Other languages
Chinese (zh)
Other versions
CN106776622B (en
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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology Co 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201510813316.7A priority Critical patent/CN106776622B/en
Publication of CN106776622A publication Critical patent/CN106776622A/en
Application granted granted Critical
Publication of CN106776622B publication Critical patent/CN106776622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F16/134Distributed 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/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • 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
    • 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/182Distributed file systems
    • G06F16/1824Distributed file systems implemented using Network-attached Storage [NAS] architecture
    • G06F16/183Provision of network file services by network file servers, e.g. by using NFS, CIFS

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Debugging And Monitoring (AREA)

Abstract

This application discloses the querying method and device of a kind of access log.Wherein, the method includes:Table is set up in distributed data base, wherein, the line unit of table includes the mark of server, and table includes multiple rows;The access log correspondence of the multiple servers that will be received is preserved to the target line of table, wherein, goal behavior line unit corresponding with destination server includes the row of the mark of destination server, and destination server is any server in multiple servers, and goal behavior corresponding with any server is multiple;According to line unit, the access log of server to be checked is inquired about in table.More long, the low technical problem of search efficiency is taken present application addresses the access log for inquiring about some or certain several servers in HBase in the prior art.

Description

The querying method and device of access log
Technical field
The application is related to data processing field, in particular to the querying method and device of a kind of access log.
Background technology
Tomcat is a free Web Application Server increased income, the quilt under middle-size and small-size system and concurrent users Commonly use.The access log that user accesses Tomcat is very valuable, it is necessary to be carried out to the access log of user Preserve.Because the data volume of access log is than larger, the money of disk will be consumed in server local preservation access log Source, influences the performance of server, and it is very feasible method that data are preserved to distributed data base.
HBase be one reliability is high, performance is good, towards row, scalable distributed memory system, can be in HBase In preserve the access log of multiple Tomcat simultaneously.The access log of Tomcat is preserved in HBase, it is necessary in HBase In set up a table, the access log for depositing Tomcat.When needing that the access log in Tomcat is looked into During inquiry, inquired about in this table.Due to the access log of multiple Tomcat, data volume are preserved in this table simultaneously It is very big, the access log for inquiring about some or certain several particular servers is time-consuming more long, and search efficiency is low.
For above-mentioned problem, effective solution is not yet proposed at present.
The content of the invention
The embodiment of the present application provides the querying method and device of a kind of access log, at least to solve to exist in the prior art The access log that some or certain several servers are inquired about in HBase takes more long, the low technical problem of search efficiency.
According to the one side of the embodiment of the present application, there is provided a kind of querying method of access log, including:In distribution Table is set up in formula database, wherein, the line unit of the table includes the mark of server, and the table includes multiple rows;Will The access log correspondence of the multiple servers for receiving is preserved to the target line of the table, wherein, with destination server pair The goal behavior line unit answered includes the row of the mark of the destination server, and the destination server is the multiple Any server in server, the goal behavior corresponding with any server is multiple;According to the line unit, The access log of server to be checked is inquired about in the table.
Further, the line unit of the table also includes Preset Time, the access log pair of the multiple servers that will be received Should preserve to the target line of the table includes:Obtain the access of the access log Li of server i in the multiple server Time ti, wherein, i takes 1 to m successively, and m is the quantity of server in the multiple server;Search the target Line unit includes mark Z in rowiAnd preset time TiTarget line Hi, wherein, the mark ZiIt is the server i Mark, the preset time TiIt is the access time tiAffiliated Preset Time;And by the server i's Access log is preserved to the target line Hi, according to the line unit, the access of server to be checked is inquired about in the table Daily record includes:According to the mark of the server to be checked, the access of the server to be checked is inquired about in the table Daily record;Or the mark according to the server to be checked and time to be checked, the clothes to be checked are inquired about in the table The access log of business device, wherein, the time to be checked is any Preset Time in the line unit of the table.
Further, the access log of the server i is included by access data Li1To access dataWhat is constituted is more Bar accesses data, wherein, niIt is a plurality of quantity for accessing access data in data, obtains the multiple server The access time t of the access log Li of middle server iiIncluding:Obtain and access data LijAccess time tij, wherein, J takes 1 to n successivelyi, line unit includes mark Z in searching the target lineiAnd preset time TiTarget line HiIncluding: Line unit includes the mark Z in searching the target lineiAnd preset time TijTarget line Hij, wherein, it is described default Time TijIt is the access time tijAffiliated Preset Time, the access log of the server i is preserved to the mesh Mark row HiIncluding:By the access data L of the server iijPreserve to the target line Hij
Further, the line unit of the table also includes that Preset Time and daily record are identified, the multiple servers that will be received Access log correspondence is preserved to the target line of the table and also included:Obtain the access of server i in the multiple server The access time t of daily record LiiDaily record with the access log Li identifies Ri, wherein, i takes 1 to m successively, and m is The quantity of server in the multiple server;Line unit includes mark Z in searching the target linei, preset time TiWith The daily record identifies RiTarget line Hi, wherein, the mark ZiIt is the mark of the server i, it is described default Time TiIt is the access time tiAffiliated Preset Time;And preserve to institute the access log of the server i State target line Hi, according to the line unit, the access log that server to be checked is inquired about in the table also includes:According to The mark of the server to be checked, inquires about the access log of the server to be checked in the table;Or according to institute The mark of server to be checked and time to be checked are stated, the access log of the server to be checked are inquired about in the table, Wherein, the time to be checked is any Preset Time in the line unit of the table.
Further, the access log of the server i is included by access data Li1To access dataWhat is constituted is more Bar accesses data, wherein, niIt is a plurality of quantity for accessing access data in data, obtains the multiple server The access time t of the access log Li of middle server iiDaily record with the access log Li identifies RiIncluding:Obtain Access data LijAccess time tijWith the access data LijThe unique code U of universal identificationij, wherein, j takes 1 successively To ni, the daily record is designated the unique code U of the universal identificationij, line unit includes mark Z in searching the target linei、 Preset time TiR is identified with the daily recordiTarget line HiIncluding:Line unit includes the mark in searching the target line Zi, preset time TijCode U unique with the universal identificationijTarget line Hij, wherein, the preset time TijFor institute State access time tijAffiliated Preset Time, the access log of the server i is preserved to the target line HiIncluding: By the access data L of the server iijPreserve to the target line Hij
According to the another aspect of the embodiment of the present application, a kind of inquiry unit of access log is additionally provided, including:Set up Unit, for setting up table in distributed data base, wherein, the line unit of the table includes the mark of server, described Table includes multiple rows;Storage unit, the access log correspondence of the multiple servers for that will receive is preserved to the table Target line, wherein, the mark of the goal behavior line unit corresponding with destination server including the destination server Row, the destination server is any server in the multiple server, corresponding with any server The goal behavior is multiple;Query unit, for according to the line unit, server to be checked being inquired about in the table Access log.
Further, the line unit of the table also includes Preset Time, and the storage unit includes:First obtains subelement, Access time t for obtaining the access log Li of server i in the multiple serveri, wherein, i takes 1 successively To m, m is the quantity of server in the multiple server;First searches subelement, for searching the target line in Line unit includes mark ZiAnd preset time TiTarget line Hi, wherein, the mark ZiIt is the mark of the server i, The preset time TiIt is the access time tiAffiliated Preset Time;And first preserve subelement, for by institute The access log for stating server i is preserved to the target line Hi, the query unit includes:First inquiry subelement, For the mark according to the server to be checked, the access log of the server to be checked is inquired about in the table; And the second inquiry subelement, for the mark according to the server to be checked and time to be checked, in the table The access log of the server to be checked is inquired about, wherein, the time to be checked is any in the line unit of the table Preset Time.
Further, the access log of the server i is included by access data Li1To access dataWhat is constituted is more Bar accesses data, wherein, niIt is a plurality of quantity for accessing access data in data, described first obtains subelement Including:First acquisition module, data L is accessed for obtainingijAccess time tij, wherein, j takes 1 to n successivelyi, The first lookup subelement includes:First searching modul, the mark is included for searching line unit in the target line ZiAnd preset time TijTarget line Hij, wherein, the preset time TijIt is the access time tijAffiliated is default Time, the first preservation subelement includes:First preserving module, for by the access number of the server i According to LijPreserve to the target line Hij
Further, the line unit of the table also includes that Preset Time and daily record are identified, and the storage unit also includes:The Two obtain subelement, the access time t of the access log Li for obtaining server i in the multiple serveriAnd institute State the daily record mark R of access log Lii, wherein, i takes 1 to m successively, and m is server in the multiple server Quantity;Second searches subelement, and mark Z is included for searching line unit in the target linei, preset time TiAnd institute State daily record mark RiTarget line Hi, wherein, the mark ZiIt is the mark of the server i, when described default Between TiIt is the access time tiAffiliated Preset Time;And second preserve subelement, for by the server i Access log preserve to the target line Hi, the query unit also includes:3rd inquiry subelement, for basis The mark of the server to be checked, inquires about the access log of the server to be checked in the table;And the 4th Inquiry subelement, for the mark according to the server to be checked and time to be checked, inquires about described in the table The access log of server to be checked, wherein, the time to be checked is any Preset Time in the line unit of the table.
Further, the access log of the server i is included by access data Li1To access dataWhat is constituted is more Bar accesses data, wherein, niIt is a plurality of quantity for accessing access data in data, described second obtains subelement Including:Second acquisition module, data L is accessed for obtainingijAccess time tijWith the access data LijGeneral knowledge Not unique code Uij, wherein, j takes 1 to n successivelyi, the daily record is designated the unique code U of the universal identificationij, it is described Second lookup subelement includes:Second searching modul, the mark Z is included for searching line unit in the target linei、 Preset time TijCode U unique with the universal identificationijTarget line Hij, wherein, the preset time TijIt is the visit Ask time tijAffiliated Preset Time, the second preservation subelement includes:Second preserving module, for by the clothes The access data L of business device iijPreserve to the target line Hij
In the embodiment of the present application, using setting up table in distributed data base, wherein, the line unit of table includes server Mark, table includes multiple rows, and the access log correspondence of the multiple servers that will be received is preserved to the target line of table, Wherein, goal behavior line unit corresponding with destination server includes the row of the mark of destination server, and destination server is Any server in multiple servers, goal behavior corresponding with any server is multiple, according to line unit, in table Inquire about the access log of server to be checked.Include server by when the table of HBase is set up, making the line unit of table Mark, the access log correspondence of server is preserved into the row of mark of the line unit including the server so that same The access data of the access log of server are stored in adjacent position in table, when the access for needing to inquire about certain server During daily record, inquired about according to the line unit of table, by same server access log access data in table institute The position at place is concentrated very much, therefore, during inquiry speed quickly, it is achieved thereby that quick search goes out the visit of server to be checked The technique effect of daily record is asked, and then is solved and is inquired about some or certain several servers in HBase in the prior art Access log takes more long, the low technical problem of search efficiency.
Brief description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, constitutes the part of the application, this Shen Schematic description and description please does not constitute the improper restriction to the application for explaining the application.In accompanying drawing In:
Fig. 1 is the flow chart of the querying method of the access log according to the embodiment of the present application;And
Fig. 2 is the schematic diagram of the inquiry unit of the access log according to the embodiment of the present application.
Specific embodiment
In order that those skilled in the art more fully understand application scheme, below in conjunction with the embodiment of the present application Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present application, it is clear that described embodiment The only embodiment of the application part, rather than whole embodiments.Based on the embodiment in the application, ability The every other embodiment that domain those of ordinary skill is obtained under the premise of creative work is not made, should all belong to The scope of the application protection.
It should be noted that term " first ", " in the description and claims of this application and above-mentioned accompanying drawing Two " it is etc. for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that this The data that sample is used can be exchanged in the appropriate case, so as to embodiments herein described herein can with except Here the order beyond those for illustrating or describing is implemented.Additionally, term " comprising " and " having " and they Any deformation, it is intended that covering is non-exclusive to be included, for example, containing process, the side of series of steps or unit Method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include unclear List or for these processes, method, product or other intrinsic steps of equipment or unit.
Description below is made to the technical term involved by the embodiment of the present application first:
Timestamp:Timestamp (time-stamp) is the voucher document of formation after one encrypted, and it includes three portions Point:(1) summary (digest) of the file that need to be added timestamp;(2) DTS receives the date and time of file;(3) The digital signature of DTS.Timestamp is broadly divided into two kinds:(1) self-built timestamp:Such timestamp be by when it is indirect Receiving unit (such as GPS, CDMA, big-dipper satellite) obtains the time to time stamp server, and is taken by timestamp Business device signs and issues timestamp certificate.This kind of timestamp can be used to enterprises confirmation of responsibility, not had in court's certification Legal effect.Because its by time receiving device receive the time when in the presence of the possibility being tampered, so can not be as method Rule foundation.(2) timestamp of the effect with law:It is combined with Beijing by the Chinese Academy of Sciences of China country's time service center Trust techniques Services Co., Ltd is responsible for China third party trusted timestamp authentication service built.By national time service center The time service and punctual monitoring of the time of being responsible for.The accuracy of the time in ensureing timestamp certificate because of its punctual monitoring function Be not tampered with.Obtaining timestamp platform has " popular copyright protection platform ", can be with the Chinese Academy of Sciences of China country's time service center Time synchronized.
According to the embodiment of the present application, there is provided a kind of embodiment of the querying method of access log, it is necessary to explanation, Can be performed in the such as one group computer system of computer executable instructions the step of the flow of accompanying drawing is illustrated, And, although logical order is shown in flow charts, but in some cases, can be with suitable different from herein Sequence performs shown or described step.
Fig. 1 is the flow chart of the querying method of the access log according to the embodiment of the present application, as shown in figure 1, the method Comprise the following steps:
Step S102, sets up table in distributed data base, wherein, the line unit of table includes the mark of server, table bag Include multiple rows.
Step S104, the access log correspondence of the multiple servers that will be received is preserved to the target line of table, wherein, with The corresponding goal behavior line unit of destination server includes the row of the mark of destination server, and destination server is serviced for multiple Any server in device, goal behavior corresponding with any server is multiple.
Step S106, according to line unit, inquires about the access log of server to be checked in table.
Distributed data base can be HBase databases.When need data to be saved data volume it is very huge when, make It is an extraordinary method to preserve data with the table in HBase databases.
HBase can only be with line unit rowkey come searching data.So the design of rowkey it is critical that, relation To the height of search efficiency.
Line unit rowkey is sorted with lexicographic order.For example, there is three line units, respectively rowkey1, rowkey2, rowkey3.Rowkey1 is aaa222, and rowkey2 is bbb111, and rowkey3 is abb111.First by rowkey1, First of rowkey2 and rowkey3 is compared, and first of rowkey1 and rowkey3 is a, rowkey2 First be b, so rowkey1 and rowkey3 are come before rowkey2, then by rowkey1 and rowkey3 Second be compared, the second of rowkey1 is a, and the second of rowkey3 is b, thus rowkey1 arrange Before rowkey3, in sum, rowkey1 is come before rowkey3, and rowkey3 is come before rowkey2.
With rowkey come the record in inquiry table in HBase, following three kinds of inquiry modes are supported:
(1) accessed by single rowkey:Get operations are carried out according to certain rowkey key assignments.
(2) it is scanned by the scope of rowkey:I.e. by set startRowKey (beginning line unit) and EndRowKey (end line unit), is scanned in the range of this;
(3) full table scan:Directly scan all row records in whole table.
When needing to be saved in the access log of multiple servers in the table of HBase, the line unit rowkey of table is designed It is the mark of server, so when the access log from some server is received, it is possible to by the server Access log preserve into the row of the mark that capable line unit is the server.The row for setting the table of HBase include:Far Journey host name (RemoteHosts), timestamp (TimeStamp), virtual hostname (VirtualHost), look into Ask parameter (Query), user agent's browser (User Agent), method name (Method), single request Changing value of Tomcat internal memories etc..The quantity of the row in HBase databases without in advance specify, can as needed with Shi Tianjia.
For example, needing to preserve 5 access logs of Tomcat, this 5 Tomcat in the table T1 of HBase altogether Mark be respectively character string s1, character string s2, character string s3, character string s4 and character string s5.Design HBase Table T1 line unit respectively include character string s1, character string s2, character string s3, character string s4, character string s5. Assuming that receiving 10 access data altogether, table 1 shows that this 10 access every numbering of access data in data Which server is come from access data, then will be accessed data D2 and preserved into table T1 row of the line unit including character string s1 In, during data D6 will be accessed and the row that data D8 preserves into table T1 line unit including character string s2 is accessed, will access Data D1 and access data D4 are preserved into table T1 in row of the line unit including character string s3, will be accessed data D5 and are preserved Into table T1 in the row of line unit including character string s4, will access data D3, access data D7, access data D9 and Access data D10 is preserved into table T1 in row of the line unit including character string s5.It should be noted that by length institute Limit, the data that this example is given are only 10, and in actual applications, the quantity right and wrong of the access data of access log Chang Ju great 's.
Table 1
Access data number Access data source
D1 Tomcat3
D2 Tomcat1
D3 Tomcat5
D4 Tomcat3
D5 Tomcat4
D6 Tomcat2
D7 Tomcat5
D8 Tomcat2
D9 Tomcat5
D10 Tomcat5
Line unit includes the row of character string s1 in inquiry table T1, obtains whole access logs of Tomcat1;Inquiry table T1 Middle line unit includes the row of character string s2, obtains whole access logs of Tomcat2;Line unit includes word in inquiry table T1 The row of symbol string s3, obtains whole access logs of Tomcat3.
Include the mark of server by when the table of HBase is set up, making the line unit of table, by the access log of server Correspondence is preserved to line unit in the row for including the mark of the server so that the access number of the access log of same server According to adjacent position in table is stored in, when needing to inquire about the access log of certain server, carried out according to the line unit of table Inquiry, because the access data of the access log of same server are concentrated location very much in table, therefore, look into Speed quickly, it is achieved thereby that quick search goes out the technique effect of the access log of server to be checked, and then is solved during inquiry Determined inquired about in HBase in the prior art some or certain several servers access log it is time-consuming more long, inquiry effect The low technical problem of rate.
Alternatively, the line unit of table also includes Preset Time, and the access log correspondence of the multiple servers that will be received is preserved Target line to table includes:Obtain the access time t of the access log Li of server i in multiple serversi, wherein, I takes 1 to m successively, and m is the quantity of server in multiple servers;Line unit includes mark Z in searching target lineiWith it is pre- If time TiTarget line Hi, wherein, identify ZiIt is the mark of server i, preset time TiIt is access time tiInstitute The Preset Time of category;And preserve to target line H the access log of server ii, according to line unit, inquired about in table The access log of server to be checked includes:According to the mark of server to be checked, server to be checked is inquired about in table Access log;Or the mark according to server to be checked and time to be checked, server to be checked is inquired about in table Access log, wherein, the time to be checked is any Preset Time in the line unit of table.
Alternatively, the access log of server i is included by access data Li1To access dataThe a plurality of access of composition Data, wherein, niTo access the quantity of data in a plurality of access data, the visit of server i in multiple servers is obtained Ask the access time t of daily record LiiIncluding:Obtain and access data LijAccess time tij, wherein, j takes 1 to n successivelyi, Line unit includes mark Z in searching target lineiAnd preset time TiTarget line HiIncluding:Line unit includes in searching target line Mark ZiAnd preset time TijTarget line Hij, wherein, preset time TijIt is access time tijAffiliated Preset Time, The access log of server i is preserved to target line HiIncluding:By the access data L of server iijPreserve to target Row Hij
The access log of each server includes that at least one accesses data, in most cases, each server Access log all include substantial amounts of access data.The access log of server 1 includes n1Bar accesses data, respectively Access data L11, access data L12, access data L13..., access dataThe access log of server 2 Including n2Bar accesses data, respectively accesses data L21, access data L22, access data L23..., access number According toBy that analogy, the access log of server i includes niBar accesses data, respectively accesses data Li1, visit Ask data Li2, access data Li3..., access data
Access data LijAccess time be tij, tijIt is accurate to the second.
Preset time TijIt is access time tijThat day at place, preset time TijIt is accurate to day.For example, when accessing Between be 10 days 08 November in 2015:20:30, then the Preset Time belonging to access time is on November 10th, 2015. Again for example, when access time is 25 days 15 October in 2015:25:58, then the Preset Time belonging to access time be On October 25th, 2015.
For example, setting up the table T2 of HBase, setting the line unit of table T2 includes mark and the date of server, for example, false If one has 3 Tomcat servers, the mark of this 3 Tomcat servers is respectively character string s1, character string S2, character string s3, the line unit for setting table T2 include character string s1 and date, or including character string s2 and date, or Including character string s3 and date.Assuming that HBase have altogether receive 1,000,000 access data, table 2 show this 1 Every the numbering of access data, access data source are produced in which server and access data in million access data Time.
To access during data D1 preserves into table T2 row of the line unit including character string s2 and character string " 20151015 ";
To access during data D2 preserves into table T2 row of the line unit including character string s2 and character string " 20151015 ";
To access during data D3 preserves into table T2 row of the line unit including character string s3 and character string " 20151015 ";
To access during data D4 preserves into table T2 row of the line unit including character string s1 and character string " 20151015 ";
To access during data D5 preserves into table T2 row of the line unit including character string s1 and character string " 20151015 ";
To access during data D6 preserves into table T2 row of the line unit including character string s1 and character string " 20151015 ";
To access during data D7 preserves into table T2 row of the line unit including character string s3 and character string " 20151015 ";
To access during data D8 preserves into table T2 row of the line unit including character string s3 and character string " 20151015 ";
To access during data D9 preserves into table T2 row of the line unit including character string s2 and character string " 20151015 ";
To access during data D10 preserves into table T2 row of the line unit including character string s1 and character string " 20151015 ";
……
Data D10000 will be accessed and preserve into table T2 row of the line unit including character string s2 and character string " 20151016 " In;
Data D10001 will be accessed and preserve into table T2 row of the line unit including character string s1 and character string " 20151016 " In;
Data D10002 will be accessed and preserve into table T2 row of the line unit including character string s3 and character string " 20151016 " In;
……
Data D1000000 will be accessed and preserve into table T2 line unit including character string s1 and character string " 20151020 " In row.
Again for example, setting rowkey is:Tomcat marks-date, if it is desired to inquiry Tomcat1 was at 2015 10 Month access log of this day on the 15th, then it is Tomcat1-20151015, endKey that startKEY is set when inquiring about It is Tomcat1-20151016.If it is desired to inquiry Tomcat2 is in the access log of this day of on November 20th, 2015, It is Tomcat2-20151120 that startKEY is set when then inquiring about, and endKey is Tomcat2-20151121.
Can will be same by setting rowkey including server identification and date, when preserving access log in the table of HBase The access log on the same day of one server is stored in adjacent position, in the table during queried access daily record, can be with Quick search goes out access log of some server on certain date, substantially increases search efficiency.
Table 2
Access data number Access data source Access the time (access time) that data are produced
D1 Tomcat2 15 days 12 October in 2015:00:00
D2 Tomcat2 15 days 12 October in 2015:00:00
D3 Tomcat3 15 days 12 October in 2015:00:03
D4 Tomcat1 15 days 12 October in 2015:00:03
D5 Tomcat1 15 days 12 October in 2015:00:03
D6 Tomcat1 15 days 12 October in 2015:00:03
D7 Tomcat3 15 days 12 October in 2015:00:05
D8 Tomcat3 15 days 12 October in 2015:00:05
D9 Tomcat2 15 days 12 October in 2015:00:06
D10 Tomcat1 15 days 12 October in 2015:00:10
…… …… ……
D10000 Tomcat2 16 days 09 October in 2015:00:15
D10001 Tomcat1 16 days 09 October in 2015:00:15
D10002 Tomcat3 16 days 09 October in 2015:00:17
…… …… ……
D1000000 Tomcat1 20 days 18 October in 2015:00:17
Alternatively, the line unit of table also includes that Preset Time and daily record are identified, the access day of the multiple servers that will be received Will correspondence is preserved to the target line of table and also included:During the access of the access log Li for obtaining server i in multiple servers Between tiDaily record with access log Li identifies Ri, wherein, i takes 1 to m successively, and m is server in multiple servers Quantity;Line unit includes mark Z in searching target linei, preset time TiR is identified with daily recordiTarget line Hi, its In, identify ZiIt is the mark of server i, preset time TiIt is access time tiAffiliated Preset Time;And will clothes The access log of business device i is preserved to target line Hi, according to line unit, the access log of server to be checked is inquired about in table Also include:According to the mark of server to be checked, the access log of server to be checked is inquired about in table;Or according to treating The mark of server and time to be checked are inquired about, the access log of server to be checked is inquired about in table, wherein, it is to be checked The inquiry time is any Preset Time in the line unit of table.
Alternatively, the access log of server i is included by access data Li1To access dataThe a plurality of access of composition Data, wherein, niTo access the quantity of data in a plurality of access data, the visit of server i in multiple servers is obtained Ask the access time t of daily record LiiDaily record with access log Li identifies RiIncluding:Obtain and access data LijAccess when Between tijWith access data LijThe unique code U of universal identificationij, wherein, j takes 1 to n successivelyi, daily record is designated general knowledge Not unique code Uij, line unit includes mark Z in searching target linei, preset time TiR is identified with daily recordiTarget line HiBag Include:Line unit includes mark Z in searching target linei, preset time TijCode U unique with universal identificationijTarget line Hij, Wherein, preset time TijIt is access time tijAffiliated Preset Time, the access log of server i is preserved to target Row HiIncluding:By the access data L of server iijPreserve to target line Hij
The unique code of universal identification (Universally Unique Identifier, abbreviation UUID) refers in a machine The numeral generated on device, it is all unique that it ensures to aerial all machines when same.Using the purpose of UUID, It is all elements allowed in distributed system, there can be unique identification information, without passing through central control terminal Do specifying for identification information.
UUID by following sections combination:(1) current date and time, first part of UUID is relevant with the time, If after a UUID is generated, a UUID is generated again within several seconds excessively, then first part is different, and remaining is identical. (2) clock sequence.(3) globally unique IEEE machine recognitions number, if network interface card, obtain from MAC Address of Network Card , there is no network interface card otherwise to obtain.
The result string of UUID generations can be long.On this standard of UUID using it is most common be Microsoft GUID(Globals Unique Identifiers).Can be with CreateUUID () function very in ColdFusion UUID is simply generated, its form is:Xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx (8-4-4-16), Wherein each x is a hexadecimal numeral in the range of 0-9 or a-f.And the UUID forms of standard are: Xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12), can download from cflib CreateGUID () UDF is changed.
Using the benefit of UUID in distributed software systems (such as:DCE/RPC, COM+, CORBA) just can body Reveal and, it is ensured that the mark that each node is generated is all without repetition, and with integration technologies such as WEB services Development, the advantage of UUID will be apparent from.According to the specific mechanism for using, UUID not only needs to be ensured of each other not Identical, or be at least have very big with the universal unique identifier of 3400 Christian eras other any generations before Difference.
Every of access log accesses data in generation, all generates unique UUID, and this UUID can be uniquely One access data of mark.Setting line unit includes server identification, date and UUID, when access log is preserved, energy It is enough that every access data are all saved in the row of UUID of the line unit comprising the access data, needing queried access daily record When, by reasonably setting startKEY and endKey, all of visit of each server can be both gone out with quick search Daily record is asked, can go out each server with quick search again is giving directions the access log on date, can go out often with quick search The a certain bar specified of individual server accesses data, substantially increases the access day that server is inquired about in the table of HBase The efficiency of will.
According to the embodiment of the present application, a kind of inquiry unit of access log is additionally provided.The inquiry unit of the access log The querying method of above-mentioned access log can be performed, the querying method of above-mentioned access log can also be by the access log Inquiry unit implement.
Fig. 2 is the schematic diagram of the inquiry unit of the access log according to the embodiment of the present application.As shown in Fig. 2 the device Including:Set up unit 22, storage unit 24 and query unit 26.
Unit 22 is set up for setting up table in distributed data base, wherein, the line unit of table includes the mark of server, Table includes multiple rows.
The access log correspondence that storage unit 24 is used for the multiple servers that will be received is preserved to the target line of table, wherein, Goal behavior line unit corresponding with destination server includes the row of the mark of destination server, and destination server takes for multiple Any server in business device, goal behavior corresponding with any server is multiple.
Query unit 26 is used for according to line unit, and the access log of server to be checked is inquired about in table.
Distributed data base can be HBase databases.When need data to be saved data volume it is very huge when, make It is an extraordinary method to preserve data with the table in HBase databases.
HBase can only be with line unit rowkey come searching data.So the design of rowkey it is critical that, relation To the height of search efficiency.
Line unit rowkey is sorted with lexicographic order.For example, there is three line units, respectively rowkey1, rowkey2, rowkey3.Rowkey1 is aaa222, and rowkey2 is bbb111, and rowkey3 is abb111.First by rowkey1, First of rowkey2 and rowkey3 is compared, and first of rowkey1 and rowkey3 is a, rowkey2 First be b, so rowkey1 and rowkey3 are come before rowkey2, then by rowkey1 and rowkey3 Second be compared, the second of rowkey1 is a, and the second of rowkey3 is b, thus rowkey1 arrange Before rowkey3, in sum, rowkey1 is come before rowkey3, and rowkey3 is come before rowkey2.
With rowkey come the record in inquiry table in HBase, following three kinds of inquiry modes are supported:
(1) accessed by single rowkey:Get operations are carried out according to certain rowkey key assignments.
(2) it is scanned by the scope of rowkey:I.e. by set startRowKey (beginning line unit) and EndRowKey (end line unit), is scanned in the range of this;
(3) full table scan:Directly scan all row records in whole table.
When needing to be saved in the access log of multiple servers in the table of HBase, the line unit rowkey of table is designed It is the mark of server, so when the access log from some server is received, it is possible to by the server Access log preserve into the row of the mark that capable line unit is the server.The row for setting the table of HBase include:Far Journey host name (RemoteHosts), timestamp (TimeStamp), virtual hostname (VirtualHost), look into Ask parameter (Query), user agent's browser (User Agent), method name (Method), single request Changing value of Tomcat internal memories etc..The quantity of the row in HBase databases without in advance specify, can as needed with Shi Tianjia.
For example, needing to preserve 5 access logs of Tomcat, this 5 Tomcat in the table T1 of HBase altogether Mark be respectively character string s1, character string s2, character string s3, character string s4 and character string s5.Design HBase Table T1 line unit respectively include character string s1, character string s2, character string s3, character string s4, character string s5. Assuming that receiving 10 access data altogether, table 1 shows that this 10 access every numbering of access data in data Which server is come from access data, then will be accessed data D2 and preserved into table T1 row of the line unit including character string s1 In, during data D6 will be accessed and the row that data D8 preserves into table T1 line unit including character string s2 is accessed, will access Data D1 and access data D4 are preserved into table T1 in row of the line unit including character string s3, will be accessed data D5 and are preserved Into table T1 in the row of line unit including character string s4, will access data D3, access data D7, access data D9 and Access data D10 is preserved into table T1 in row of the line unit including character string s5.It should be noted that by length institute Limit, the data that this example is given are only 10, and in actual applications, the quantity right and wrong of the access data of access log Chang Ju great 's.
Line unit includes the row of character string s1 in inquiry table T1, obtains whole access logs of Tomcat1;Inquiry table T1 Middle line unit includes the row of character string s2, obtains whole access logs of Tomcat2;Line unit includes word in inquiry table T1 The row of symbol string s3, obtains whole access logs of Tomcat3.
Include the mark of server by when the table of HBase is set up, making the line unit of table, by the access log of server Correspondence is preserved to line unit in the row for including the mark of the server so that the access number of the access log of same server According to adjacent position in table is stored in, when needing to inquire about the access log of certain server, carried out according to the line unit of table Inquiry, because the access data of the access log of same server are concentrated location very much in table, therefore, look into Speed quickly, it is achieved thereby that quick search goes out the technique effect of the access log of server to be checked, and then is solved during inquiry Determined inquired about in HBase in the prior art some or certain several servers access log it is time-consuming more long, inquiry effect The low technical problem of rate.
Alternatively, the line unit of table also includes Preset Time, and storage unit 24 includes that first obtains subelement, the first lookup Subelement and first preserves subelement.First acquisition subelement is used to obtain the access day of server i in multiple servers The access time t of will Lii, wherein, i takes 1 to m successively, and m is the quantity of server in multiple servers.First looks into Line unit includes mark Z during subelement is looked for for searching target lineiAnd preset time TiTarget line Hi, wherein, identify Zi It is the mark of server i, preset time TiIt is access time tiAffiliated Preset Time.First preservation subelement is used for The access log of server i is preserved to target line Hi.Query unit 26 includes that the first inquiry subelement and second is looked into Ask subelement.First inquiry subelement is used for the mark according to server to be checked, and server to be checked is inquired about in table Access log.Second inquiry subelement is used for the mark according to server to be checked and time to be checked, is looked into table The access log of server to be checked is ask, wherein, the time to be checked is any Preset Time in the line unit of table.
Alternatively, the access log of server i is included by access data Li1To access dataThe a plurality of access of composition Data, wherein, niTo access the quantity of data in a plurality of access data, first obtains subelement includes that first obtains mould Block.First acquisition module is used to obtain access data LijAccess time tij, wherein, j takes 1 to n successivelyi.First Searching subelement includes the first searching modul.First searching modul, mark Z is included for searching line unit in target lineiWith Preset time TijTarget line Hij, wherein, preset time TijIt is access time tijAffiliated Preset Time.First protects Depositing subelement includes the first preserving module.First preserving module, for by the access data L of server iijPreserve to mesh Mark row Hij
The access log of each server includes that at least one accesses data, in most cases, each server Access log all include substantial amounts of access data.The access log of server 1 includes n1Bar accesses data, respectively Access data L11, access data L12, access data L13..., access dataThe access log of server 2 Including n2Bar accesses data, respectively accesses data L21, access data L22, access data L23..., access number According toBy that analogy, the access log of server i includes niBar accesses data, respectively accesses data Li1, visit Ask data Li2, access data Li3..., access data
Access data LijAccess time be tij, tijIt is accurate to the second.
Preset time TijIt is access time tijThat day at place, preset time TijIt is accurate to day.For example, when accessing Between be 10 days 08 November in 2015:20:30, then the Preset Time belonging to access time is on November 10th, 2015. Again for example, when access time is 25 days 15 October in 2015:25:58, then the Preset Time belonging to access time be On October 25th, 2015.
For example, setting up the table T2 of HBase, setting the line unit of table T2 includes mark and the date of server, for example, false If one has 3 Tomcat servers, the mark of this 3 Tomcat servers is respectively character string s1, character string S2, character string s3, the line unit for setting table T2 include character string s1 and date, or including character string s2 and date, or Including character string s3 and date.Assuming that HBase have altogether receive 1,000,000 access data, table 2 show this 1 Every the numbering of access data, access data source are produced in which server and access data in million access data Time.
To access during data D1 preserves into table T2 row of the line unit including character string s2 and character string " 20151015 ";
To access during data D2 preserves into table T2 row of the line unit including character string s2 and character string " 20151015 ";
To access during data D3 preserves into table T2 row of the line unit including character string s3 and character string " 20151015 ";
To access during data D4 preserves into table T2 row of the line unit including character string s1 and character string " 20151015 ";
To access during data D5 preserves into table T2 row of the line unit including character string s1 and character string " 20151015 ";
To access during data D6 preserves into table T2 row of the line unit including character string s1 and character string " 20151015 ";
To access during data D7 preserves into table T2 row of the line unit including character string s3 and character string " 20151015 ";
To access during data D8 preserves into table T2 row of the line unit including character string s3 and character string " 20151015 ";
To access during data D9 preserves into table T2 row of the line unit including character string s2 and character string " 20151015 ";
To access during data D10 preserves into table T2 row of the line unit including character string s1 and character string " 20151015 ";
……
Data D10000 will be accessed and preserve into table T2 row of the line unit including character string s2 and character string " 20151016 " In;
Data D10001 will be accessed and preserve into table T2 row of the line unit including character string s1 and character string " 20151016 " In;
Data D10002 will be accessed and preserve into table T2 row of the line unit including character string s3 and character string " 20151016 " In;
……
Data D1000000 will be accessed and preserve into table T2 line unit including character string s1 and character string " 20151020 " In row.
Again for example, setting rowkey is:Tomcat marks-date, if it is desired to inquiry Tomcat1 was at 2015 10 Month access log of this day on the 15th, then it is Tomcat1-20151015, endKey that startKEY is set when inquiring about It is Tomcat1-20151016.If it is desired to inquiry Tomcat2 is in the access log of this day of on November 20th, 2015, It is Tomcat2-20151120 that startKEY is set when then inquiring about, and endKey is Tomcat2-20151121.
Can will be same by setting rowkey including server identification and date, when preserving access log in the table of HBase The access log on the same day of one server is stored in adjacent position, in the table during queried access daily record, can be with Quick search goes out access log of some server on certain date, substantially increases search efficiency.
Alternatively, the line unit of table also includes that Preset Time and daily record are identified, and storage unit 24 also includes that second obtains sub single Unit, second are searched subelement and second and preserve subelement.Second acquisition subelement is used to obtain service in multiple servers The access time t of the access log Li of device iiDaily record with access log Li identifies Ri, wherein, i takes 1 to m successively, M is the quantity of server in multiple servers.Line unit includes mark Z during second lookup subelement is used to search target linei、 Preset time TiR is identified with daily recordiTarget line Hi, wherein, identify ZiIt is the mark of server i, preset time Ti It is access time tiAffiliated Preset Time.Second preservation subelement is used to preserve the access log of server i to mesh Mark row Hi.Query unit 26 also includes the 3rd inquiry subelement and the 4th inquiry subelement.3rd inquiry subelement is used In the mark according to server to be checked, the access log of server to be checked is inquired about in table.4th inquiry subelement For the mark according to server to be checked and time to be checked, the access log of server to be checked is inquired about in table, Wherein, the time to be checked is any Preset Time in the line unit of table.
Alternatively, the access log of server i is included by access data Li1To access dataThe a plurality of access of composition Data, wherein, niTo access the quantity of data in a plurality of access data.Second obtains subelement includes that second obtains mould Block.Second acquisition module is used to obtain access data LijAccess time tijWith access data LijThe unique code of universal identification Uij, wherein, j takes 1 to n successivelyi, daily record is designated the unique code U of universal identificationij.Second searches subelement includes the Two searching moduls.Line unit includes mark Z during second searching modul is used to search target linei, preset time TijWith general knowledge Not unique code UijTarget line Hij, wherein, preset time TijIt is access time tijAffiliated Preset Time.Second protects Depositing subelement includes the second preserving module.Second preserving module is used for the access data L of server iijPreserve to target Row Hij
The unique code of universal identification (Universally Unique Identifier, abbreviation UUID) refers in a machine The numeral generated on device, it is all unique that it ensures to aerial all machines when same.Using the purpose of UUID, It is all elements allowed in distributed system, there can be unique identification information, without passing through central control terminal Do specifying for identification information.
UUID by following sections combination:(1) current date and time, first part of UUID is relevant with the time, If after a UUID is generated, a UUID is generated again within several seconds excessively, then first part is different, and remaining is identical. (2) clock sequence.(3) globally unique IEEE machine recognitions number, if network interface card, obtain from MAC Address of Network Card , there is no network interface card otherwise to obtain.
The result string of UUID generations can be long.On this standard of UUID using it is most common be Microsoft GUID(Globals Unique Identifiers).Can be with CreateUUID () function very in ColdFusion UUID is simply generated, its form is:Xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx (8-4-4-16), Wherein each x is a hexadecimal numeral in the range of 0-9 or a-f.And the UUID forms of standard are: Xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12), can download from cflib CreateGUID () UDF is changed.
Using the benefit of UUID in distributed software systems (such as:DCE/RPC, COM+, CORBA) just can body Reveal and, it is ensured that the mark that each node is generated is all without repetition, and with integration technologies such as WEB services Development, the advantage of UUID will be apparent from.According to the specific mechanism for using, UUID not only needs to be ensured of each other not Identical, or be at least have very big with the universal unique identifier of 3400 Christian eras other any generations before Difference.
Every of access log accesses data in generation, all generates unique UUID, and this UUID can be uniquely One access data of mark.Setting line unit includes server identification, date and UUID, when access log is preserved, energy It is enough that every access data are all saved in the row of UUID of the line unit comprising the access data, needing queried access daily record When, by reasonably setting startKEY and endKey, all of visit of each server can be both gone out with quick search Daily record is asked, can go out each server with quick search again is giving directions the access log on date, can go out often with quick search The a certain bar specified of individual server accesses data, substantially increases the access day that server is inquired about in the table of HBase The efficiency of will.
The inquiry unit of the access log includes processor and memory, above-mentioned to set up unit 22, storage unit 24 With the grade of query unit 26 as program unit storage in memory, by computing device storage in memory upper Program unit is stated to realize corresponding function.
Kernel is included in processor, is gone in memory to transfer corresponding program unit by kernel.Kernel can set one Or more, the access log of server is quickly and efficiently inquired about in the table of HBase by adjusting kernel parameter.
Memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/ Or the form, such as read-only storage (ROM) or flash memory (flash RAM) such as Nonvolatile memory, memory includes at least one Individual storage chip.
Present invention also provides a kind of computer program product, when being performed on data processing equipment, it is adapted for carrying out just The program code of beginningization there are as below methods step:Table is set up in distributed data base, wherein, the line unit of table includes clothes The mark of business device, table includes multiple rows, and the access log correspondence of the multiple servers that will be received is preserved to the target of table OK, wherein, the row of the mark of goal behavior line unit corresponding with destination server including destination server, destination service Device is any server in multiple servers, and corresponding with any server goal behavior is multiple, according to line unit, The access log of server to be checked is inquired about in table.
Above-mentioned the embodiment of the present application sequence number is for illustration only, and the quality of embodiment is not represented.
In above-described embodiment of the application, the description to each embodiment all emphasizes particularly on different fields, and does not have in certain embodiment The part of detailed description, may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed technology contents, can be by other Mode realize.Wherein, device embodiment described above is only schematical, such as division of described unit, Can be a kind of division of logic function, there can be other dividing mode when actually realizing, for example multiple units or component Can combine or be desirably integrated into another system, or some features can be ignored, or do not perform.It is another, institute Display or the coupling each other for discussing or direct-coupling or communication connection can be by some interfaces, unit or mould The INDIRECT COUPLING of block or communication connection, can be electrical or other forms.
The unit that is illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit The part for showing can be or may not be physical location, you can with positioned at a place, or can also be distributed to On multiple units.Some or all of unit therein can be according to the actual needs selected to realize this embodiment scheme Purpose.
In addition, during each functional unit in the application each embodiment can be integrated in a processing unit, it is also possible to It is that unit is individually physically present, it is also possible to which two or more units are integrated in a unit.It is above-mentioned integrated Unit can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.
If the integrated unit is to realize in the form of SFU software functional unit and as independent production marketing or when using, Can store in a computer read/write memory medium.Based on such understanding, the technical scheme essence of the application On all or part of the part that is contributed to prior art in other words or the technical scheme can be with software product Form is embodied, and the computer software product is stored in a storage medium, including some instructions are used to so that one Platform computer equipment (can be personal computer, server or network equipment etc.) performs each embodiment institute of the application State all or part of step of method.And foregoing storage medium includes:USB flash disk, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD Etc. it is various can be with the medium of store program codes.
The above is only the preferred embodiment of the application, it is noted that for the ordinary skill people of the art For member, on the premise of the application principle is not departed from, some improvements and modifications can also be made, these improve and moisten Decorations also should be regarded as the protection domain of the application.

Claims (10)

1. a kind of querying method of access log, it is characterised in that including:
Table is set up in distributed data base, wherein, the line unit of the table includes the mark of server, the table Including multiple rows;
The access log correspondence of the multiple servers that will be received is preserved to the target line of the table, wherein, with mesh The corresponding goal behavior line unit of mark server includes the row of the mark of the destination server, the target clothes Business device is any server in the multiple server, the goal behavior corresponding with any server It is multiple;
According to the line unit, the access log of server to be checked is inquired about in the table.
2. method according to claim 1, it is characterised in that the line unit of the table also includes Preset Time,
The access log correspondence of the multiple servers that will be received is preserved to the target line of the table and included:
Obtain the access time t of the access log Li of server i in the multiple serveri, wherein, i is successively 1 to m is taken, m is the quantity of server in the multiple server;
Line unit includes mark Z in searching the target lineiAnd preset time TiTarget line Hi, wherein, the mark Know ZiIt is the mark of the server i, the preset time TiIt is the access time tiAffiliated Preset Time; And
The access log of the server i is preserved to the target line Hi,
According to the line unit, the access log that server to be checked is inquired about in the table includes:
According to the mark of the server to be checked, the access day of the server to be checked is inquired about in the table Will;Or
Mark and time to be checked according to the server to be checked, inquire about the clothes to be checked in the table The access log of business device, wherein, the time to be checked is any Preset Time in the line unit of the table.
3. method according to claim 2, it is characterised in that the access log of the server i is included by accessing Data Li1To access dataThe a plurality of access data of composition, wherein, niTo be visited in a plurality of access data The quantity of data is asked,
Obtain the access time t of the access log Li of server i in the multiple serveriIncluding:Obtain and access Data LijAccess time tij, wherein, j takes 1 to n successivelyi,
Line unit includes mark Z in searching the target lineiAnd preset time TiTarget line HiIncluding:Search described Line unit includes the mark Z in target lineiAnd preset time TijTarget line Hij, wherein, the preset time Tij It is the access time tijAffiliated Preset Time,
The access log of the server i is preserved to the target line HiIncluding:By the institute of the server i State access data LijPreserve to the target line Hij
4. method according to claim 1, it is characterised in that the line unit of the table also includes Preset Time and daily record Mark,
The access log correspondence of the multiple servers that will be received is preserved to the target line of the table and also included:
Obtain the access time t of the access log Li of server i in the multiple serveriWith the access log The daily record mark R of Lii, wherein, i takes 1 to m successively, and m is the quantity of server in the multiple server;
Line unit includes mark Z in searching the target linei, preset time TiR is identified with the daily recordiTarget line Hi, wherein, the mark ZiIt is the mark of the server i, the preset time TiIt is the access time tiAffiliated Preset Time;And
The access log of the server i is preserved to the target line Hi,
According to the line unit, the access log that server to be checked is inquired about in the table also includes:
According to the mark of the server to be checked, the access day of the server to be checked is inquired about in the table Will;Or
Mark and time to be checked according to the server to be checked, inquire about the clothes to be checked in the table The access log of business device, wherein, the time to be checked is any Preset Time in the line unit of the table.
5. method according to claim 4, it is characterised in that the access log of the server i is included by accessing Data Li1To access dataThe a plurality of access data of composition, wherein, niTo be visited in a plurality of access data The quantity of data is asked,
Obtain the access time t of the access log Li of server i in the multiple serveriWith the access log The daily record mark R of LiiIncluding:Obtain and access data LijAccess time tijWith the access data LijIt is general Recognize unique code Uij, wherein, j takes 1 to n successivelyi, the daily record is designated the unique code U of the universal identificationij,
Line unit includes mark Z in searching the target linei, preset time TiR is identified with the daily recordiTarget line HiIncluding:Line unit includes the mark Z in searching the target linei, preset time TijWith the universal identification Unique code UijTarget line Hij, wherein, the preset time TijIt is the access time tijWhen affiliated default Between,
The access log of the server i is preserved to the target line HiIncluding:By the institute of the server i State access data LijPreserve to the target line Hij
6. a kind of inquiry unit of access log, it is characterised in that including:
Unit is set up, for setting up table in distributed data base, wherein, the line unit of the table includes server Mark, the table includes multiple rows;
Storage unit, the access log correspondence of the multiple servers for that will receive is preserved to the target of the table OK, wherein, the mark of the goal behavior line unit corresponding with destination server including the destination server OK, the destination server is any server in the multiple server, corresponding with any server The goal behavior it is multiple;
Query unit, for according to the line unit, the access log of server to be checked being inquired about in the table.
7. device according to claim 6, it is characterised in that the line unit of the table also includes Preset Time,
The storage unit includes:
First obtains subelement, the access of the access log Li for obtaining server i in the multiple server Time ti, wherein, i takes 1 to m successively, and m is the quantity of server in the multiple server;
First searches subelement, and mark Z is included for searching line unit in the target lineiAnd preset time TiMesh Mark row Hi, wherein, the mark ZiIt is the mark of the server i, the preset time TiIt is the access Time tiAffiliated Preset Time;And
First preserves subelement, for the access log of the server i to be preserved to the target line Hi,
The query unit includes:
First inquiry subelement, for the mark according to the server to be checked, inquires about described in the table The access log of server to be checked;And
Second inquiry subelement, for the mark according to the server to be checked and time to be checked, described The access log of the server to be checked is inquired about in table, wherein, the time to be checked is the line unit of the table In any Preset Time.
8. device according to claim 7, it is characterised in that the access log of the server i is included by accessing Data Li1To access dataThe a plurality of access data of composition, wherein, niTo be visited in a plurality of access data The quantity of data is asked,
The first acquisition subelement includes:
First acquisition module, data L is accessed for obtainingijAccess time tij, wherein, j takes 1 to n successivelyi,
The first lookup subelement includes:
First searching modul, the mark Z is included for searching line unit in the target lineiAnd preset time Tij's Target line Hij, wherein, the preset time TijIt is the access time tijAffiliated Preset Time,
The first preservation subelement includes:
First preserving module, for by the access data L of the server iijPreserve to the target line Hij
9. device according to claim 6, it is characterised in that the line unit of the table also includes Preset Time and daily record Mark,
The storage unit also includes:
Second obtains subelement, the access of the access log Li for obtaining server i in the multiple server Time tiDaily record with the access log Li identifies Ri, wherein, i takes 1 to m successively, and m is the multiple The quantity of server in server;
Second searches subelement, and mark Z is included for searching line unit in the target linei, preset time TiAnd institute State daily record mark RiTarget line Hi, wherein, the mark ZiIt is the mark of the server i, it is described pre- If time TiIt is the access time tiAffiliated Preset Time;And
Second preserves subelement, for the access log of the server i to be preserved to the target line Hi,
The query unit also includes:
3rd inquiry subelement, for the mark according to the server to be checked, inquires about described in the table The access log of server to be checked;And
4th inquiry subelement, for the mark according to the server to be checked and time to be checked, described The access log of the server to be checked is inquired about in table, wherein, the time to be checked is the line unit of the table In any Preset Time.
10. device according to claim 9, it is characterised in that the access log of the server i is included by accessing Data Li1To access dataThe a plurality of access data of composition, wherein, niTo be visited in a plurality of access data The quantity of data is asked,
The second acquisition subelement includes:
Second acquisition module, data L is accessed for obtainingijAccess time tijWith the access data LijIt is general Recognize unique code Uij, wherein, j takes 1 to n successivelyi, the daily record is designated the unique code U of the universal identificationij,
The second lookup subelement includes:
Second searching modul, the mark Z is included for searching line unit in the target linei, preset time TijWith The unique code U of universal identificationijTarget line Hij, wherein, the preset time TijIt is the access time tijInstitute The Preset Time of category,
The second preservation subelement includes:
Second preserving module, for by the access data L of the server iijPreserve to the target line Hij
CN201510813316.7A 2015-11-20 2015-11-20 Query method and device for access log Active CN106776622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510813316.7A CN106776622B (en) 2015-11-20 2015-11-20 Query method and device for access log

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510813316.7A CN106776622B (en) 2015-11-20 2015-11-20 Query method and device for access log

Publications (2)

Publication Number Publication Date
CN106776622A true CN106776622A (en) 2017-05-31
CN106776622B CN106776622B (en) 2020-03-03

Family

ID=58886137

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510813316.7A Active CN106776622B (en) 2015-11-20 2015-11-20 Query method and device for access log

Country Status (1)

Country Link
CN (1) CN106776622B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107241231A (en) * 2017-07-26 2017-10-10 成都科来软件有限公司 A kind of fast accurate localization method of raw network data bag
CN107688619A (en) * 2017-08-10 2018-02-13 北京奇安信科技有限公司 A kind of daily record data processing method and processing device
CN108241744A (en) * 2018-01-04 2018-07-03 北京奇艺世纪科技有限公司 A kind of log read method and apparatus
CN110955868A (en) * 2018-09-27 2020-04-03 千寻位置网络有限公司 Certificate expiration verification method and device and terminal equipment
CN111143311A (en) * 2019-12-13 2020-05-12 东软集团股份有限公司 Method, device, medium and equipment for determining correlation between applications and searching log correlation
CN111400368A (en) * 2020-03-06 2020-07-10 网宿科技股份有限公司 Log searching method and device of distributed server system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122291A (en) * 2011-01-18 2011-07-13 浙江大学 Blog friend recommendation method based on tree log pattern analysis
CN103401937A (en) * 2013-08-07 2013-11-20 中国科学院信息工程研究所 Log data processing method and system
US20140032494A1 (en) * 2012-04-30 2014-01-30 International Business Machines Corporation Data index using a linked data standard
CN104182506A (en) * 2014-08-19 2014-12-03 浪潮(北京)电子信息产业有限公司 Log management method
CN104394041A (en) * 2014-12-15 2015-03-04 北京国双科技有限公司 Access log generation method and device
US9189513B1 (en) * 2012-12-03 2015-11-17 Vmware, Inc. Distributed, transactional key-value store

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102122291A (en) * 2011-01-18 2011-07-13 浙江大学 Blog friend recommendation method based on tree log pattern analysis
US20140032494A1 (en) * 2012-04-30 2014-01-30 International Business Machines Corporation Data index using a linked data standard
US9189513B1 (en) * 2012-12-03 2015-11-17 Vmware, Inc. Distributed, transactional key-value store
CN103401937A (en) * 2013-08-07 2013-11-20 中国科学院信息工程研究所 Log data processing method and system
CN104182506A (en) * 2014-08-19 2014-12-03 浪潮(北京)电子信息产业有限公司 Log management method
CN104394041A (en) * 2014-12-15 2015-03-04 北京国双科技有限公司 Access log generation method and device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107241231A (en) * 2017-07-26 2017-10-10 成都科来软件有限公司 A kind of fast accurate localization method of raw network data bag
CN107241231B (en) * 2017-07-26 2020-04-03 成都科来软件有限公司 Rapid and accurate positioning method for original network data packet
CN107688619A (en) * 2017-08-10 2018-02-13 北京奇安信科技有限公司 A kind of daily record data processing method and processing device
CN107688619B (en) * 2017-08-10 2020-06-16 奇安信科技集团股份有限公司 Log data processing method and device
CN108241744A (en) * 2018-01-04 2018-07-03 北京奇艺世纪科技有限公司 A kind of log read method and apparatus
CN110955868A (en) * 2018-09-27 2020-04-03 千寻位置网络有限公司 Certificate expiration verification method and device and terminal equipment
CN111143311A (en) * 2019-12-13 2020-05-12 东软集团股份有限公司 Method, device, medium and equipment for determining correlation between applications and searching log correlation
CN111143311B (en) * 2019-12-13 2023-10-13 东软集团股份有限公司 Inter-application association determination and log association search methods, devices, media and equipment
CN111400368A (en) * 2020-03-06 2020-07-10 网宿科技股份有限公司 Log searching method and device of distributed server system
CN111400368B (en) * 2020-03-06 2023-12-12 网宿科技股份有限公司 Log searching method and device of distributed server system

Also Published As

Publication number Publication date
CN106776622B (en) 2020-03-03

Similar Documents

Publication Publication Date Title
CN106776622A (en) The querying method and device of access log
CN101464894B (en) Data query method and system
CN106326361B (en) Data query method and device based on HBase database
JP6599906B2 (en) Login account prompt
CN103368992B (en) Message push method and device
US20060184584A1 (en) Contact merge auto-suggest
CN105138592A (en) Distributed framework-based log data storing and retrieving method
CN106997557B (en) Order information acquisition method and device
CN101043421B (en) Memory based method for searching quickly the longest matching of IP address
US20150220234A1 (en) Method and device of trans-browser login for mobile terminal
KR20190062530A (en) Domain name resolution method, server and storage medium
CN103077208B (en) URL(uniform resource locator) matched processing method and device
WO2017148295A1 (en) Data processing method and device
US10140347B2 (en) Exposing data to query generating applications using usage profiles
CN111416880A (en) IP address addressing method and device, computer storage medium and electronic equipment
CN106302384A (en) DNS message processing method and device
CN108427736A (en) A method of for inquiring data
CN104636368A (en) Data retrieval method and device and server
CN104253796B (en) Quick area's recognition methods based on network address binding region layer level in domain name system
CN103036726A (en) Method and device for network user management
CN104424316A (en) Data storage method, data searching method, related device and system
CN113377876A (en) Domino platform-based data sub-database processing method, device and platform
CN111131049B (en) Method and device for processing routing table entry
CN115098738A (en) Service data extraction method and device, storage medium and electronic equipment
US8281000B1 (en) Variable-length nonce generation

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Cuigong Hotel, 76 Zhichun Road, Shuangyushu District, Haidian District, Beijing

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant