[go: up one dir, main page]

CN103177080A - File pre-reading method and file pre-reading device - Google Patents

File pre-reading method and file pre-reading device Download PDF

Info

Publication number
CN103177080A
CN103177080A CN2013100496553A CN201310049655A CN103177080A CN 103177080 A CN103177080 A CN 103177080A CN 2013100496553 A CN2013100496553 A CN 2013100496553A CN 201310049655 A CN201310049655 A CN 201310049655A CN 103177080 A CN103177080 A CN 103177080A
Authority
CN
China
Prior art keywords
user
file
reading
stream
document flow
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
CN2013100496553A
Other languages
Chinese (zh)
Other versions
CN103177080B (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.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310049655.3A priority Critical patent/CN103177080B/en
Publication of CN103177080A publication Critical patent/CN103177080A/en
Application granted granted Critical
Publication of CN103177080B publication Critical patent/CN103177080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种文件预读的方法和装置,属于文件操作领域。所述方法包括:监听操作文件的请求;跟踪读写文件的进程,获取用户与进程的对应关系,以及进程与文件的对应关系;检测预读文件得到文件流信息,以文件为单位对请求进行划分得到用户流信息;根据所述用户与进程的对应关系,以及进程与文件的对应关系,为读写特征匹配的文件流和用户流建立用户、进程和文件的三元组;根据建立的所述三元组执行预读文件的操作。所述装置包括:监听模块、跟踪模块、关联分析模块和预读处理模块。本发明实现了用户级别的文件预读,提高了预读的准确性,无需依赖上层应用,降低了局限性。

Figure 201310049655

The invention discloses a file pre-reading method and device, belonging to the field of file operation. The method includes: monitoring the request for operating the file; tracking the process of reading and writing the file, obtaining the corresponding relationship between the user and the process, and the corresponding relationship between the process and the file; detecting the pre-read file to obtain the file flow information, and performing the request on the basis of the file Divide and obtain user flow information; according to the corresponding relationship between the user and the process, and the corresponding relationship between the process and the file, set up a triplet of user, process and file for the file flow and user flow matching the read and write characteristics; The above triplet performs the operation of pre-reading the file. The device includes: a monitoring module, a tracking module, an association analysis module and a pre-reading processing module. The invention realizes file pre-reading at the user level, improves the accuracy of pre-reading, does not need to rely on upper-layer applications, and reduces limitations.

Figure 201310049655

Description

The method and apparatus that file is read in advance
Technical field
The present invention relates to the file operation field, particularly the method and apparatus read in advance of a kind of file.
Background technology
File-sharing is the important function of server.By file-sharing, the user that access rights are arranged is access file at any time.The shared file readwrite performance is better, and the efficient of user job is higher, more can bring into play the value of file.common file sharing method has CIFS(Common Internet File System, the common the Internet file system)/SMB(Server Message Block, the service message piece) share directory form, FTP(File Transfer Protocol, file transfer protocol (FTP)) upload download, HTTP(Hypertext transfer protocol, HTML (Hypertext Markup Language)) download, emule(electricity donkey) share etc., its basic fundamental model is to set up a subprocess or sub-thread in service end for each client, by new subprocess, sub-thread provides service for client.But during the disk random read-write, because seek time is longer, actual transmission speed seldom reaches peak value.In order to reach higher I/O(Input Output, input and output) bandwidth, file system reads common employing and reads in advance algorithm, and prediction is about to the blocks of files of access, and in advance they is read in memory cache in batches, thereby improves the I/O performance.
Existing file system has two kinds of pre-head methods usually.A kind of is suggestive pre-head method (heuristic prefetching), and another kind is the pre-head method (informed prefetching) of knowing the inside story.Enlightening reading in advance is feature at file system layer Study document system cache page, the page of current request and page in the time period of just passing by are contrasted, thereby find the feature of file read-write, such as block size, read-write ratio, the order of order read-write, each read-write read with machine-readable ratio etc., then read in advance according to this feature.Reading in advance of knowing the inside story read API(Application Programming Interface, application programming interface in advance by using), by upper level applications give file system clear and definite read in advance indication, file system is read in advance indication according to this and is read in advance.
But there is the problem of hit rate in enlightening reading in advance to the having relatively high expectations of algorithm, and has the inaccurate problem of result of prediction.Reading in advance of knowing the inside story need to be called API, upper layer application relied on serious, and usage comparison is limited, has limitation.
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.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, during the below will describe embodiment, the accompanying drawing of required use is done to introduce simply, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the method flow diagram that file that the embodiment of the present invention 1 provides is read in advance;
Fig. 2 is the method flow diagram that file that the embodiment of the present invention 2 provides is read in advance;
Fig. 3 is the structure drawing of device that file that the embodiment of the present invention 3 provides is read in advance;
Fig. 4 is the structure drawing of device that file that the embodiment of the present invention 4 provides is read in advance.
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 Σ 1 m stream _ file [ i ] .
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 Σ 1 n stream _ user [ i ] .
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
Figure BDA00002831019000111
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.

Claims (14)

1. the method that file is read in advance, is characterized in that, described method comprises:
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.
2. method according to claim 1, is characterized in that, follows 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, 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.
3. method according to claim 1, is characterized in that, 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.
4. method according to claim 1, is characterized in that, 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.
5. method according to claim 4, is characterized in that, 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 revised, and 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.
6. method according to claim 1, is characterized in that, 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.
7. the described method of any one according to claim 1 to 6, is characterized in that, described method also comprises:
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.
8. the device that file is read in advance, is characterized in that, described device 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.
9. device according to claim 8, is characterized in that, 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.
10. device according to claim 8, is characterized in that, 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.
11. device according to claim 8 is characterized in that, 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.
12. device according to claim 11 is characterized in that, 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.
13. device according to claim 8 is characterized in that, 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.
14. according to claim 8 to 13, the described device of any one, is characterized in that, described association analysis module also is used for:
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.
CN201310049655.3A 2013-02-07 2013-02-07 The method and apparatus that file pre-reads Active CN103177080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310049655.3A CN103177080B (en) 2013-02-07 2013-02-07 The method and apparatus that file pre-reads

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310049655.3A CN103177080B (en) 2013-02-07 2013-02-07 The method and apparatus that file pre-reads

Publications (2)

Publication Number Publication Date
CN103177080A true CN103177080A (en) 2013-06-26
CN103177080B CN103177080B (en) 2016-03-30

Family

ID=48636941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310049655.3A Active CN103177080B (en) 2013-02-07 2013-02-07 The method and apparatus that file pre-reads

Country Status (1)

Country Link
CN (1) CN103177080B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250450A (en) * 2016-07-26 2016-12-21 惠州市斯坦利科技有限公司 The quick deployment method of file and device
CN106293513A (en) * 2016-07-26 2017-01-04 惠州市斯坦利科技有限公司 Movable storage device file reading and device
CN106293515A (en) * 2016-07-26 2017-01-04 惠州市斯坦利科技有限公司 Flash memory device file reading and device
CN108628550A (en) * 2018-04-28 2018-10-09 深信服科技股份有限公司 A kind of method, apparatus and system of reading disk mapped file
CN109542341A (en) * 2018-11-06 2019-03-29 网宿科技股份有限公司 A kind of read-write IO monitoring method, device, terminal and computer readable storage medium
CN115098017A (en) * 2022-05-12 2022-09-23 北京卡普拉科技有限公司 Data processing method and device, electronic equipment and storage medium
CN118244997A (en) * 2024-05-28 2024-06-25 山东云海国创云计算装备产业创新中心有限公司 Solid state disk data processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591887A (en) * 2011-01-18 2012-07-18 腾讯科技(深圳)有限公司 Network data pre-fetching method and network data pre-fetching system
CN102737037A (en) * 2011-04-07 2012-10-17 北京搜狗科技发展有限公司 Webpage pre-reading method, device and browser
CN102810092A (en) * 2011-05-31 2012-12-05 腾讯科技(深圳)有限公司 Data read-write method and system
US20130031221A1 (en) * 2010-09-21 2013-01-31 Tencent Technology (Shenzhen) Company Limited Distributed data storage system and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130031221A1 (en) * 2010-09-21 2013-01-31 Tencent Technology (Shenzhen) Company Limited Distributed data storage system and method
CN102591887A (en) * 2011-01-18 2012-07-18 腾讯科技(深圳)有限公司 Network data pre-fetching method and network data pre-fetching system
CN102737037A (en) * 2011-04-07 2012-10-17 北京搜狗科技发展有限公司 Webpage pre-reading method, device and browser
CN102810092A (en) * 2011-05-31 2012-12-05 腾讯科技(深圳)有限公司 Data read-write method and system

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250450A (en) * 2016-07-26 2016-12-21 惠州市斯坦利科技有限公司 The quick deployment method of file and device
CN106293513A (en) * 2016-07-26 2017-01-04 惠州市斯坦利科技有限公司 Movable storage device file reading and device
CN106293515A (en) * 2016-07-26 2017-01-04 惠州市斯坦利科技有限公司 Flash memory device file reading and device
CN108628550A (en) * 2018-04-28 2018-10-09 深信服科技股份有限公司 A kind of method, apparatus and system of reading disk mapped file
CN108628550B (en) * 2018-04-28 2022-02-22 深信服科技股份有限公司 Method, device and system for reading disk mapping file
CN109542341A (en) * 2018-11-06 2019-03-29 网宿科技股份有限公司 A kind of read-write IO monitoring method, device, terminal and computer readable storage medium
CN115098017A (en) * 2022-05-12 2022-09-23 北京卡普拉科技有限公司 Data processing method and device, electronic equipment and storage medium
CN118244997A (en) * 2024-05-28 2024-06-25 山东云海国创云计算装备产业创新中心有限公司 Solid state disk data processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN103177080B (en) 2016-03-30

Similar Documents

Publication Publication Date Title
CN103177080A (en) File pre-reading method and file pre-reading device
CN105550338B (en) A kind of mobile Web cache optimization method based on HTML5 application cache
WO2016115957A1 (en) Method and device for accelerating computers and intelligent devices for users and applications
US10771358B2 (en) Data acquisition device, data acquisition method and storage medium
CN107341267A (en) A kind of distributed file system access method and platform
JP5931595B2 (en) Information processing device
CN107391770A (en) A kind of method, apparatus of processing data, equipment and storage medium
KR20200060245A (en) Data accessing method, apparatus, device, and storage medium
CN110287152A (en) A data management method and related device
CN110008197A (en) A kind of data processing method, system and electronic equipment and storage medium
US8924642B2 (en) Monitoring record management method and device
CN101770504B (en) Data storage method, data reading method, and data reading equipment
Zhou et al. Improving big data storage performance in hybrid environment
CN104281545B (en) A kind of method for reading data and equipment
US9645873B2 (en) Integrated configuration management and monitoring for computer systems
CN114461948B (en) Web cache setting optimization method and electronic device
CN102081565A (en) Method and device for performing stability test on storage system
EP3264254B1 (en) System and method for a simulation of a block storage system on an object storage system
CN109710547B (en) A Design and Implementation Method of Buffer Memory Management in Industrial Internet of Things
US8417811B1 (en) Predicting hardware usage in a computing system
WO2016088237A1 (en) Distribution method, device, and program
Liao Server‐side prefetching in distributed file systems
US20240403205A1 (en) Near-memory protocol analyzer
CN104636209A (en) Resource scheduling system and method based on big data and cloud storage system directional performance optimization
CN118069589B (en) File access method, device, computer equipment and program product

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220214

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.