CN102970358A - Method and device for controlling local cache of mobile client in network disc - Google Patents

Method and device for controlling local cache of mobile client in network disc Download PDF

Info

Publication number
CN102970358A
CN102970358A CN2012104454998A CN201210445499A CN102970358A CN 102970358 A CN102970358 A CN 102970358A CN 2012104454998 A CN2012104454998 A CN 2012104454998A CN 201210445499 A CN201210445499 A CN 201210445499A CN 102970358 A CN102970358 A CN 102970358A
Authority
CN
China
Prior art keywords
file
instruction
cache
collection
cache file
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
CN2012104454998A
Other languages
Chinese (zh)
Other versions
CN102970358B (en
Inventor
吴啸樾
林高河
赵松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201210445499.8A priority Critical patent/CN102970358B/en
Publication of CN102970358A publication Critical patent/CN102970358A/en
Application granted granted Critical
Publication of CN102970358B publication Critical patent/CN102970358B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a method for controlling local cache of a mobile client in a network disc. The method includes the following steps: receiving a user construction, acquiring type information and verification information of a target file related with the instruction, judging whether the target file exists in a local cache file or not according to the type information and the verification information, acquiring the target file from the local cache file on yes judgment and downloading the instruction from a server on no judgment. The method provides a management function for local cache, enables the mobile client to utilize the local cache more effectively, improves reading speed of the network disc, completely utilizes resources and saves network flow. A device for controlling the local cache of the mobile client in the network disc is further disclosed.

Description

The control method of the local cache of mobile client and device in the net dish
Technical field
The present invention relates to Internet technical field, particularly a kind of control method and device of netting the local cache of mobile client in the dish.
Background technology
The net dish claims again Network U plate, network hard disc, is the online storage service that network company releases.The net dish to the user provide file storage, access, backup, the file management facilities such as share, can regard the net dish as hard disk or a USB flash disk that is placed on the network, do not need to carry, be not afraid of and lose, can be whenever and wherever possible by network management document easily.
Along with the fast development of cloud platform technology and portable terminal product, can make things convenient for the net dish product of respectively holding synchronous documents also to arise at the historic moment, and also more and more universal by mobile client access net dish product.The mobile client of net dish is except uploading local file to server, and topmost effect is exactly that the file that obtains on the server is checked to this locality.In this process, generally need file on the first Download Server to local cache.The local cache file of net dish mobile client can be divided into two classes: a class is to open the interim cache file of checking and downloading, and the another kind of user of being has carried out the collection cache file of collection operation.
Because the mobile device local disk space is limited, therefore arrange and adjust the size that allows the local cache space that takies, and add up respectively the space size that interim cache file and collection cache file take, and remove interim cache file according to operating position, these functions can both obtain better user and experience, improve the result of use of net dish, and be the mobile device saving network flow.
But in the prior art, net dish product or cache module management is not provided, perhaps all more elementary to the realization of cache module management.For example, external like product Dropbox and Box do not provide the function of buffer setting.Domestic Huawei's net dish and grand net dish do not provide the function of buffer setting yet.The fast dish in Kingsoft and Kingsoft T dish only have the function of simple removing buffer memory.115 net dishes provide the setting of local cache space size and have removed the function of buffer memory.Cruel dish provides the function of checking interim cache file size and collection cache file size and removing buffer memory.Therefore can find out that prior art all can not comprehensively be managed and fully utilization local cache.
Summary of the invention
The present invention is intended to solve at least one of technical problem that exists in the prior art.For this reason, one object of the present invention is to propose a kind of control method of netting the local cache of mobile client in the dish.This method provides management function to local cache, so that mobile client can be utilized local cache more efficiently, has improved the reading speed of net dish, takes full advantage of resource, saving network flow.
Second purpose of the present invention is to propose a kind of control device of netting the local cache of mobile client in the dish.
For achieving the above object, the embodiment of first aspect present invention has proposed a kind of control method of netting the local cache of mobile client in the dish, may further comprise the steps: receive user's instruction; Obtain type information and the check information of the file destination relevant with described instruction according to described instruction; Judge according to described type information and check information whether described file destination is stored in the local cache file; If judge to exist, then from described local cache file, obtain described file destination; If judge not exist, then download described file destination according to described instruction from server end.
The control method of the local cache of mobile client can be obtained according to instruction the information of file in the net dish of the embodiment of the invention, file is downloaded or is carried out the buffer memory associative operation according to judged result, the service of management is provided for local cache, can more effectively utilize more fully local cache, reduce flow, improve access speed, thereby the result of use and the user that improve the net dish experience.
In one embodiment of the invention, described instruction is for checking instruction, if described file destination is stored in the described local cache file, then described method also comprises: obtain interim cache file identification information corresponding to described file destination, and upgrade described interim cache file identification information.If the file destination of checking in buffer memory, then needn't be asked again, directly from buffer memory, read, saved network traffics, take full advantage of resource, and improved response speed.
In one embodiment of the invention, described instruction is for checking instruction, if described file destination is not stored in the described local cache file, then described method also comprises: according to the check information of the described file destination generation correspondence of downloading and with described check information and described file destination corresponding stored; Obtain interim cache file identification information corresponding to described file destination, and upgrade described interim cache file identification information.If there is no in the local cache, then from server, download, and be buffered in the buffer memory, just ask directly reading out data from buffer memory when next time in transmission, convenient and swift.
In one embodiment of the invention, described instruction is the collection instruction, if described file destination is stored in the described local cache file, then described method also comprises: obtain collection cache file identification information corresponding to described file destination, and upgrade described collection cache file identification information.
In one embodiment of the invention, described instruction is the collection instruction, if described file destination is not stored in the described local cache file, then described method also comprises: according to the check information of the described file destination generation correspondence of downloading and with described check information and described file destination corresponding stored; Obtain collection cache file identification information corresponding to described file destination, and upgrade described collection cache file identification information.
In one embodiment of the invention, also comprise: upgrade citation times information corresponding to described file destination.Quote number of times and recorded the situation that the file in the buffer memory is cited, conveniently cache file is managed, prevent inappropriate deletion and cleaning.
In one embodiment of the invention, also comprise: receive user's cancellation collection instruction; Obtain the collection cache file relevant with described cancellation collection instruction according to described cancellation collection instruction; Upgrade described collection cache file identification information corresponding to collection cache file relevant with described cancellation collection instruction.
In one embodiment of the invention, receive user's deletion buffer memory instruction; Obtain the local cache file relevant with the instruction of described deletion buffer memory according to described deletion buffer memory instruction; Judge whether to delete described local cache file according to the corresponding citation times information of local cache file relevant with the instruction of described deletion buffer memory.
In one embodiment of the invention, also comprise: receive and calculate the cache size instruction; Obtain respectively interim cache file and/or collection cache file according to interim cache file identification information and/or collection cache file identification information; Respectively described interim cache file and/or collection cache file are gone retry according to described interim cache file and/or identification information corresponding to collection cache file; Add up removing retry described interim cache file and/or collection cache file afterwards.
In one embodiment of the invention, also comprise: receive and remove the buffer memory instruction; Obtain interim cache file according to interim cache file identification information; Upgrade described interim cache file identification information and citation times information; According to judging whether to delete described interim cache file with the corresponding citation times information of described interim cache file.
The embodiment of second aspect present invention has proposed a kind of control device of netting the local cache of mobile client in the dish, comprises receiver module, enquiry module, cache module, judge module, buffer control module and download module.Receiver module is used for receiving user's instruction; Enquiry module is used for obtaining according to described instruction type information and the check information of the file destination relevant with described instruction; Cache module is used for the local cache file cache at the local cache file; Judge module is used for judging according to described type information and check information whether described file destination is stored in the local cache file; The buffer control module is used for when described judge module judges that described file destination is stored in the local cache file, obtains described file destination from described local cache file; Download module is used for downloading described file destination according to described instruction from server end when described judge module judges that described file destination is not stored in the local cache file.
Obtain the information of file according to instruction according to the control device of the local cache of mobile client in the net dish of the embodiment of the invention, file is downloaded or is carried out the buffer memory associative operation according to judged result, the service of management is provided for local cache, can more effectively utilize more fully local cache, reduce flow, improve access speed, thereby the result of use and the user that improve the net dish experience.
In one embodiment of the invention, described instruction is for checking instruction, and described buffer control module comprises: check submodule, be used for obtaining interim cache file identification information corresponding to described file destination, and upgrade described interim cache file identification information.If the file destination of checking in buffer memory, then needn't be asked again, directly from buffer memory, read, saved network traffics, take full advantage of resource, and improved response speed.
In one embodiment of the invention, the described submodule of checking, also be used for according to the check information of the described file destination generation correspondence of downloading and with described check information and described file destination corresponding stored, and obtain interim cache file identification information corresponding to described file destination, and upgrade described interim cache file identification information.If there is no in the local cache, then from server, download, and be buffered in the buffer memory, just ask directly reading out data from buffer memory when next time in transmission, convenient and swift.
In one embodiment of the invention, described instruction is the collection instruction, described buffer control module comprises: the collection submodule is used for obtaining collection cache file identification information corresponding to file destination corresponding to described collection instruction, and upgrades described collection cache file identification information.If the file destination of collecting in buffer memory, then needn't be asked again, directly from buffer memory, read, saved network traffics, take full advantage of resource, and improved response speed.
In one embodiment of the invention, described collection submodule, also be used for according to the check information of the described file destination generation correspondence of downloading and with described check information and described file destination corresponding stored, and obtain collection cache file identification information corresponding to described file destination, and upgrade described collection cache file identification information.If the file destination of collecting in buffer memory, then needn't be asked again, directly from buffer memory, read, saved network traffics, take full advantage of resource, and improved response speed.
In one embodiment of the invention, when described instruction is collected instruction for cancellation, described buffer control module also comprises: cancellation collection file submodule, be used for obtaining the collection cache file relevant with described cancellation collection instruction according to described cancellation collection instruction, and renewal described collection cache file identification information corresponding to collection cache file relevant with described cancellation collection instruction.
In one embodiment of the invention, described cancellation collection file submodule also is used for upgrading citation times information corresponding to described file destination.Quote number of times and recorded the situation that the file in the buffer memory is cited, conveniently cache file is managed, prevent inappropriate deletion and cleaning.
In one embodiment of the invention, when described instruction is the instruction of deletion buffer memory, described buffer control module also comprises: the deletion cache sub-module, be used for obtaining the local cache file relevant with the instruction of described deletion buffer memory according to described deletion buffer memory instruction, and judge whether to delete described local cache file according to the corresponding citation times information of local cache file relevant with the instruction of described deletion buffer memory.
In one embodiment of the invention, when described instruction is when calculating the cache size instruction, described buffer control module also comprises: calculate the cache size submodule, be used for obtaining respectively interim cache file and/or collection cache file according to interim cache file identification information and/or collection cache file identification information, and respectively described interim cache file and/or collection cache file are gone retry according to described interim cache file and/or identification information corresponding to collection cache file, and to going described interim cache file and/or collection cache file after the retry to add up.
In one embodiment of the invention, when described instruction is when removing the buffer memory instruction, described buffer control module also comprises: remove cache sub-module, be used for obtaining interim cache file according to interim cache file identification information, and upgrade described interim cache file identification information and citation times information, and according to judging whether to delete described interim cache file with the corresponding citation times information of described interim cache file.
Additional aspect of the present invention and advantage in the following description part provide, and part will become obviously from the following description, or recognize by practice of the present invention.
Description of drawings
Above-mentioned and/or additional aspect of the present invention and advantage are from obviously and easily understanding becoming the description of embodiment in conjunction with following accompanying drawing, wherein:
Fig. 1 is the flow chart according to the control method of the local cache of mobile client in the net dish of the embodiment of the invention;
Fig. 2 is the flow chart of checking the mobile client local cache control method that instruction is corresponding according to the embodiment of the invention;
Fig. 3 is the flow chart according to mobile client local cache control method corresponding to the collection instruction of the embodiment of the invention;
Fig. 4 is the flow chart according to mobile client local cache control method corresponding to the cancellation collection instruction of the embodiment of the invention;
Fig. 5 is the flow chart according to mobile client local cache control method corresponding to the deletion buffer memory instruction of the embodiment of the invention;
Fig. 6 is the flow chart according to mobile client local cache control method corresponding to the calculating cache size instruction of the embodiment of the invention;
Fig. 7 is the flow chart according to mobile client local cache control method corresponding to the removing buffer memory instruction of the embodiment of the invention;
Fig. 8 is the structural representation according to the control device of the local cache of mobile client in the net dish of the embodiment of the invention; With
Fig. 9 is the operation interface schematic diagram according to the control device of the local cache of mobile client in the net dish of the embodiment of the invention.
Embodiment
The below describes embodiments of the invention in detail, and the example of described embodiment is shown in the drawings, and wherein identical or similar label represents identical or similar element or the element with identical or similar functions from start to finish.Be exemplary below by the embodiment that is described with reference to the drawings, only be used for explaining the present invention, and can not be interpreted as limitation of the present invention.
Below with reference to the control method of Fig. 1 description according to the local cache of mobile client in the net dish of the embodiment of the invention, may further comprise the steps:
Step S110: receive user's instruction.
Step S120: the type information and the check information that obtain the relevant file destination of and instruction according to instruction.
Step S130: judge according to type information and check information whether file destination is stored in the local cache file.
Step S140: if judge existence, then from the local cache file, obtain file destination.
Step S150: if judge and not exist, then according to instruction from the server end downloading object file.
Wherein, mobile client also is used for upgrading citation times information corresponding to file destination.Upgrade citation times information corresponding to file destination.
In one embodiment of the invention, following field is set: relevant with the interim cache file field is_temporary_cache that arranges in the local file database; Relevant with the collection cache file in the local file database field is_favorite_cache is set; Put down in writing the file FileMD5Ref.plist of each cache file citation times: a string MD5 value of calculating according to each file content is designated as FileMD5.This method in conjunction with the reference count value concept of the is_temporary_cache in the database, is_favorite_cache field and FileMD5Ref.plist file, effectively realizes interim cache file and the management of collecting cache file in the net dish mobile client by effectively.Be understandable that, above-mentioned setting only for illustrative purposes, the embodiment of the invention is not limited to this.
For example, net dish mobile client at first can be obtained the file directory tabulation the net dish and is kept in the local database from server, and each bar record mainly comprises the path of file, whether catalogue, FileMD5 value etc.
In one embodiment of the invention, instruction is for checking instruction.If file destination is stored in the local cache file, then method also comprises: obtain interim cache file identification information corresponding to file destination, and upgrade interim cache file identification information.Instruction is for checking instruction, if file destination is not stored in the local cache file, then method also comprises: according to the check information of the file destination generation correspondence of downloading and with check information and file destination corresponding stored; Obtain interim cache file identification information corresponding to file destination, and upgrade interim cache file identification information.
For example, instruction is to check that the corresponding performed step of instruction is as follows as shown in Figure 2, is understandable that, followingly checks step only for illustrative purposes, and the embodiment of the invention is not limited to this.
Step S210: receive user's instruction for checking instruction.
Step S220: judge interim cache file corresponding to file destination.Obtain the FileMD5 value of the relevant file destination of and instruction according to instruction, and in the cache file folder of this locality, search the interim cache file that whether exists file destination corresponding.
Step S230: if file destination is stored in the local cache file, then directly from the cache file of this locality, reads and open file destination and upgrade the cache file identification information.Upgrade interim cache file identification information and comprise whether the is_temporary_cache field of judging this file destination respective items in the database puts 1, if do not put 1, then put 1, and in FileMD5Ref.plist, reference count value corresponding to this FileMD5 value added 1.
Step S240: if file destination is not stored in the local cache file, downloading object file and upgrade the cache file identification information then.At first need from the server end downloading object file, download the FileMD5 value that the use file destination generates after finishing the file destination correspondence is saved in the local cache file.Upgrade simultaneously interim cache file identification information, comprise the is_temporary_cache field of file destination respective items in the database is put 1, and in FileMD5Ref.plist, reference count value corresponding to this FileMD5 value added 1.
In one embodiment of the invention, instruction is the collection instruction, if file destination is stored in the local cache file, then method also comprises: obtain collection cache file identification information corresponding to file destination, and upgrade collection cache file identification information.Instruction is the collection instruction, if file destination is not stored in the local cache file, then method also comprises: according to the check information of the file destination generation correspondence of downloading and with check information and file destination corresponding stored; Obtain collection cache file identification information corresponding to file destination, and upgrade collection cache file identification information.
For example, instruction is understandable that for the corresponding performed step of collection instruction is as follows as shown in Figure 3, following collection step only for illustrative purposes, the embodiment of the invention is not limited to this.
Step S310: receive user's instruction for checking the collection instruction.
Step S320: judge whether file destination is stored in the local cache file.When collection during a file, at first obtain the FileMD5 value of the relevant file destination of and instruction, and in the local cache file, search and whether be stored in the local cache file.
Step S330: if judge existence, then directly obtain file and upgrade corresponding information from local cache.Directly from the local cache file, obtain file destination, after the collection is_favorite_cache of file destination respective items in the database is put 1, and in FileMD5Ref.plist, reference count value corresponding to this FileMD5 value added 1.
Step S340: if judgement does not exist, download file also upgrades corresponding information.Need first from the server end downloading object file, the FileMD5 value of use file destination was saved in the local cache file after download was finished.Then the is_favorite_cache of file destination respective items in the database is put 1, and in FileMD5Ref.plist, reference count value corresponding to this FileMD5 value added 1.
In one embodiment of the invention, receive user's cancellation collection instruction; Obtain the collection cache file relevant with cancellation collection instruction according to cancellation collection instruction; Upgrade collection cache file identification information corresponding to collection cache file relevant with cancellation collection instruction.
For example, as shown in Figure 4, instruction is understandable that for step corresponding to cancellation collection instruction is as follows following cancellation is collected step only for illustrative purposes, and the embodiment of the invention is not limited to this.
Step S410: the instruction that receives the user is cancellation collection instruction.
Step S420: obtain the file destination corresponding informance and make amendment.When a file of cancellation collection, at first obtain the FileMD5 value of the relevant file destination of and instruction, is_favorite_cache with file destination respective items in the database sets to 0 simultaneously, and the reference count value that file destination FileMD5 value is corresponding subtracts 1 in FileMD5Ref.plist.
In one embodiment of the invention, receive user's deletion buffer memory instruction; Instruction obtains the local cache file relevant with the instruction of deletion buffer memory according to the deletion buffer memory; Judge whether to delete the local cache file according to the corresponding citation times information of local cache file relevant with the instruction of deletion buffer memory.
For example, as shown in Figure 5, instruction is understandable that for step corresponding to deletion buffer memory instruction is as follows, following deletion buffer memory step only for illustrative purposes, the embodiment of the invention is not limited to this.
Step S510: the instruction that receives the user is the instruction of deletion buffer memory.
Step S520: whether the is_temporary_cache field of judging the file destination respective items in database puts 1.When the deletion file destination, at first obtain the FileMD5 value of the relevant file destination of and instruction, and judge in database whether the is_temporary_cache field of file destination respective items puts 1,
Step S530: if do not put 1, then finish this operation.Because not putting 1 is illustrated in this locality and does not have corresponding cache file and exist.
Step S540: if 1, being revised as setting to 0, the reference count value that the FileMD5 value of file destination is corresponding subtracts 1 in FileMD5Ref.plist simultaneously.
Step S550: judge whether the reference count value equals 0.
Step S560: if equal 0, then delete cache file.Because equaling 0 explanation, the reference count value do not have other local reference cache files.
Step S570: if be not equal to 0, then keep corresponding cache file.Also have other local reference cache files because be not equal to 0 expression, and as also there being same file to quote corresponding cache file under other paths, then continue to keep corresponding cache file.
In one embodiment of the invention, receive the instruction of calculating cache size; Obtain respectively interim cache file and/or collection cache file according to interim cache file identification information and/or collection cache file identification information; Respectively interim cache file and/or collection cache file are gone retry according to interim cache file and/or identification information corresponding to collection cache file; Add up removing retry interim cache file and/or collection cache file afterwards.
For example, as shown in Figure 6, instruction is as follows for calculating step corresponding to cache size instruction, be understandable that, following calculating cache size step only for illustrative purposes, the embodiment of the invention is not limited to this.
Step S610: receive user's instruction for calculating the cache size instruction.
Step S620: from database, find out the is_temporary_cache field and put 1 record.
Step S630: will record according to the FileMD5 value and go heavily.The FileMD5 value of two same files is identical under the different paths, and what expression was used is same cache file, therefore needs to remove duplicate message.
Step S640: total size of calculating the cache file after going to weigh.When needs calculate the cache file size of collection, then from database, find out the is_favorite_cache field and put 1 clauses and subclauses, then record is gone to calculate after heavy total size of the file of collecting according to FileMD5 value.
In one embodiment of the invention, receive the instruction of removing buffer memory; Obtain interim cache file according to interim cache file identification information; Upgrade interim cache file identification information and citation times information; According to judging whether to delete interim cache file with the corresponding citation times information of interim cache file.
For example, as shown in Figure 7, instruction is as follows for removing step corresponding to buffer memory instruction, be understandable that, following removing buffer memory step only for illustrative purposes, the embodiment of the invention is not limited to this.
Step S710: receive user's instruction for removing the buffer memory instruction.Wherein, remove the buffer memory instruction and only remove interim buffer unit, do not comprise the collection buffer unit that has carried out the collection operation.
Step S720: from database, find out the is_temporary_cache field and put 1 record.
Step S730: the is_temporary_cache field is set to 0, in the FileMD5Ref.plist file, corresponding reference count value is subtracted 1 according to the FileMD5 value simultaneously.
Step S740: if the reference count value is 0, the cache file of then deletion correspondence.
Can effectively manage file in the local cache according to the control method of the local cache of mobile client in the net dish of the embodiment of the invention, improve the mobile terminal document service speed, take full advantage of cache resources.When having used traditional field mark method, also used the reference count method of memory management, come the more effective management of carrying out cache file, improve cache management efficient, improve the cache management result.
Below with reference to the control device 100 of Fig. 8 description according to the local cache of mobile client in the net dish of the embodiment of the invention, comprise receiver module 110, enquiry module 120, cache module 130, judge module 140, buffer control module 150 and download module 160.
Wherein, receiver module 110 is used for receiving user's instruction; Enquiry module 120 is used for obtaining according to instruction type information and the check information of the relevant file destination of and instruction; Cache module 130 is used for the local cache file cache at the local cache file; Judge module 140 is used for judging according to type information and check information whether file destination is stored in the local cache file; Buffer control module 150 is used for obtaining file destination from the local cache file when judge module 140 judges that file destination is stored in the local cache file; Download module 160 is used for when judge module 140 judges that file destinations are not stored in the local cache file, according to instruction from the server end downloading object file.
Fig. 9 is a realization interface according to the control device of the local cache of mobile client in the net dish of the embodiment of the invention, in this cache management interface, the user can see the upper limit of buffer memory and use details, the operating position that comprises collection and local cache, and can remove voluntarily buffer memory by removing the buffer memory button according to actual conditions.Be understandable that, this realization interface only for illustrative purposes, the embodiment of the invention is not limited to this.
In one embodiment of the invention, following field is set: relevant with the interim cache file field is_temporary_cache that arranges in the local file database; Relevant with the collection cache file in the local file database field is_favorite_cache is set; Put down in writing the file FileMD5Ref.plist of each cache file citation times: a string MD5 value of calculating according to each file content is designated as FileMD5.This device in conjunction with the reference count value concept of the is_temporary_cache in the database, is_favorite_cache field and FileMD5Ref.plist file, is effectively realized interim cache file and the management of collecting cache file in the net dish mobile client by effectively.Be understandable that, above-mentioned setting only for illustrative purposes, the embodiment of the invention is not limited to this.
For example, the control device 100 of the local cache of mobile client at first can obtain the file directory tabulation the net dish and is kept in the local database from server in the net dish, and each bar record mainly comprises the path of file, whether catalogue, FileMD5 value etc.
The control device 100 of the local cache of mobile client receives different instructions and calls corresponding module in the net dish.The below describes each instruction and corresponding module operation respectively, be understandable that, following explanation only for illustrative purposes, the embodiment of the invention is not limited to this.
In one embodiment of the invention, instruction is for checking instruction, and buffer control module 150 comprises: check that submodule 151 is used for obtaining interim cache file identification information corresponding to file destination, and upgrade interim cache file identification information.Check that submodule 151 also is used for according to the check information of the file destination generation correspondence of downloading and with check information and file destination corresponding stored, and obtain interim cache file identification information corresponding to file destination, and upgrade interim cache file identification information.
For example, receiver module 110 receives user's instruction for checking instruction.Enquiry module 120 is according to the FileMD5 value of the relevant file destination of instruction acquisition and instruction, and judge module 140 inquiries are searched the interim cache file that whether exists file destination corresponding in the cache file folder of this locality.If judge module 140 judges that file destination is stored in the local cache file, then buffer control module 150 directly reads and opens file destination from the cache file of this locality.Check that simultaneously submodule 151 upgrades interim cache file identification information, comprise whether the is_temporary_cache field of judging this file destination respective items in the database puts 1, if do not put 1, check that then submodule 151 puts 1 with it, and in FileMD5Ref.plist, reference count value corresponding to this FileMD5 value added 1.If judge module 140 judges that file destination is not stored in the local cache file, then download module 160 is downloaded and is checked after finishing that the FileMD5 value that submodule 151 uses file destination to generate is saved in the file destination correspondence in the local cache file from the server end downloading object file.Check that simultaneously submodule 151 upgrades interim cache file identification information, comprise the is_temporary_cache field of file destination respective items in the database is put 1, and the reference count value that the FileMD5 value is corresponding adds 1 in FileMD5Ref.plist.
In one embodiment of the invention, instruction is the collection instruction, and buffer control module 150 comprises: collection submodule 152 is used for obtaining collection cache file identification information corresponding to file destination corresponding to collection instruction, and upgrades collection cache file identification information.Collection submodule 152 also is used for according to the check information of the file destination generation correspondence of downloading and with check information and file destination corresponding stored, and obtains collection cache file identification information corresponding to file destination, and upgrades collection cache file identification information.
When instruction is collected instruction for cancellation, buffer control module 150 also comprises cancellation collection file submodule 153, be used for obtaining the collection cache file relevant with cancellation collection instruction according to cancellation collection instruction, and upgrade collection cache file identification information corresponding to collection cache file relevant with cancellation collection instruction.Cancellation collection file submodule 153 also is used for upgrading citation times information corresponding to file destination.
For example, receiver module 110 receives user's instruction for checking the collection instruction.When a file of collection, enquiry module 120 at first obtains the FileMD5 value of the relevant file destination of and instruction, and whether judge module 140 is searched in the local cache file and be stored in the local cache file.Exist if judge module 140 is judged, then collect submodule 152 directly from the local cache file or file destination.If judge module 140 is judged do not exist, then download module 160 first will be from the server end downloading object file, and the FileMD5 value of downloading collection submodule use file destination after finishing is saved in the local cache file.No matter whether have the local cache file, collect at last submodule 152 and all the is_favorite_cache of file destination respective items in the database is put 1, and the reference count value that the FileMD5 value is corresponding adds 1 in FileMD5Ref.plist.
The instruction that receiver module 110 receives the user is cancellation collection instruction.When a file of cancellation collection, cancellation collection file submodule 153 obtains the FileMD5 value of the relevant file destination of and instruction, is_favorite_cache with file destination respective items in the database sets to 0 simultaneously, and the reference count value that file destination FileMD5 value is corresponding subtracts 1 in FileMD5Ref.plist.
In one embodiment of the invention, when instruction is the instruction of deletion buffer memory, buffer control module 150 also comprises: deletion cache sub-module 154, be used for the local cache file relevant with the instruction of deletion buffer memory according to deletion buffer memory instruction acquisition, and judge whether to delete the local cache file according to the corresponding citation times information of local cache file relevant with the instruction of deletion buffer memory.
For example, receiver module 110 receives user's instruction for deleting the buffer memory instruction.When the deletion file destination, deletion cache sub-module 154 judges in database whether the is_temporary_cache field of file destination respective items puts 1, if do not put 1, is illustrated in this locality and does not have corresponding cache file existence.If 1, deletion cache sub-module 154 is revised the is_temporary_cache field for setting to 0, the reference count value that the FileMD5 value of file destination is corresponding subtracts 1 in FileMD5Ref.plist simultaneously, and then judge whether the reference count value equals 0, if equal 0, illustrating does not have other local reference cache files, then deletes cache sub-module 154 deletion cache files; If be not equal to 0, then explanation also has other places, quotes corresponding cache file as same file is also arranged under other paths, then continues to keep corresponding cache file.
In one embodiment of the invention, when instruction is when calculating the cache size instruction, buffer control module 150 also comprises: calculate cache size submodule 155, be used for obtaining respectively interim cache file and/or collection cache file according to interim cache file identification information and/or collection cache file identification information, and respectively interim cache file and/or collection cache file are gone retry according to interim cache file and/or identification information corresponding to collection cache file, and to going interim cache file and/or collection cache file after the retry to add up.
For example, receiver module 110 receives user's instruction for calculating the cache size instruction.When needs calculate interim cache file size, calculating cache size submodule 155 is found out the is_temporary_cache field and has been put 1 record from database, to record according to the FileMD5 value and go heavily, as the FileMD5 value of two same files under the different paths is identical, what expression was used is same cache file, therefore needs to remove duplicate message.Calculate total size that cache size submodule 155 calculates the cache file after going to weigh.When needs calculate the cache file size of collection, calculate cache size submodule 155 and from database, find out the is_favorite_cache field and put 1 clauses and subclauses, then record is gone to calculate after heavy total size of the file of collecting according to FileMD5 value.
In one embodiment of the invention, when instruction is when removing the buffer memory instruction, buffer control module 150 also comprises: remove cache sub-module 156, be used for obtaining interim cache file according to interim cache file identification information, and upgrade interim cache file identification information and citation times information, and according to judging whether to delete interim cache file with the corresponding citation times information of interim cache file.
For example, receiver module 110 receives user's instruction for removing the buffer memory instruction.Remove the buffer memory instruction and only remove interim buffer unit, do not comprise the collection buffer unit that has carried out the collection operation.Therefore removing cache sub-module 156 at first finds out the is_temporary_cache field and has put 1 record from database, the is_temporary_cache field is set to 0, remove simultaneously cache sub-module 156 and in the FileMD5Ref.plist file, corresponding reference count value is subtracted 1 according to the FileMD5 value, if the result is 0, remove cache file corresponding to cache sub-module 156 deletions.
Can effectively manage file in the local cache according to the control device of the local cache of mobile client in the net dish of the embodiment of the invention, improve the mobile terminal document service speed, take full advantage of cache resources.When having used traditional field mark method, also used the reference count method of memory management, come the more effective management of carrying out cache file, improve the local cache efficiency of management, improve local cache management result.
In the description of this specification, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or the example in conjunction with specific features, structure, material or the characteristics of this embodiment or example description.In this manual, the schematic statement of above-mentioned term not necessarily referred to identical embodiment or example.And the specific features of description, structure, material or characteristics can be with suitable mode combinations in any one or more embodiment or example.
Although illustrated and described embodiments of the invention, for the ordinary skill in the art, be appreciated that without departing from the principles and spirit of the present invention and can carry out multiple variation, modification, replacement and modification to these embodiment that scope of the present invention is by claims and be equal to and limit.

Claims (21)

1. a control method of netting the local cache of mobile client in the dish is characterized in that, may further comprise the steps:
Receive user's instruction;
Obtain type information and the check information of the file destination relevant with described instruction according to described instruction;
Judge according to described type information and check information whether described file destination is stored in the local cache file;
If judge to exist, then from described local cache file, obtain described file destination; And
If judge not exist, then download described file destination according to described instruction from server end.
2. the control method of the local cache of mobile client in the net dish as claimed in claim 1 is characterized in that, described instruction is for checking instruction, if described file destination is stored in the described local cache file, then described method also comprises:
Obtain interim cache file identification information corresponding to described file destination, and upgrade described interim cache file identification information.
3. the control method of the local cache of mobile client in the net dish as claimed in claim 1 or 2 is characterized in that, described instruction is for checking instruction, if described file destination is not stored in the described local cache file, then described method also comprises:
According to the check information of the described file destination generation correspondence of downloading and with described check information and described file destination corresponding stored; And
Obtain interim cache file identification information corresponding to described file destination, and upgrade described interim cache file identification information.
4. the control method of the local cache of mobile client in the net dish as claimed in claim 1 is characterized in that, described instruction is the collection instruction, if described file destination is stored in the described local cache file, then described method also comprises:
Obtain collection cache file identification information corresponding to described file destination, and upgrade described collection cache file identification information.
5. such as the control method of the local cache of mobile client in claim 1 or the 4 described net dishes, it is characterized in that described instruction is the collection instruction, if described file destination is not stored in the described local cache file, then described method also comprises:
According to the check information of the described file destination generation correspondence of downloading and with described check information and described file destination corresponding stored; And
Obtain collection cache file identification information corresponding to described file destination, and upgrade described collection cache file identification information.
6. such as the control method of the local cache of mobile client in each described net dish of claim 1-5, it is characterized in that, also comprise:
Upgrade citation times information corresponding to described file destination.
7. such as the control method of the local cache of mobile client in claim 4 or the 5 described net dishes, it is characterized in that, also comprise:
Receive user's cancellation collection instruction;
Obtain the collection cache file relevant with described cancellation collection instruction according to described cancellation collection instruction; And
Upgrade described collection cache file identification information corresponding to collection cache file relevant with described cancellation collection instruction.
8. the control method of the local cache of mobile client in the net dish as claimed in claim 7 is characterized in that, also comprises:
Upgrade citation times information corresponding to described file destination.
9. the control method of the local cache of mobile client in the net dish as claimed in claim 1 is characterized in that, also comprises:
Receive user's deletion buffer memory instruction;
Obtain the local cache file relevant with the instruction of described deletion buffer memory according to described deletion buffer memory instruction;
Judge whether to delete described local cache file according to the corresponding citation times information of local cache file relevant with the instruction of described deletion buffer memory.
10. the control method of the local cache of mobile client in the net dish as claimed in claim 1 is characterized in that, also comprises:
Receive and calculate the cache size instruction;
Obtain respectively interim cache file and/or collection cache file according to interim cache file identification information and/or collection cache file identification information;
Respectively described interim cache file and/or collection cache file are gone retry according to described interim cache file and/or identification information corresponding to collection cache file; And
Add up removing retry described interim cache file and/or collection cache file afterwards.
11. the control method of the local cache of mobile client is characterized in that in the net dish as claimed in claim 1, also comprises:
Receive and remove the buffer memory instruction;
Obtain interim cache file according to interim cache file identification information;
Upgrade described interim cache file identification information and citation times information;
According to judging whether to delete described interim cache file with the corresponding citation times information of described interim cache file.
12. a control device of netting the local cache of mobile client in the dish is characterized in that, comprising:
Receiver module is used for receiving user's instruction;
Enquiry module is used for type information and check information according to the described instruction acquisition file destination relevant with described instruction;
Cache module is used for the local cache file cache at the local cache file;
Judge module is used for judging according to described type information and check information whether described file destination is stored in the local cache file;
The buffer control module is used for when described judge module judges that described file destination is stored in the local cache file, obtains described file destination from described local cache file; And
Download module is used for downloading described file destination according to described instruction from server end when described judge module judges that described file destination is not stored in the local cache file.
13. the control device of the local cache of mobile client is characterized in that in the net dish as claimed in claim 12, described instruction is for checking instruction, and described buffer control module comprises:
Check submodule, be used for obtaining interim cache file identification information corresponding to described file destination, and upgrade described interim cache file identification information.
14. the control device of the local cache of mobile client in the net dish as claimed in claim 13, it is characterized in that, the described submodule of checking, also be used for according to the check information of the described file destination generation correspondence of downloading and with described check information and described file destination corresponding stored, and obtain interim cache file identification information corresponding to described file destination, and upgrade described interim cache file identification information.
15. the control device of the local cache of mobile client is characterized in that in the net dish as claimed in claim 12, described instruction is the collection instruction, and described buffer control module comprises:
The collection submodule is used for obtaining collection cache file identification information corresponding to file destination corresponding to described collection instruction, and upgrades described collection cache file identification information.
16. the control device of the local cache of mobile client in the net dish as claimed in claim 12, it is characterized in that, described collection submodule, also be used for according to the check information of the described file destination generation correspondence of downloading and with described check information and described file destination corresponding stored, and obtain collection cache file identification information corresponding to described file destination, and upgrade described collection cache file identification information.
17. the control device of the local cache of mobile client is characterized in that in the net dish as claimed in claim 12, when described instruction was collected instruction for cancellation, described buffer control module also comprised:
Cancellation collection file submodule is used for obtaining the collection cache file relevant with described cancellation collection instruction according to described cancellation collection instruction, and renewal described collection cache file identification information corresponding to collection cache file relevant with described cancellation collection instruction.
18. the control device of the local cache of mobile client is characterized in that in the net dish as claimed in claim 17, described cancellation collection file submodule also is used for upgrading citation times information corresponding to described file destination.
19. the control device of the local cache of mobile client is characterized in that in the net dish as claimed in claim 12, when described instruction was the instruction of deletion buffer memory, described buffer control module also comprised:
The deletion cache sub-module, be used for obtaining the local cache file relevant with the instruction of described deletion buffer memory according to described deletion buffer memory instruction, and judge whether to delete described local cache file according to the corresponding citation times information of local cache file relevant with the instruction of described deletion buffer memory.
20. the control device of the local cache of mobile client is characterized in that in the net dish as claimed in claim 12, when described instruction is that described buffer control module also comprises when calculating the cache size instruction:
Calculate the cache size submodule, be used for obtaining respectively interim cache file and/or collection cache file according to interim cache file identification information and/or collection cache file identification information, and respectively described interim cache file and/or collection cache file are gone retry according to described interim cache file and/or identification information corresponding to collection cache file, and to going described interim cache file and/or collection cache file after the retry to add up.
21. the control device of the local cache of mobile client is characterized in that in the net dish as claimed in claim 12, when described instruction is that described buffer control module also comprises when removing the buffer memory instruction:
Remove cache sub-module, be used for obtaining interim cache file according to interim cache file identification information, and upgrade described interim cache file identification information and citation times information, and according to judging whether to delete described interim cache file with the corresponding citation times information of described interim cache file.
CN201210445499.8A 2012-11-08 2012-11-08 The control method of the local cache of mobile client and device in net dish Active CN102970358B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210445499.8A CN102970358B (en) 2012-11-08 2012-11-08 The control method of the local cache of mobile client and device in net dish

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210445499.8A CN102970358B (en) 2012-11-08 2012-11-08 The control method of the local cache of mobile client and device in net dish

Publications (2)

Publication Number Publication Date
CN102970358A true CN102970358A (en) 2013-03-13
CN102970358B CN102970358B (en) 2016-06-15

Family

ID=47800237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210445499.8A Active CN102970358B (en) 2012-11-08 2012-11-08 The control method of the local cache of mobile client and device in net dish

Country Status (1)

Country Link
CN (1) CN102970358B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104537085A (en) * 2014-12-31 2015-04-22 广州华多网络科技有限公司 Picture processing method and system based on cloud storage
CN105100210A (en) * 2015-06-24 2015-11-25 深圳市美贝壳科技有限公司 File cache method and device applied to client
CN105205069A (en) * 2014-06-24 2015-12-30 鸿合科技有限公司 Cache opening method and device based on paging file
CN106357769A (en) * 2016-09-20 2017-01-25 百度在线网络技术(北京)有限公司 Resource downloading method, device and network disk server
CN106506704A (en) * 2016-12-29 2017-03-15 北京奇艺世纪科技有限公司 A kind of buffering updating method and device
CN106899630A (en) * 2015-12-18 2017-06-27 北京奇虎科技有限公司 The method for viewing thumbnail and device of picture in Dropbox
CN108459914A (en) * 2017-12-26 2018-08-28 深圳神州数码云科数据技术有限公司 A kind of middleware command execution method and device
CN109413340A (en) * 2018-11-02 2019-03-01 北京奇安信科技有限公司 A kind of processing method and processing device generating photograph album
CN109729165A (en) * 2018-12-28 2019-05-07 国云科技股份有限公司 A kind of system and method for realizing file download using local cache strategy
CN109756581A (en) * 2019-03-06 2019-05-14 珠海金山网络游戏科技有限公司 A kind of document transmission system and method, a kind of calculating equipment and storage medium
CN109962976A (en) * 2019-02-20 2019-07-02 深圳点猫科技有限公司 A kind of http caching method and device based on small routine framework
CN112199341A (en) * 2020-12-07 2021-01-08 深圳市房多多网络科技有限公司 File storage system, method and equipment
CN113377722A (en) * 2021-07-02 2021-09-10 厦门雅基软件有限公司 Resource data reading method and device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060121919A1 (en) * 2003-06-25 2006-06-08 Maki Amishima Network management device, mobile terminal, communication method using same
CN101442554A (en) * 2008-10-17 2009-05-27 深圳华为通信技术有限公司 Method, server and system for implementing content distribution business interaction
CN102014158A (en) * 2010-11-29 2011-04-13 北京兴宇中科科技开发股份有限公司 Cloud storage service client high-efficiency fine-granularity data caching system and method
CN102035881A (en) * 2010-11-19 2011-04-27 清华大学 Data caching method of cloud storage system
CN102216930A (en) * 2010-12-14 2011-10-12 华为技术有限公司 Web request scheduling method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060121919A1 (en) * 2003-06-25 2006-06-08 Maki Amishima Network management device, mobile terminal, communication method using same
CN101442554A (en) * 2008-10-17 2009-05-27 深圳华为通信技术有限公司 Method, server and system for implementing content distribution business interaction
CN102035881A (en) * 2010-11-19 2011-04-27 清华大学 Data caching method of cloud storage system
CN102014158A (en) * 2010-11-29 2011-04-13 北京兴宇中科科技开发股份有限公司 Cloud storage service client high-efficiency fine-granularity data caching system and method
CN102216930A (en) * 2010-12-14 2011-10-12 华为技术有限公司 Web request scheduling method and system

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105205069A (en) * 2014-06-24 2015-12-30 鸿合科技有限公司 Cache opening method and device based on paging file
CN105205069B (en) * 2014-06-24 2020-04-21 鸿合科技股份有限公司 Cache opening method and device based on paging file
CN104537085B (en) * 2014-12-31 2019-03-26 广州华多网络科技有限公司 Image processing method and system based on cloud storage
CN104537085A (en) * 2014-12-31 2015-04-22 广州华多网络科技有限公司 Picture processing method and system based on cloud storage
CN105100210A (en) * 2015-06-24 2015-11-25 深圳市美贝壳科技有限公司 File cache method and device applied to client
CN106899630A (en) * 2015-12-18 2017-06-27 北京奇虎科技有限公司 The method for viewing thumbnail and device of picture in Dropbox
CN106899630B (en) * 2015-12-18 2020-11-03 北京奇虎科技有限公司 Thumbnail display method and device for pictures in network disk
CN106357769A (en) * 2016-09-20 2017-01-25 百度在线网络技术(北京)有限公司 Resource downloading method, device and network disk server
CN106506704A (en) * 2016-12-29 2017-03-15 北京奇艺世纪科技有限公司 A kind of buffering updating method and device
CN108459914A (en) * 2017-12-26 2018-08-28 深圳神州数码云科数据技术有限公司 A kind of middleware command execution method and device
CN108459914B (en) * 2017-12-26 2021-01-01 深圳神州数码云科数据技术有限公司 Middleware command execution method and device
CN109413340A (en) * 2018-11-02 2019-03-01 北京奇安信科技有限公司 A kind of processing method and processing device generating photograph album
CN109413340B (en) * 2018-11-02 2021-10-01 奇安信科技集团股份有限公司 Processing method and device for generating album
CN109729165A (en) * 2018-12-28 2019-05-07 国云科技股份有限公司 A kind of system and method for realizing file download using local cache strategy
CN109962976A (en) * 2019-02-20 2019-07-02 深圳点猫科技有限公司 A kind of http caching method and device based on small routine framework
CN109756581A (en) * 2019-03-06 2019-05-14 珠海金山网络游戏科技有限公司 A kind of document transmission system and method, a kind of calculating equipment and storage medium
CN112199341A (en) * 2020-12-07 2021-01-08 深圳市房多多网络科技有限公司 File storage system, method and equipment
CN113377722A (en) * 2021-07-02 2021-09-10 厦门雅基软件有限公司 Resource data reading method and device and storage medium

Also Published As

Publication number Publication date
CN102970358B (en) 2016-06-15

Similar Documents

Publication Publication Date Title
CN102970358A (en) Method and device for controlling local cache of mobile client in network disc
CN110457281A (en) Data processing method, device, equipment and medium
WO2015117426A1 (en) File management method and device
CN103092665A (en) Immediate updating device and immediate updating method
CN102479250A (en) Disk caching method for embedded browser
CN102708197B (en) A kind of multimedia file management method and device
US11669492B2 (en) Method and apparatus for managing storage space on storage device in an electronic apparatus by using context data and user profile data
CN105045905B (en) A kind of log maintenance method and system based on full-text search
CN102104617A (en) Method for storing massive picture data by website operating system
CN103201756A (en) Utilizing metadata to optimize efficiency for archiving emails
CN112114849B (en) Resource updating method and device
CN104765592A (en) Plugin management method and device facing web page acquisition task
CN105589943A (en) Method and device for picture adaptability processing of search result page and server
CN103092839A (en) Management method and device for recording historical information
CN104331376A (en) Method and device for clearing installation package stored in mobile terminal
CN105447037A (en) Caching clearing method and device
CN103309868A (en) One-stop book searching method and device
KR102572702B1 (en) Method and apparatus for managing storage space in an electronic device using context data and user profile data
CN102385614B (en) Terminal file updating management method and system
CN102523301A (en) Method for caching data on client in cloud storage
JP5314570B2 (en) Accumulated data reconstruction system, reconstruction method, and program
CN108319634A (en) The directory access method and apparatus of distributed file system
CN105354229B (en) A kind of information processing method and electronic equipment
KR100858157B1 (en) System and merhod for map uapdate, storage medium recording that method program, user termianl
CN102104581A (en) Network karaoke on-demand system and method thereof

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