The application be filing date on May 31st, 2013, Application No. 201310214543.9,
The divisional application of the Chinese invention patent application of entitled " a kind of file download equipment and method ".
Summary of the invention
In view of the above problems, under the present invention provides a kind of file download equipment and corresponding file
Support method, in order to overcome the problems referred to above or solve the problems referred to above at least in part.
According to an aspect of the present invention, it is provided that a kind of file download equipment, including web analysis
Module, file judge module and file download module: described web analysis module is suitable to
When browser side loads Webpage, receive the described page call request to file;Described literary composition
Part judge module is suitable to judge whether described file is present in the file storage preset in browser side
In unit;And described file download module is suitable to: if there is described file, then directly from institute
State and file storage unit obtains described file;And/or, if there is not described file, then basis
Described call request downloads described file.
According to a further aspect in the invention, it is provided that a kind of document down loading method, including: browsing
When device side loads Webpage, receive the described page call request to file;Judge described literary composition
Whether part is present in the file storage unit that browser side is preset;If there is described file,
Then directly from described memory element, obtain described file;If and/or there is not described file, then
Described file is downloaded from the server that described webpage is corresponding according to described call request.
The file download equipment of present invention offer and corresponding document down loading method, by this locality
The preset file storage unit including multifile so that browser needs in access web page
When calling file, first look for whether the file storage unit of this locality exists required to be called
File, if in the presence of; would directly invoke local file, and without being downloaded on network,
Thus it is avoided that browser is because causing webpage response time from Website server downloading files
Long, quick webpage response speed can be greatly improved satisfaction of users.
Further, the file download equipment of present invention offer and method, by downloading file
Particular attribute-value, verifies the correctness downloading file;If correct, then stored
In file storage unit, it is achieved that in file storage unit, the safety of file is added, and also makes
The file download equipment of the present invention and method can save the download time of more networks resource.
Described above is only the general introduction of technical solution of the present invention, in order to better understand this
Bright technological means, and can be practiced according to the content of description, and in order to allow the present invention
Above and other objects, features and advantages can become apparent, below especially exemplified by the present invention's
Detailed description of the invention.
Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although accompanying drawing
In show the exemplary embodiment of the disclosure, it being understood, however, that can be real in a variety of manners
Show the disclosure and should not limited by embodiments set forth here.On the contrary, it is provided that these embodiments
It is able to be best understood from the disclosure, and can be by biography complete for the scope of the present disclosure
Reach to those skilled in the art.
Fig. 1 shows the structural representation of file download equipment according to an embodiment of the invention,
Including: web analysis module 101, file judge module 102, file download module 103, literary composition
Part memory element 104, filename computing module 105 and file storage module 106.In the present invention
In, described file download equipment can be Computer Browser terminal, it is also possible to is the energy such as mobile phone
Access the Internet and carry out other electronic equipments of web page browsing.
User loads A Website page ht tp: //www.a.com/index.htm in browser side,
This content of pages be:
Wherein, jquery-1.7.1.min.js is to load the javascript that A website is to be called
Script file, the specific fields that localFi le is comprised by it, its value is abcdabcd.js.
Now, web analysis module 101 receives described A Website page to javascr ipt script
The call request of file jquery-1.7.1.min.js.Generally, browser side needs from network
This script file is downloaded in server side, and described A Website page just can be made to demonstrate the friendship of this JS
Effect mutually.
Inventors noted that this javascr ipt script file is a kind of general Internet resources,
Content is all standard, it is not necessary that allow all users accessing this A Website page first all go
Downloading this script file, one is the waste causing Internet resources, and two is that many I haven't seen you for ages that response browses
The device response speed to this webpage, especially in the case of network condition is not so good.
File download equipment according to embodiments of the present invention, it is provided that file storage unit 104, wherein
Storage has the Generic Network Resource of multiple content standard, such as jquery-1.7.1.min.js's
Javascr ipt script file.So, just can be local when utilizing browser to load webpage
Script file in file storage unit 104 substitutes from needs from webserver side download institute
State file, thus improve network access speed.
In file storage unit 104, the script file stored all is ordered with its particular attribute-value
Name so that script file content can with its filename uniquely, the most corresponding.In this enforcement
In example, particular attribute-value is the value after file content carries out Hash calculation, more specifically, special
Determine property value be file content is carried out md5 calculating after the md5 value that obtains.
Alternatively, depositing under file storage unit 104 can be provided in browser installation directory
Storage unit, or can also be arranged under the subdirectory of browser installation directory.
It follows that according to described call request, file judge module 102 judges that described file is
No it is present in file storage unit 104.In the above-mentioned loading to A Website page, webpage
The script file call request that parsing module 101 receives is
http://www.a.com/jquery-1.7.1.min.js?LocalFile=abcdabcd.js.In this case,
File judge module 102 is by loca lFi le field value abcdabcd.js and file storage unit
The filename of each file stored in 104 mates, and thus judges file storage unit
Script file to be called whether is there is in 104.In the present embodiment, if file storage unit
Script file name in 104 matches with abcdabcd.js, then judge that it there are loading A net
Stand the script file jquery-1.7.1.min.js called needed for webpage;If not mating, then judge
There is not this script file.
Certainly, if call request does not comprise specific fields loca lFi le, then file judge module
102 also judge not exist in file storage unit 104 file to be called.
File storage unit 104 exists in the case of file to be called, browser directly from
Obtaining described file in file storage unit 104 and it loads, A Website page can show
Go out the interaction effect of this JS.
In the case of there is not file to be called in file storage unit 104, file download mould
Block 103 downloads this document, then according to this call request from the server of responsible offer this document
By browser this document loaded again and show.
Further, the file download equipment of the present invention also includes filename computing module 105,
For calculating the particular attribute-value obtaining the file that this document download module 103 is downloaded;In this reality
Executing in example, filename computing module 105 passes through the hash algorithm of the such as md5 literary composition to being downloaded
Part calculates, and obtains its particular attribute-value.
File download equipment can also include file storage module 106, by filename computing module
105 calculated downloaded file particular attribute-value and this call request in specific fields
The value of loca lFi le compares, if the two coupling, it is judged that downloaded file content is not repaiied
Change, be the script file of standard content, then in file storage unit 104, storage is downloaded
File is also named with this particular attribute-value;If the particular attribute-value calculated and described call request
The value of the specific fields loca lFi le comprised is not mated, it is judged that downloaded file content by
(mala fide or favourably) amendment, is not the script file of standard content, does not the most store under institute
The file carried.
In the description of the present embodiment, all with javascript script file as example, but ability
Field technique personnel are the most clear, and the file involved by file download equipment of the present invention is not limited to
Javascr ipt script file, it is also possible to include that other be there is a need to the literary composition called from server side
Part.
Fig. 2 shows the schematic flow sheet of document down loading method according to another embodiment of the present invention,
The method is suitable to perform in a kind of file download equipment.The method starts from step 201, in step
In S201, when loading the A Website page of embodiment as shown in Figure 1 in browser side, receive institute
State A Website page javascr ipt script file jquery-1.7.1.min.js is called please
Asking, alternatively, this call request also includes specific fields localFi le and value thereof.Subsequently,
In step 202., judge to be asked according to the call request received in step s 201
Whether file is present in file download equipment (such as, in the file storage of file download equipment
In unit 104).
Specifically, match according to the file in this call request whether APMB package download equipment
Filename judges whether asked file.A real mode according to the present invention, if
This call request comprises specific fields, and the value being associated with this specific fields with in file download
The filename of file match, then judge to there is this document;If this call request is comprised
The value that specific fields is associated is not mated with the filename of the file in file download equipment, or should
Call request does not comprise this specific fields, then judge to there is not asked file.
It follows that if there is script file to be called, then carry out step 203, directly
Obtain this document from this locality and loaded by browser;
On the other hand, if there is no script file to be called, then carry out step 204, root
This document is downloaded from corresponding server according to this call request.
After downloading file, enter step 205, obtain the particular attribute-value of downloaded file;
In the present embodiment, by the hash algorithm of such as md5, downloaded file is calculated,
Obtain its particular attribute-value.
It follows that judge what the particular attribute-value of this document and call request comprised in step 206
Whether the value of specific fields matches;
If it does, enter step 207, in locally stored downloaded file and with this specified genus
Property value name;
If not mating, being directly entered step 208 and terminating, do not preserve downloaded file.
File download equipment that the present invention provides and corresponding document down loading method, actual propose one
Individual local file replaces the agreement of Internet resources.According to this agreement, deposit at local profile
Storage unit, stores the Internet resources of such as script file, by script file with its particular attribute-value
(such as md5 value) is named;And website is when calling script file in its content of pages
Increase the entitled localFile of specific fields, such as field, and with the specified genus of this script file
Property value (such as md5 value) carries out assignment to this field.So, using at browser access should
During the website of agreement, it is possible to directly invoke the script file in file storage unit, reduce from institute
State download script file on website thus improve the response speed of access.
Further, the file stored due to file storage unit of the present invention is all with its particular community
Value (such as md5 value) is named, by the checking of localFile field in call request,
Ensure that the reliability of called file so that website while using oneself assured resources,
Also have an opportunity can call the Internet resources originated from other quickly.
Provided herein algorithm and display not with any certain computer, virtual system or other
Equipment is intrinsic relevant.Various general-purpose systems can also be used together with based on teaching in this.Root
According to above description, construct the structure required by this kind of system and be apparent from.Additionally, this
Invention is also not for any certain programmed language.It is understood that, it is possible to use various programming languages
Realize the content of invention described herein, and the description above language-specific done be for
Disclose the preferred forms of the present invention.
In description mentioned herein, illustrate a large amount of detail.But, it is possible to reason
Solving, embodiments of the invention can be put into practice in the case of not having these details.At some
In example, it is not shown specifically known method, structure and technology, in order to not fuzzy to this theory
The understanding of bright book.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand in each inventive aspect
One or more, above in the description of the exemplary embodiment of the present invention, the present invention's
Each feature is grouped together in single embodiment, figure or descriptions thereof sometimes.So
And, should not be construed to reflect an intention that the most required for protection by the method for the disclosure
Invention requires than the more feature of feature being expressly recited in each claim.More precisely
Ground says, as the following claims reflect as, inventive aspect be less than above public affairs
All features of the single embodiment opened.Therefore, it then follows claims of detailed description of the invention
Thus being expressly incorporated in this detailed description of the invention, the most each claim itself is as this
Bright independent embodiment.
Those skilled in the art are appreciated that can be to the module in the equipment in embodiment
Adaptively change and they be arranged on different from this embodiment one or more
In equipment.Module in embodiment or unit or assembly can be combined into a module or unit
Or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Remove
Outside at least some in such feature and/or process or unit excludes each other, permissible
Use any combination to public in this specification (including adjoint claim, summary and accompanying drawing)
All features of opening and the disclosedest any method or all processes of equipment or unit are entered
Row combination.Unless expressly stated otherwise, this specification (includes adjoint claim, summary
With accompanying drawing) disclosed in each feature can by provide identical, equivalent or the replacement of similar purpose
Feature replaces.
Although additionally, it will be appreciated by those of skill in the art that embodiments more described herein
Including some feature included in other embodiments rather than further feature, but different enforcement
The combination of the feature of example means to be within the scope of the present invention and formed different enforcement
Example.Such as, in the following claims, embodiment required for protection one of arbitrarily
Can mode use in any combination.
The all parts embodiment of the present invention can realize with hardware, or with at one or many
The software module run on individual processor realizes, or realizes with combinations thereof.This area
It will be appreciated by the skilled person that microprocessor or digital signal processor can be used in practice
(DSP) some of some or all parts in equipment according to embodiments of the present invention are realized
Or repertoire.The present invention be also implemented as perform method as described herein one
Equipment or device program (such as, computer program and computer program partly or completely
Product).The program of such present invention of realization can store on a computer-readable medium, or
Person can be to have the form of one or more signal.Such signal can be from internet website
Upper download obtains, or provides on carrier signal, or provides with any other form.
The present invention will be described rather than carries out the present invention to it should be noted above-described embodiment
Limit, and those skilled in the art without departing from the scope of the appended claims may be used
Design alternative embodiment.In the claims, any reference between bracket should not will be located in
Symbol construction becomes limitations on claims.Word " comprises " not exclude the presence of and is not listed in right
Element in requirement or step.Word "a" or "an" before being positioned at element is not excluded for
There is multiple such element.The present invention can be by means of the hardware including some different elements
And realize by means of properly programmed computer.If listing the unit right of equipment for drying
In requirement, several in these devices can be specifically to be embodied by same hardware branch.
Word first, second and third use do not indicate that any order.Can be by these words
It is construed to title.