CN103699674B - Webpage preservation, webpage deployment method and device and Web browsing system - Google Patents

Webpage preservation, webpage deployment method and device and Web browsing system Download PDF

Info

Publication number
CN103699674B
CN103699674B CN201310749825.9A CN201310749825A CN103699674B CN 103699674 B CN103699674 B CN 103699674B CN 201310749825 A CN201310749825 A CN 201310749825A CN 103699674 B CN103699674 B CN 103699674B
Authority
CN
China
Prior art keywords
ajax
resources
webpage
request
url
Prior art date
Application number
CN201310749825.9A
Other languages
Chinese (zh)
Other versions
CN103699674A (en
Inventor
赵鸿彬
Original Assignee
优视科技有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 优视科技有限公司 filed Critical 优视科技有限公司
Priority to CN201310749825.9A priority Critical patent/CN103699674B/en
Publication of CN103699674A publication Critical patent/CN103699674A/en
Application granted granted Critical
Publication of CN103699674B publication Critical patent/CN103699674B/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The method and device opened with webpage is preserved the invention discloses a kind of webpage.In the webpage store method, after the instruction for preserving webpage is received, the page data of webpage is preserved with MHTML forms;And when webpage includes AJAX request, AJAX resources and AJAX request are preserved in the local database in association.And when webpage is opened, if producing AJAX request during loading webpage, locally obtaining corresponding AJAX resources.Using this method, when opening webpage, even at suspension state, AJAX resources are also maintain due to local, it is possible thereby to locally obtain AJAX resources, so as to solve under offline condition, cause the non-serviceable problem of part webpage function because the AJAX resources of AJAX request can not be obtained.

Description

Webpage preservation, webpage deployment method and device and Web browsing system

Technical field

The present invention relates to web page browsing field, more specifically, be related to a kind of webpage preserves and webpage is opened method and Device, and a kind of Web browsing system.

Background technology

Present webpage, which preserves form, substantially two kinds.

A kind of is the form of HTML+ child resources, is exactly to preserve current webpage into a html document, its picture, sample Formula table and script file etc. are all each preserved with a single file, and the path of the resource in html document will phase It is revised as with answering corresponding to the path for being saved in local file.

Another kind is the form of MHTML, exactly the web data packing of current page is saved in a file, webpage All data in the inside are all saved in same file, and it is not necessary to modify any page data.

The form of HTML+ child resources belongs to a kind of static preservation, can only preserve the generated content of current page.Such as Fruit partial content be by JS (JavaScript) generate if, when opening this html file of preservation, this part Content can regenerate, then the content of two parts of repetitions just occurs.This preservation form also has many problems, for example, some Domain name limitation has been done in website, such as Sina weibo, youku.com, it is impossible to is preserved webpage by this form.In addition, also have Limitation of base (basis) label etc., causes the webpage that preserves very big with the discrepancy of original webpage.

MHTML forms follow MHTML standards, and all initial data packings of webpage are saved among a file, are opened During file, the operation of the generation page can be re-executed, is not in thus asking present in the form of above-mentioned HTML+ child resources Topic.Because the page is to re-execute generation, so in the case of if in suspension, and this webpage partial content be according to Rely if AJAX (asynchronous JavaScript and XML) is requested to generate, then the page can not also be reduced to the appearance of the original page. And this problem for HTML+ child resources form without presence.

It is obvious that MHTML is more outstanding than the form of HTML+ child resource, but ask there is also the form is insurmountable Topic, that is, the content for relying on AJAX request, can not properly generate in the case of suspension.

The problem of original such, is influenced nor apparent.But with the expansion of business, problem becomes serious.For example, The combination of reading+offline video later is proposed on iPad2.0.The realization read later is exactly the guarantor using MHTML forms Form is deposited, more perfectly can be preserved all webpages.But add offline video and just go wrong.Many websites Video control video (video) labels generated by some AJAX request.If under offline condition, then this is regarded Frequency control can not generate, and then can not just play and be saved in local video offline.Therefore, this function is just as this is asked Topic and there is it is most great the defects of, i.e. webpage preserves, and video also preserves, and cannot but play offline.

The content of the invention

In view of the above problems, it is proposed that a kind of webpage store method and device, the webpage store method and device can be In the case that the webpage for needing to preserve includes AJAX request, except preserved with MHTML forms the webpage page data it Outside;Also the AJAX resources obtained based on the AJAX request and AJAX request will be stored in local data base in association In.

The invention also provides a kind of webpage deployment method and device, the webpage deployment method and device can be based on above-mentioned The web data and AJAX resources that mode preserves are browsed to be locally generated webpage.

The invention also provides a kind of Web browsing system, the Web browsing system can realize web page contents are carried out from Line browses.

According to an aspect of the invention, there is provided a kind of webpage store method, including:Instruction is preserved receiving webpage Afterwards, the page data of the webpage is preserved with MHTML forms;And in the case where the webpage includes AJAX request, will The AJAX resources obtained based on the AJAX request are preserved in the local database in association with AJAX request.

In one or more examples of above-mentioned aspect, the AJAX resource conservations obtained based on the AJAX request are existed It can include in local data base:In the case where the webpage includes AJAX request, create be used to preserve base in memory In the AJAX caching resources for the AJAX resources that the AJAX request obtains;The AJAX resources is related to the AJAX request It is stored in the AJAX caching resources connection;And the AJAX resources that will be preserved in the AJAX caching resources, with number It is saved in association in local data base according to the form and the AJAX request in storehouse.

In one or more examples of above-mentioned aspect, the AJAX request can include the URL addresses of AJAX resources, with And by the AJAX resource conservations in the step of AJAX caching resources and local data base, the AJAX resources and institute URL addresses are stated to preserve in association.

In one or more examples of above-mentioned aspect, it is described by the AJAX resource conservations in the AJAX caching resources And the step of local data base, performs in network adaptation layer.

According to another aspect of the present invention, there is provided a kind of webpage save set, including:Page data storage unit, is used In after receiving webpage and preserving instruction, the page data of the webpage is preserved with MHTML forms;And AJAX resource conservation lists Member, in the webpage include AJAX request in the case of, by the AJAX resources obtained based on the AJAX request with AJAX request preserves in the local database in association.

In one or more examples of above-mentioned aspect, the webpage save set can also include:AJAX caching resources Creating unit, in the case of including AJAX request in the webpage, creates be used to preserve based on described in memory AJAX request and the AJAX caching resources of AJAX resources obtained;AJAX caching resource storage units, for the AJAX to be provided Source and the AJAX request are stored in the AJAX caching resources in association, and the AJAX resource conservations unit by with The AJAX resources that will be preserved in the AJAX caching resources are set to, it is associated with the AJAX request in the form of database Ground is saved in local data base.

According to another aspect of the present invention, there is provided a kind of webpage deployment method, including:Browsed as described above receiving After the web page browsing instruction of the webpage of preservation, webpage loading is carried out based on the page data preserved with the MHTML forms;When When producing AJAX request when loading the webpage, AJAX resources corresponding with the AJAX request are read from local;And it is based on The page data loaded and read AJAX resources, generate the Webpage.

It is described that AJAX corresponding with the AJAX request is read from local in one or more examples of above-mentioned aspect Resource can include:Based on the AJAX request, AJAX resources corresponding with the AJAX request are read from local data base.

It is described that AJAX corresponding with the AJAX request is read from local in one or more examples of above-mentioned aspect Resource can include:In the case where local is there are the AJAX caching resources, based on the AJAX request, provided from the AJAX AJAX resources corresponding with the AJAX request are read in source cache.

In one or more examples of above-mentioned aspect, the AJAX request can include the URL addresses of AJAX resources, with And the AJAX resources and the URL addresses are stored in the local data base in association, and described read from local AJAX resources corresponding with the AJAX request are taken to include:Obtain what is preserved in local data base or AJAX caching resources The url list of all URL addresses of AJAX resources;URL addresses in the AJAX request, carry out the url list Complete matched and searched;When complete matched URL addresses are found in the url list, from the local data base or AJAX AJAX resources corresponding with the URL found are read in caching resource;Complete matched URL is not found in the url list During address, fuzzy matching lookup is carried out using the regular expression of the URL in the AJAX request;And finding unique one During bar matching result, read from the local data base or AJAX caching resources corresponding with the URL addresses found AJAX resources.

It is described to read AJAX moneys corresponding with the AJAX request from local in one or more examples of above-mentioned aspect The step of source, performs in network adaptation layer.

According to another aspect of the present invention, there is provided a kind of webpage device for opening, including:Page data loading unit, is used In receive browse the webpage preserved as described above web page browsing instruction after, based on the page preserved with the MHTML forms Face data carry out webpage loading;AJAX resource reading units, for when loading the webpage produce AJAX request when, from this Read AJAX resources corresponding with the AJAX request in ground;And auto-building html files unit, for based on the page data loaded And read AJAX resources, generate the Webpage.

In one or more examples of above-mentioned aspect, the AJAX resources reading unit is configured as being based on the AJAX Request, reads AJAX resources corresponding with the AJAX request from local data base.

It is described in the case where local is there are the AJAX caching resources in one or more examples of above-mentioned aspect AJAX resource reading units are configured as being based on the AJAX request, and being read from the AJAX caching resources please with the AJAX Seek corresponding AJAX resources.

In one or more examples of above-mentioned aspect, the AJAX request can include the URL addresses of AJAX resources, with And the AJAX resources are stored in the local data base in association with the URL addresses, and the AJAX resources are read Unit is taken to include:Url list acquiring unit, for obtaining the AJAX preserved in local data base or AJAX caching resources moneys The url list of all URL addresses in source;Complete matching unit, for the URL addresses in the AJAX request, to described Url list carries out complete matched and searched;First AJAX resource acquisition units, for finding complete in the url list During the URL addresses matched somebody with somebody, AJAX moneys corresponding with the URL found are read from the local data base or AJAX caching resources Source;Fuzzy matching unit, during for not finding complete matched URL addresses in the url list, uses the AJAX request In URL regular expression carry out fuzzy matching lookup;And the 2nd AJAX resource acquisition unit, for when in fuzzy matching When finding a unique matching result, the URL with being found is read from the local data base or AJAX caching resources Corresponding AJAX resources.

According to another aspect of the present invention, there is provided a kind of Web browsing system, including display unit, storage unit, such as The upper webpage save set and webpage device for opening as described above.

By using methods and apparatus of the present invention, in the case where the Webpage browsed includes AJAX request, i.e., Make to be in suspension state, also AJAX resources can be obtained in response to AJAX request in local, so as to locally realize offline Webpage browses.

In order to realize above-mentioned and related purpose, one or more aspects of the invention include will be explained in below and The feature particularly pointed out in claim.Some illustrative aspects of the present invention are described in detail in following explanation and attached drawing. However, some modes in the various modes that the principle of the present invention only can be used of these aspect instructions.It is in addition, of the invention It is intended to include all these aspects and their equivalent.

Brief description of the drawings

According to following detailed descriptions carried out referring to the drawings, above and other objects, features and advantages of the invention will become It must become apparent from.In the accompanying drawings:

Fig. 1 shows the overview flow chart of Web browser method according to the present invention;

Fig. 2 shows the schematic block diagram of Web browsing system according to the present invention;

Fig. 3 shows the indicative flowchart of webpage store method according to an embodiment of the invention;

Fig. 4 shows the indicative flowchart of webpage store method according to another embodiment of the present invention;

Fig. 5 shows the schematic block diagram of one embodiment of the webpage save set in Fig. 2;

Fig. 6 shows the schematic block diagram of another embodiment of the webpage save set in Fig. 2;

Fig. 7 is the schematic flow diagram of webpage deployment method according to an embodiment of the invention;

Fig. 8 schematically shows the method based on the URL in AJAX request from local data base reading AJAX resources and shows The flow chart of example;

Fig. 9 gives the flow chart of the modification of the webpage deployment method shown in Fig. 7;

Figure 10 is the schematic block diagram of one embodiment of the webpage device for opening in Fig. 2;With

Figure 11 shows the schematic block diagram of one embodiment of AJAX resources reading unit according to the present invention.

Identical label indicates similar or corresponding feature or function in all of the figs.

Embodiment

Various aspects of the disclosure is described below.It is to be understood that teaching herein can have in the form of varied Body embodies, and any concrete structure disclosed herein, function or both are only representational.Religion based on this paper Lead, those skilled in the art it is to be understood that one aspect disclosed herein can be realized independently of any other aspect, And two or more aspects in these aspects can combine in various manners.It is it is, for example, possible to use described in this paper Any number of aspect, realization device or puts into practice method.Further, it is possible to use other structures, function or except described here One or more aspects outside or be not one or more aspects described herein 26S Proteasome Structure and Function, realize this device Or put into practice this method.In addition, any aspect described herein can include at least one element of claim.

Before the embodiment of the present invention is described in detail, first the AJAX technologies involved in the present invention are carried out brief Explanation.

AJAX is Asynchronous JavaScript+XML(Asynchronous JavaScript and XML) abbreviation.AJAX skills Art is the organic assembling of a variety of development technique in fact, including:Standard interface is realized using XHTML and CSS technologies;Utilize Document Object Model technologies realize Dynamic Announce and interactive function;Data are realized using XML and XSLT technologies Exchange and safeguard;Realize that asynchronous data is retrieved using XMLHttpRequest technologies;And all are joined using JavaScript System gets up.

Traditional network program workflow is substantially as follows:Operation of the client on webpage is converted into HTTP request and passes clothes back Business device, and after server receives request and related data, parses data and send it to corresponding processing unit, it will return Data converting to HTML page return to client.This workflow always allows user not feel well, because at server When managing data, user can only wait.Obvious user does not like every after making single stepping, is required for waiting for server to return new Webpage, user desirably smoothly uses network program, or even the presence of imperceptible server.

AJAX technologies can break away from the network interaction mode of this stop-go, and the method for realization is AJAX in client and takes Insertion AJAX engine, AJAX engine is write with JavasSript between business device, is seen for being responsible for drafting client Interface and communicate with server.After session start, browser loads AJAX engine, rather than a webpage. The input of user can be sent to server by AJAX engine with the mode of asynchronous communication, so as to avoid user from look at blank Webpage waiting for server response.The operation of user can call the javascript functions of an AJAX engine, former This would generally trigger a HTTP request to server, and all responses to user's operation need not be again by server, such as Simple data inspection, modification data even searching web pages, engine can be handled.Returned if engine has to server Data are returned to respond the request of user, than the data submitted if desired for server process or load new code or data etc., Engine can send request by the way of asynchronous communication, usually with XML, so as to not interfere with interacting for user and program.

Each embodiment of the present invention is described below with reference to accompanying drawings.

Web browser method and system

Fig. 1 shows the overview flow chart of Web browser method according to an embodiment of the invention.

As shown in Figure 1, first, URL, or the point on webpage are inputted in address field in step S10, such as in response to user Link is hit, after the page data that webpage is loaded from network, the page data loaded is saved in local, such as with webpage In the storage unit of the terminal device of function of browse, the terminal device such as includes desktop computer, laptop, intelligence Mobile terminal, the IPad of Apple Inc., personal digital assistant etc..Page loading flow can be as usual manner, Ke Yi Performed in browser kernel such as WebKit kernels.Details are not described herein.Step is preserved on webpage, will be below in reference to Fig. 3 It is described in detail with Fig. 4.

After webpage executed as described above preservation, if necessary to carry out off-line browsing, then in step S20, protected in response to opening The web page browsing instruction for the webpage deposited, opens the webpage locally preserved.Illustrated below with reference to Fig. 8 to Fig. 9.

Fig. 2 shows the schematic block diagram of Web browsing system 1 according to an embodiment of the invention.

As shown in Fig. 2, Web browsing system 1 include webpage save set 10, webpage device for opening 20, storage unit 30 with And display unit 40.

Webpage save set 10 is configured as after the page data of webpage is loaded from network, the page number that will be loaded According to being saved in local, such as the storage unit 30 of the terminal device with web page browsing function.On webpage save set 10, It will be described in more detail as follows with reference to Fig. 5 and Fig. 6.

Webpage device for opening 20 is configured as after the web page browsing for opening preserved webpage instruction is received, and opens this Ground(Such as in the storage unit of terminal device or the local data base of caching)The webpage of preservation.On webpage device for opening 20, To more specifically it be described with reference to Figure 10 and Figure 11 as follows.

Storage unit 30 can include high-speed random access memory, can also include nonvolatile memory, such as one A or multiple magnetic disk storages, flash memory device or other solid-state, non-volatile memories.Storage unit 30 is configured as preserving The page data of webpage, AJAX resources corresponding with the AJAX request included in webpage.Display unit 40 is used to show webpage number According to.

It will be clear that webpage save set 10 and webpage device for opening 20 can utilize hardware realization, can also Realized using software, or realization can be combined using software and hardware.For example webpage save set 10 and webpage open dress Putting 20 can be realized using one or more processors.In this case, storage unit 30 is additionally configured to preservation and is used for Perform the application program of the function of webpage save set 10 and webpage device for opening 20.One or more processors are configured as After receiving webpage preservation instruction or webpage open instructions, the corresponding application programs preserved in storage unit 30 are called to realize net Page preserves or webpage is opened, so as to fulfill the function of webpage save set 10 and webpage device for opening 20.

Webpage store method and webpage save set

The webpage specifically described below with reference to Fig. 3 to Fig. 4 in Fig. 1 preserves step.Fig. 3 shows reality according to the present invention Apply the indicative flowchart of the webpage store method of example;Fig. 4 shows webpage preservation side according to another embodiment of the present invention The indicative flowchart of method.

As shown in figure 3, in step s 110, instruction is preserved when receiving webpage after webpage is loaded from network, then with The page data of the webpage is stored in local storage unit 30 by MHTML forms.

Then, in the step s 120, judge whether preserved webpage includes AJAX request.In the webpage preserved not During comprising AJAX request, flow terminates.The AJAX request is a request in browser application, its core is Xmlhttprequest, this request do not have to refresh page.

When AJAX request is included in the webpage preserved, in step S130, it will be obtained based on the AJAX request AJAX resources are stored in local in association with AJAX request, for example are stored in local storage unit.The AJAX resources It can be when loading webpage from network, be downloaded by network from the web page server for storing AJAX resources.It is alternatively, described What AJAX resources can also be obtained by other approach from web page server.

Here, AJAX resources can be the data that broadcasting with content-data is related.For example, it is in video in content-data In the case of appearance, AJAX resources can be video (video) label of video content.Video tab can be related to some of video Attribute etc..When playing video content, it is necessary to obtain video tab.

Here, the AJAX request can include the URL addresses of AJAX resources, and the URL addresses instruction is used to obtain The network address of AJAX resources.The AJAX resources can be stored in storage unit with the AJAX request in the form of database In 30 local data base.For an AJAX resource, database has two fields key and value, and field key is AJAX The URL addresses of resource, field value are corresponding data, i.e. AJAX resources.In this way, included in AJAX request is parsed In URL addresses, it is possible to search corresponding AJAX resources in the local database.

In addition, above-mentioned webpage store method can enable multi-process to realize, for example page number is preserved using a process According to, and another process is enabled to perform the preservation of AJAX resources.In this case, step S110 can with step S120, S130 is performed parallel, can also be performed successively in any order.

Fig. 4 shows the indicative flowchart of webpage store method according to another embodiment of the present invention.Shown in Fig. 4 Embodiment be the embodiment to being shown in Fig. 3 improvement.Compared with Fig. 3, the difference of the embodiment shown in Fig. 4 is only It is identical in the step S130 in Fig. 3 is replaced using step S131, S133 and S135, other steps.In order to illustrate simplicity, Only difference is illustrated herein.

As shown in figure 4, when including AJAX request in judging preserved webpage, in step S131, create in memory Build the AJAX caching resources for preserving the AJAX resources obtained based on the AJAX request.Then, in step S133, by institute AJAX resources are stated to be stored in association in the AJAX caching resources with the AJAX request.Then, in step S135, by institute The AJAX resources preserved in AJAX caching resources are stated, are saved in association with the AJAX request in the form of database In local data base.

According to this embodiment, AJAX request is included in the webpage newly loaded in the method for opening the webpage locally preserved In the case of, by the AJAX cachings of the AJAX caching resources obtained based on AJAX request in memory.In one example, may be used To be all buffered in for the AJAX resources obtained in all pages based on AJAX request in AJAX cachings.In another example, It can just enable AJAX cachings only in the case where user have issued webpage preservation instruction, these AJAX caching resources existed In AJAX cachings.So, it is possible to reduce the consumption to memory.It can be by directly selecting preservation by user that webpage, which preserves instruction, The instruction of webpage and initiate or in response to it is other instruction and activate.

Here, it is further illustrated with case of WebKit.The buffer structure of WebKit is such: MemoryCache->AppCache->HTTPCache.AJAX cachings can be created between AppCache and HTTPCache AJAXCache, for caching AJAX resources.Realized since the AJAX is buffered in network layer, so it is not necessary to modify WebKit's Code.

In addition, in order to save memory headroom, in the embodiment shown in figs. 3 and 4, can also delay including AJAX resources Deposit situation step.For example it can be emptied all relevant with the browser window in AJAX caching resources after browser window closing AJAX resources.Alternatively, can be after by AJAX resource conservations into local data base or when in response to webpage advance or net Page retreat instruction and again network loading webpage when, empty AJAX caching in cached correspond to webpage all AJAX money Source.

In addition, the step of AJAX resources are preserved in step S133 can perform in network adaptation layer, so can be to avoid Modify to WebKit.Certainly, what is included in the above method can also perform in other layers respectively.

Fig. 5 shows the schematic block diagram of webpage save set 10 according to an embodiment of the invention.

As shown in figure 5, webpage save set 10 includes page data storage unit 110 and AJAX resource conservations unit 120.

Page data storage unit 110 is used for after receiving webpage and preserving instruction, and the webpage is preserved with MHTML forms Page data.AJAX resource conservations unit 120 is used in the webpage in the case of including AJAX request, will be based on described AJAX request and the AJAX resources that obtain preserve in the local database in association with AJAX request.

In another example of the present invention, webpage save set 10 can also include the first judging unit(It is not shown), use In judging whether include AJAX request in the webpage.

Corresponding with the webpage store method shown in Fig. 4, in another embodiment of the invention, webpage save set 10 is also It can include AJAX caching resources creating unit 130 and AJAX caching resources storage unit 140.

AJAX caching resources creating unit 130 is used in the case where the webpage includes AJAX request, in memory Create the AJAX caching resources for being used for preserving the AJAX resources obtained based on the AJAX request.AJAX caching resources preserve single Member 140 is used to the AJAX resources and the AJAX request being stored in association in the AJAX caching resources.Then, The AJAX resources that AJAX resource conservations unit will preserve in the AJAX caching resources, in the form of database with it is described AJAX request is saved in local data base in association.

Similarly, in order to save memory headroom, in addition AJAX caching resources can also be provided empty unit(Do not show in figure Go out).For example AJAX caching resources empty unit and can be configured as after browser window closing, empty in AJAX caching resources All and relevant AJAX resources of the browser window.It can be configured as alternatively, AJAX caching resources empty unit by AJAX Instructed and loading net of networking again after resource conservation is into local data base or when being retreated in response to webpage advance or webpage During page, all AJAX resources corresponding to webpage cached in AJAX cachings are emptied.

In the example of the present invention, can just it be enabled only in the case where user have issued webpage preservation instruction AJAX is cached, by these AJAX caching resources in AJAX cachings.So, it is possible to reduce the consumption to memory.Webpage, which preserves, to be referred to Order can be by by user directly select preserve webpage instruction and it is initiating or in response to it is other instruction and activate 's.In this case, webpage save set 10 can also include webpage preservation instruction activation unit(It is not shown).Webpage preserves Instruction activation unit is configured to respond to preserve the instruction of the content-data in page data, and activation preserves the instruction of webpage.

Webpage deployment method and webpage device for opening

Webpage deployment method and webpage device for opening according to an embodiment of the invention are described below with reference to Fig. 7 to Figure 11.

Fig. 7 is the schematic flow diagram of webpage deployment method according to an embodiment of the invention.

As shown in fig. 7, in step S210, the webpage that browses webpage store method as shown in Figure 3 and preserve is being received Web page browsing instruction after, based on is preserved with the MHTML forms page data progress webpage loading.Then, in step S220, judges when loading the webpage, if produces AJAX request.If not producing AJAX request, flow terminates.

, then, please with the AJAX from local read in step S230 when AJAX request is produced when loading the webpage Seek corresponding AJAX resources.Here, in one example, reading AJAX resources corresponding with the AJAX request from local can With including:Based on the AJAX request, AJAX resources corresponding with the AJAX request are read from local data base.Alternatively, In another example, in the case where local is there are the AJAX caching resources, described read from local please with the AJAX Corresponding AJAX resources are asked to include:Based on the AJAX request, read and the AJAX from the AJAX caching resources Ask corresponding AJAX resources.Here, it can perform in network adaptation layer from the local operation for reading AJAX resources, thus may be used Modify to avoid to WebKit codes.

Then, in step S240, based on the page data and read AJAX resources loaded, webpage page is generated Face.

In addition, the AJAX request can include the URL addresses of AJAX resources, and the AJAX resources and the URL Address is stored in the local data base in association.Fig. 8 is schematically shown based on the URL in AJAX request from local Database reads the exemplary flow chart of method of AJAX resources.

As shown in figure 8, when producing AJAX request when judging to load webpage, first, in step S2310, obtain local The url list of all URL addresses of the AJAX resources preserved in database or AJAX caching resources.Then, in step S2320 and S2330, the URL addresses in the AJAX request, complete matched and searched is carried out to the url list.

Complete matched URL addresses are found in the url list(The result of step S2340 is yes)When, then in step Rapid S2340, reads AJAX resources corresponding with the URL found from the local data base or AJAX caching resources, and Acquired AJAX resources are returned into browser kernel(Such as Webkit kernels)To be rendered(Step S2350).

Complete matched URL addresses are not found in the url list(The result of step S2340 is no)When, using institute The regular expression for stating the URL in AJAX request carries out fuzzy matching lookup, and in step S2370, judges whether Matching result.

If there is no matching result(The result of step S2370 is no), then empty data are returned.If there is matching result (The result of step S2370 is yes), then in step S2380, judge existing matching result whether more than one.

If find a unique matching result(The result of step S2380 is no), then back to step S2340, from AJAX resources corresponding with the URL addresses found are read in local data base or the AJAX caching resource.If search The matching result arrived more than one(The result of step S2380 is yes), then empty data are returned.

Further, since AJAX resources are the resource of dynamic requests in itself, in most cases, the URL addresses of request are also Dynamic change, so when initiating inquiry, domain name judgement can be first carried out, is then matched completely, carried out again in matching not Regular expression fuzzy matching is with raising efficiency and hit rate.

By using the AJAX resources from local data base, the correlation that corresponding AJAX request is sent in the page can be performed Task.In the case of the broadcasting video being generally noted above, AJAX resources are video tab.There is video tab, it is possible to play The video frequency program of local is stored.

Thus, in the case of suspension, can also be responded using the AJAX resources preserved in the local database AJAX request in webpage, so as to perform the inter-related task on webpage.In the example of offline video, in response to AJAX request, Video tab is obtained from local data base, so that in the case of no networking, can also normally play video offline.

Being stored in local webpage can open in the case of no networking, can also be opened under networking state. Under networking state, AJAX resources can be preferably obtained from network.In this way, when the AJAX resources on network change, The AJAX resources after renewal can be timely used.

Fig. 9 gives the flow chart of the modification of the webpage deployment method shown in Fig. 7.Compared with Fig. 7, the reality that is shown in Fig. 9 The difference for applying example is only in that and adds step S940 and step S950, and other steps are identical with Fig. 7.Herein only Only to the step S940 and step S950 of increase illustrate.

As shown in figure 9, judging in step S220 after producing AJAX request when loading webpage, in step S940, sentence Whether the disconnected terminal device for carrying out web page browsing is currently in networking state.If being in networking state, in step S950, lead to Cross network and obtain AJAX resources.Then, flow proceeds to step S240.

If being in suspension state, proceed to step S230, AJAX resources corresponding with AJAX request are read from local. Then, flow proceeds to step S240.

Figure 10 is the schematic block diagram of one embodiment of the webpage device for opening 20 in Fig. 2.As shown in Fig. 2, webpage Device for opening 20 includes page data loading unit 210, AJAX resources reading unit 220 and auto-building html files unit 230.

Page data loading unit 210 is for receiving the net for browsing webpage store method as shown in Figure 3 and preserving After the web page browsing instruction of page, webpage loading is carried out based on the page data preserved with the MHTML forms.AJAX resources are read It is corresponding with the AJAX request from local reading when unit 220 is used to produce AJAX request when loading the webpage AJAX resources.Auto-building html files unit 230 is used to, based on the page data and read AJAX resources loaded, generate webpage The page.

In the example of the present invention, the AJAX resources reading unit can be configured as please based on the AJAX Ask, AJAX resources corresponding with the AJAX request are read from local data base to generate the webpage.

In another example of the present invention, in the case where local is there are the AJAX caching resources, the AJAX resources Reading unit can be configured as based on the AJAX request, be read and the AJAX request pair from the AJAX caching resources The AJAX resources answered.

In addition, in another example of the present invention, webpage device for opening 20 can also include the second judging unit(Do not show Go out), for judging whether produce AJAX request when loading webpage.

In addition, the AJAX request can include the URL addresses of AJAX resources, and the AJAX resources and the URL Address is stored in the local data base in association.Figure 11 shows AJAX resources reading unit 220 according to the present invention One embodiment schematic block diagram.

As shown in figure 11, AJAX resources reading unit 220 can include url list acquiring unit 2210, completely matching list Member 2220, fuzzy matching unit 2230, the first AJAX resource acquisitions unit 2240 and the 2nd AJAX resource acquisitions unit 2250.

Url list acquiring unit 2210 is for obtaining the AJAX resources preserved in local data base or AJAX caching resources The url list of all URL addresses.Complete matching unit 2220 is used for the URL addresses in the AJAX request, to described Url list carries out complete matched and searched.When complete matched URL addresses are found in the url list, the first AJAX resources Acquiring unit 2240 reads AJAX resources corresponding with the URL found from the local data base or AJAX caching resources.

When not finding complete matched URL addresses in the url list, fuzzy matching unit 2230 uses the AJAX The regular expression of URL in request carries out fuzzy matching lookup.A unique matching result is found when in fuzzy matching When, the 2nd AJAX resource acquisitions unit 2250 reads the URL with being found from the local data base or AJAX caching resources Corresponding AJAX resources.Matching result is not found when in fuzzy matching or the matching result found is more than one Bar, then return to empty data.

In the present invention, by one AJAX buffer of addition, the resource of the AJAX request of particular webpage is cached, When preserving webpage, also these AJAX resources are also together preserved, then local also to maintain in the case of suspension A data, it is possible to solve under offline condition, cause some webpage functions not because the resource of AJAX request can not be obtained The problem of using.Like this, the defects of offline video can not play under offline condition can also be solved.

Example

An application example of the invention is briefly described below.

The combination of reading+offline video later is proposed for iPad2.0.The realization read later is exactly to use MHTML The preservation form of form, more ideally can preserve all webpages.But add offline video and just go wrong. Video control video (video) label of many websites is generated by some AJAX request, if under offline condition, that This video control can not generate, then can not just play offline to local video.Therefore, this function just as this Problem there is it is most great the defects of, webpage preserves, and video also preserves, and cannot but play offline.

According to the present invention it is possible to ensure also get in the case of suspension by establishing an AJAXCache AJAX resources.

1) in the page with video, such as youtube, the offline foradownloaded video of small tv is clicked on.While downloading offline video Also current page can be added in reading later and is preserved.

2) AJAXCache is opened to the page, the AJAX resources of all requests retain a data in AJAXCache.

3) when the page, on backstage, loading is completed, and is preserved page data to locally, while is preserved corresponding in AJAXCache AJAX resources after preserving successfully, empty these cache resources releasing memories to locally.

4) under offline condition, offline video is opened, the local page for reading preservation later can be opened.Mistake of the page in loading Cheng Zhong, can produce AJAX request, database data cached inquiry AJAX, searches corresponding data, if so, then returning.

5) local page can get AJAX resources in the case of suspension, then all the elements in the page are all It can properly generate.

6) offline regarding to local like this, can be played directly on local youtube video pages are saved in Frequently, because video labels can properly generate.

By the above method, solve the problems, such as that offline video can not be played under suspension state.

In addition, the method according to the invention is also implemented as by the processor in mobile terminal(Such as CPU)Perform Computer program, and store in a memory in the mobile terminal.When the computer program is executed by processor, sheet is performed The above-mentioned function of being limited in the method for invention.

In addition, the method according to the invention is also implemented as a kind of computer program product, the computer program product Including computer-readable medium, be stored with the computer-readable medium for perform the present invention method in limit it is above-mentioned The computer program of function.

In addition, above method step and system unit can also utilize controller and for storing so that controller is real The computer readable storage devices of the computer program of existing above-mentioned steps or Elementary Function are realized.

Those skilled in the art will also understand is that, with reference to the described various illustrative logical blocks of disclosure herein, mould Block, circuit and algorithm steps may be implemented as the combination of electronic hardware, computer software or both.It is hard in order to clearly demonstrate This interchangeability of part and software, with regard to various exemplary components, square, module, circuit and step function to its into General description is gone.This function is implemented as software and is also implemented as hardware depending on concrete application and application Design constraint to whole system.Those skilled in the art can realize described in a variety of ways for every kind of concrete application Function, but this realize that decision should not be interpreted as causing a departure from the scope of the present.

Although content disclosed above shows the exemplary embodiment of the present invention, it should be noted that without departing substantially from power On the premise of profit requires the scope of the present invention of restriction, it may be many modifications and change.It is real according to invention described herein The function, step and/or action for applying the claim to a method of example are not required to perform with any particular order.In addition, the although present invention Element can describe or require in the form of individual, be unless explicitly limited odd number it is also contemplated that multiple.

Although describe each embodiment according to the present invention above with reference to figure to be described, people in the art Member can also do it should be appreciated that each embodiment proposed to the invention described above on the basis of present invention is not departed from Go out various improvement.Therefore, protection scope of the present invention should be determined by the content of appended claims.

Claims (16)

1. a kind of webpage store method, this method include:
Instruction in response to the content-data for preserving the content that can be played on webpage, activation webpage preserve instruction;
Preserve and instruct in response to the webpage, the page data of the webpage is preserved with MHTML forms;And
In the case where the webpage includes AJAX request, the AJAX resources and AJAX that will be obtained based on the AJAX request Request preserves in the local database in association, and the AJAX resources are the data related with the broadcasting of the content-data.
2. webpage store method according to claim 1, wherein, the AJAX resources that will be obtained based on the AJAX request Preservation includes in the local database:
In the case where the webpage includes AJAX request, create be used to preserve based on the AJAX request and obtain in memory The AJAX caching resources of the AJAX resources taken;
The AJAX resources and the AJAX request are stored in the AJAX caching resources in association;And
The AJAX resources that will be preserved in the AJAX caching resources, it is associated with the AJAX request in the form of database Ground is saved in local data base.
3. webpage store method according to claim 2, wherein, the AJAX request is with including the URL of AJAX resources Location, and by the AJAX resource conservations in the step of AJAX caching resources and local data base, AJAX money Source preserves in association with the URL addresses.
4. the webpage store method according to any one of claims 1 to 3, wherein, will be based on the AJAX request and The AJAX resource conservations of acquisition are performed in network adaptation layer the local data base the step of.
5. a kind of webpage save set, which includes:
Network instruction activates unit, for the instruction of the content-data in response to preserving the content that can be played on webpage, activation Webpage preserves instruction;
Page data storage unit, instructs for being preserved in response to the webpage, and the page of the webpage is preserved with MHTML forms Data;And
AJAX resource conservation units, in the case of including AJAX request in the webpage, will be based on the AJAX request And the AJAX resources obtained preserve in the local database in association with AJAX request, the AJAX resources are and the content Data play related data.
6. webpage save set according to claim 5, further includes:
AJAX caching resource creating units, in the case of including AJAX request in the webpage, create use in memory In the AJAX caching resources for preserving the AJAX resources obtained based on the AJAX request;
AJAX caching resource storage units, it is described for the AJAX resources and the AJAX request to be stored in association In AJAX caching resources, and
The AJAX resource conservations unit is configured as the AJAX resources that will be preserved in the AJAX caching resources, with data The form in storehouse is saved in local data base in association with the AJAX request.
7. a kind of webpage deployment method, this method include:
After the web page browsing for browsing the webpage preserved as claimed in claim 1 instruction is received, based on the MHTML forms The page data of preservation carries out webpage loading;
When AJAX request is produced when loading the webpage, AJAX resources corresponding with the AJAX request are read from local, The AJAX resources are the related data of the broadcasting of the content-data of the content with that can be played on webpage;And
Based on the page data and read AJAX resources loaded, Webpage is generated, plays the content-data.
8. webpage deployment method according to claim 7, wherein, it is described to be read and the AJAX request pair from local The AJAX resources answered include:
Based on the AJAX request, AJAX resources corresponding with the AJAX request are read from local data base.
9. webpage deployment method according to claim 7, wherein, the reading from local is corresponding with the AJAX request AJAX resources include:
In the case where local is there are the AJAX caching resources, based on the AJAX request, from the AJAX caching resources Read AJAX resources corresponding with the AJAX request.
10. webpage deployment method according to claim 8 or claim 9, wherein, the AJAX request includes the URL of AJAX resources Address, and the AJAX resources are stored in the local data base in association with the URL addresses, and
The reading AJAX resources corresponding with the AJAX request from local include:
Obtain the url list of all URL addresses of the AJAX resources preserved in local data base or AJAX caching resources;
URL addresses in the AJAX request, complete matched and searched is carried out to the url list;
When complete matched URL addresses are found in the url list, from the local data base or AJAX caching resources Read AJAX resources corresponding with the URL found;
When not finding complete matched URL addresses in the url list, the canonical table of the URL in the AJAX request is used Fuzzy matching lookup is carried out up to formula;And
When finding a unique matching result, read from the local data base or AJAX caching resources with being found The corresponding AJAX resources in URL addresses.
11. the webpage deployment method according to any one in claim 7 to 9, wherein, it is described from it is local read with it is described The step of AJAX request corresponding AJAX resources, performs in network adaptation layer.
12. a kind of webpage device for opening, which includes:
Page data loading unit, for receiving the web page browsing for browsing the webpage preserved as claimed in claim 1 instruction Afterwards, webpage loading is carried out based on the page data preserved with the MHTML forms;
AJAX resource reading units, during for producing AJAX request when loading the webpage, from it is local read with it is described The corresponding AJAX resources of AJAX request, the AJAX resources are the related numbers of the broadcasting of the content-data with that can be played on webpage According to;And
Auto-building html files unit, for based on the page data and read AJAX resources loaded, generating Webpage, broadcasting Put the content-data.
13. webpage device for opening according to claim 12, wherein, the AJAX resources reading unit is configured as base In the AJAX request, AJAX resources corresponding with the AJAX request are read from local data base to generate the webpage.
14. webpage device for opening according to claim 12, wherein, locally there is a situation where the AJAX caching resources Under, the AJAX resources reading unit is configured as being based on the AJAX request, reading and institute from the AJAX caching resources State the corresponding AJAX resources of AJAX request.
15. the webpage device for opening according to claim 12 or 13, wherein, the AJAX request includes AJAX resources URL addresses, and the AJAX resources are stored in the local data base in association with the URL addresses, and
The AJAX resources reading unit includes:
Url list acquiring unit, for obtaining all URL of the AJAX resources preserved in local data base or AJAX caching resources The url list of address;
Complete matching unit, for the URL addresses in the AJAX request, carries out the url list matching completely and looks into Look for;
First AJAX resource acquisition units, during for finding complete matched URL addresses in the url list, from described AJAX resources corresponding with the URL found are read in local data base or AJAX caching resources;
Fuzzy matching unit, please using the AJAX during for not finding complete matched URL addresses in the url list The regular expression of URL in asking carries out fuzzy matching lookup;And
2nd AJAX resource acquisition units, during for finding a unique matching result when in fuzzy matching, from described AJAX resources corresponding with the URL found are read in ground database or AJAX caching resources.
16. a kind of Web browsing system, including:
Display unit, for showing web page contents;
Storage unit;
Webpage save set as described in claim 5 or 6;And
Webpage device for opening as described in any one in claim 12 to 15.
CN201310749825.9A 2013-12-31 2013-12-31 Webpage preservation, webpage deployment method and device and Web browsing system CN103699674B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310749825.9A CN103699674B (en) 2013-12-31 2013-12-31 Webpage preservation, webpage deployment method and device and Web browsing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310749825.9A CN103699674B (en) 2013-12-31 2013-12-31 Webpage preservation, webpage deployment method and device and Web browsing system

Publications (2)

Publication Number Publication Date
CN103699674A CN103699674A (en) 2014-04-02
CN103699674B true CN103699674B (en) 2018-04-13

Family

ID=50361202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310749825.9A CN103699674B (en) 2013-12-31 2013-12-31 Webpage preservation, webpage deployment method and device and Web browsing system

Country Status (1)

Country Link
CN (1) CN103699674B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138312B (en) * 2014-06-05 2018-07-03 阿里巴巴集团控股有限公司 A kind of table generation method and device
CN105681380B (en) * 2014-11-20 2019-09-03 阿里巴巴集团控股有限公司 Client off-line method and its system
CN104965848B (en) * 2015-02-12 2018-01-23 腾讯科技(深圳)有限公司 A kind of front end resource loading method and device
CN104866591B (en) * 2015-05-29 2020-05-15 珠海豹趣科技有限公司 Video recommendation method and device
CN105447089B (en) * 2015-11-06 2019-05-07 百度在线网络技术(北京)有限公司 Search results pages display methods and device
CN105592166A (en) * 2016-03-07 2016-05-18 福建宏天信息产业有限公司 HTML5 video file persistent processing method and HTML5 video file persistent processing system of mobile platform
CN107193834A (en) * 2016-03-15 2017-09-22 广州市动景计算机科技有限公司 Computing device, device and method for browsing pages
CN108153778A (en) * 2016-12-05 2018-06-12 腾讯科技(深圳)有限公司 Webpage store method, webpage read method and device
CN107704605A (en) * 2017-10-13 2018-02-16 北京中教在线科技有限公司 It is a kind of based on the user behavior recording method being locally stored
CN107766509A (en) * 2017-10-23 2018-03-06 北京京东尚科信息技术有限公司 A kind of method and apparatus of webpage static backup

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030105745A1 (en) * 2001-12-05 2003-06-05 Davidson Jason A. Text-file based relational database
CN100504870C (en) * 2006-09-05 2009-06-24 腾讯科技(深圳)有限公司 Web page content revealing method and customer terminal device
JP2008165432A (en) * 2006-12-27 2008-07-17 Fujitsu Ltd Query control program, query control device and query control method
CN101441631A (en) * 2007-11-19 2009-05-27 上海新纳广告传媒有限公司 Data access method for asynchronous web page browsing
CN103106216A (en) * 2011-11-15 2013-05-15 腾讯科技(深圳)有限公司 Method and device of web page access
CN102662966B (en) * 2012-03-08 2014-01-01 中国科学院计算机网络信息中心 Method and system for obtaining subject-oriented dynamic page content
CN103064989B (en) * 2013-02-03 2016-05-04 广州市动景计算机科技有限公司 Webpage preservation, deployment method and device
CN103186670B (en) * 2013-03-27 2016-04-13 北京中金云网科技有限公司 A kind of method and system of complete collection info web

Also Published As

Publication number Publication date
CN103699674A (en) 2014-04-02

Similar Documents

Publication Publication Date Title
JP6272933B2 (en) Remote browsing session management
US9195750B2 (en) Remote browsing and searching
US9514405B2 (en) Scoring concept terms using a deep network
US9690830B2 (en) Gathering and contributing content across diverse sources
US9898542B2 (en) Narration of network content
CA2840416C (en) Remote browsing session management
US9826052B2 (en) Web page content loading control method and device
RU2618910C2 (en) Method and device for displaying information
US8335837B2 (en) Transferring data between applications
US20200193081A1 (en) Automated augmentation of text, web and physical environments using multimedia content
KR101824222B1 (en) Fast rendering of websites containing dynamic content and stale content
US10013502B1 (en) Preloading resources of a web page
CN103218434B (en) A kind of method and apparatus loading static resource
US10585952B2 (en) Systems and methods for determining content popularity based on searches
KR20150107840A (en) Indexing application pages of native applications
US9141595B2 (en) Contextual commenting on the web
US7437312B2 (en) Method for context personalized web browsing
US7606794B2 (en) Active Abstracts
CN103221951B (en) Predictive query suggestion caching
TWI613555B (en) Search method and device
US10754917B2 (en) Method and system for displaying customized webpage on double webview
KR100330620B1 (en) An apparatus and method for retrieving information using standard objects
US8578261B1 (en) Active preview of hyperlink content in browser supported file-format
US20150363504A1 (en) Dynamically identifying and evaluating component hierarchy for rendering content components on a webpage
US8849802B2 (en) Historical browsing session management

Legal Events

Date Code Title Description
PB01 Publication
C06 Publication
SE01 Entry into force of request for substantive examination
C10 Entry into substantive examination
CB02 Change of applicant information

Address after: 100083, Haidian District, Beijing, Fu Cheng Road, No. 28 excellent building, block A, floor 12

Applicant after: Excelle View Technology Co., Ltd.

Address before: 100080 Beijing City, Haidian District Suzhou Street No. 29 building 16 room 10-20 Scandinavia

Applicant before: Excelle View Technology Co., Ltd.

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant