CN105956182B - A kind of method, apparatus and system of resource load - Google Patents
A kind of method, apparatus and system of resource load Download PDFInfo
- Publication number
- CN105956182B CN105956182B CN201610373847.3A CN201610373847A CN105956182B CN 105956182 B CN105956182 B CN 105956182B CN 201610373847 A CN201610373847 A CN 201610373847A CN 105956182 B CN105956182 B CN 105956182B
- Authority
- CN
- China
- Prior art keywords
- resource
- website information
- backup
- load
- information
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Abstract
The embodiment of the invention discloses the method, apparatus and system of a kind of load of resource, wherein loading the corresponding resource of the website information the described method includes: according to the website information of acquisition applied to browser;The integrality of the resource after the completion of load is detected;If the resource after the completion of load is imperfect, the corresponding relationship of the website information and backup website information that are saved according to itself determines the corresponding backup website information of the website information, loads the corresponding resource of the backup website information.Using the embodiment of the present invention, browser be can be realized when load resource is imperfect, reload the purpose of resource automatically, keep user imperfect in the webpage load of browsing, or webpage loads when not coming out, and can normally watch webpage without hand-operated forced refreshing browser rs cache.
Description
Technical field
The present invention relates to method, apparatus and system that network technique field more particularly to a kind of resource load.
Background technique
When user is using browser browsing Webpage, the normal presentation of Webpage needs to rely on browser resource
Two load, rendering steps, browser rendering is built upon in the load completely of browser resource, and browser resource has loaded
It is whole to need to rely on the complete of browser rs cache resource, and the complete of browser rs cache resource needs the resource of reliance server complete
It is whole.
But when browser load server resource, network transmission process it is possible that mistake, such case
Under, though the resource in server be completely also result in browser load resource it is imperfect, if browser is loaded with
The webpage load of incomplete resource, user's browsing is imperfect or webpage load does not come out, to influence user experience.Network
Environment and remote server also will appear unstable situation, and in the case of these, server resource is it is possible that resource is endless
It is whole, if browser has been downloaded incomplete resource from server and cached, when user browses cache resources using browser
When corresponding webpage, the webpage of user's browsing also will appear the problem of load is imperfect or webpage load does not come out, and at this moment, use
Family refresh webpage be it is of no avail, need to remove the caching of local hard drive manually and refresh browser and could normally show.
As it can be seen that in the prior art, existing since browser resource loads the imperfect caused webpage browsed as user
When loading the load of imperfect or webpage and not coming out, user wants hand-operated forced refreshing browser rs cache that could normally watch webpage
Problem.
Summary of the invention
The method, apparatus and system for being designed to provide a kind of resource load of the embodiment of the present invention, so that browser exists
When load resource is imperfect, resource is reloaded automatically.
In order to achieve the above objectives, the embodiment of the invention discloses a kind of methods of resource load, comprising:
According to the website information of acquisition, the corresponding resource of the website information is loaded;
The integrality of the resource after the completion of load is detected;
If the resource after the completion of load is imperfect, according to the website information itself saved and backup website information
Corresponding relationship determines the corresponding backup website information of the website information, loads the corresponding resource of the backup website information.
Preferably, the integrality of the resource after the completion of described pair of load detects, comprising:
When the resource is html resource, judge that the end identification information of the resource whether there is;
When the resource is css resource, judge whether the pattern of the resource last line meets preset pattern requirement;
When the resource is js resource, judge that the end flag bit of the resource whether there is.
Preferably, described load the corresponding resource of the backup website information, comprising:
For different types of resource, the corresponding resource of the backup website information is loaded using different loading methods.
Wherein, described to be directed to different types of resource, the backup website information pair is loaded using different loading methods
The resource answered includes:
When the resource is html resource, the corresponding html of the backup website information is loaded using redirection mode and is provided
Source;
When the resource is css resource, the backup is loaded by the way of document.head.appendChild
The corresponding css resource of website information;
When the resource is js resource, the backup is loaded by the way of document.head.appendChild
The corresponding js resource of website information.
In order to achieve the above objectives, the embodiment of the invention also discloses a kind of resource loading devices, comprising:
Loading module, for loading the corresponding resource of the website information according to user's website information of acquisition;
Detection module is detected for the integrality to the resource after the completion of load;
Update module, if the resource for after the completion of loading is imperfect, according to itself save website information with
The corresponding relationship of backup website information determines the corresponding backup website information of the website information, loads the backup network address letter
Cease corresponding resource.
Preferably, the detection module is specifically used for:
When the resource is html resource, judge that the end identification information of the resource whether there is;
When the resource is css resource, judge whether the pattern of the resource last line meets preset pattern requirement;
When the resource is js resource, judge that the end flag bit of the resource whether there is.
Preferably, the update module, is specifically used for:
For different types of resource, the corresponding resource of the backup website information is loaded using different loading methods.
Preferably, the update module includes:
First updating unit, for loading the backup net using redirection mode when the resource is html resource
The corresponding html resource of location information;
Second updating unit is used for when the resource is css resource, using document.head.appendChild
Mode load the corresponding css resource of the backup website information;
Third updating unit is used for when the resource is js resource, using document.head.appendChild's
Mode loads the corresponding js resource of the backup website information.
In order to achieve the above objectives, the embodiment of the invention also discloses a kind of resource loading systems, comprising: browser, first
Server and second server, wherein
The browser loads the corresponding resource of the website information for user's website information according to acquisition;To adding
The integrality of the resource after the completion of load is detected;If the resource after the completion of load is imperfect, protected according to itself
The corresponding relationship of the website information and backup website information deposited, determines the corresponding backup website information of the website information, loads
The corresponding resource of the backup website information;
The first server, for according to the website information, it is corresponding that Xiang Suoshu browser provides the website information
Resource;
The second server, for providing the backup website information to browser according to the backup website information
Corresponding resource.
Preferably, the first server, is specifically used for obtaining each network address according to preset website information backup mode
The corresponding backup website information of information, and to backup website information pair described in the corresponding server backup of the backup website information
The resource answered;And the preset website information backup mode is sent to browser.
As shown from the above technical solution, the embodiment of the invention provides the method, apparatus and system of a kind of load of resource, should
In method, according to the website information of acquisition, the corresponding resource of the website information is loaded;To the resource after the completion of load
Integrality is detected;If the resource after the completion of load is imperfect, the website information and backup net that are saved according to itself
The corresponding relationship of location information determines the corresponding backup website information of the website information, and it is corresponding to load the backup website information
Resource.
Using the embodiment of the present invention, whether the resource that can be judged automatically after the completion of loading is complete, after the completion of load
When resource load is imperfect, the corresponding resource of the corresponding backup website information of website information can be loaded automatically, realizes user
It, can be normally without hand-operated forced refreshing browser rs cache when the webpage of browsing loads the load of imperfect or webpage and do not come out
Watch the purpose of webpage.Certainly, it implements any of the products of the present invention or method must be not necessarily required to reach above-described simultaneously
All advantages.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram for resource loading method that the embodiment of the present invention one provides;
Fig. 2 is a kind of structural schematic diagram for resource loading device that the embodiment of the present invention three provides;
Fig. 3 is a kind of structural schematic diagram for resource loading system that the embodiment of the present invention four provides;
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention provides the method, apparatus and system of a kind of load of resource, are described in detail below.
Embodiment one
Fig. 1 is a kind of flow diagram for resource loading method that the embodiment of the present invention one provides, and is applied to browser, packet
Include following steps:
Step S110 loads the corresponding resource of the website information according to the website information of acquisition.
Specifically, the website information includes some web page address and the corresponding webpage of the web page address that browser obtains
On different resource mark.The mark can pass through hash algorithm or other meters according to the different resource content on webpage
Calculation machine algorithm, which calculates, to be generated, therefore, the corresponding unique mark of different resource on webpage.Pass through hash algorithm or other computers
It is technology well-known to those skilled in the art that algorithm, which generates mark, and details are not described herein again by the present invention.
When the website information that browser obtains only includes web page address, the website information of the acquisition is to obtain for the first time
It takes, at this point, browser first downloads the corresponding resource of the website information from server, as local is cached to, then load should
Resource.When the website information that browser obtains includes the different resource on web page address and the corresponding webpage of the web page address
When mark, the website information of the acquisition is the second and second above acquisition, is obtained for the first time at this point, browser is loaded directly into
The local website information corresponding resource is cached to when taking the website information.Browser is to the corresponding money of website information
The specific loading procedure in source belongs to the prior art, and this embodiment is not repeated.
The corresponding resource of the website information can include but is not limited to following resource: html (Hyper Text Makeup
Language, hypertext markup language) resource, css (Cascading Style Sheets, cascading style sheets) resource and js
(JavaScript, scripting language) resource etc..
Step S120 detects the integrality of the resource after the completion of load.
Specifically, according to the mark of different type resource, different detectable marks is determined, after the completion of to load
The resource carries out integrity detection.
Further, different examine is determined for different types of resource to improve detection efficiency and detection accuracy
Mark is known and different integrity detection rules detects the integrality of the resource after the completion of load.
When the resource is html resource, judge that the end identification information of the resource whether there is.
Specifically, for html resource, the detectable mark determined can be the end identification information of html resource, to adding
When html resource after the completion of load carries out integrity detection, judge that the end identification information of the resource whether there is, and if it exists, then
Determine that the html resource load is complete, if it does not exist, it is determined that the html resource load is imperfect.
When the resource is css resource, judge whether the pattern of the resource last line meets preset pattern requirement;
Specifically, for css resource, the detectable mark determined can be the pattern of the last line of css resource, to adding
When css resource after the completion of load carries out integrity detection, judge the resource last line pattern whether with it is preset last
Capable pattern is consistent, if unanimously, it is determined that the css resource load is complete, if inconsistent, it is determined that the css resource load
It is imperfect.
When the resource is js resource, judge that the end flag bit of the resource whether there is.
Specifically, for js resource, the detectable mark determined can be the end flag bit of js resource, complete to load
When js resource afterwards carries out integrity detection, judge that the end flag bit of the resource whether there is, and if it exists, then determine the js
Resource load is complete, if it does not exist, it is determined that the js resource load is imperfect.
For different types of resource, by the different integrity detection rule of determination to the resource after the completion of load
Integrality detected, improve the accuracy of detection efficiency and detection.
Step S130, if the resource after the completion of load is imperfect, the website information and backup saved according to itself
The corresponding relationship of website information determines the corresponding backup website information of the website information, loads the backup website information pair
The resource answered.
Wherein, each website information pair has been can recorde in the corresponding relationship of the website information and backup website information
The backup website information answered also can recorde the corresponding multiple backup website informations of each website information.
The backup website information is regular website information, and the corresponding resource of the backup website information is corresponding
The corresponding resource consistence of website information.
The corresponding relationship of website information and backup website information can be table 1:
Table 1
Or it is table 2:
Table 2
For table 1, after the completion of the corresponding resource load of website information www.iqiyi.com/x/1.html, testing result
It is imperfect for resource load, according to table 1, determine the corresponding backup network address of website information www.iqiyi.com/x/1.html
Information is backup website information 1www.iqiyi.com/x1/1.html, then loads backup website information automatically
The corresponding resource of 1www.iqiyi.com/x1/1.html.
Using this corresponding relationship of table 1, the mistake occurred due to network transmission process can be solved, is loaded with browser not
Complete resource, the webpage load for causing user to browse is imperfect or webpage load does not come out, and user needs to remove manually local
The caching of hard disk simultaneously refreshes the problem of browser could normally be shown.
For table 2, after the completion of the corresponding resource load of website information www.iqiyi.com/x/1.html, testing result
It is imperfect for resource load, according to table 2, determine the corresponding backup network address of website information www.iqiyi.com/x/1.html
Information is backup website information 1www.iqiyi.com/x1/1.html, then loads backup website information automatically
The corresponding resource of 1www.iqiyi.com/x1/1.html, to the backup website information 1www.iqiyi.com/ after the completion of load
The corresponding resource of x1/1.html carries out integrity detection, if 1www.iqiyi.com/x1/1.html pairs of backup website information
After the completion of the resource load answered, testing result is also that load is imperfect, according to table 2, determines backup website information
The corresponding backup website information of 1www.iqiyi.com/x1/1.html is backup website information 2www.iqiyi.com/x2/
1.html, then the corresponding resource of load backup website information 2www.iqiyi.com/x2/1.html automatically, according to table 2 successively into
Row, until being loaded into complete resource.It is of course also possible to load the corresponding resource of backup website information, tool in other orders
According to what sequence determines backup website information and loads the corresponding resource of backup website information, the present embodiment does not limit body
It is fixed.
Browser is set to be loaded with incomplete money when the mistake that network transmission process occurs using this corresponding relationship of table 2
Source, the webpage load for causing user to browse is imperfect or webpage loads when not coming out, and can solve user and need to remove manually locally
The caching of hard disk simultaneously refreshes the problem of browser could normally be shown.It also solves the problem that due to network environment and remote server appearance
It is unstable, so that server resource resource is occurred imperfect, cause browser to download incomplete resource from server and delay
It deposits, so that the webpage load for browsing user is imperfect or webpage load does not come out, user needs to remove local hard drive manually
It caches and refreshes the problem of browser could normally be shown.
Further, for different types of resource, the backup website information pair is loaded using different loading methods
The resource answered.
When the resource is html resource, the corresponding html of the backup website information is loaded using redirection mode and is provided
Source.The prior art is belonged to using the process that redirection mode loads resource, this embodiment is not repeated.
When the resource is css resource, the backup is loaded by the way of document.head.appendChild
The corresponding css resource of website information.The process that resource is loaded by the way of document.head.appendChild is belonged to now
There is technology, this embodiment is not repeated.
When the resource is js resource, the backup is loaded by the way of document.head.appendChild
The corresponding js resource of website information.The process that resource is loaded by the way of document.head.appendChild is belonged to now
There is technology, this embodiment is not repeated.
For different types of resource, the corresponding money of the backup website information is loaded by using different loading methods
Source improves resource loading efficiency.
Using the embodiment of the present invention, whether the resource that can be judged automatically after the completion of loading is complete, after the completion of load
When resource load is imperfect, the corresponding resource of the corresponding backup website information of website information can be loaded automatically, realizes user
It, can be normally without hand-operated forced refreshing browser rs cache when the webpage of browsing loads the load of imperfect or webpage and do not come out
Watch the purpose of webpage.
Embodiment two
It is illustrated below with a specific embodiment.
For example, in practical applications, the html money on the corresponding webpage of website information www.iqiyi.com/x/1.html
After source updates, using preset website information backup mode, the corresponding no less than one backup network address of the website information is obtained
Information, and to the corresponding resource of backup website information described in the corresponding server backup of the backup website information, wherein it is each
Backup website information corresponds to a server, and the service corresponding with website information of the corresponding server of each backup website information
Device is different from;The website information backup mode is sent to browser.
The website information that browser obtains contains only webpage network address www.iqiyi.com/x/1.html, is one first
The web page address of secondary acquisition, the corresponding resource of the web page address are html resource, then browser is first from described in server downloading
Then html resource loads the resource as buffer memory to locally.
The integrality of html resource after the completion of load is detected.
Specifically, the detection mark of the html resource is set as that end identification information is arranged at html resource end,
When carrying out integrity detection to the html resource after the completion of load, judge that the end identification information of the resource whether there is, if depositing
, it is determined that the html resource load is complete, if it does not exist, it is determined that the html resource load is imperfect.It is specific how
End beacon information is arranged, and this embodiment is not limited.
If the html resource after the completion of load is imperfect, the website information and backup network address that are saved according to browser itself
The corresponding relationship of information determines the corresponding backup website information of the website information, and it is corresponding to load the backup website information
Resource.
For the incomplete reason of html resource after the completion of load, it may be possible to when browser load server resource,
The process of network transmission, which will appear mistake, causes resource load imperfect, it is also possible to not due to network environment and remote server
Stablize, the imperfect resource for resulting in browser load of server resource is imperfect, no matter the resource after the completion of load is imperfect
Concrete reason what is, in the present embodiment, website information and backup website information that browser can all be saved according to itself
Corresponding relationship determines the corresponding backup website information of the website information, loads the corresponding resource of the backup website information.
The corresponding relationship such as table 2 of website information and backup website information that browser itself saves, according to backing up net in table 2
The number order of location information successively determines backup website information and loads the corresponding resource of backup website information.When network address is believed
After the completion of ceasing the corresponding resource load of www.iqiyi.com/x/1.html, testing result is that the resource loads imperfect, root
According to table 2, determine that the corresponding backup website information of website information www.iqiyi.com/x/1.html is backup website information
1www.iqiyi.com/x1/1.html, then load backup website information 1www.iqiyi.com/x1/1.html is corresponding automatically
Resource carries out integrality inspection to the corresponding resource of backup website information 1www.iqiyi.com/x1/1.html after the completion of load
It surveys, testing result is also that load is imperfect, according to table 2, determines 1www.iqiyi.com/x1/1.html pairs of backup website information
The backup website information answered is backup website information 2www.iqiyi.com/x2/1.html, then loads backup website information automatically
The corresponding resource of 2www.iqiyi.com/x2/1.html, to the backup website information 1www.iqiyi.com/ after the completion of load
The corresponding resource of x1/1.html carries out integrity detection, and testing result is that load is not whole, then is no longer determined backup network address letter
The step of breath and load backup website information corresponding resource.
For loading the corresponding html resource of the backup website information, the backup is loaded by using redirection mode
The corresponding html resource of website information.The prior art is belonged to using the process that redirection mode loads resource, the present embodiment is no longer
It repeats.
Using the present embodiment, whether the resource that can be judged automatically after the completion of loading is complete, the resource after the completion of load
When loading imperfect, do not consider to load incomplete the reason is that, can all load the corresponding backup network address of website information automatically
The corresponding resource of information realizes user when the webpage of browsing loads the load of imperfect or webpage and do not come out, is not necessarily to manually by force
System, which refreshes browser rs cache, can normally watch the purpose of webpage.
Embodiment three
The embodiment of the invention also discloses a kind of resource loading device, Fig. 2 is a kind of money that the embodiment of the present invention three provides
The structural schematic diagram of source loading device is applied to browser, comprising:
Loading module 210 loads the corresponding resource of the website information for user's website information according to acquisition.
Specifically, the website information includes the difference on some web page address and its corresponding webpage of browser acquisition
The mark of resource.The mark can calculate life by hash algorithm or other computerized algorithms according to web page resources content
At, therefore, the corresponding unique mark of different resource on webpage.Generating mark by hash algorithm or other computerized algorithms is
Technology well-known to those skilled in the art, details are not described herein again by the present invention.
When the website information that browser obtains only includes web page address, the website information of the acquisition is to obtain for the first time
It takes, at this point, browser first downloads the corresponding resource of the website information from server, as local is cached to, then load should
Resource.When the website information that browser obtains includes the mark of web page address and the corresponding web page resources of the web page address,
The website information of the acquisition is the second and second above acquisition, at this point, browser is loaded directly into obtains the net for the first time
The local website information corresponding resource is cached to when the information of location.Tool of the browser to the corresponding resource of website information
Body loading procedure belongs to the prior art, and this embodiment is not repeated.
The corresponding resource of the website information can include but is not limited to following resource: html (Hyper Text Makeup
Language, hypertext markup language) resource, css (Cascading Style Sheets, cascading style sheets) resource and js
(JavaScript, scripting language) resource etc..
Detection module 220 is detected for the integrality to the resource after the completion of load.
Specifically, according to the mark of different type resource, different detectable marks is determined, after the completion of to load
The resource carries out integrity detection.
Further, be the accuracy for improving detection efficiency and detection, for different types of resource, determine it is different can
Detection mark and different integrity detection rules detect the integrality of the resource after the completion of load.
When the resource is html resource, judge that the end identification information of the resource whether there is.
Specifically, for html resource, the detectable mark determined can be the end identification information of html resource, to adding
When html resource after the completion of load carries out integrity detection, judge that the end identification information of the resource whether there is, and if it exists, then
Determine that the html resource load is complete, if it does not exist, it is determined that the html resource load is imperfect.
When the resource is css resource, judge whether the pattern of the resource last line meets preset pattern requirement;
Specifically, for css resource, the detectable mark determined can be the pattern of the last line of css resource, to adding
When css resource after the completion of load carries out integrity detection, judge the resource last line pattern whether with it is preset last
Capable pattern is consistent, if unanimously, it is determined that the css resource load is complete, if inconsistent, it is determined that the css resource load
It is imperfect.
When the resource is js resource, judge that the end flag bit of the resource whether there is.
Specifically, for js resource, the detectable mark determined can be the end flag bit of js resource, complete to load
When js resource afterwards carries out integrity detection, judge that the end flag bit of the resource whether there is, and if it exists, then determine the js
Resource load is complete, if it does not exist, it is determined that the js resource load is imperfect.
For different types of resource, by the different integrity detection rule of determination to the resource after the completion of load
Integrality detected, improve the accuracy of detection efficiency and detection.
Update module 230, if the resource for after the completion of loading is imperfect, according to the website information of itself preservation
With the corresponding relationship of backup website information, determines the corresponding backup website information of the website information, load the backup network address
The corresponding resource of information.
Wherein, each website information pair has been can recorde in the corresponding relationship of the website information and backup website information
The backup website information answered also can recorde the corresponding multiple backup website informations of each website information.
The backup website information is regular website information, and the corresponding resource of the backup website information is corresponding
The corresponding resource consistence of website information.
Further, for different types of resource, the backup website information pair is loaded using different loading methods
The resource answered.
When the resource is html resource, the corresponding html of the backup website information is loaded using redirection mode and is provided
Source.The prior art is belonged to using the process that redirection mode loads resource, this embodiment is not repeated.
When the resource is css resource, the backup is loaded by the way of document.head.appendChild
The corresponding css resource of website information.The process that resource is loaded by the way of document.head.appendChild is belonged to now
There is technology, this embodiment is not repeated.
When the resource is js resource, the backup is loaded by the way of document.head.appendChild
The corresponding js resource of website information.The process that resource is loaded by the way of document.head.appendChild is belonged to now
There is technology, this embodiment is not repeated.
For different types of resource, the corresponding money of the backup website information is loaded by using different loading methods
Source improves resource loading efficiency.
Using the embodiment of the present invention, whether the resource that can be judged automatically after the completion of loading is complete, after the completion of load
When resource load is imperfect, the corresponding resource of the corresponding backup website information of website information can be loaded automatically, realizes user
It, can be normally without hand-operated forced refreshing browser rs cache when the webpage of browsing loads the load of imperfect or webpage and do not come out
Watch the purpose of webpage.
Example IV
The embodiment of the invention also discloses a kind of resource loading system, Fig. 3 is a kind of money that the embodiment of the present invention four provides
The structural schematic diagram of source loading system, comprising: browser 310, first server 320 and second server 330.
The browser 310, comprising:
Loading module 3101 loads the corresponding resource of the website information for user's website information according to acquisition.
Detection module 3102 is detected for the integrality to the resource after the completion of load.
Update module 3103 is believed if the resource for after the completion of loading is imperfect according to the network address itself saved
The corresponding relationship of breath and backup website information, determines the corresponding backup website information of the website information, loads the backup net
The corresponding resource of location information.
It should be noted that the load in loading module 3101, detection module 3102, update module 3103 and embodiment two
Module 210, detection module 220, update module 230 function can be identical, detailed description is not repeated herein.
The first server 320, comprising:
First transmission module 3201, for according to the website information, Xiang Suoshu browser to provide the website information pair
The resource answered.
According to website information, Xiang Suoshu browser provides the corresponding resource of the website information and belongs to the prior art, this reality
Example is applied to repeat no more.
Backup information module 3202, for it is corresponding to obtain each website information according to preset website information backup mode
Backup website information, and to the corresponding money of backup website information described in the corresponding server backup of the backup website information
Source;And the preset website information backup mode is sent to browser.
Specifically, website information backup mode can be the regular backup mode of user's sets itself, in order to look for
To backup website information and its corresponding resource backup.For example, it is assumed that website information is www.iqiyi.com/x/1.html,
Then its backup website information can be www.iqiyi.com/x1/1.html, the corresponding backup network address of the website information
The corresponding resource consistence of information.
According to preset website information backup mode, the website information backup mode can be corresponding for a website information
One backup website information, as shown in table 3, or a website information is corresponding to be no less than a backup website information, such as
Shown in table 4.
Table 3
Table 4
When the corresponding backup website information of a website information, by the corresponding resource backup of the backup website information
Into the corresponding server of the backup website information, the corresponding server of the backup website information can be with website information pair
The server answered is the same server, to avoid causing to service due to network environment and remote server are unstable etc.
Device resource is imperfect, the corresponding server of the backup website information can also server corresponding with website information be not same
A server, i.e., can also will be on the corresponding resource backup to other servers of the backup website information.
It, will a no less than backup network address letter when a website information is corresponding is no less than a backup website information
Corresponding resource backup is ceased into the corresponding server of the backup website information, a no less than backup website information pair
It is in the same server, such as table 4 that the server answered, which can be the same server and server corresponding with website information,
The corresponding server of backup website information 1 and the corresponding server of backup website information 2 be all be server 1, and website information
Corresponding server is also server 1.The no less than corresponding server of a backup website information may not be same
A server and server all corresponding with website information are not the corresponding clothes of website information in the same server, such as table 4
Business device is server 1, and the corresponding server of backup website information 1 is server 2, and the corresponding server of backup website information 2 is
Server 3.The no less than corresponding server of a backup website information may not be the same server but part phase
Server same and corresponding with website information is in the same server, such as table 4, and the corresponding server of website information is service
Device 1, the corresponding server of backup website information 1 are also server 1, and the corresponding server of backup website information 2 is server 2.
To the corresponding resource of backup website information described in the corresponding server backup of the backup website information, the network address
The corresponding corresponding resource consistence of backup website information of information, and the corresponding resource of the backup website information can and net
Information corresponding source synchronous in location updates.
The second server 330, comprising:
Second transmission module 3301, for providing the backup network address letter to browser according to the backup website information
Cease corresponding resource.
According to backup website information, Xiang Suoshu browser provides the corresponding resource of the backup website information and belongs to existing skill
Art, this embodiment is not repeated.
The corresponding backup net of each website information is obtained according to preset website information backup mode using the present embodiment
Location information, and to the corresponding resource of backup website information described in the corresponding server backup of the backup website information, in user
When browsing webpage using browser, whether the resource that can be judged automatically after the completion of loading is complete, the resource after the completion of load
When loading imperfect, the corresponding resource of the corresponding backup website information of website information can be loaded automatically, makes user in browsing
When webpage load is imperfect or webpage load does not come out, webpage can be normally watched without hand-operated forced refreshing browser rs cache.
For system and Installation practice, since it is substantially similar to the method embodiment, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Those of ordinary skill in the art will appreciate that all or part of the steps in realization above method embodiment is can
It is completed with instructing relevant hardware by program, the program can store in computer-readable storage medium,
The storage medium designated herein obtained, such as: ROM/RAM, magnetic disk, CD.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (10)
1. a kind of resource loading method, which is characterized in that be applied to browser, which comprises
According to the website information of acquisition, the corresponding resource of the website information is loaded;
The integrality of the resource after the completion of load is detected;
If the resource after the completion of load is imperfect, the website information saved according to itself is corresponding with backup website information
Relationship determines the corresponding backup website information of the website information, loads the corresponding resource of the backup website information;
The website information includes the mark of web page address and the resource on the corresponding webpage of the web page address.
2. the method according to claim 1, wherein described pair load after the completion of the resource integrality into
Row detection, comprising:
When the resource is html resource, judge that the end identification information of the resource whether there is;
When the resource is css resource, judge whether the pattern of the resource last line meets preset pattern requirement;
When the resource is js resource, judge that the end flag bit of the resource whether there is.
3. the method according to claim 1, wherein the corresponding resource of the load backup website information,
Include:
For different types of resource, the corresponding resource of the backup website information is loaded using different loading methods.
4. according to the method described in claim 3, it is characterized in that, described be directed to different types of resource, using different plus
Load mode loads the corresponding resource of the backup website information
When the resource is html resource, the corresponding html resource of the backup website information is loaded using redirection mode;
When the resource is css resource, the backup network address is loaded by the way of document.head.appendChild
The corresponding css resource of information;
When the resource is js resource, the backup network address is loaded by the way of document.head.appendChild
The corresponding js resource of information.
5. a kind of resource loading device, which is characterized in that be applied to browser, described device includes:
Loading module, for loading the corresponding resource of the website information according to user's website information of acquisition;
Detection module is detected for the integrality to the resource after the completion of load;
Update module, if the resource for after the completion of loading is imperfect, the website information and backup that are saved according to itself
The corresponding relationship of website information determines the corresponding backup website information of the website information, loads the backup website information pair
The resource answered;
The website information includes the mark of web page address and the resource on the corresponding webpage of the web page address.
6. device according to claim 5, which is characterized in that the detection module is specifically used for:
When the resource is html resource, judge that the end identification information of the resource whether there is;
When the resource is css resource, judge whether the pattern of the resource last line meets preset pattern requirement;
When the resource is js resource, judge that the end flag bit of the resource whether there is.
7. device according to claim 5, which is characterized in that the update module is specifically used for:
For different types of resource, the corresponding resource of the backup website information is loaded using different loading methods.
8. device according to claim 7, which is characterized in that the update module includes:
First updating unit, for loading the backup network address using redirection mode and believing when the resource is html resource
Cease corresponding html resource;
Second updating unit is used for when the resource is css resource, using the side of document.head.appendChild
Formula loads the corresponding css resource of the backup website information;
Third updating unit is used for when the resource is js resource, by the way of document.head.appendChild
Load the corresponding js resource of the backup website information.
9. a kind of resource loading system, which is characterized in that the system comprises: browser, first server and second server,
Wherein,
The browser loads the corresponding resource of the website information for user's website information according to acquisition;To having loaded
The integrality of the resource after is detected;If the resource after the completion of load is imperfect, saved according to itself
The corresponding relationship of website information and backup website information, determines the corresponding backup website information of the website information, described in load
The corresponding resource of backup website information;
The first server, for according to the website information, Xiang Suoshu browser to provide the website information corresponding money
Source;
The second server, for it is corresponding to provide the backup website information to browser according to the backup website information
Resource;
The website information includes the mark of web page address and the resource on the corresponding webpage of the web page address.
10. system according to claim 9, which is characterized in that the first server is specifically used for according to preset net
Location information back-up mode obtains the corresponding backup website information of each website information, and corresponding to the backup website information
The corresponding resource of backup website information described in server backup;And the preset website information backup mode is sent to browsing
Device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610373847.3A CN105956182B (en) | 2016-05-31 | 2016-05-31 | A kind of method, apparatus and system of resource load |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610373847.3A CN105956182B (en) | 2016-05-31 | 2016-05-31 | A kind of method, apparatus and system of resource load |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105956182A CN105956182A (en) | 2016-09-21 |
CN105956182B true CN105956182B (en) | 2019-06-14 |
Family
ID=56907368
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610373847.3A Active CN105956182B (en) | 2016-05-31 | 2016-05-31 | A kind of method, apparatus and system of resource load |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105956182B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109788305B (en) * | 2018-12-10 | 2021-03-02 | 北京爱奇艺科技有限公司 | Cache data refreshing method and device |
CN109857649B (en) * | 2019-01-14 | 2022-07-26 | 珠海金山网络游戏科技有限公司 | Resource testing method and system |
CN111639275B (en) * | 2019-03-01 | 2023-04-25 | 阿里巴巴集团控股有限公司 | Routing information processing method, device, electronic equipment and computer storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102109989A (en) * | 2009-12-29 | 2011-06-29 | 阿里巴巴集团控股有限公司 | Method, device and system for controlling browser cache |
CN102214223A (en) * | 2011-06-15 | 2011-10-12 | 奇智软件(北京)有限公司 | Method and system for browser access control |
CN105022750A (en) * | 2014-04-28 | 2015-11-04 | 腾讯科技(北京)有限公司 | Resource file loading method and apparatus |
-
2016
- 2016-05-31 CN CN201610373847.3A patent/CN105956182B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102109989A (en) * | 2009-12-29 | 2011-06-29 | 阿里巴巴集团控股有限公司 | Method, device and system for controlling browser cache |
CN102214223A (en) * | 2011-06-15 | 2011-10-12 | 奇智软件(北京)有限公司 | Method and system for browser access control |
CN105022750A (en) * | 2014-04-28 | 2015-11-04 | 腾讯科技(北京)有限公司 | Resource file loading method and apparatus |
Also Published As
Publication number | Publication date |
---|---|
CN105956182A (en) | 2016-09-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20160378731A1 (en) | Method and apparatus for intelligent capture of document object model events | |
CN102663062B (en) | Method and device for processing invalid links in search result | |
CN102004756B (en) | Traffic visualization across web maps | |
CN102985921B (en) | There is the client terminal device high speed caching electronic document resources of e-sourcing data base | |
EP3161610B1 (en) | Optimized browser rendering process | |
CN107003877A (en) | The context deep-link of application | |
US20220129620A1 (en) | Systems and methods for co-browsing | |
CN103377064B (en) | The loading method of a kind of page script and device | |
CN102932197A (en) | Testing method and system | |
CN105956182B (en) | A kind of method, apparatus and system of resource load | |
CN106990975A (en) | One kind application heat deploying method, device and system | |
CN106897336A (en) | Web page files sending method, webpage rendering intent and device, webpage rendering system | |
CN103297291A (en) | Method and system for monitoring website real-time statuses | |
CN103078945A (en) | Method and system for processing browser crash data | |
CN107547524A (en) | A kind of page detection method, device and equipment | |
CN110750244B (en) | Code synchronization method and device, electronic equipment and storage medium | |
CN105278977B (en) | A kind of loading method and device of web pages component | |
CN104731817B (en) | A kind of webpage exhibiting method and device | |
CN110347955A (en) | A kind of resource detection method and device | |
CN106649299A (en) | Method and device for lazy loading of webpage block | |
WO2015116437A1 (en) | Providing print view of document for editing in web-based application | |
CN106933569A (en) | A kind of webpage method for refreshing and device | |
CN105653550A (en) | Web page filtering method and device | |
JP2019511060A5 (en) | ||
US10440144B2 (en) | Near real time notifications distribution platform |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |