Summary of the invention
The purpose of the embodiment of the present invention is to provide a kind of file search method and device, to improve looking into of file
Look for efficiency.
For reaching above-mentioned purpose, the embodiment of the invention discloses a kind of file search method, including:
Reception ff is asked;
Access the number of times of catalogue according to user, determine catalogue set to be found;
The file meeting search criterion is searched in described catalogue set;
By finding the file meeting described search criterion, it is defined as lookup result.
It is also preferred that the left the described number of times accessing catalogue according to user, determine catalogue set to be found, including:
Determining first threshold, according to described first threshold, the request of described ff determines, or according in advance
If configuration information of searching determine;
The number of times that user accesses catalogue is more than or equal to the set of catalogue corresponding to described first threshold, determines
For catalogue set to be found.
It is also preferred that the left the described number of times accessing catalogue according to user, determine catalogue set to be found, including:
Determining Second Threshold, according to described Second Threshold, the request of described ff determines, or according in advance
If configuration information of searching determine;
Access the number of times of catalogue according to user, catalogue is ranked up from high to low according to access times, will row
The set of the catalogue that name is corresponding less than or equal to described Second Threshold, is defined as catalogue set to be found.
It is also preferred that the left the described number of times accessing catalogue according to user, determine catalogue set to be found, including:
Determine that the 3rd threshold value and time period, described 3rd threshold value and described time period be: look into according to described file
Look for request to determine, and/or search what configuration information determined according to default;
In time period determined by Jiang, the number of times that user accesses catalogue is corresponding more than or equal to described 3rd threshold value
The set of catalogue, be defined as catalogue set to be found.
For reaching above-mentioned purpose, the embodiment of the invention discloses a kind of ff device, including: file is looked into
Module, lookup module and lookup result determine module to look for request receiver module, catalogue set to determine, wherein,
Described ff request receiver module, is used for receiving ff request;
Described catalogue set determines module, for accessing the number of times of catalogue according to user, determines mesh to be found
Record set;
Described lookup module, meets for searching in described catalogue set determines the catalogue set that module determines
The file of search criterion;
Described lookup result determines module, for the file described lookup module searches arrived, is defined as searching
Result.
It is also preferred that the left described catalogue set determines module, including: first determines submodule and the first catalogue set
Determine submodule, wherein,
Described first determines submodule, for the file received according to described ff request receiver module
Search request determines first threshold, or determines first threshold according to default lookup configuration information;
Described first catalogue set determines submodule, for user accessing the number of times of catalogue more than or equal to institute
State the first set determining catalogue corresponding to first threshold that submodule determines, be defined as directory set to be found
Close.
It is also preferred that the left described catalogue set determines module, including: second determines submodule and the second catalogue set
Determine submodule, wherein,
Described second determines submodule, for the file received according to described ff request receiver module
Search request determines Second Threshold, or determines Second Threshold according to default lookup configuration information;
Described second catalogue set determines submodule, for accessing the number of times of catalogue according to user, catalogue is pressed
It is ranked up from high to low according to access times, ranking is determined what submodule determined less than or equal to described second
The set of the catalogue that Second Threshold is corresponding, is defined as catalogue set to be found.
It is also preferred that the left described catalogue set determines module, including: the 3rd determines submodule and the 3rd catalogue set
Determine submodule, wherein,
Described 3rd determines submodule, for the file received according to described ff request receiver module
Search request, and/or according to default lookup configuration information, determined for the 3rd threshold value and time period;
Described 3rd catalogue set determines submodule, for determining, by the described 3rd, the time period that submodule determines
In, user accesses more than or equal to described 3rd catalogue set, the 3rd that the number of times of catalogue determines that submodule determines
The set of the catalogue that threshold value is corresponding, is defined as catalogue set to be found.
As seen from the above technical solutions, embodiments provide a kind of file search method and device,
Method includes: receive ff request;Access the number of times of catalogue according to user, determine catalogue to be found
Set;The file meeting search criterion is searched in described catalogue set;To find and meet described lookup bar
The file of part, is defined as lookup result.The technical scheme that the application embodiment of the present invention is provided, only user
Locating file in the catalogue often accessed, the catalogue seldom accessed for user does not carry out the lookup of file, contracting
The little scope of ff, improves the search efficiency of file.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly
Chu, be fully described by, it is clear that described embodiment be only a part of embodiment of the present invention rather than
Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creation
The every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
Below by specific embodiment, the present invention is described in detail.
The schematic flow sheet of a kind of file search method that Fig. 1 provides for the embodiment of the present invention, may include that
S101: receive ff request;
S102: access the number of times of catalogue according to user, determines catalogue set to be found;
S103: search the file meeting search criterion in described catalogue set;
S104: by finding the file meeting described search criterion, be defined as lookup result.
Concrete, in actual applications, it may be determined that first threshold;The number of times that user accesses catalogue is more than
Or the set of the catalogue corresponding equal to first threshold, it is defined as catalogue set to be found.Wherein,
First threshold can determine according to ff request, it is also possible to is according to the lookup configuration preset
Information determines.
Exemplary, it is assumed that ff request includes for comparing the value accessing catalogue number of times, according to literary composition
Part search request, being used for of ff request being included is compared the value accessing catalogue number of times, is defined as the
One threshold value, it is assumed that value is 10.
Illustrate as a example by 5 catalogues below, it is assumed that 5 catalogues are respectively directory A, catalogue B, mesh
Record C, catalogue D and catalogue E, wherein, by current time, user accesses directory A 3 times, Yong Hufang
Asking catalogue B25 time, user accesses catalogue C20 time, and user accesses catalogue D5 time, and user accesses catalogue
E10 time, detect user in above-mentioned 5 catalogues and access the number of times of the catalogue catalogue more than or equal to 10 times, inspection
Survey result is catalogue B, catalogue C and catalogue E, then the set of catalogue B, catalogue C and catalogue E determined
For catalogue set to be found, catalogue B, catalogue C and catalogue E are searched the literary composition meeting search criterion
Part, the file that will find, it is defined as lookup result.
Assume that presets searches the value comprised in configuration information for comparing access catalogue number of times, then by default
Search the value for comparing access catalogue number of times comprised in configuration information, be defined as first threshold, it is assumed that value
It is 10.
Illustrate as a example by 5 catalogues below, it is assumed that 5 catalogues are respectively directory A, catalogue B, mesh
Record C, catalogue D and catalogue E, wherein, by current time, user accesses directory A 3 times, Yong Hufang
Asking catalogue B25 time, user accesses catalogue C20 time, and user accesses catalogue D5 time, and user accesses catalogue
E10 time, detect user in above-mentioned 5 catalogues and access the number of times of the catalogue catalogue more than or equal to 10 times, inspection
Survey result is catalogue B, catalogue C and catalogue E, then the set of catalogue B, catalogue C and catalogue E determined
For catalogue set to be found, catalogue B, catalogue C and catalogue E are searched the literary composition meeting search criterion
Part, the file that will find, it is defined as lookup result.
Concrete, in actual applications, it is also possible to determine Second Threshold;The secondary of catalogue is accessed according to user
Number, is ranked up according to access times from high to low by catalogue, and ranking is corresponding less than or equal to Second Threshold
The set of catalogue, be defined as catalogue set to be found.Wherein,
Second Threshold can determine according to ff request, it is also possible to is according to the lookup configuration preset
Information determines.
Exemplary, it is assumed that ff request includes the value for comparing ranking, please according to ff
Ask, ff is asked the value being used for comparing ranking that includes, is defined as Second Threshold, it is assumed that be worth and be
2。
Illustrate as a example by 5 catalogues below, it is assumed that 5 catalogues are respectively directory A, catalogue B, mesh
Record C, catalogue D and catalogue E, wherein, by current time, user accesses directory A 3 times, Yong Hufang
Asking catalogue B25 time, user accesses catalogue C20 time, and user accesses catalogue D5 time, and user accesses catalogue
E10 time, by directory A, catalogue B, catalogue C, catalogue D and catalogue E according to access times from high to low
Be ranked up, be ordered as catalogue B, catalogue C, catalogue E, catalogue D, directory A, by ranking less than or
Catalogue B and the set of catalogue C equal to 2 are defined as catalogue set, search in catalogue B and catalogue C
Meet the file of search criterion, the file that will find, it is defined as lookup result.
Assume that the configuration information of searching preset includes the value for comparing ranking, then by default lookup configuration
The value for comparing ranking that information includes, is defined as Second Threshold, it is assumed that value is 2.
Illustrate as a example by 5 catalogues below, it is assumed that 5 catalogues are respectively directory A, catalogue B, mesh
Record C, catalogue D and catalogue E, wherein, by current time, user accesses directory A 3 times, Yong Hufang
Asking catalogue B25 time, user accesses catalogue C20 time, and user accesses catalogue D5 time, and user accesses catalogue
E10 time, by directory A, catalogue B, catalogue C, catalogue D and catalogue E according to access times from high to low
Be ranked up, be ordered as catalogue B, catalogue C, catalogue E, catalogue D, directory A, by ranking less than or
Catalogue B and the set of catalogue C equal to 2 are defined as catalogue set, search in catalogue B and catalogue C
Meet the file of search criterion, the file that will find, it is defined as lookup result.
Concrete, in actual applications, it is also possible to determined for the 3rd threshold value and time period;Determined by Jiang
In time period, user accesses the set of the number of times of the catalogue catalogue corresponding more than or equal to described 3rd threshold value,
It is defined as catalogue set to be found.Wherein,
3rd threshold value and time period can all determine according to the request of described ff, it is also possible to be all root
Search what configuration information determined according to default;Can also is that the 3rd threshold value is according to the request of described ff really
Fixed, the time period is to determine according to the configuration information of searching preset;Can also is that the 3rd threshold value is according to pre-
If configuration information of searching determine, the time period is to determine according to the configuration information of searching preset.
Exemplary, it is assumed that ff request includes for comparing the value and a section accessing catalogue number of times
Time, asking according to ff, ff request included be used for comparing accesses catalogue number of times
Value, is defined as the 3rd threshold value, it is assumed that value is 10, ff is asked this period included, determines
For the time period, it is assumed that the time period determined is that this day 0:00 is to current time.
Illustrate as a example by 5 catalogues below, it is assumed that 5 catalogues are respectively directory A, catalogue B, mesh
Record C, catalogue D and catalogue E, wherein, by current time, user accesses directory A 3 times, Yong Hufang
Asking catalogue B25 time, user accesses catalogue C20 time, and user accesses catalogue D5 time, and user accesses catalogue
E10 time;Within this day, 0:00 is to current time, and user accesses directory A 2 times, and user accesses catalogue B9 time, uses
Family accesses catalogue C15 time, and user accesses catalogue D4 time, and user accesses catalogue E10 time.Detect above-mentioned 5
In individual catalogue, this day 0:00 is to the current time catalogue more than or equal to 10 times, testing result be catalogue C and
Catalogue E, then be defined as catalogue set to be found, at catalogue C and mesh by the set of catalogue C and catalogue E
Record E searches the file meeting search criterion, the file that will find, is defined as lookup result.
Assume when the lookup configuration information preset includes for comparing the value and one section that access catalogue number of times
Between, then the value being used for comparing access catalogue number of times that default lookup configuration information includes is defined as the 3rd
Threshold value, it is assumed that value is 10;A period of time that default lookup configuration information includes is defined as the time period,
Assume that the time period determined is that this day 0:00 is to current time.
Illustrate as a example by 5 catalogues below, it is assumed that 5 catalogues are respectively directory A, catalogue B, mesh
Record C, catalogue D and catalogue E, wherein, by current time, user accesses directory A 3 times, Yong Hufang
Asking catalogue B25 time, user accesses catalogue C20 time, and user accesses catalogue D5 time, and user accesses catalogue
E10 time;Within this day, 0:00 is to current time, and user accesses directory A 2 times, and user accesses catalogue B9 time, uses
Family accesses catalogue C15 time, and user accesses catalogue D4 time, and user accesses catalogue E10 time.Detect above-mentioned 5
In individual catalogue, this day 0:00 is to the current time catalogue more than or equal to 10 times, testing result be catalogue C and
Catalogue E, then be defined as catalogue set to be found, at catalogue C and mesh by the set of catalogue C and catalogue E
Record E searches the file meeting search criterion, the file that will find, is defined as lookup result.
Assume that ff request includes for comparing the value accessing catalogue number of times, default lookup configuration letter
Breath includes a period of time, then according to ff ask, by ff request include be used for compare
Access the value of catalogue number of times, be defined as the 3rd threshold value, it is assumed that value is 10;By in default lookup configuration information
Including a period of time be defined as the time period, it is assumed that the time period determined is that this day 0:00 is to current time.
Illustrate as a example by 5 catalogues below, it is assumed that 5 catalogues are respectively directory A, catalogue B, mesh
Record C, catalogue D and catalogue E, wherein, by current time, user accesses directory A 3 times, Yong Hufang
Asking catalogue B25 time, user accesses catalogue C20 time, and user accesses catalogue D5 time, and user accesses catalogue
E10 time;Within this day, 0:00 is to current time, and user accesses directory A 2 times, and user accesses catalogue B9 time, uses
Family accesses catalogue C15 time, and user accesses catalogue D4 time, and user accesses catalogue E10 time.Detect above-mentioned 5
In individual catalogue, this day 0:00 is to the current time catalogue more than or equal to 10 times, testing result be catalogue C and
Catalogue E, then be defined as catalogue set to be found, at catalogue C and mesh by the set of catalogue C and catalogue E
Record E searches the file meeting search criterion, the file that will find, is defined as lookup result.
Assume that ff request includes that a period of time, default lookup configuration information include for comparing
Access the value of catalogue number of times, then ff is asked this period included, is defined as the time period, false
If the time period determined is that this day 0:00 is to current time;Default is searched the use that configuration information includes
It is defined as the 3rd threshold value, it is assumed that value is 10 in comparing the value accessing catalogue number of times.
Illustrate as a example by 5 catalogues below, it is assumed that 5 catalogues are respectively directory A, catalogue B, mesh
Record C, catalogue D and catalogue E, wherein, by current time, user accesses directory A 3 times, Yong Hufang
Asking catalogue B25 time, user accesses catalogue C20 time, and user accesses catalogue D5 time, and user accesses catalogue
E10 time;Within this day, 0:00 is to current time, and user accesses directory A 2 times, and user accesses catalogue B9 time, uses
Family accesses catalogue C15 time, and user accesses catalogue D4 time, and user accesses catalogue E10 time.Detect above-mentioned 5
In individual catalogue, this day 0:00 is to the current time catalogue more than or equal to 10 times, testing result be catalogue C and
Catalogue E, then be defined as catalogue set to be found, at catalogue C and mesh by the set of catalogue C and catalogue E
Record E searches the file meeting search criterion, the file that will find, is defined as lookup result.
It should be noted that search the file meeting search criterion in catalogue set, can be according to directory set
The sequencing creating the time of the catalogue comprised in conjunction makes a look up;Can also comprise according in catalogue set
The last modification time of catalogue make a look up;Can also be according to the title of the catalogue comprised in catalogue set
Put in order and make a look up;The number of times of catalogue can also be accessed according to user to make a look up.The application is the most right
The mode searching the file meeting search criterion in catalogue set is defined, any mode in the cards
Can be applied in the application.
In actual applications, it is also possible to the type of file included in pre-recorded each catalogue.Such as: mesh
Record A comprises the file extending entitled doc, exe and jpg;Catalogue B comprises extension entitled doc,
The file of txt and jpg;Catalogue C comprises the file extending entitled doc and xls;In catalogue D
Comprise the file extending entitled pdf, ppt and txt;Catalogue E comprises extension entitled doc, ppt with
And the file of jpg.
Assuming to access the number of times of catalogue according to user, the directory set to be found determined is combined into by directory A, mesh
Record B, catalogue C, catalogue D and the set of catalogue E composition;When search criterion extends entitled doc for searching
File time, it is also possible to according to the type of file included in pre-recorded each catalogue to this catalogue set
In the catalogue that comprises screen, determine final directory set to be found be combined into by directory A, catalogue B,
Catalogue C and the set of catalogue E composition;Reduce the seeking scope of file further, improve ff
Efficiency.
It should be noted that and above-mentioned illustrate as a example by 5 catalogues, an only instantiation of the present invention, and
Do not constitute limitation of the invention.
Apply embodiment illustrated in fig. 1 of the present invention, only locating file in the catalogue that user often accesses, for
The catalogue that user seldom accesses does not carries out the lookup of file, reduces the scope of ff, improves file
Search efficiency.
Corresponding with above-mentioned embodiment of the method, the embodiment of the present invention additionally provides a kind of ff device.
The structural representation of a kind of ff device that Fig. 2 provides for the embodiment of the present invention, may include that
Ff request receiver module 201, catalogue set determine module 202, search module 203 and search knot
Fruit determines module 204, wherein,
Ff request receiver module 201, is used for receiving ff request;
Catalogue set determines module 202, for accessing the number of times of catalogue according to user, determines mesh to be found
Record set;
In actual applications, the catalogue set of the embodiment of the present invention determines module 202, may include that first
Determine that submodule and the first catalogue set determine submodule (not shown), wherein,
First determines submodule, for the ff received according to ff request receiver module 201
Request determines first threshold, or determines first threshold according to default lookup configuration information;
First catalogue set determines submodule, true more than or equal to first for user accesses the number of times of catalogue
The set of the catalogue that first threshold that stator modules determines is corresponding, is defined as catalogue set to be found.
In actual applications, the catalogue set of the embodiment of the present invention determines module 202, may include that second
Determine that submodule and the second catalogue set determine submodule (not shown), wherein,
Second determines submodule, for the ff received according to ff request receiver module 201
Request determines Second Threshold, or determines Second Threshold according to default lookup configuration information;
Second catalogue set determines submodule, for accessing the number of times of catalogue according to user, by catalogue according to visit
Ask that number of times is ranked up from high to low, ranking is determined, less than or equal to second, the Second Threshold that submodule determines
The set of corresponding catalogue, is defined as catalogue set to be found.
In actual applications, the catalogue set of the embodiment of the present invention determines module 202, may include that the 3rd
Determine that submodule and the 3rd catalogue set determine submodule (not shown), wherein,
3rd determines submodule, for the ff received according to ff request receiver module 201
Request, and/or according to default lookup configuration information, determined for the 3rd threshold value and time period;
3rd catalogue set determines submodule, in determining, by the 3rd, the time period that submodule determines, and user
The number of times accessing catalogue determines, more than or equal to the 3rd catalogue set, the mesh that the 3rd threshold value that submodule determines is corresponding
The set of record, is defined as catalogue set to be found.
Search module 203, meet for searching in catalogue set determines the catalogue set that module 202 determines
The file of search criterion;
Lookup result determines module 204, for searching the file that module 203 finds, is defined as searching
Result.
Apply embodiment illustrated in fig. 2 of the present invention, only locating file in the catalogue that user often accesses, for
The catalogue that user seldom accesses does not carries out the lookup of file, reduces the scope of ff, improves file
Search efficiency.
It should be noted that in this article, the relational terms of such as first and second or the like be used merely to by
One entity or operation separate with another entity or operating space, and not necessarily require or imply these
Relation or the order of any this reality is there is between entity or operation.And, term " includes ", " bag
Contain " or its any other variant be intended to comprising of nonexcludability, so that include a series of key element
Process, method, article or equipment not only include those key elements, but also include being not expressly set out
Other key elements, or also include the key element intrinsic for this process, method, article or equipment.?
In the case of there is no more restriction, statement " including ... " key element limited, it is not excluded that including
The process of described key element, method, article or equipment there is also other identical element.
Each embodiment in this specification all uses relevant mode to describe, phase homophase between each embodiment
As part see mutually, what each embodiment stressed is different from other embodiments it
Place.For device embodiment, owing to it is substantially similar to embodiment of the method, so describe
Fairly simple, relevant part sees the part of embodiment of the method and illustrates.
One of ordinary skill in the art will appreciate that all or part of step realizing in said method embodiment
The program that can be by completes to instruct relevant hardware, and described program can be stored in computer-readable
Take in storage medium, the storage medium obtained designated herein, such as: ROM/RAM, magnetic disc, CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the protection model of the present invention
Enclose.All any modification, equivalent substitution and improvement etc. made within the spirit and principles in the present invention, all wrap
Containing within the scope of the present invention.