A kind ofly apply the method and apparatus that browser processes resource automatically
Technical field
The present invention relates to internet, applications field, particularly relate to and a kind ofly apply the method and apparatus that browser processes resource automatically.
Background technology
Current use mobile phone or mobile device are got more and more by the user of 2G or 3G accessing Internet, the time of the netizen's surfing Internet with cell phone even had greatly exceed the time of surfing the Net with computer (desktop computer or notebook computer), 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 service of 2G or the 3G accessing Internet provided due to mobile telecommunication service business is normally by flow or duration based accounting, so just need during general 2G or 3G of use online to take some modes of saving flow to reduce expenses, but current mobile phone or mobile device generally all have wifi function, and only need to connect a wireless router to cable broadband mobile phone just can be used easily to have been surfed the Net by wifi, and because cable broadband is all generally not limit flow in unlimited time, so just need not consider to save the problem of flow.Therefore, no small puzzlement is brought with the user of mobile phone or mobile device online with regard to giving, because when using the online of the browser on mobile phone, see has value for preservation or highly with the Internet resources that good friend shares very much, prepare download preserve or when being shared with good friend, must first go to check what access way of oneself being and the problem such as memory space is enough, then go to do respective handling to resource file, thus very loaded down with trivial details.
Summary of the invention
The object of the present invention is to provide one can according to the environment for use such as network insertion, memory space, automatically a kind of of process is carried out to Internet resources file and applies the method and apparatus that browser processes resource automatically, thus solve the foregoing problems existed in prior art.
To achieve these goals, the technical solution used in the present invention is as follows:
Apply the method that browser processes resource automatically, comprise the steps:
S1, creates and safeguards the processing rule of the resource file for the resource file shown in browser or link;
S2, when described browser receives processing instruction, then apply the processing rule described in S1, the pending resource file corresponding to described processing instruction processes.
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 preset first threshold value and Second Threshold respectively;
When judging that current internet access way or access bandwidth or local free memory are applicable to using described first threshold, the size then applying first threshold and described resource file compares, if described resource file size is greater than described first threshold, then adopt long-range share or remote download mode process described in resource file, if resource file size is less than described first threshold, then local uploading is adopted to share or resource file described in local mode process of downloading preservation;
When judging that current internet access way is applicable to using described Second Threshold and access band to be applicable to using described Second Threshold and local free memory is applicable to using described first threshold, the size then applying Second Threshold and described resource file compares, if resource file size is greater than described Second Threshold, then adopt long-range share or remote download mode process described in resource file, if resource file size is less than described Second Threshold, then local uploading is adopted to share or resource file described in local mode process of downloading preservation.
Preferably, following steps are also had before S2:
Obtain the file size of the pending resource file corresponding to 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.
Apply the device that browser processes resource automatically, comprising:
Processing rule maintenance module, for creating and safeguarding the processing rule of the resource file for the resource file shown in browser or link;
Processing instruction receives Executive Module, and for receiving processing instruction, and the pending resource file performing described processing instruction corresponding to described processing instruction processes, processing rule during process described in application.
Preferably, the device that described application browser processes resource automatically also comprises:
Current environment acquisition module, for obtaining current internet access way, access bandwidth and local free memory.
Preferably, the device that described application browser processes resource automatically also comprises: resource file acquiring size module, for obtaining the file size of the pending resource file corresponding to described processing instruction.
The invention has the beneficial effects as follows:
By adopting technical scheme of the present invention, according to situations such as current internet access way, access bandwidth and local free memories, the resource file that the link shown in the resource file shown in browser or browser is linked to can be processed automatically.When 2G, the 3G network accessing Internet of flow or duration based accounting is pressed in user's use, can ensure preserve in timely remote download or while network resource sharing file, flow and Networked Time can also be saved to greatest extent.In time resource file can be saved in this locality again when user uses the access way of not limit flow or duration to surf the Net, thus easier real-time edition uses, and also can not cause obstruction to sharing.
Accompanying drawing explanation
Fig. 1 is the method step flow chart that application browser of the present invention processes resource automatically.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, 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, be not intended to limit the present invention.
As shown in Figure 1, application browser disclosed by the invention processes the method for resource automatically, comprises the steps:
S1, creates and safeguards the processing rule of the resource file for the resource file shown 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, determines 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 preset first threshold value and Second Threshold respectively;
When judging that current internet access way or access bandwidth or local free memory are applicable to using described first threshold, such as current internet access way is that 3G network or 2G network or access bandwidth are less than 1M or local free memory when being less than 2GB, the size then applying first threshold and described resource file compares, if described resource file size is greater than described first threshold, then adopt long-range share or remote download mode process described in resource file, if resource file size is less than described first threshold, local uploading then is adopted to share or resource file described in local mode process of downloading preservation,
When judging that current internet access way is applicable to using described Second Threshold and access band to be applicable to using described Second Threshold and local free memory is applicable to using described first threshold, such as current internet access way be cable broadband or wifi mode and access band be greater than 1M and local free memory is greater than 2GB time, the size then applying Second Threshold and described resource file compares, if resource file size is greater than described Second Threshold, then adopt long-range share or remote download mode process described in resource file, if resource file size is less than described Second Threshold, local uploading then is adopted to share or resource file described in local mode process of downloading preservation.
Obtain the file size of the pending resource file corresponding to described processing instruction.
S2, when described browser receives processing instruction, then apply the processing rule described in S1, the pending resource file corresponding to described processing instruction processes.
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.
Application browser disclosed by the invention processes the device of resource automatically, comprising:
Processing rule maintenance module, for creating and safeguarding the processing rule of the resource file for the resource file shown in browser or link;
Processing instruction receives Executive Module, and for receiving processing instruction, and the pending resource file performing described processing instruction corresponding to described processing instruction processes, processing rule during process described in application.
Current environment acquisition module, for obtaining current internet access way, access bandwidth and local free memory.
Resource file acquiring size module, for obtaining the file size of the pending resource file corresponding to described processing instruction.
Described remote download, refer to and send instruction by browser to remote server, download the Internet resources of specifying by remote server and preserve, when sharing, only needing remote server to pass to good friend for the link of sharing of the file generated preserved on the server.Thus do not need first Internet resources file first to be downloaded to this locality, then send good friend to.So both eliminating the trouble of download, save flow, also can not link because of only sharing an original document, and the embarrassment cannot shared after causing original document link fails.
By adopting technique scheme disclosed by the invention, obtain effect useful as follows:
According to situations such as current internet access way, access bandwidth and local free memories, the resource file that the link shown in the resource file shown in browser or browser is linked to can be processed automatically.When 2G, the 3G network accessing Internet of flow or duration based accounting is pressed in user's use, can ensure preserve in timely remote download or while network resource sharing file, flow and Networked Time can also be saved to greatest extent.In time resource file can be saved in this locality again when user uses the access way of not limit flow or duration to surf the Net, thus easier real-time edition uses, and also can not cause obstruction to sharing.
The above is only the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications also should look protection scope of the present invention.