Summary of the invention
The accuracy of reading in advance in order to improve file reduces limitation, the invention provides the method and apparatus that a kind of file is read in advance.Described technical scheme is as follows:
First aspect the invention provides a kind of method that file is read in advance, comprising:
The request of snoop-operations file;
Follow the tracks of the process of reading and writing of files, obtain the corresponding relation of user and process, and the corresponding relation of process and file;
Detection is read in advance file and is obtained document flow information, take file as unit, request is divided and obtains user's stream information;
According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling;
Carry out the operation of reading in advance file according to the described tlv triple of setting up.
In conjunction with first aspect, under the first embodiment of first aspect, follow the tracks of the process of reading and writing of files, obtain the corresponding relation of user and process, and the corresponding relation of process and file, comprising:
Obtain user profile according to described request;
Follow the tracks of the process of reading and writing of files, be defined as the process of described request service, and the file of described process processing;
According to described user profile and definite described process, set up the corresponding relation of user and process;
According to the file that the described process of determining is processed, set up the corresponding relation of process and file.
In conjunction with first aspect, under the second embodiment of first aspect, according to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple for document flow and user's stream of reading/writing characteristics coupling are set up user, process and file comprises:
Obtain the reading/writing characteristics of described document flow, and the reading/writing characteristics of described user stream;
The reading/writing characteristics of the reading/writing characteristics of more described document flow and described user stream, the document flow and the user that find out the reading/writing characteristics coupling flow;
According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling.
In conjunction with first aspect, under the third embodiment of first aspect, described method also comprises:
For the unmatched document flow of reading/writing characteristics and user's stream, according to the reading/writing characteristics of user's stream, unmatched document flow is revised.
In conjunction with above-mentioned the third embodiment, under the 4th kind of embodiment of first aspect, for the unmatched document flow of reading/writing characteristics and user's stream, according to the reading/writing characteristics of user's stream, unmatched document flow is revised, comprising:
For the unmatched document flow of reading/writing characteristics and user's stream, determine that number of users corresponding to a certain file less than the document flow number of this document, merges processing to the document flow of this document if flow according to the user; If flow number of users corresponding to definite a certain file greater than the document flow number of this document according to the user, the document flow of this document carried out deconsolidation process.
In conjunction with first aspect, under the 5th kind of embodiment of first aspect, described method also comprises:
Resolve the current described request that listens to, the order of obtaining user's operation file;
When described order is completed, with the respective items deletion of user described in described tlv triple and file.
In conjunction with first aspect, the first of first aspect, the second, the third, any in the 4th kind, the 5th kind embodiment, under the 6th kind of embodiment of first aspect, described method also comprises:
After setting up described tlv triple, reach the number of times or duration of appointment when the request that listens to after, again detect and read in advance file and obtain document flow information, and again take file as unit, request is divided and obtain user's stream information;
According to again detecting the document flow information that obtains and repartitioning the user's stream information that obtains described tlv triple is upgraded.
Second aspect, the device that the present invention also provides a kind of file to read in advance comprises:
Monitor module, be used for the request of snoop-operations file;
Tracking module for the process of following the tracks of reading and writing of files, obtains the corresponding relation of user and process, and the corresponding relation of process and file;
The association analysis module obtains document flow information for detection of reading in advance file, take file as unit, request is divided and obtains user's stream information; According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling;
Read in advance processing module, be used for carrying out the operation of reading in advance file according to the described tlv triple of setting up.
In conjunction with second aspect, under the first embodiment of second aspect, described tracking module is used for:
Obtain user profile according to described request;
Follow the tracks of the process of reading and writing of files, be defined as the process of described request service, and the file of described process processing;
According to described user profile and definite described process, set up the corresponding relation of user and process;
According to the file that the described process of determining is processed, set up the corresponding relation of process and file.
In conjunction with second aspect, under the second embodiment of second aspect, described association analysis module is used for:
Obtain the reading/writing characteristics of described document flow, and the reading/writing characteristics of described user stream;
The reading/writing characteristics of the reading/writing characteristics of more described document flow and described user stream, the document flow and the user that find out the reading/writing characteristics coupling flow;
According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling.
In conjunction with second aspect, under the third embodiment of second aspect, described association analysis module also comprises:
Amending unit is used for, according to the reading/writing characteristics of user's stream unmatched document flow being revised for the unmatched document flow of reading/writing characteristics and user's stream.
In conjunction with above-mentioned the third embodiment, under the 4th kind of embodiment of second aspect, described amending unit is used for:
For the unmatched document flow of reading/writing characteristics and user's stream, determine that number of users corresponding to a certain file less than the document flow number of this document, merges processing to the document flow of this document if flow according to the user; If flow number of users corresponding to definite a certain file greater than the document flow number of this document according to the user, the document flow of this document carried out deconsolidation process.
In conjunction with second aspect, under the 5th kind of embodiment of second aspect, described association analysis module also is used for:
Resolve the current described request that listens to, the order of obtaining user's operation file;
When described order is completed, with the respective items deletion of user described in described tlv triple and file.
In conjunction with second aspect, the first of second aspect, the second, the third, any in the 4th kind, the 5th kind embodiment, under the 6th kind of embodiment of second aspect, described association analysis module also is used for:
After setting up described tlv triple, reach the number of times or duration of appointment when the request that listens to after, again detect and read in advance file and obtain document flow information, and again take file as unit, request is divided and obtain user's stream information;
According to again detecting the document flow information that obtains and repartitioning the user's stream information that obtains described tlv triple is upgraded.
The beneficial effect that technical scheme provided by the invention is brought is:
By the request of snoop-operations file, follow the tracks of the process of reading and writing of files, obtain the corresponding relation of user and process, and the corresponding relation of process and file; Detection is read in advance file and is obtained document flow information, take file as unit, request is divided and obtains user's stream information; According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling; Carry out the operation of reading in advance file according to the described tlv triple of setting up, realized that the file of user class reads in advance, changed the state that the file system internal statistical is blindly analyzed, active analysis user's request behavior, user and file association are got up, improve the accuracy of reading in advance, need not to rely on upper layer application, reduced limitation.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
Referring to Fig. 1, a kind of method that the present embodiment provides file to read in advance comprises:
101: the request of snoop-operations file;
102: follow the tracks of the process of reading and writing of files, obtain the corresponding relation of user and process, and the corresponding relation of process and file;
103: detection is read in advance file and is obtained document flow information, take file as unit, request is divided and obtains user's stream information;
104: according to the corresponding relation of user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling;
105: carry out the operation of reading in advance file according to the tlv triple of setting up.
In the present invention, described read in advance to refer to will be to be operated before read-write operation file read in advance and carry out buffer memory in internal memory, then directly the file in internal memory is carried out read or write when carrying out read or write, thereby can improve read or write speed, improve the I/O performance.
In conjunction with said method, under the first embodiment of said method, follow the tracks of the process of reading and writing of files, obtain the corresponding relation of user and process, and the corresponding relation of process and file, comprising:
According to acquisition request user profile;
Follow the tracks of the process of reading and writing of files, be defined as the process of request service, and the file of process processing;
According to user profile and definite process, set up the corresponding relation of user and process;
According to the file that the process of determining is processed, set up the corresponding relation of process and file.
In conjunction with said method, under the second embodiment of said method, according to the corresponding relation of user and process, and the corresponding relation of process and file, the tlv triple for document flow and user's stream of reading/writing characteristics coupling are set up user, process and file comprises:
Obtain the reading/writing characteristics of document flow, and the reading/writing characteristics of user's stream;
The reading/writing characteristics of the reading/writing characteristics of comparison document stream and user's stream, the document flow and the user that find out the reading/writing characteristics coupling flow;
According to the corresponding relation of user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling.
In conjunction with said method, under the third embodiment of said method, said method also comprises:
For the unmatched document flow of reading/writing characteristics and user's stream, according to the reading/writing characteristics of user's stream, unmatched document flow is revised.
In conjunction with above-mentioned the third embodiment, under the 4th kind of embodiment of said method, for the unmatched document flow of reading/writing characteristics and user's stream, according to the reading/writing characteristics of user's stream, unmatched document flow is revised, comprising:
For the unmatched document flow of reading/writing characteristics and user's stream, determine that number of users corresponding to a certain file less than the document flow number of this document, merges processing to the document flow of this document if flow according to the user; If flow number of users corresponding to definite a certain file greater than the document flow number of this document according to the user, the document flow of this document carried out deconsolidation process.
In conjunction with said method, under the 5th kind of embodiment of said method, said method also comprises:
Resolve the current request that listens to, the order of obtaining user's operation file;
When this order is completed, with the respective items deletion of user in tlv triple and file.
In conjunction with said method, the first of said method, the second, the third, any in the 4th kind, the 5th kind embodiment, under the 6th kind of embodiment of said method, said method also comprises:
After setting up tlv triple, reach the number of times or duration of appointment when the request that listens to after, again detect and read in advance file and obtain document flow information, and again take file as unit, request is divided and obtain user's stream information;
According to again detecting the document flow information that obtains and repartitioning the user's stream information that obtains tlv triple is upgraded.
The said method that the present embodiment provides by the request of snoop-operations file, is followed the tracks of the process of reading and writing of files, obtains the corresponding relation of user and process, and the corresponding relation of process and file; Detection is read in advance file and is obtained document flow information, take file as unit, request is divided and obtains user's stream information; According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling; Carry out the operation of reading in advance file according to the described tlv triple of setting up, realized that the file of user class reads in advance, changed the state that the file system internal statistical is blindly analyzed, active analysis user's request behavior, user and file association are got up, improve the accuracy of reading in advance, need not to rely on upper layer application, reduced limitation.
Embodiment 2
Referring to Fig. 2, a kind of method that the present embodiment provides file to read in advance comprises:
201: the request of snoop-operations file;
In the present embodiment, operation file can for reading file, perhaps also can be written document.The present embodiment is applied to the scene of file-sharing.Usually, a file is set to share on server, and a plurality of clients can be carried out read or write to this file of sharing respectively.
Particularly, can monitor the TCP(Transmission Control Protocol on network interface card, transmission control protocol)/IP agreement, CIFS/SMB service etc., to analyze, whether new request is arranged, as a new TCP link, and whether have data to flow, the read-write block size of request, content etc.
202: according to acquisition request user profile, follow the tracks of the process of reading and writing of files, be defined as the process of request service, and the file of process processing;
In the present embodiment, server can be opened a plurality of processes, and each is in-process also can open a plurality of threads, and usually, each thread is user's service.Particularly, can utilize the orders such as ps, pstree to come the follow-up service process, thereby can obtain the present process of moving and the set membership of subprocess, and the set membership of thread and sub-thread etc.
In the present embodiment, described user profile comprises and client ip (Internet Protocol, Internet protocol) address perhaps comprises client ip address and port numbers.During from different IP, it can be identified as different users when two requests, can obtain port number information this moment; When two requests during from identical IP, the request of further obtaining from port numbers, if port numbers is different, it is identified as different users.By IP, perhaps IP and port numbers can identify different users.
In this step, be defined as the process of request service, particularly, can realize by two tuples of setting up user-process.For example, referring to table 1, be an example of user-process two tuples.
Table 1
The user |
Process |
SAMBA client ip/PORT |
SMB process/serve port |
Wherein, current request is from a SAMBA client, and IP/PORT represents IP address and the port numbers of this client, and the process of this current request service is the SMB process, and this client and this process context are got up to obtain user-process two tuples.
In this step, determine the file that process is processed, particularly, can realize by two tuples of setting up process-file.For example, referring to table 2, be an example of process-file two tuples.
Table 2
Process |
File |
SMB process/serve port |
a.doc |
Wherein, the process of processing current request is the SMB process, and the file that this process is processed is a.doc, thereby can set up process-file as shown in table 2 two tuples.
203: according to described user profile and definite process, set up the corresponding relation of user and process, and, according to the file that the process of determining is processed, set up the corresponding relation of process and file;
204: detection is read in advance file and is obtained document flow information;
In the present embodiment, detect the method for document flow by multiple, as adopting the multiple stream detection methods such as sequential stream detection, random sequence stream, weaving flow, concurrent stream, the present invention is not specifically limited this.Detect by stream and can obtain the one or more document flows that file is corresponding.
In the present embodiment, the testing result of each file is that this document comprises m document flow, particularly, can use array stream_file[m] represent, wherein, m is natural number.A total document flow corresponding to file can be expressed as
205: take file as unit, request is divided and obtain user's stream information;
In the present embodiment, a user can carry out read-write operation to a plurality of files, therefore, according to file, request is divided and obtains user's stream, can use array stream_user[n] represent.If the operation that a user's request reads or writes n file is divided into n user's stream, total user's stream corresponding to this user can be expressed as
For example, two in user's stream content, size and the files of reading and writing pieces are compared, find to belong to respectively different files, this user's flow point is split into the stream of two file-level.
206: obtain the reading/writing characteristics of document flow, and the reading/writing characteristics of user's stream, the reading/writing characteristics of the reading/writing characteristics of comparison document stream and user's stream, the document flow and the user that find out the reading/writing characteristics coupling flow;
207: according to the corresponding relation of user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling;
In the present embodiment, reading/writing characteristics includes but not limited to: the content of read-write piece, read-write block size, read or write, random degree, sequential relationship etc., the present invention is not specifically limited this.Described reading/writing characteristics coupling refers to that the reading/writing characteristics of document flow is identical with the reading/writing characteristics of user's stream.
The tlv triple of the user who sets up in this step, process and file can be as shown in table 3.
Table 3
Tlv triple in table 3 comprises three, in first, what provide service for user 1 request is process 1, the file of this request access is a.doc, the reading/writing characteristics corresponding with this user and this document comprise read-write piece content, read-write block size and read or the feature such as write, and corresponding operation comprises read and write.In second, what provide service for user 1 request is process 1, the file of this request access is b.doc, and the reading/writing characteristics corresponding with this user and this document comprise read-write piece content, read-write block size and read or the feature such as write, and corresponding operation comprises read and write.In the 3rd, what provide service for user 2 request is process 2, the file of this request access is a.doc, and the reading/writing characteristics corresponding with this user and this document comprise read-write piece content, read-write block size and read or the feature such as write, and corresponding operation comprises read and write.
208: carry out the operation of reading in advance file according to the tlv triple of setting up.
In the present embodiment, further, can also revise the tlv triple of having set up, said method also comprises:
For the unmatched document flow of reading/writing characteristics and user's stream, according to the reading/writing characteristics of user's stream, unmatched document flow is revised.
This mode of document flow being revised according to the reading/writing characteristics of user's stream has taken into full account user's request, asks associated with stream based on the user, has improved further the accuracy of reading in advance.
Particularly, for the unmatched document flow of reading/writing characteristics and user's stream, according to the reading/writing characteristics of user's stream, unmatched document flow is revised, being comprised:
For the unmatched document flow of reading/writing characteristics and user's stream, determine that number of users corresponding to a certain file less than the document flow number of this document, merges processing to the document flow of this document if flow according to the user; If flow number of users corresponding to definite a certain file greater than the document flow number of this document according to the user, the document flow of this document carried out deconsolidation process.
For example, can learn file a.doc respective user 1 and user 2 according to user's stream, and can learn that according to document flow file a.doc comprises 3 document flows, difference respective user 1,2 and 3, the document flow of user's 3 correspondences wherein can be merged in the document flow of user's 1 correspondence, perhaps merge in the document flow of user's 2 correspondences, thereby guaranteed the coupling that document flow and user flow.
For another example, can learn file b.doc respective user 1,2 and 3 according to user's stream, and can learn that according to document flow file b.doc comprises 2 document flows, difference respective user 2 and 3, the document flow of user 2 or user's 3 correspondences wherein can be split as two document flows, one of them respective user 1, thus the coupling that document flow and user flow guaranteed.
In addition, in the present embodiment, said method can also comprise:
Resolve the current request that listens to, the order of obtaining user's operation file; When this order is completed, with the respective items deletion of user in tlv triple and file.For example, parse the get order, can judge whether read operation is completed, and parses the put order, can judge whether write operation is completed etc.
This mode of adjusting tlv triple according to order can be applied to the common protocol such as FTP, HTTP because the characteristics of this quasi-protocol user stream normally bulk sequentially read and write.Perhaps, also can be applied to the services such as CIFS/SMB, the characteristics of this class service are to be generally a large amount of order read-writes, a small amount of random read-write.In above-mentioned types of applications, whether finish to adjust tlv triple according to read write command, unnecessary item in the deletion tlv triple, can improve the precision of tlv triple, discharge related resource, avoid the wasting of resources, especially read the scene of same file for a plurality of clients, this method is more effective.
In the present embodiment, said method also comprises:
After setting up tlv triple, reach the number of times or duration of appointment when the request that listens to after, again detect and read in advance file and obtain document flow information, and again take file as unit, request is divided and obtain user's stream information; According to again detecting the document flow information that obtains and repartitioning the user's stream information that obtains tlv triple is upgraded.
The number of times of described appointment or duration can arrange as required, and the present invention does not do restriction to concrete numerical value.When request number of times reaches the number of times of this appointment or duration, the tlv triple of having set up is upgraded, can accomplish to adjust in time the tlv triple of having set up, thereby guarantee the reliability of tlv triple, also make the accuracy of reading in advance obtain reliable guarantee.
The said method that the present embodiment provides by the request of snoop-operations file, is followed the tracks of the process of reading and writing of files, obtains the corresponding relation of user and process, and the corresponding relation of process and file; Detection is read in advance file and is obtained document flow information, take file as unit, request is divided and obtains user's stream information; According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling; Carry out the operation of reading in advance file according to the described tlv triple of setting up, realized that the file of user class reads in advance, changed the state that the file system internal statistical is blindly analyzed, active analysis user's request behavior, user and file association are got up, improve the accuracy of reading in advance, need not to rely on upper layer application, reduced limitation.
Embodiment 3
Referring to Fig. 3, the device that the present embodiment provides a kind of file to read in advance comprises:
Monitor module 301, be used for the request of snoop-operations file;
Tracking module 302 for the process of following the tracks of reading and writing of files, obtains the corresponding relation of user and process, and the corresponding relation of process and file;
Association analysis module 303 obtains document flow information for detection of reading in advance file, take file as unit, request is divided and obtains user's stream information; According to the corresponding relation of user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling;
Read in advance processing module 304, be used for carrying out the operation of reading in advance file according to the tlv triple of setting up.
In conjunction with said apparatus, under the first embodiment of said apparatus, tracking module 302 is used for:
According to acquisition request user profile;
Follow the tracks of the process of reading and writing of files, be defined as the process of request service, and the file of process processing;
According to user profile and definite process, set up the corresponding relation of user and process;
According to the file that the process of determining is processed, set up the corresponding relation of process and file.
In conjunction with said apparatus, under the second embodiment of said apparatus, association analysis module 303 is used for:
Obtain the reading/writing characteristics of document flow, and the reading/writing characteristics of user's stream;
The reading/writing characteristics of the reading/writing characteristics of comparison document stream and user's stream, the document flow and the user that find out the reading/writing characteristics coupling flow;
According to the corresponding relation of user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling.
In conjunction with said apparatus, under the third embodiment of said apparatus, association analysis module 303 also comprises:
Amending unit is used for, according to the reading/writing characteristics of user's stream unmatched document flow being revised for the unmatched document flow of reading/writing characteristics and user's stream.
In conjunction with above-mentioned the third embodiment, under the 4th kind of embodiment of said apparatus, amending unit is used for:
For the unmatched document flow of reading/writing characteristics and user's stream, determine that number of users corresponding to a certain file less than the document flow number of this document, merges processing to the document flow of this document if flow according to the user; If flow number of users corresponding to definite a certain file greater than the document flow number of this document according to the user, the document flow of this document carried out deconsolidation process.
In conjunction with said apparatus, under the 5th kind of embodiment of said apparatus, association analysis module 303 also is used for:
Resolve the current request that listens to, the order of obtaining user's operation file;
When order is completed, with the respective items deletion of user in tlv triple and file.
In conjunction with said apparatus, above-mentioned the first, the second, the third, any in the 4th kind, the 5th kind embodiment, under the 6th kind of embodiment of said apparatus, association analysis module 303 also is used for:
After setting up tlv triple, reach the number of times or duration of appointment when the request that listens to after, again detect and read in advance file and obtain document flow information, and again take file as unit, request is divided and obtain user's stream information;
According to again detecting the document flow information that obtains and repartitioning the user's stream information that obtains tlv triple is upgraded.
The said apparatus that the present embodiment provides can be provided by the method that provides in above-mentioned either method embodiment, and the description in the square method embodiment of detailed process is not given unnecessary details herein.Described device can be applied in server.
The said apparatus that the present embodiment provides by the request of snoop-operations file, is followed the tracks of the process of reading and writing of files, obtains the corresponding relation of user and process, and the corresponding relation of process and file; Detection is read in advance file and is obtained document flow information, take file as unit, request is divided and obtains user's stream information; According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling; Carry out the operation of reading in advance file according to the described tlv triple of setting up, realized that the file of user class reads in advance, changed the state that the file system internal statistical is blindly analyzed, active analysis user's request behavior, user and file association are got up, improve the accuracy of reading in advance, need not to rely on upper layer application, reduced limitation.
Embodiment 4
Referring to Fig. 4, the device that the present embodiment provides a kind of file to read in advance comprises:
Processor 401 is used for the request of snoop-operations file; Follow the tracks of the process of reading and writing of files, obtain the corresponding relation of user and process, and the corresponding relation of process and file; Detection is read in advance file and is obtained document flow information, take file as unit, request is divided and obtains user's stream information; According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling; Carry out the operation of reading in advance file according to the described tlv triple of setting up;
Storer 402 is used for storing the file of pre-read operation.
In conjunction with said apparatus, under the first embodiment of said apparatus, processor 401 is used for:
Obtain user profile according to described request;
Follow the tracks of the process of reading and writing of files, be defined as the process of described request service, and the file of described process processing;
According to described user profile and definite described process, set up the corresponding relation of user and process;
According to the file that the described process of determining is processed, set up the corresponding relation of process and file.
In conjunction with said apparatus, under the second embodiment of said apparatus, processor 401 is used for:
Obtain the reading/writing characteristics of described document flow, and the reading/writing characteristics of described user stream;
The reading/writing characteristics of the reading/writing characteristics of more described document flow and described user stream, the document flow and the user that find out the reading/writing characteristics coupling flow;
According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling.
In conjunction with said apparatus, under the third embodiment of said apparatus, processor 401 also is used for:
For the unmatched document flow of reading/writing characteristics and user's stream, according to the reading/writing characteristics of user's stream, unmatched document flow is revised.
In conjunction with above-mentioned the third embodiment, under the 4th kind of embodiment of said apparatus, processor 401 is used for:
For the unmatched document flow of reading/writing characteristics and user's stream, determine that number of users corresponding to a certain file less than the document flow number of this document, merges processing to the document flow of this document if flow according to the user; If flow number of users corresponding to definite a certain file greater than the document flow number of this document according to the user, the document flow of this document carried out deconsolidation process.
In conjunction with said apparatus, under the 5th kind of embodiment of said apparatus, processor 401 also is used for:
Resolve the current described request that listens to, the order of obtaining user's operation file;
When described order is completed, with the respective items deletion of user described in described tlv triple and file.
In conjunction with said apparatus, above-mentioned the first, the second, the third, any in the 4th kind, the 5th kind embodiment, under the 6th kind of embodiment of said apparatus, processor 401 also is used for:
After setting up described tlv triple, reach the number of times or duration of appointment when the request that listens to after, again detect and read in advance file and obtain document flow information, and again take file as unit, request is divided and obtain user's stream information;
According to again detecting the document flow information that obtains and repartitioning the user's stream information that obtains described tlv triple is upgraded.
The said apparatus that the present embodiment provides can be provided by the method that provides in above-mentioned either method embodiment, and the description in the square method embodiment of detailed process is not given unnecessary details herein.Described device can be applied in server.
The said apparatus that the present embodiment provides by the request of snoop-operations file, is followed the tracks of the process of reading and writing of files, obtains the corresponding relation of user and process, and the corresponding relation of process and file; Detection is read in advance file and is obtained document flow information, take file as unit, request is divided and obtains user's stream information; According to the corresponding relation of described user and process, and the corresponding relation of process and file, the tlv triple of setting up user, process and file for document flow and user's stream of reading/writing characteristics coupling; Carry out the operation of reading in advance file according to the described tlv triple of setting up, realized that the file of user class reads in advance, changed the state that the file system internal statistical is blindly analyzed, active analysis user's request behavior, user and file association are got up, improve the accuracy of reading in advance, need not to rely on upper layer application, reduced limitation.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can come the relevant hardware of instruction to complete by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The above is only preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., within all should being included in protection scope of the present invention.