A kind ofly use the method and apparatus that browser is processed resource automatically
Technical field
The present invention relates to the internet, applications field, relate in particular to a kind of method and apparatus that browser is processed resource automatically of using.
Background technology
use at present mobile phone or mobile device more and more by the user of 2G or 3G accessing Internet, the netizen who even has has substantially exceeded the time of surfing the Net with computer (desktop computer or notebook computer) with the time of surfing Internet with cell phone, because surfing Internet with cell phone is very convenient, can be whenever and wherever possible, open any browser just can be surfed the Net, but the 2G that provides due to the mobile telecommunication service business or the service of 3G accessing Internet are normally by flow or duration based accounting, so just need to take some modes of saving flow to reduce expenses when generally using 2G or 3G online, but present mobile phone or mobile device generally all have the wifi function, just can use easily mobile phone to surf the Net by wifi and only need to connect a wireless router to cable broadband, and because cable broadband is all generally not limit flow in unlimited time, so just need not consider to have saved the problem of flow.Therefore, just brought no small puzzlement for the user with mobile phone or mobile device online, because during the online of the browser on using mobile phone, see the Internet resources that value for preservation arranged very much or be worth very much sharing with the good friend, when preparing to download preservation or being shared with the good friend, must first go to check oneself be the problems such as what access way of use and memory space be enough, then goes resource file is done respective handling, thereby very loaded down with trivial details.
Summary of the invention
The object of the present invention is to provide a kind of can be according to environments for use such as network insertion, memory spaces, the Internet resources file is carried out a kind of of processing automatically use the method and apparatus that browser is processed resource automatically, thereby solve the foregoing problems that exists in prior art.
To achieve these goals, the technical solution used in the present invention is as follows:
A kind ofly use the method that browser is processed resource automatically, comprise the steps:
S1 creates and safeguards processing rule for the resource file of the resource file that shows in browser or link;
S2 when described browser receives processing instruction, uses the processing rule described in S1, and the pending resource file that described processing instruction is corresponding is processed.
Preferably, further comprising the steps of after S1:
Obtain current internet access way, access bandwidth and local free memory.
Preferably, the processing rule described in S1 is:
According to current internet access way, access bandwidth and local free memory, and the size of pending resource file, determine to take which kind of processing mode for described pending resource file.
Preferably, the processing rule described in S1 is specially:
According to different interconnection network access modes, access bandwidth and local free memory, for resource file size difference preset first threshold value and Second Threshold;
When judgement current internet access way or access bandwidth or the described first threshold of the suitable use of local free memory, the size of using first threshold and described resource file compares, if described resource file size is greater than described first threshold, adopt long-range share or the mode of remote download is processed described resource file, if the resource file size is less than described first threshold, adopt local uploading to share or the local mode of preserving of downloading is processed described resource file;
When judgement current internet access way is fit to use described Second Threshold and access band to be fit to use described Second Threshold and local free memory to be fit to use described first threshold, the size of using Second Threshold and described resource file compares, if the resource file size is greater than described Second Threshold, adopt long-range share or the mode of remote download is processed described resource file, if the resource file size is less than described Second Threshold, adopt local uploading to share or the local mode of preserving of downloading is processed described resource file.
Preferably, also have following steps before S2:
Obtain the file size of the corresponding pending resource file of described processing instruction.
Preferably, described browser is web browser.
Preferably, described resource comprises data file and/or picture and/or video display and/or music and/or text.
A kind ofly use the device that browser is processed resource automatically, comprising:
The processing rule maintenance module is used for creating and safeguards the processing rule of the resource file of the resource file that shows for browser or link;
Processing instruction receives Executive Module, is used for the reception ﹠ disposal instruction, and carries out described processing instruction pending resource file corresponding to described processing instruction processed, and uses described processing rule during processing.
Preferably, the described application browser device of automatically processing resource also comprises:
The current environment acquisition module is used for obtaining current internet access way, access bandwidth and local free memory.
Preferably, the described application browser device of automatically processing resource also comprises:
Resource file acquiring size module is used for obtaining the file size of the corresponding pending resource file of described processing instruction.
The invention has the beneficial effects as follows:
By adopting technical scheme of the present invention, can be according to situations such as current internet access way, access bandwidth and local free memories, the resource file that the link that shows in the resource file that shows in browser or browser is linked to is processed automatically.When the user uses the 2G press flow or duration based accounting, 3G network accessing Internet, can guarantee to save to greatest extent flow and networking time in time remote download preservation or network resource sharing file.Can in time be saved in this locality to resource file again when the user uses the access way online of limit flow not or duration, thereby easier real-time edition uses, also can not give to share and cause obstruction.
Description of drawings
Fig. 1 is the method step flow chart that application browser of the present invention is processed resource automatically.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing, the present invention is further elaborated.Should be appreciated that embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
As shown in Figure 1, application browser disclosed by the invention is processed the method for resource automatically, comprises the steps:
S1 creates and safeguards processing rule for the resource file of the resource file that shows in browser or link; Described processing rule is: according to current internet access way, access bandwidth and local free memory, and the size of pending resource file, determine to take which kind of processing mode for described pending resource file.
Obtain current internet access way, access bandwidth and local free memory.
Processing rule described in S1 is specially:
According to different interconnection network access modes, access bandwidth and local free memory, for resource file size difference preset first threshold value and Second Threshold;
when judgement current internet access way or access bandwidth or the described first threshold of the suitable use of local free memory, when being 3G network or 2G network or access bandwidth less than 1M or local free memory less than 2GB such as the current internet access way, the size of using first threshold and described resource file compares, if described resource file size is greater than described first threshold, adopt long-range share or the mode of remote download is processed described resource file, if the resource file size is less than described first threshold, adopt local uploading to share or the local mode of preserving of downloading is processed described resource file,
when judgement current internet access way is fit to use described Second Threshold and access band to be fit to use described Second Threshold and local free memory to be fit to use described first threshold, when being cable broadband or wifi mode and access band greater than 1M and local free memory greater than 2GB such as the current internet access way, the size of using Second Threshold and described resource file compares, if the resource file size is greater than described Second Threshold, adopt long-range share or the mode of remote download is processed described resource file, if the resource file size is less than described Second Threshold, adopt local uploading to share or the local mode of preserving of downloading is processed described resource file.
Obtain the file size of the corresponding pending resource file of described processing instruction.
S2 when described browser receives processing instruction, uses the processing rule described in S1, and the pending resource file that described processing instruction is corresponding is processed.
Browser described in the present invention is web browser.
Described resource file comprises data file and/or picture and/or video display and/or music and/or text etc.
As shown in Figure 2, application browser disclosed by the invention is processed the device of resource automatically, comprising:
The processing rule maintenance module is used for creating and safeguards the processing rule of the resource file of the resource file that shows for browser or link;
Processing instruction receives Executive Module, is used for the reception ﹠ disposal instruction, and carries out described processing instruction pending resource file corresponding to described processing instruction processed, and uses described processing rule during processing.
The current environment acquisition module is used for obtaining current internet access way, access bandwidth and local free memory.
Resource file acquiring size module is used for obtaining the file size of the corresponding pending resource file of described processing instruction.
Described remote download, refer to send instruction by browser to remote server, download the Internet resources of appointment and preserve by remote server, only need to pass to the good friend to remote server for the link of sharing that is kept at the file generated on server when sharing.Thereby do not need first the Internet resources file first to be downloaded to this locality, then send the good friend to.So both saved the trouble of downloading, saved flow, and also can not link because of only sharing an original document, and cause the embarrassment that to share after the original document link fails.
By adopting technique scheme disclosed by the invention, obtained following useful effect:
Can be according to situations such as current internet access way, access bandwidth and local free memories, the resource file that the link that shows in the resource file that shows in browser or browser is linked to is processed automatically.When the user uses the 2G press flow or duration based accounting, 3G network accessing Internet, can guarantee to save to greatest extent flow and networking time in time remote download preservation or network resource sharing file.Can in time be saved in this locality to resource file again when the user uses the access way online of limit flow not or duration, thereby easier real-time edition uses, also can not give to share and cause obstruction.
The above is only the preferred embodiment of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be looked protection scope of the present invention.