CN105956182A - Resource loading method, apparatus and system - Google Patents
Resource loading method, apparatus and system Download PDFInfo
- Publication number
- CN105956182A CN105956182A CN201610373847.3A CN201610373847A CN105956182A CN 105956182 A CN105956182 A CN 105956182A CN 201610373847 A CN201610373847 A CN 201610373847A CN 105956182 A CN105956182 A CN 105956182A
- Authority
- CN
- China
- Prior art keywords
- resource
- website information
- backup
- information
- load
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 41
- 238000000034 method Methods 0.000 claims abstract description 29
- 238000001514 detection method Methods 0.000 claims description 35
- 238000004422 calculation algorithm Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 230000005540 biological transmission Effects 0.000 description 4
- 238000000151 deposition Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000029058 respiratory gaseous exchange Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
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
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Embodiments of the present invention disclose a resource loading method, apparatus and system. The method applied to a browser comprises: according to acquired website address information, loading a resource corresponding to the website address information; detecting integrity of the loaded resource; and if the loaded resource is not complete, determining backup website address information corresponding to the website information according to a stored corresponding relationship between website address information and backup website address information, and loading a resource corresponding to the backup website information. By applying the method, apparatus and system disclosed by the embodiments of the present invention, the purpose that the browser automatically loads the resource again when the loaded resource is not complete is achieved, so that the user can normaly watch the webpage without the need for manually refreshing the browser cache when the webpage that the user is browsing is not loaded completely or the webpage can not be loaded.
Description
Technical field
The present invention relates to networking technology area, particularly relate to method, Apparatus and system that a kind of resource loads.
Background technology
When user uses browser to browse Webpage, the normal presentation of Webpage, need dependence to browse
Device resource loads, renders two steps, and browser renders is built upon browser resource and loads on complete,
And browser resource loads and completely needs to rely on the complete of browser rs cache resource, and browser rs cache resource
The resource completely needing reliance server is complete.
But, during browser load server resource, in the process of network transmission it is possible that mistake, this
In the case of Zhong, even if the resource also resulting in browser loading that the resource in server is complete is imperfect,
If browser is loaded with incomplete resource, the webpage that user browses loads imperfect, or webpage loads not
Out, thus affect Consumer's Experience.Network environment and remote server also there will be the situation of instability, this
In the case of Xie, server resource is it is possible that resource is imperfect, if browser has been downloaded not from server
Complete resource also caches, then, when user uses browser to browse webpage corresponding to cache resources, user is clear
It is imperfect that the webpage look at also there will be loading, or webpage loads problem the most out, and at this moment, user refreshes net
Page is of no avail, needs manually to remove the caching of local hard drive and refresh browser and could normally show.
Visible, in the prior art, exist due to browser resource load imperfect cause browse as user
Webpage load imperfect, or when webpage loads the most out, user wants hand-operated forced refreshing browser rs cache
The problem that can normally watch webpage.
Summary of the invention
The purpose of the embodiment of the present invention is method, the Apparatus and system providing a kind of resource to load, so that clear
Look at device load resource imperfect time, automatically reload resource.
For reaching above-mentioned purpose, the embodiment of the invention discloses a kind of method that resource loads, including:
According to the website information obtained, load the resource that described website information is corresponding;
The integrity of the described resource after having loaded is detected;
If the described resource after having loaded is imperfect, then the website information preserved according to self and backup network address
The corresponding relation of information, determines the backup website information that described website information is corresponding, loads described backup network address
The resource that information is corresponding.
It is preferred that the described integrity to the described resource after having loaded detects, including:
When described resource is html resource, it is judged that whether the end identification information of this resource exists;
When described resource is css resource, it is judged that whether the pattern of this resource last column meets the pattern preset
Requirement;
When described resource is js resource, it is judged that whether the end flag bit of this resource exists.
It is preferred that the resource that described loading described backup website information is corresponding, including:
For different types of resource, different load modes is used to load described backup website information corresponding
Resource.
Wherein, described for different types of resource, use different load modes to load described backup network address
Resource corresponding to information includes:
When described resource is html resource, redirection mode is used to load described backup website information corresponding
Html resource;
When described resource is css resource, the mode of document.head.appendChild is used to load described standby
The css resource that part website information is corresponding;
When described resource is js resource, the mode of document.head.appendChild is used to load described standby
The js resource that part website information is corresponding.
For reaching above-mentioned purpose, the embodiment of the invention also discloses a kind of resource charger, including:
Load-on module, for loading, according to the user's website information obtained, the resource that described website information is corresponding;
Detection module, for detecting the integrity of the described resource after having loaded;
More new module, if the described resource after having loaded is imperfect, then the network address preserved according to self
Information and the corresponding relation of backup website information, determine the backup website information that described website information is corresponding, add
Carry the resource that described backup website information is corresponding.
It is preferred that described detection module specifically for:
When described resource is html resource, it is judged that whether the end identification information of this resource exists;
When described resource is css resource, it is judged that whether the pattern of this resource last column meets the pattern preset
Requirement;
When described resource is js resource, it is judged that whether the end flag bit of this resource exists.
It is preferred that described more new module, specifically for:
For different types of resource, different load modes is used to load described backup website information corresponding
Resource.
It is preferred that described more new module includes:
First updating block, for when described resource is html resource, uses redirection mode to load described standby
The html resource that part website information is corresponding;
Second updating block, for when described resource is css resource, uses
The mode of document.head.appendChild loads the css resource that described backup website information is corresponding;
3rd updating block, for when described resource is js resource, uses document.head.appendChild
Mode load the js resource that described backup website information is corresponding.
For reaching above-mentioned purpose, the embodiment of the invention also discloses a kind of resource loading system, including: browse
Device, first server and second server, wherein,
Described browser, for according to the user's website information obtained, loading the money that described website information is corresponding
Source;The integrity of the described resource after having loaded is detected;If the described resource after having loaded is not
Completely, then the website information preserved according to self and the corresponding relation of backup website information, determine described network address
The backup website information that information is corresponding, loads the resource that described backup website information is corresponding;
Described first server, for according to described website information, providing described network address letter to described browser
The resource that breath is corresponding;
Described second server, for according to described backup website information, providing described backup net to browser
The resource that location information is corresponding.
It is preferred that described first server, specifically for according to the website information backup mode preset, obtain
The backup website information that each website information is corresponding, and to server backup corresponding to described backup website information
The resource that described backup website information is corresponding;And be sent to browse by default described website information backup mode
Device.
As shown from the above technical solution, embodiments provide a kind of resource load method, device and
System, in the method, according to the website information obtained, loads the resource that described website information is corresponding;To adding
The integrity of the described resource after having carried detects;If the described resource after having loaded is imperfect, then
The website information preserved according to self and the corresponding relation of backup website information, determine that described website information is corresponding
Backup website information, load the resource that described backup website information is corresponding.
The application embodiment of the present invention, it is possible to the resource after automatic decision has loaded is the most complete, when having loaded
When resource after one-tenth loads imperfect, it is possible to the backup website information automatically loading website information corresponding is corresponding
Resource, it is achieved that user loads imperfect at the webpage browsed, or when webpage loads the most out, it is not necessary to manually
Force to refresh browser rs cache and just can normally watch the purpose of webpage.Certainly, arbitrary product of the present invention is implemented
Or method must be not necessarily required to reach all the above advantage simultaneously.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to enforcement
In example or description of the prior art, the required accompanying drawing used is briefly described, it should be apparent that, describe below
In accompanying drawing be only some embodiments of the present invention, for those of ordinary skill in the art, do not paying
On the premise of going out creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
The schematic flow sheet of a kind of resource loading method that Fig. 1 provides for the embodiment of the present invention one;
The structural representation of a kind of resource charger that Fig. 2 provides for the embodiment of the present invention three;
The structural representation of a kind of resource loading system that Fig. 3 provides for the embodiment of the present invention four;
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clearly
Chu, be fully described by, it is clear that described embodiment be only a part of embodiment of the present invention rather than
Whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art are not making creation
The every other embodiment obtained under property work premise, broadly falls into the scope of protection of the invention.
Embodiments provide method, Apparatus and system that a kind of resource loads, below carry out specifically
Bright.
Embodiment one
The schematic flow sheet of a kind of resource loading method that Fig. 1 provides for the embodiment of the present invention one, is applied to clear
Look at device, comprise the following steps:
Step S110, according to the website information obtained, loads the resource that described website information is corresponding.
Specifically, described website information includes that certain web page address that browser obtains and this web page address are corresponding
Webpage on the mark of different resource.Described mark can be according to the different resource content on webpage by breathing out
Uncommon algorithm or other computerized algorithms calculate and generate, therefore, and 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,
Here is omitted for the present invention.
When the website information that browser obtains only includes web page address, the website information of described acquisition is the
Once obtaining, now, browser first downloads, from server, the resource that described website information is corresponding, as caching
To this locality, then load this resource.The website information obtained when browser includes web page address and this webpage
During the mark of the different resource on webpage that address is corresponding, the website information of described acquisition is second time and second
Secondary above acquisition, now, browser is loaded directly into being cached to when obtaining this website information for the first time the institute of this locality
State the resource that website information is corresponding.The concrete loading procedure of the resource that browser is corresponding to website information belongs to
In prior art, the present embodiment repeats no more.
Resource corresponding to described website information can include but not limited to following resource: html (Hyper Text
Makeup Language, HTML) resource, css (Cascading Style Sheets, stacking
CSS) resource and js (JavaScript, script) resource etc..
Step S120, detects the integrity of the described resource after having loaded.
Specifically, according to the mark of dissimilar resource, different detected marks is determined, in order to loading
Described resource after completing carries out integrity detection.
Further, for improving detection efficiency and detection accuracy, for different types of resource, determine not
Same detected mark and the different integrity detection rule integrity to the described resource after having loaded
Detect.
When described resource is html resource, it is judged that whether the end identification information of this resource exists.
Specifically, for html resource, the detected mark determined can be the end identification information of html resource,
When html resource after having loaded is carried out integrity detection, it is judged that whether the end identification information of this resource is deposited
, if existing, it is determined that described html resource loads complete, if not existing, it is determined that described html resource adds
Carry imperfect.
When described resource is css resource, it is judged that whether the pattern of this resource last column meets the pattern preset
Requirement;
Specifically, for css resource, the detected mark determined can be the pattern of last column of css resource,
When css resource after having loaded is carried out integrity detection, it is judged that the pattern of this resource last column whether and
The pattern of the last column preset is consistent, if unanimously, it is determined that described css resource loads complete, if inconsistent,
Then determine that described css resource loads imperfect.
When described resource is js resource, it is judged that whether the end flag bit of this resource exists.
Specifically, for js resource, the detected mark determined can be the end flag bit of js resource, to adding
When js resource after having carried carries out integrity detection, it is judged that whether the end flag bit of this resource exists, if depositing
, it is determined that described js resource loads complete, if not existing, it is determined that described js resource loads imperfect.
For different types of resource, it is determined by different integrity detection rules to the institute after having loaded
The integrity stating resource detects, and improves the accuracy of detection efficiency and detection.
Step S130, if the described resource after having loaded is imperfect, then the website information preserved according to self
With the corresponding relation of backup website information, determine the backup website information that described website information is corresponding, load institute
State the resource that backup website information is corresponding.
Wherein, described website information can record each network address in the corresponding relation of backup website information
The backup website information that information is corresponding, it is also possible to record has multiple backups that each website information is corresponding
Website information.
Described backup website information is regular website information, resource corresponding to described backup website information with
The resource consistence that the website information of its correspondence is corresponding.
Website information can be table 1 with the corresponding relation of backup website information:
Table 1
Or it is table 2:
Table 2
For table 1, after the resource that website information www.iqiyi.com/x/1.html is corresponding has loaded, detection
Result is that the loading of described resource is imperfect, according to table 1, determines website information www.iqiyi.com/x/1.html pair
The backup website information answered is backup website information 1www.iqiyi.com/x1/1.html, the most automatically loads backup
The resource that website information 1www.iqiyi.com/x1/1.html is corresponding.
Application this corresponding relation of table 1, it is possible to resolve the mistake occurred due to network transmission process, makes browser add
Having carried incomplete resource, the webpage causing user to browse loads imperfect, or webpage loads the most out, uses
Family needs manually remove the caching of local hard drive and refresh the problem that browser could normally show.
For table 2, after the resource that website information www.iqiyi.com/x/1.html is corresponding has loaded, detection
Result is that the loading of described resource is imperfect, according to table 2, determines website information www.iqiyi.com/x/1.html pair
The backup website information answered is backup website information 1www.iqiyi.com/x1/1.html, the most automatically loads backup
The resource that website information 1www.iqiyi.com/x1/1.html is corresponding, to the backup website information 1 after having loaded
Resource corresponding for www.iqiyi.com/x1/1.html carries out integrity detection, if backup website information 1
After resource corresponding for www.iqiyi.com/x1/1.html has loaded, testing result is also imperfect for loading, root
According to table 2, determine and back up backup website information corresponding to website information 1www.iqiyi.com/x1/1.html for backup
Website information 2www.iqiyi.com/x2/1.html, then load backup website information 2 automatically
The resource that www.iqiyi.com/x2/1.html is corresponding, is carried out successively according to table 2, until being loaded into complete resource.
It is of course also possible to load the resource that backup website information is corresponding in other orders, specifically according to what order
Determining backup website information and load the resource that this backup website information is corresponding, the present embodiment is not construed as limiting.
Application this corresponding relation of table 2, when the mistake that network transmission process occurs, makes browser cannot not be loaded with completely
Whole resource, the webpage causing user to browse loads imperfect, or when webpage loads the most out, it is possible to resolve use
Family needs manually remove the caching of local hard drive and refresh the problem that browser could normally show.Also solve the problem that
The instability occurred due to network environment and remote server, resource is imperfect to make server resource occur, leads
Cause browser downloaded incomplete resource from server and cached, so that the webpage that user browses loads not
Completely, or webpage loads the most out, and user needs manually remove the caching of local hard drive and refresh browser
The problem that can normally show.
Further, for different types of resource, different load modes is used to load described backup network address
The resource that information is corresponding.
When described resource is html resource, redirection mode is used to load described backup website information corresponding
Html resource.The process using redirection mode to load resource belongs to prior art, and the present embodiment repeats no more.
When described resource is css resource, the mode of document.head.appendChild is used to load described standby
The css resource that part website information is corresponding.The mode using document.head.appendChild loads the mistake of resource
Journey belongs to prior art, and the present embodiment repeats no more.
When described resource is js resource, the mode of document.head.appendChild is used to load described standby
The js resource that part website information is corresponding.The mode using document.head.appendChild loads the mistake of resource
Journey belongs to prior art, and the present embodiment repeats no more.
For different types of resource, by using different load modes to load described backup website information pair
The resource answered, improves resource loading efficiency.
The application embodiment of the present invention, it is possible to the resource after automatic decision has loaded is the most complete, when having loaded
When resource after one-tenth loads imperfect, it is possible to the backup website information automatically loading website information corresponding is corresponding
Resource, it is achieved that user loads imperfect at the webpage browsed, or when webpage loads the most out, it is not necessary to manually
Force to refresh browser rs cache and just can normally watch the purpose of webpage.
Embodiment two
Illustrate with a specific embodiment below.
Such as, in actual applications, the html on webpage that website information www.iqiyi.com/x/1.html is corresponding
After resource updates, use preset website information backup mode, obtain this website information corresponding no less than one
Individual backup website information, and to backing up network address letter described in server backup corresponding to described backup website information
The resource that breath is corresponding, wherein, the corresponding server of each backup website information, and each backup network address letter
The server that the server of breath correspondence is corresponding with website information is different from;By described website information backup mode
It is sent to browser.
The website information that browser obtains contains only webpage network address www.iqiyi.com/x/1.html, is one the
The web page address once obtained, the resource that this web page address is corresponding is html resource, then browser is first from server
Download described html resource, as buffer memory to local, then load described resource.
The integrity of the html resource after having loaded is detected.
Specifically, the detection mark of described html resource is set at html resource end arrange end mark letter
Breath, when carrying out integrity detection to the html resource after having loaded, it is judged that the end identification information of this resource is
No existence, if existing, it is determined that described html resource loads complete, if not existing, it is determined that described html
Resource loads imperfect.Specifically how to arrange end beacon information the present embodiment to be not construed as limiting.
If the html resource after having loaded is imperfect, then the website information preserved according to browser self and backup
The corresponding relation of website information, determines the backup website information that described website information is corresponding, loads described backup
The resource that website information is corresponding.
For the incomplete reason of html resource after having loaded, it may be possible to browser load server resource
Time, the process in network transmission there will be mistake and causes resource loading imperfect, it is also possible to due to network rings
Border and remote server are unstable, and server resource is imperfect, and to result in the resource that browser loads imperfect,
No matter what the incomplete concrete reason of the resource after having loaded is, in the present embodiment, browser all can root
The website information preserved according to self and the corresponding relation of backup website information, determine that described website information is corresponding
Backup website information, loads the resource that described backup website information is corresponding.
The website information that browser self preserves and the corresponding relation such as table 2 backing up website information, according in table 2
The number order of backup website information, determines backup website information successively and loads this backup website information correspondence
Resource.After the resource that website information www.iqiyi.com/x/1.html is corresponding has loaded, testing result is
Described resource loads imperfect, according to table 2, determines corresponding standby of website information www.iqiyi.com/x/1.html
Part website information is backup website information 1www.iqiyi.com/x1/1.html, then automatically load and back up network address letter
The resource that breath 1www.iqiyi.com/x1/1.html is corresponding, to the backup website information 1 after having loaded
Resource corresponding for www.iqiyi.com/x1/1.html carries out integrity detection, and testing result is also imperfect for loading,
According to table 2, determine that the backup website information backing up website information 1www.iqiyi.com/x1/1.html corresponding is standby
Part website information 2www.iqiyi.com/x2/1.html, then load backup website information 2 automatically
The resource that www.iqiyi.com/x2/1.html is corresponding, to the backup website information 1 after having loaded
Resource corresponding for www.iqiyi.com/x1/1.html carries out integrity detection, and testing result is the most whole, then for loading
No longer it is determined backing up website information and loading the step of resource corresponding to backup website information.
The html resource corresponding for loading described backup website information, described by using redirection mode to load
The html resource that backup website information is corresponding.The process using redirection mode to load resource belongs to prior art,
The present embodiment repeats no more.
Application the present embodiment, it is possible to the resource after automatic decision has loaded is the most complete, after loading completes
Resource load imperfect time, do not consider to load what incomplete reason is, all can automatically load network address letter
Cease the resource that corresponding backup website information is corresponding, it is achieved that user loads imperfect at the webpage browsed, or
When webpage loads the most out, it is not necessary to hand-operated forced refreshing browser rs cache just can normally watch the purpose of webpage.
Embodiment three
The embodiment of the invention also discloses a kind of resource charger, Fig. 2 provide for the embodiment of the present invention three one
Plant the structural representation of resource charger, be applied to browser, including:
Load-on module 210, for according to the user's website information obtained, loading the money that described website information is corresponding
Source.
Specifically, described website information includes on the webpage of certain web page address that browser obtains and correspondence thereof
The mark of different resource.Described mark can be according to web page resources content by hash algorithm or other meters
Calculation machine algorithm calculates and generates, therefore, and the corresponding unique mark of different resource on webpage.By hash algorithm or
It is technology well-known to those skilled in the art that other computerized algorithms of person generate mark, and the present invention is the most no longer
Repeat.
When the website information that browser obtains only includes web page address, the website information of described acquisition is the
Once obtaining, now, browser first downloads, from server, the resource that described website information is corresponding, as caching
To this locality, then load this resource.The website information obtained when browser includes web page address and this webpage
During the mark of the web page resources that address is corresponding, the website information of described acquisition obtains for second time and second time are above
Taking, now, browser is loaded directly into being cached to when obtaining this website information for the first time the described network address letter of this locality
The resource that breath is corresponding.The concrete loading procedure of the resource that browser is corresponding to website information belongs to existing skill
Art, the present embodiment repeats no more.
Resource corresponding to described website information can include but not limited to following resource: html (Hyper Text
Makeup Language, HTML) resource, css (Cascading Style Sheets, stacking
CSS) resource and js (JavaScript, script) resource etc..
Detection module 220, for detecting the integrity of the described resource after having loaded.
Specifically, according to the mark of dissimilar resource, different detected marks is determined, in order to loading
Described resource after completing carries out integrity detection.
Further, for improving detection efficiency and the accuracy of detection, for different types of resource, determine
Different detected marks and different integrity detection complete to the described resource after having loaded of rule
Property detects.
When described resource is html resource, it is judged that whether the end identification information of this resource exists.
Specifically, for html resource, the detected mark determined can be the end identification information of html resource,
When html resource after having loaded is carried out integrity detection, it is judged that whether the end identification information of this resource is deposited
, if existing, it is determined that described html resource loads complete, if not existing, it is determined that described html resource adds
Carry imperfect.
When described resource is css resource, it is judged that whether the pattern of this resource last column meets the pattern preset
Requirement;
Specifically, for css resource, the detected mark determined can be the pattern of last column of css resource,
When css resource after having loaded is carried out integrity detection, it is judged that the pattern of this resource last column whether and
The pattern of the last column preset is consistent, if unanimously, it is determined that described css resource loads complete, if inconsistent,
Then determine that described css resource loads imperfect.
When described resource is js resource, it is judged that whether the end flag bit of this resource exists.
Specifically, for js resource, the detected mark determined can be the end flag bit of js resource, to adding
When js resource after having carried carries out integrity detection, it is judged that whether the end flag bit of this resource exists, if depositing
, it is determined that described js resource loads complete, if not existing, it is determined that described js resource loads imperfect.
For different types of resource, it is determined by different integrity detection rules to the institute after having loaded
The integrity stating resource detects, and improves the accuracy of detection efficiency and detection.
More new module 230, if the described resource after having loaded is imperfect, then the net preserved according to self
Location information and the corresponding relation of backup website information, determine the backup website information that described website information is corresponding,
Load the resource that described backup website information is corresponding.
Wherein, described website information can record each network address in the corresponding relation of backup website information
The backup website information that information is corresponding, it is also possible to record has multiple backups that each website information is corresponding
Website information.
Described backup website information is regular website information, resource corresponding to described backup website information with
The resource consistence that the website information of its correspondence is corresponding.
Further, for different types of resource, different load modes is used to load described backup network address
The resource that information is corresponding.
When described resource is html resource, redirection mode is used to load described backup website information corresponding
Html resource.The process using redirection mode to load resource belongs to prior art, and the present embodiment repeats no more.
When described resource is css resource, the mode of document.head.appendChild is used to load described standby
The css resource that part website information is corresponding.The mode using document.head.appendChild loads the mistake of resource
Journey belongs to prior art, and the present embodiment repeats no more.
When described resource is js resource, the mode of document.head.appendChild is used to load described standby
The js resource that part website information is corresponding.The mode using document.head.appendChild loads the mistake of resource
Journey belongs to prior art, and the present embodiment repeats no more.
For different types of resource, by using different load modes to load described backup website information pair
The resource answered, improves resource loading efficiency.
The application embodiment of the present invention, it is possible to the resource after automatic decision has loaded is the most complete, when having loaded
When resource after one-tenth loads imperfect, it is possible to the backup website information automatically loading website information corresponding is corresponding
Resource, it is achieved that user loads imperfect at the webpage browsed, or when webpage loads the most out, it is not necessary to manually
Force to refresh browser rs cache and just can normally watch the purpose of webpage.
Embodiment four
The embodiment of the invention also discloses a kind of resource loading system, Fig. 3 provide for the embodiment of the present invention four one
Plant the structural representation of resource loading system, including: browser 310, first server 320 and second service
Device 330.
Described browser 310, including:
Load-on module 3101, for according to the user's website information obtained, loading described website information corresponding
Resource.
Detection module 3102, for detecting the integrity of the described resource after having loaded.
More new module 3103, if the described resource after having loaded is imperfect, then preserves according to self
Website information and the corresponding relation of backup website information, determine the backup website information that described website information is corresponding,
Load the resource that described backup website information is corresponding.
It should be noted that load-on module 3101, detection module 3102, more new module 3103 and embodiment
Load-on module 210 in two, the function of detection module 220, more new module 230 can be identical, this
In be not repeated describe in detail.
Described first server 320, including:
First transport module 3201, for according to described website information, providing described network address to described browser
The resource that information is corresponding.
According to website information, the resource providing described website information corresponding to described browser belongs to prior art,
The present embodiment repeats no more.
Backup information module 3202, for according to the website information backup mode preset, obtains each network address letter
The backup website information that breath is corresponding, and back up net to described in server backup corresponding to described backup website information
The resource that location information is corresponding;And default described website information backup mode is sent to browser.
Specifically, website information backup mode can be the regular backup mode of user's sets itself, with
It is easy to find backup website information and the resource backup of correspondence thereof.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, institute
State the resource consistence that the corresponding backup website information of website information is corresponding.
According to default website information backup mode, described website information backup mode can be a network address letter
The corresponding backup website information of breath, as shown in table 3, it is also possible to be that a website information correspondence is no less than one
Backup website information, as shown in table 4.
Table 3
Table 4
When the corresponding backup website information of a website information, by money corresponding for described backup website information
Source backups in server corresponding to described backup website information, the server that described backup website information is corresponding
Server that can be corresponding with website information is same server, for avoiding due to network environment and remotely taking
The former server resources that thus result in such as business device is unstable are imperfect, the server that described backup website information is corresponding
Server that can also be corresponding with website information is not same server, i.e. can also be by described backup network address
Resource backup corresponding to information is on other servers.
When a website information correspondence is no less than a backup website information, it is no less than a backup by described
Resource backup corresponding to website information in server corresponding to described backup website information, described is no less than one
Server corresponding to individual backup website information can be same server and the server corresponding with website information
Be same server, such as the server and the backup website information 2 that back up website information 1 correspondence in table 4 are corresponding
Server be to be all server 1, and server corresponding to website information is also server 1.Described it is no less than
One backup server corresponding to website information may not be same server and all corresponding with website information
Server be not same server, such as in table 4, server corresponding to website information is server 1,
The server of backup website information 1 correspondence is server 2, and the server of backup website information 2 correspondence is server
3.Described it be no less than a backup server corresponding to website information and may not be same server but part
Identical and corresponding with website information server is same server, such as, in table 4, website information is corresponding
Server is server 1, and the server of backup website information 1 correspondence is also server 1, backs up website information 2
Corresponding server is server 2.
To backing up the resource that website information is corresponding, institute described in the server backup that described backup website information is corresponding
State the resource consistence that the corresponding backup website information of website information is corresponding, and described backup website information pair
The resource answered can be corresponding with website information source synchronous update.
Described second server 330, including:
Second transport module 3301, for according to described backup website information, providing described backup to browser
The resource that website information is corresponding.
According to backup website information, the resource providing described backup website information corresponding to described browser belongs to
Prior art, the present embodiment repeats no more.
Application the present embodiment, according to default website information backup mode, obtains each website information corresponding
Backup website information, and to backing up website information pair described in server backup corresponding to described backup website information
The resource answered, when user uses browser to browse webpage, it is possible to the resource after automatic decision has loaded is
No completely, when the resource after having loaded loads imperfect, it is possible to automatically load corresponding standby of website information
The resource that part website information is corresponding, makes user load imperfect at the webpage browsed, or webpage loads the most out
Time, it is not necessary to hand-operated forced refreshing browser rs cache just can normally watch webpage.
For system and device embodiment, owing to it is substantially similar to embodiment of the method, so describe
Fairly simple, relevant part sees the part of embodiment of the method and illustrates.
It should be noted that in this article, the relational terms of such as first and second or the like be used merely to by
One entity or operation separate with another entity or operating space, and not necessarily require or imply these
Relation or the order of any this reality is there is between entity or operation.And, term " includes ", " comprising "
Or its any other variant is intended to comprising of nonexcludability, so that include the mistake of a series of key element
Journey, method, article or equipment not only include those key elements, but also other including being not expressly set out
Key element, or also include the key element intrinsic for this process, method, article or equipment.Do not having
In the case of more restrictions, statement " including ... " key element limited, it is not excluded that including described wanting
Process, method, article or the equipment of element there is also other identical element.
One of ordinary skill in the art will appreciate that all or part of step realizing in said method embodiment
The program that can be by completes to instruct relevant hardware, and described program can be stored in computer-readable
Take in storage medium, the storage medium obtained designated herein, such as: ROM/RAM, magnetic disc, CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit protection scope of the present invention.
All any modification, equivalent substitution and improvement etc. made within the spirit and principles in the present invention, are all contained in
In protection scope of the present invention.
Claims (10)
1. a resource loading method, it is characterised in that be applied to browser, described method includes:
According to the website information obtained, load the resource that described website information is corresponding;
The integrity of the described resource after having loaded is detected;
If the described resource after having loaded is imperfect, then the website information preserved according to self and backup network address
The corresponding relation of information, determines the backup website information that described website information is corresponding, loads described backup network address
The resource that information is corresponding.
Method the most according to claim 1, it is characterised in that described to the described money after having loaded
The integrity in source detects, including:
When described resource is html resource, it is judged that whether the end identification information of this resource exists;
When described resource is css resource, it is judged that whether the pattern of this resource last column meets the pattern preset
Requirement;
When described resource is js resource, it is judged that whether the end flag bit of this resource exists.
Method the most according to claim 1, it is characterised in that described loading described backup website information
Corresponding resource, including:
For different types of resource, different load modes is used to load described backup website information corresponding
Resource.
Method the most according to claim 3, it is characterised in that described for different types of resource,
The resource using different load modes to load described backup website information corresponding includes:
When described resource is html resource, redirection mode is used to load described backup website information corresponding
Html resource;
When described resource is css resource, the mode of document.head.appendChild is used to load described standby
The css resource that part website information is corresponding;
When described resource is js resource, the mode of document.head.appendChild is used to load described standby
The js resource that part website information is corresponding.
5. a resource charger, it is characterised in that be applied to browser, described device includes:
Load-on module, for loading, according to the user's website information obtained, the resource that described website information is corresponding;
Detection module, for detecting the integrity of the described resource after having loaded;
More new module, if the described resource after having loaded is imperfect, then the network address preserved according to self
Information and the corresponding relation of backup website information, determine the backup website information that described website information is corresponding, add
Carry the resource that described backup website information is corresponding.
Device the most according to claim 5, it is characterised in that described detection module specifically for:
When described resource is html resource, it is judged that whether the end identification information of this resource exists;
When described resource is css resource, it is judged that whether the pattern of this resource last column meets the pattern preset
Requirement;
When described resource is js resource, it is judged that whether the end flag bit of this resource exists.
Device the most according to claim 5, it is characterised in that described more new module, specifically for:
For different types of resource, different load modes is used to load described backup website information corresponding
Resource.
Device the most according to claim 7, it is characterised in that described more new module includes:
First updating block, for when described resource is html resource, uses redirection mode to load described standby
The html resource that part website information is corresponding;
Second updating block, for when described resource is css resource, uses
The mode of document.head.appendChild loads the css resource that described backup website information is corresponding;
3rd updating block, for when described resource is js resource, uses document.head.appendChild
Mode load the js resource that described backup website information is corresponding.
9. a resource loading system, it is characterised in that described system includes: browser, first server
And second server, wherein,
Described browser, for according to the user's website information obtained, loading the money that described website information is corresponding
Source;The integrity of the described resource after having loaded is detected;If the described resource after having loaded is not
Completely, then the website information preserved according to self and the corresponding relation of backup website information, determine described network address
The backup website information that information is corresponding, loads the resource that described backup website information is corresponding;
Described first server, for according to described website information, providing described network address letter to described browser
The resource that breath is corresponding;
Described second server, for according to described backup website information, providing described backup net to browser
The resource that location information is corresponding.
System the most according to claim 9, it is characterised in that described first server, specifically for
According to default website information backup mode, obtain the backup website information that each website information is corresponding, and to
The resource that website information is corresponding is backed up described in the server backup that described backup website information is corresponding;And will preset
Described website information backup mode be sent to browser.
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 true CN105956182A (en) | 2016-09-21 |
CN105956182B 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) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109788305A (en) * | 2018-12-10 | 2019-05-21 | 北京爱奇艺科技有限公司 | A kind of data cached method for refreshing and device |
CN109857649A (en) * | 2019-01-14 | 2019-06-07 | 珠海金山网络游戏科技有限公司 | A kind of resource testing method and system |
CN111639275A (en) * | 2019-03-01 | 2020-09-08 | 阿里巴巴集团控股有限公司 | Routing information processing method and 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 device |
-
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 device |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109788305A (en) * | 2018-12-10 | 2019-05-21 | 北京爱奇艺科技有限公司 | A kind of data cached method for refreshing and device |
CN109788305B (en) * | 2018-12-10 | 2021-03-02 | 北京爱奇艺科技有限公司 | Cache data refreshing method and device |
CN109857649A (en) * | 2019-01-14 | 2019-06-07 | 珠海金山网络游戏科技有限公司 | A kind of resource testing method and system |
CN111639275A (en) * | 2019-03-01 | 2020-09-08 | 阿里巴巴集团控股有限公司 | Routing information processing method and device, electronic equipment and computer storage medium |
CN111639275B (en) * | 2019-03-01 | 2023-04-25 | 阿里巴巴集团控股有限公司 | Routing information processing method, device, electronic equipment and computer storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN105956182B (en) | 2019-06-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105528408A (en) | Page display method and apparatus | |
US8225192B2 (en) | Extensible cache-safe links to files in a web page | |
JP6080866B2 (en) | Computerized method, system, and computer program for mapping one or more dynamic visual objects of a network document | |
CN107291519A (en) | A kind of cross-platform image cache implementation method of webview based on mobile terminal | |
EP3557437A1 (en) | Systems and methods for search template generation | |
WO2021002971A1 (en) | Revealing content reuse using coarse analysis | |
CN104615768B (en) | Same recognition methods of document and device | |
US20140310560A1 (en) | Method and apparatus for module repair in software | |
CN106980698A (en) | Browser static resource loading method, browser program and readable storage medium storing program for executing | |
CN105956030A (en) | WEB system and WEB request processing method | |
EP3528474B1 (en) | Webpage advertisement anti-shielding methods and content distribution network | |
CN105956182A (en) | Resource loading method, apparatus and system | |
US9294538B1 (en) | Dynamic content injection | |
CN106372179A (en) | Method and system for detecting document change and synchronization | |
CN103019556A (en) | Quick help information display system and quick help information display method | |
CN104899236A (en) | Comment information display method, comment information display device and comment information display system | |
EP3100154A1 (en) | Providing print view of document for editing in web-based application | |
CN105279029B (en) | A kind of local storage dynamic allocation method based on Activity Calculation resource | |
US20020166118A1 (en) | System and method for detecting dirty data fields | |
US8880547B1 (en) | Implementation of a search for items | |
JP2019511060A5 (en) | ||
CN106156291A (en) | The caching method of static resource and system thereof based on Localstroage | |
US9215280B2 (en) | Systems and methods for downloading multiple files | |
CN108363711B (en) | Method and device for detecting dark chain in webpage | |
CN109299423A (en) | A method of obtaining network data |
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 |