CN108153778A - Webpage store method, webpage read method and device - Google Patents

Webpage store method, webpage read method and device Download PDF

Info

Publication number
CN108153778A
CN108153778A CN201611105483.7A CN201611105483A CN108153778A CN 108153778 A CN108153778 A CN 108153778A CN 201611105483 A CN201611105483 A CN 201611105483A CN 108153778 A CN108153778 A CN 108153778A
Authority
CN
China
Prior art keywords
webpage
unit
plug
web page
communication network
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
Application number
CN201611105483.7A
Other languages
Chinese (zh)
Other versions
CN108153778B (en
Inventor
刘强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201611105483.7A priority Critical patent/CN108153778B/en
Publication of CN108153778A publication Critical patent/CN108153778A/en
Application granted granted Critical
Publication of CN108153778B publication Critical patent/CN108153778B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions

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

The invention discloses a kind of webpage store method, webpage read method and devices, belong to Internet technical field.The method includes:It receives and instruction is preserved to the offline of target webpage;The interactive relation for at least two page data contents that plug-in unit is obtained in target webpage is preserved by webpage, interactive relation is used to indicate switch logic of the page data content when receiving user's operation;Plug-in unit is preserved by webpage, at least two page data contents in target webpage and interactive relation are saved as into predetermined webpage file.The present invention is solved in the H5 webpages that offline reading preserves, it is only able to display a page data content of the H5 webpages, the interactive operation according to user and page data content is unable to come the problem of switching to other page data contents of the H5 webpages, so that user can be switched to other page data contents when reading the webpage preserved offline by the interactive operation with page data content.

Description

Webpage store method, webpage read method and device
Technical field
The present embodiments relate to Internet technical field, more particularly to a kind of webpage store method, webpage read method And device.
Background technology
It is to preserve the web page files of webpage to local that webpage preserves offline so that can still be read under off-line state The mode of webpage.Web page files be comprising HTML (HyperText Markup Language, hypertext markup language) label, The file of the resources such as word, picture, audio, video.
At present, it is by picture, word, the CSS (Cascading in a webpage by browser that webpage preserves offline Style Sheets, cascading style sheets) resource downloadings such as file, html file and save as webpage text using mht as extension name Part.By taking H5 (HTML 5) webpage as an example, when need preserve a H5 webpage when, browser by H5 webpages word, picture, All resource conservations such as CSS files, html file are to one using mht as in the web page files of extension name.
Since H5 webpages have strong interaction characteristic, it may include multiple page data contents, each page in a H5 webpage There are interactive relations between data content.For using the music album that H5 webpages are realized, 5 are included in a music album Page data content, user can be switched over by horizontally slipping between the different page data contents of the H5 webpages.But It is after the H5 webpages of music album are preserved by the above method, when reading the H5 webpages offline, to be only able to display the H5 webpages The page data content shown when stored is unable to be switched according to the interactive operation of user and page data content To other page data contents of the H5 webpages.
Invention content
In order to solve in the prior art after the H5 webpages with strong interaction characteristic are preserved, in the offline H5 nets read and preserved During page, the page data content that the H5 webpages are shown when stored is only able to display, is unable to according to user and page number According to the interactive operation of content come the problem of switching to other page data contents of the H5 webpages, an embodiment of the present invention provides one Kind webpage store method, webpage read method and device.The technical solution is as follows:
In a first aspect, a kind of webpage store method is provided, the method includes:
It receives and instruction is preserved to the offline of target webpage;
The interactive relation for at least two page data contents that plug-in unit is obtained in the target webpage, institute are preserved by webpage It states interactive relation and is used to indicate switch logic of the page data content when receiving user's operation;
Plug-in unit is preserved by least two page data contents in the target webpage and the interaction by the webpage Relationship saves as predetermined webpage file.
Second aspect provides a kind of webpage read method, the method includes:
Obtain the predetermined webpage file of target webpage;
Plug-in unit is preserved from the predetermined webpage file by webpage, obtains at least two pages in the target webpage The interactive relation of data content and at least two page datas content, the interactive relation are used to indicate the page data Switch logic of the content when receiving user's operation;
Show the page data content in the target webpage;
When receiving user's operation, according to the interactive relation of at least two page datas content to the page Face data content switches over.
The third aspect, provides a kind of webpage save set, and described device includes:
Receiving module preserves instruction for receiving to the offline of target webpage;
Acquisition module, for preserving at least two page data contents in the plug-in unit acquisition target webpage by webpage Interactive relation, the interactive relation is used to indicate switch logic of the page data content when receiving user's operation;
Preserving module is preserved for passing through the webpage in the target webpage that plug-in unit obtains the acquisition module At least two page data contents and the interactive relation save as predetermined webpage file.
Fourth aspect, provides a kind of webpage reading device, and described device includes:
First acquisition module, for obtaining the predetermined webpage file of target webpage;
Second acquisition module, for the predetermined webpage read by webpage preservation plug-in unit from first acquisition module In file, the friendship of at least two page data contents and at least two page datas content in the target webpage is obtained Mutual relation, the interactive relation are used to indicate switch logic of the page data content when receiving user's operation;
First display module, for showing the page data content in the target webpage;
Handover module, for when receiving user's operation, according to the friendship of at least two page datas content Mutual relation switches over the page data content that first display module is shown.
The advantageous effect that technical solution provided in an embodiment of the present invention is brought is:
Plug-in unit is preserved by the interaction between multiple page data contents of webpage and multiple page data contents by webpage Relationship saves as predetermined webpage file, due to saving the interactive relation between multiple page data contents so that is protected reading During the webpage deposited, the interactive relation between multiple page data contents can be recovered by webpage preservation plug-in unit;So that User read preserve offline webpage when, still can by the interactive operation with page data content the webpage difference It is switched between page data content.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present invention, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing.
Fig. 1 is the method flow diagram of webpage store method provided in one embodiment of the invention;
Fig. 2 is the method flow diagram of webpage read method provided in one embodiment of the invention;
Fig. 3 A are the method flow diagrams of webpage store method provided in another embodiment of the present invention;
Fig. 3 B are the schematic diagrams of schematical webpage store method provided in one embodiment of the invention;
Fig. 4 A are the method flow diagrams of webpage read method provided in another embodiment of the present invention;
Fig. 4 B are the schematic diagrames of the prompt window of update request provided in one embodiment of the invention;
Fig. 4 C are the schematic diagrams of schematical webpage read method provided in one embodiment of the invention;
Fig. 5 A are the schematic diagrames of the implementation environment involved by section Example of the present invention;
Fig. 5 B are the schematic diagrames of the webpage preservation flow involved by section Example of the present invention;
Fig. 5 C are the schematic diagrames of the webpage reading flow involved by section Example of the present invention;
Fig. 6 is the block diagram of webpage save set provided in one embodiment of the invention;
Fig. 7 is the block diagram of webpage reading device provided in one embodiment of the invention;
Fig. 8 is the block diagram of the hardware device involved by section Example of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
When user wishes still read webpage under off-line state, webpage can be preserved offline, it is existing The preservation of single page data content (shown page data content during preservation) in webpage can be realized in technology, when one When multiple page data contents are included in webpage, webpage store method as shown in Figure 1 may be used to realize.
Fig. 1 is the method flow diagram of webpage store method provided in one embodiment of the invention.The present embodiment is with the net Page store method is applied to come for example, being equipped with browser in the terminal or having in the terminal for having web page browsing function The third party application of web page browsing function.As shown in Figure 1, the webpage store method includes:
Step 101, it receives and instruction is preserved to the offline of target webpage.
It in practical applications, can be related by triggering when user wishes still read webpage under off-line state Control preserves the webpage, such as the option control of the preservation webpage in triggering browser offline.When the control quilt for preserving webpage During triggering, terminal can be received preserves instruction to the offline of the webpage.
Target webpage, that is, user wishes the webpage preserved offline.
Step 102, the interaction pass for at least two page data contents that plug-in unit is obtained in target webpage is preserved by webpage System.
Page data content refers to the content shown by webpage to user, and page data content includes the various of the page Resource, such as picture, document, video, music, CSS files, html file, js (JavaScript) file, ajax (Asynchronous Javascript And XML) file etc..
Interactive relation is used to indicate switch logic of the page data content when receiving user's operation.Switch logic includes Switch logic between the switch logic of single page data content and/or multiple page data contents.For example, user is slided to the left Dynamic, the page data content of display is switched to next page data content by current page data content;For another example, page number Include the control of control music according to content, user can control the broadcasting of music in webpage or stop by triggering the control Only.
In a kind of possible realization method, at least two page data contents are included in webpage.By taking H5 webpages as an example, one It can include multiple page data contents in a H5 webpages, there are interactive relation between each page data content, user can be with It is switched between the different page data contents of H5 webpages by the similar interactive operation to horizontally slip.
Webpage preserves plug-in unit and refers to preserve offline for webpage with reading the program of webpage preserved offline.Optionally, net It is service worker that page, which preserves plug-in unit,.
In a kind of possible realization method, third party application preserves plug-in unit by installing the webpage, can be not The offline function of preserving webpage is realized in the case that browser is installed.
Step 103, plug-in unit is preserved by at least two page data contents and interactive relation in target webpage by webpage Save as predetermined webpage file.
Webpage preserves plug-in unit in each page data content for preserving webpage, can preserve and be wrapped in each page data content The whole resources included, such as word, picture, video, music, CSS files, html file etc..
Webpage preserves plug-in unit other than preserving each page data content of webpage, will also maintain page data content Interactive relation, in order to which when user reads offline webpage, webpage preserves plug-in unit and can be closed according to the interaction of page data content System reverts to webpage can be to state that user's operation responds.
After webpage preservation plug-in unit gets the interactive relation of at least two page data contents, webpage preserves plug-in unit should Each page data content of webpage and the interactive relation of each page data content save as predetermined webpage file.
Optionally, predetermined webpage file is using mht as the mht files of extension name.
Optionally, webpage preserves plug-in unit when preserving predetermined webpage file, and pre- calibration can be added into predetermined webpage file Know, for showing that the mht files preserved are to preserve plug-in unit by webpage to preserve, and be stored with page data in the mht files The interactive relation of content and page data content.Optionally, predetermined mark is the naming method of mht files or the figure of mht files Mark.The present embodiment is not defined the specific implementation of predetermined mark.
In conclusion webpage store method provided in an embodiment of the present invention, plug-in unit is preserved by the multiple of webpage by webpage Interactive relation between page data content and multiple page data contents saves as predetermined webpage file, multiple due to saving Interactive relation between page data content so that when reading the webpage preserved, can plug-in unit be preserved by webpage and recovered Interactive relation between multiple page data contents;So that user can still lead to when reading the webpage preserved offline It crosses and is switched between the different page data contents of the webpage from the interactive operation of page data content.
After by webpage store method shown in FIG. 1, webpage is preserved, user can read offline under off-line state The webpage of preservation, the reading for the predetermined webpage file of preservation can be by webpage read method as shown in Figure 2 come real It is existing.
Fig. 2 is the method flow diagram of webpage read method provided in one embodiment of the invention.The present embodiment is with the net Page read method is applied to come for example, being equipped with browser in the terminal or having in the terminal for having web page browsing function The third party application of web page browsing function.As shown in Fig. 2, the webpage read method includes:
Step 201, the predetermined webpage file of target webpage is obtained.
Optionally, predetermined webpage file is the mht files preserved by webpage store method shown in FIG. 1.
In practical applications, in the mht files of reading and saving, need whether the mht files for judging to preserve are predetermined net Page file, that is, identify whether the mht files of preservation have the predetermined mark of predetermined webpage file.For example, the mht texts that identification preserves The naming method of part whether be predetermined webpage file naming method, alternatively, whether the icon of mht files that identification preserves is pre- Determine the icon of web page files.
If the mht files preserved are not the predetermined webpage files preserved by webpage store method shown in FIG. 1, according to The mode of the common mht files of reading provided in the prior art directly opens mht files.
If the mht files preserved are the predetermined webpage file preserved by webpage store method shown in FIG. 1, step is performed Rapid 202.
Step 202, plug-in unit is preserved from predetermined webpage file by webpage, obtains at least two pages in target webpage The interactive relation of data content and at least two page data contents.
Interactive relation is used to indicate switch logic of the page data content when receiving user's operation.Switch logic includes Switch logic between the switch logic of single page data content and/or multiple page data contents.
Since webpage preserves plug-in unit when preserving predetermined webpage file, by the page data content of target webpage and at least two The interactive relation of a page data content is preserved into predetermined webpage file, therefore in the predetermined webpage file of reading and saving, By reading the interactive relation of each page data content and each page data content, to be rebuild to target webpage or wash with watercolours Dye.For example, webpage, which preserves plug-in unit, reads the corresponding word of page data content, picture, music, video, CSS files, HTML texts The resources such as part, by these combination of resources read into webpage preserve offline when corresponding page data content, further according to the page The corresponding interactive relation of data content, each page data content that would be combined into are rendered to and can be interacted with user's operation Webpage.
Step 203, the page data content in display target webpage.
When the interaction that webpage preserves page data content and page data content of the plug-in unit in predetermined webpage file is closed System, can be with the page data content in target webpage displayed on the terminals after rendering obtains the target webpage.
Optionally, the page data content of display is one in multiple page data contents that target webpage includes.
Step 204, when receiving user's operation, according to the interactive relation of at least two page data contents to page number It is switched over according to content.
After the page data content of target webpage renders reconstruction, user can operate page data content.Net When page receives user's operation, according to the corresponding interactive relation of user's operation, switch page data content.For example, user carries out During the operation slided to the left, the page data content of display is switched to by current page data content in next page data Hold;For another example, page data content includes the control of control music, and current music is playing, and user should by triggering Control can control the stopping of the music in the target webpage to play.
In conclusion webpage read method provided in an embodiment of the present invention, by when reading predetermined webpage file, obtaining The interactive relation of page data content and page data content in predetermined webpage file, target webpage reconstruction is rendered to can The webpage responded to user's operation.Even if what is preserved is the H5 webpages of strong interaction characteristic, can also it read what is preserved offline During H5 webpages, restore the interactive function of H5 webpages so that offline H5 webpages can respond user's operation so that user When reading the webpage preserved offline, still can other page numbers be switched to by the interactive operation with page data content According to content.
Since webpage store method shown in FIG. 1 needs the offline preservation using webpage preservation plug-in unit progress webpage, When preserving webpage offline, need to detect whether that installing the webpage preserves plug-in unit.In addition, in order to make user's energy under off-line state It enough checks all resources on target webpage, needs all resources of target webpage being downloaded when preserving webpage offline. The specific webpage store method referred to as shown in Figure 3A.
Fig. 3 A are the method flow diagrams of webpage store method provided in another embodiment of the present invention.The present embodiment is with this Webpage store method is applied to come for example, being equipped with browser or tool in the terminal in the terminal for having web page browsing function There is the third party application of web page browsing function.As shown in Figure 3A, which includes:
Step 301, it receives and instruction is preserved to the offline of target webpage.
In general, instruction is preserved to the offline of target webpage to receive by the browser in terminal.
In a kind of possible realization, the browser in terminal is provided with offline the first menu item for preserving webpage, when with First menu item is clicked at family during browsing objective webpage, can trigger and offline preserve of the target webpage is instructed, clear Device of looking at receives offline preserve and instructs.
In alternatively possible realization, the third party application in terminal has web browsing capabilities, and the third Square application program is provided with offline the second menu item for preserving webpage, when user uses third party application browsing objective webpage When click second menu item, can trigger and instruction is preserved to the offline of the target webpage, which calls browsing Device instructs to complete offline preserve.
Step 302, detect whether that having installed webpage preserves plug-in unit.
In a kind of possible realization, it is service worker that webpage, which preserves plug-in unit,.Service worker independently of Current web page provides the ability that the function of not needing to interact with webpage performs on backstage, for example the offline function that preserves exists The ability that backstage performs.The independent process preserved offline for webpage can be created by service worker.The independence into Journey has the ability for the code for identifying and acquiring relevant user interactive relation.
If not yet installation webpage preserves plug-in unit, 303 are entered step;If having installed webpage preserves plug-in unit, enter step Rapid 305.
Step 303, if not yet installation webpage preserves plug-in unit, detect whether the communication network currently connected is the first communication network Network.
Optionally, the first communication network for unlimited downloading flow or downloads expense less than threshold value or the communication network freely used Network, such as WiFi (WIreless-Fidelity, Wireless Fidelity) network.
If the communication network currently connected is the first communication network, 304 are entered step;If the communication network currently connected It is to be different from the first communication network, then asks the user whether to agree to this download, when user agrees to this download, enter step 305。
Step 304, it downloads and webpage is installed and preserve plug-in unit.
Browser downloads installation service worker.When the communication network that terminal currently connects is the first communication network When, the flow for downloading installation webpage preservation plug-in unit performs automatically, does not need to interact with user;When terminal currently connects Communication network when being the second communication network, need to ask the user whether to agree to this download, when user agrees to this download, Enter step 305.
The priority of second communication network is less than the priority of the first communication network.
Step 305, the web page source code of plug-in unit acquisition target webpage is preserved by webpage.
Optionally, terminal preserves plug-in unit from the web page source code of server acquisition target webpage by webpage.
Step 306, plug-in unit is preserved by webpage and traverses interaction code segment related with interactive relation in web page source code, The interactive relation of at least two page data contents is obtained according to interaction code segment.
Interactive relation is used to indicate switch logic of the page data content when receiving user's operation.Switch logic includes Switch logic between the switch logic of single page data content and/or multiple page data contents.
When between two page data contents there are during interactive relation, such as first page data content and second page number The logical operation of second page data content is switched to according to the level and context of content and by first page data content Deng in the presence of the interaction code segment that this kind of interactive relation is described in web page source code.
Webpage preserves all interaction code segments related with interactive relation in plug-in unit traversal web page source code, passes through duplication These interaction code segments, to preserve the interactive relation of at least two page data contents.
Optionally, in order to make user under off-line state, the institute of each page data content in target webpage can be checked There are web page resources, browser also needs to all resources in target webpage are downloaded by step 307 and step 308.
Step 307, plug-in unit is preserved by webpage and resource address is obtained from web page source code.
Optionally, the web page source code of target webpage includes multiple resources, for example, picture, audio, video etc..Each Resource corresponds to respective resource address.Optionally, resource address is using URI (Uniform Resource Identifier, system One resource identifier) address represents.
Step 308, plug-in unit is preserved from all web page resources of resource address download target webpage by webpage.
All web page resources of target webpage include the web page resources for being used to form at least two page data contents.
Target webpage is in opening procedure, and browser is according to resource address to the corresponding server request of loading of target webpage Resource.Webpage preserves plug-in unit by downloading or replicating all web page resources of target webpage, and all web page resources are preserved.
It should be noted that step 306 and step 308 can perform parallel, alternatively, step 308 is held before step 306 Row, the embodiment of the present invention are not limited this.
Step 309, plug-in unit is preserved by webpage to close web page resources, the corresponding resource address of each web page resources, interaction System saves as predetermined webpage file.
Predetermined webpage file is using mht as the mht files of extension name.
Optionally, webpage preserves plug-in unit when preserving predetermined webpage file, and predetermined mark can be added to predetermined webpage file, For showing that this mht file preserved offline is to preserve plug-in unit by webpage to preserve, and be stored in the mht files each The interaction of web page resources, the corresponding resource address of each web page resources, single page data content needed for page data content The interactive relation of relationship, a page data content and another page data content.Optionally, make a reservation for mark using mht texts The naming method of part or the icon of mht files represent, for example, predetermined mark is using naming method " H5service+ serial numbers " It represents, then the web page files with name H5service1.mht are predetermined webpage files.The present embodiment is not to predetermined mark Specific implementation be defined.
Webpage preserves plug-in unit and preserves all web page resources of target webpage into predetermined webpage file so that target webpage When being read under off-line state, still it can browse through and the relevant all web page resources of target webpage.For example, by target webpage Video resource be downloaded, then when target webpage is read under off-line state, the video in the target webpage remains able to just Often play.
Webpage preserves plug-in unit and also preserves the corresponding resource address of each web page resources into predetermined webpage file so that When having communication network, webpage, which preserves plug-in unit, to detect whether web page resources update according to the resource address of preservation, when webpage provides When there is update in source, updated web page resources can be provided to the user.
Webpage preserves plug-in unit and also preserves interactive relation into predetermined webpage file so that is reading target webpage offline When, the interactive relation between multiple page data contents in target webpage can be restored.
In a kind of possible realization, plug-in unit, and the communication network that terminal currently connects are preserved when not installing webpage in terminal When network is not the first communication network, target webpage is saved as into the generic web page file using mht as extension name, common mht texts Part can only realize the preservation to page data content single in target webpage, and will not store the relevant all moneys of target webpage Source (for example only preserve video resource address but do not preserve video file in itself) and the interactive relation of each page data content, So the resource address stored in common mht files there is a possibility that failure.When resource address fails, target network is read Corresponding web page resources can not be just found during page.
It, can be with a schematical webpage preservation side shown in reference chart 3B to webpage store method in this present embodiment It is illustrated in the schematic diagram of method.In figure 3b, S31 is that webpage preserves offline, when being preserved offline to webpage, is needed First carry out S32;S32 is to judge whether that installing webpage preserves plug-in unit, if S32 judging results are yes, performs S33, by target Webpage saves as predetermined webpage file;If S32 judging results are no, S34 is performed, judges whether terminal connects WiFi network; If S34 judging results are yes, S35 is performed, installation webpage preserves plug-in unit;After in S35 webpages preservation plug-in unit, installation is complete, perform Target webpage is saved as predetermined webpage file by S33;If S34 judging results are no, S36 is performed, target webpage is saved as Common mht files.
In conclusion webpage store method provided in an embodiment of the present invention, plug-in unit is preserved by the multiple of webpage by webpage Interactive relation between page data content and multiple page data contents saves as predetermined webpage file, multiple due to saving Interactive relation between page data content so that when reading the webpage preserved, can plug-in unit be preserved by webpage and recovered Interactive relation between multiple page data contents;So that user can still lead to when reading the webpage preserved offline It crosses and is switched between the different page data contents of the webpage from the interactive operation of page data content.
In addition, by traverse in web page source code with the relevant interaction code segment of interactive relation so that webpage preserve Plug-in unit can get the interactive relation of at least two page data contents, and interaction code fragment replication is preserved, and can read When taking the webpage preserved offline, restore the interactive relation of web page contents in webpage.
In addition, by downloading the relevant all web page resources of webpage so that user is under off-line state or in resource address Failure cannot more new resources when, still all web page resources preserved offline can be showed user.
In addition, by detecting whether that installation webpage preserves plug-in unit, can be capable of determining that save as predetermined webpage by webpage File.
In addition, before downloading installation webpage and preserving plug-in unit, whether detection communication network is the first communication network so that is used Family can carry out webpage in suitable network environment and preserve the download of plug-in unit and the download of web page resources.
After by target webpage preserve offline by the webpage store method shown in Fig. 3 A, user is reading offline protect During the target webpage deposited, the interactive relation between each page data content in target webpage can be not only rebuild, it can be with Web page resources are updated under conditions of having communication network, specifically refer to webpage read method as shown in Figure 4 A.
Fig. 4 A are the method flow diagrams of webpage read method provided in another embodiment of the present invention.The present embodiment is with this Webpage read method is applied to come for example, being equipped with browser or tool in the terminal in the terminal for having web page browsing function There is the third party application of web page browsing function.As shown in Figure 4 A, which includes:
Step 401, the predetermined webpage file of target webpage is obtained.
Optionally, predetermined webpage file is the mht files preserved by the webpage store method shown in Fig. 3 A.
In practical applications, in the mht files of reading and saving, need whether the mht files for judging to preserve are predetermined net Page file, that is, identify whether the mht files of preservation have the predetermined mark of predetermined webpage file.For example, the mht texts that identification preserves The naming method of part whether be predetermined webpage file naming method, alternatively, whether the icon of mht files that identification preserves is pre- Determine the icon of web page files.
If the mht files preserved are not the predetermined webpage files preserved by the webpage store method shown in Fig. 3 A, press Mht files are directly opened according to the mode of the common mht files of reading provided in the prior art.
If the mht files preserved are the predetermined webpage file preserved by the webpage store method shown in Fig. 3 A, perform Step 402.
Step 402, detect whether that having installed webpage preserves plug-in unit.
In actual implementation, it is service worker that webpage, which preserves plug-in unit,.Service worker are independently of current net Page provides the ability that the function of not needing to interact with webpage performs on backstage, for example offline webpage read functions are rear The ability that platform performs.The independent process read for offline webpage can be created by service worker.The independent process Ability with identification and the code for rendering reconstruction relevant user interactive relation.
Due to need by webpage preserve plug-in unit, could restore when reading target webpage webpage page data content it Between interactive relation, it is therefore desirable to detect whether installation webpage preserve plug-in unit.
Step 403, it if not yet installation webpage preserves plug-in unit, downloads and webpage preservation plug-in unit is installed.
Optionally, it is similar with step 303 and step 304, before downloading installation webpage and preserving plug-in unit, first detection terminal Whether the communication network of connection is the first communication network.First communication network is unlimited downloading flow or downloads expense less than threshold value Or the communication network freely used, such as WiFi network.If the communication network currently connected is the first communication network, download simultaneously Installation script injects;If the communication network currently connected is different from the first communication network, ask the user whether to agree under this It carries, when user agrees to this download, downloads installation webpage and preserve plug-in unit.
In a kind of possible realization, if terminal is not connected with communication network, installation webpage can not be downloaded and preserve plug-in unit, by In predetermined webpage file be the mht files using mht as extension name, therefore can be read according to the method for opening common mht files Target webpage, i.e. target webpage can not restore the interactive relation of the page data content of target webpage when reading.
Step 404, plug-in unit is preserved from predetermined webpage file by webpage, obtains the web page resources, each of target webpage The corresponding resource address of web page resources and interactive relation.
All web page resources of target webpage include the web page resources for being used to form at least two page data contents.
Interactive relation is used to indicate switch logic of the page data content when receiving user's operation.Switch logic includes Switch logic between the switch logic of single page data content and/or multiple page data contents.
After being mounted with that webpage preserves plug-in unit, plug-in unit is preserved by webpage and reads predetermined webpage file, gets target The interactive relation of the web page resources of webpage, the corresponding resource address of each web page resources and page data content, can be by mesh Mark webpage rendering is reconstructed into the webpage that can be interacted with user's operation, and user can check it is relevant with target webpage All web page resources.
Step 405, according to the corresponding resource address of each web page resources, whether detection web page resources need to update.
In the case of terminal connection communication network, webpage preserves plug-in unit according to the resource address preserved offline, Ke Yijian Survey whether web page resources update.
Optionally, for different types of web page resources, when whether detection web page resources need update, the method for use Also it is different.For example, when web page resources are video resource, the video resource of preservation is to upload November 10, is protected by webpage It deposits plug-in unit and detects that the video resource in server is to upload November 15, be then determined as needing to update by video resource.Again For example, when web page resources are file resource, the 200KB of the size of the file resource of preservation preserves plug-in unit by webpage and detects File resource into server is 300KB, then is determined as needing to update by file resource.When web page resources are other types When, it needs to detect whether web page resources need newer method determines according to actual conditions, just repeat no more here.
Optionally, it if webpage preserves plug-in unit and detects that web page resources do not update, is shown by the web page resources of preservation The page data content of target webpage;If webpage preserves plug-in unit and detects that web page resources have update, 406 are entered step.
In a kind of possible realization, when terminal is not connected with communication network, webpage preserves plug-in unit can not be to web page resources It is updated, then the page data content for rebuilding target webpage is rendered by the web page resources preserved offline.
Step 406, if web page resources need to update, detect whether the communication network currently connected is the first communication network.
Since the update of web page resources needs to transmit data by communication network.Communication network includes at least the first communication Network and the second communication network, the first communication network are used less than threshold value or freely logical for unlimited downloading flow or download expense Communication network, such as WiFi network, the second communication network are to limit downloading flow or download the communication network that expense is higher than threshold value, than Such as mobile network.The priority of second communication network is less than the priority of the first communication network.Therefore, it is updated in web page resources Before, whether need the communication network that detection terminal connects is the first communication network.
If the communication network currently connected is the first communication network, 407 are entered step;If the communication network currently connected For the second communication network, then 409 are entered step.
Step 407, it if the communication network currently connected is the first communication network, is obtained by resource address updated Web page resources.
Step 408, pass through the page data content in updated web page resources display target webpage.
By the page data content in updated web page resources display target webpage, can user be read most New web page resources.
What it is when terminal connection is the second communication network, that is, during the communication network used with compensation, in order to avoid not knowing in user In the case of feelings, web page resources are updated using the second communication network, cause the loss of user, it can be by step 409 User is prompted to update to step 411, and determine whether to be updated web page resources according to the selection of user.
Step 409, if the communication network currently connected is the second communication network, update request is shown, update request is used Web page resources are updated using the second communication network in request.
In practical applications, when terminal connection be the second communication network when, show in terminal screen update ask Prompt window.For example, the prompt window 40 of update request, prompt window 40 are shown as shown in Figure 4 B, in terminal screen In, there are one confirm control 41 and a cancellation control 42 for display.
Step 410, when receiving confirmation operation, the step that updated web page resources are obtained by resource address is performed Suddenly.
Corresponding diagram 4B, when confirming that control 41 is triggered, terminal receives confirmation operation, then script control is logical using second Communication network is updated web page resources.
Step 411, it when receiving cancellation operation, performs through the page in not newer web page resources display target webpage Face data content.
Corresponding diagram 4B, when cancellation control 42 is triggered, terminal receives cancellation operation, then script control does not provide webpage Source is updated, and by the page data content in not newer web page resources display target webpage, that is, passes through the webpage of preservation Resource, which renders, rebuilds target webpage.
It, can be with a schematical webpage reading side shown in reference chart 4C to webpage read method in this present embodiment It is illustrated in the schematic diagram of method.S401 is to read offline webpage, when reading offline webpage, needs to perform S402, sentence Whether disconnected target webpage is predetermined webpage file;If S402 judging results are no, S412 is performed, mesh is read using common mode Webpage is marked, common mode is the mode for reading common mht files;If S402 judging results are yes, S403 is performed, is detected whether Webpage is installed and preserves plug-in unit;If S403, which is detected, is mounted with that webpage preserves plug-in unit, S404 is performed, is provided by not newer webpage Open webpage in source;If S403 detects that not installing webpage preserves plug-in unit, performs S405, whether detection terminal connects WiFi nets Network if S405 detects connection WiFi network, performs S406, and installation webpage preserves plug-in unit, is using under WiFi network here Contained network page preserves the installation kit of plug-in unit;After installation is complete in S406 webpages preservation plug-in unit, S407 is performed, web page resources are carried out more Newly, it is that web page resources are updated using WiFi network here;After S407 web page resources update, S408 is performed, is led to It crosses newer web page resources and opens webpage;If S405 detects not connected WiFi network, S409 is performed, is confirmed whether to user It is ready that consumed flow is read;If the confirmation result of S409 is yes, S410 is performed, installation webpage preserves plug-in unit, is to use here Flow downloads the installation kit that webpage preserves plug-in unit;After installation is complete in S410 webpages preservation plug-in unit, S411 is performed, to web page resources It is updated, is that web page resources are updated using flow here;After S411 web page resources update, S408 is performed, Webpage is opened by newer web page resources;If the confirmation result of S409 is no, S412 is performed, net is read using common mode Page, common mode are the mode for reading common mht files.
In conclusion webpage read method provided in an embodiment of the present invention, by when reading predetermined webpage file, obtaining The interactive relation of page data content and page data content in predetermined webpage file, target webpage reconstruction is rendered to can The webpage responded to user's operation.Even if what is preserved is the H5 webpages of strong interaction characteristic, can also it read what is preserved offline During H5 webpages, restore the interactive function of H5 webpages so that offline H5 webpages can respond user's operation so that user When reading the webpage preserved offline, still can other page numbers be switched to by the interactive operation with page data content According to content.
In addition, preserve plug-in unit by webpage detects whether web page resources have update according to the resource address preserved offline, it can To determine whether web page resources need to update.
In addition, it is updated by the web page resources in the target webpage to preserving offline so that user is reading target During webpage, the page data content shown according to newest web page resources can be read.
In addition, by before web page resources update, whether the communication network for detecting connection is the first telecommunication network, can It avoids, when terminal connects the second communication network, being updated web page resources using the second communication network and causing what user lost Problem.
In addition, by when detect terminal connection is the second communication network, display update request can be according to user Selection determine the need for being updated web page resources.
Fig. 5 A are the schematic diagrames of the implementation environment involved by section Example of the present invention.Schematically, in the implementation environment The webpage of client 510, the client of browser 520, browser including third party application preserves plug-in unit 522, browsing The server 530 of device and terminal 540.
Terminal 540 is used to install the client 510 of third party application and the client 520 of browser.
The server 530 of browser is used to provide the client of browser and the webpage of browser preserves the download of plug-in unit Service.
It is connected between terminal 540 and the server 530 of browser by communication network.Optionally, communication network includes Gauze network and wireless network.
The webpage that browser is equipped in the client 520 of browser preserves plug-in unit 522, and the webpage of browser preserves plug-in unit 522 be a program for operating in browser background process, and the offline webpage that preserves can be realized with reading the webpage preserved offline Function.
The client 510 of third party application has web page browsing function.Third party application has with browser Cooperative relationship, the client 510 of third party application can call the webpage of browser to preserve plug-in unit 522 to carry out webpage Offline preservation or the reading of webpage.
When terminal 540 does not install the client 520 of browser, if the client 510 of third party application need from Line preserves webpage or reads the webpage that preserves offline, then the client 510 of third party application by terminal 540 to browser Server 530 ask browser client 520 installation kit, optionally, the server 530 of browser is same to terminal 540 When send browser client 520 and browser webpage preserve plug-in unit 522 installation kit.When the client 520 of browser And after the webpage preservation plug-in unit 522 of browser is downloaded installation, the client 510 of third party application can call browsing Webpage in the client 520 of device preserves plug-in unit 522, and webpage is carried out to preserve or read offline.
Optionally, when the webpage for not installing browser in the client of browser 520 preserves plug-in unit 522, if third party The client 510 of application program needs to preserve webpage offline or reads the visitor of webpage, then third party application preserved offline The webpage of browser is asked to preserve the installation kit of plug-in unit 522 to the server 530 of browser by terminal 540 in family end 510.When clear The webpage of device look at is preserved after plug-in unit 522 is downloaded installation, and the client 510 of third party application can call the visitor of browser The webpage at family end 520 preserves plug-in unit 522, and webpage is carried out to preserve or read offline.
In a kind of possible realization method, the webpage preservation that third party application is corresponding with third party application is inserted Part, after the webpage that the client 510 of third party application downloads installation third party application preserves plug-in unit, third party should The offline webpage that preserves can be expanded with reading the function of webpage of preserving offline with the client 510 of program, without adjusting Plug-in unit 522 is preserved with the webpage of browser.
Fig. 5 B are the schematic diagrames of the webpage preservation flow involved by section Example of the present invention.Schematically, the present embodiment It applies in the implementation environment shown in Fig. 5 A.
As shown in Figure 5A, user in terminal 540 using third party application A browse webpage 541, when user need from When line preserves webpage 541, it can be shown by triggering dropdown menu controls 542 comprising " locally downloading " and/or " preserving to clear Look at device " menu item 543.When any menu item 543 in " locally downloading " or " preserving to browser " is triggered, third Whether square application program A detection terminals 540 install browser (client 520 of the browser i.e. shown in Fig. 5 A), if terminal 540 Browser is installed, S51 in corresponding diagram 5B then calls browser to protect webpage 541 offline by third party application A It deposits.During offline preservation, the prompt message 544 of display " during webpage preserves " on screen, and prompt the path preserved offline 545, such as " you can check in file download-a files ", wherein a files are corresponding with third party application A, in a files It is stored with the various types of files preserved by third party application A.
It, can be in order to allow users to fast access the webpage 541 preserved offline after webpage 541 preserves successfully offline The shortcut 570 of a files is created on the table.Optionally, it before the shortcut 570 for creating a files, shows on the screen Show that shortcut creates prompting 550, terminal 540 is created in prompting 550 really after confirmation operation is received in shortcut When recognizing control 551 and being triggered, the shortcut 570 of a files is created on the table.If shortcut creates taking in prompting 550 The control 552 that disappears is triggered, then does not create the shortcut 570 of a files on the table.
If third party application A detects terminal 540 and does not install browser, the S52 in corresponding diagram 5B, then on the screen The prompting link 560 of display installation browser, when receiving user and confirming the operation of installation, i.e. 561 quilt of installation control immediately During triggering, the server 530 of the browser shown in third party application A to Fig. 5 A asks the peace of the client 520 of browser Dress packet downloads the client 520 of installation browser.After browser is successfully installed, according to indicated by S53, third-party application Program A calls browser to preserve webpage 541 offline.
After terminal preserves webpage offline by the flow shown in Fig. 5 B, user can search according to the flow shown in Fig. 5 C To the 541 corresponding mht files of webpage preserved offline.
Fig. 5 C are the schematic diagrames of the webpage reading flow involved by section Example of the present invention.Schematically, the present embodiment It applies in the implementation environment shown in Fig. 5 A.
Optionally, when user needs to read the webpage 541 preserved offline, offline preservation can be found by two ways Webpage 541 mht files 591.The path 545 preserved offline that a kind of mode is prompted when being according to offline preserve, opens " text The file 580 of part download ", then opens " a files " file 590, finds the mht files of the webpage 541 preserved offline 591, the webpage 541 preserved offline can just be read by opening mht files 591;Another way is as shown in Figure 5 B offline Under the premise of the shortcut 570 that a files are created when preserving webpage 541, pass through the shortcut of a files created on desktop 570, directly open " a files " file 590, find the mht files 591 of the webpage 541 preserved offline, then can read from The webpage 541 that line preserves.Wherein, the method that the rendering of mht files is reconstructed into webpage may refer to the step shown in Fig. 2 or Fig. 4 A Suddenly.
Fig. 6 is the block diagram of webpage save set provided in one embodiment of the invention.The present embodiment is with the net Page save set is applied to illustrate in the terminal for having web page browsing function.As shown in fig. 6, the webpage save set packet It includes:Receiving module 610, acquisition module 620 and preserving module 630.
Receiving module 610 is used to implement above-mentioned steps 101, step 301 and any other implicit or disclosed and reception The relevant function of step.
Acquisition module 620 is used to implement above-mentioned steps 102 and any other implicit or disclosed related to obtaining step Function.
Preserving module 630 is used to implement above-mentioned steps 103 and any other implicit or disclosed related with preservation step Function.
Optionally, acquisition module 620, including:First acquisition unit and Traversal Unit.
First acquisition unit is used to implement above-mentioned steps 305 and any other implicit or disclosed with obtaining step phase The function of pass.
Traversal Unit is used to implement above-mentioned steps 306 and any other implicit or disclosed relevant with traversal step Function.
Optionally, preserving module 530, including:Second acquisition unit, download unit and storage unit.
Second acquisition unit is used to implement above-mentioned steps 307 and any other implicit or disclosed with obtaining step phase The function of pass.
Download unit is used to implement above-mentioned steps 308 and any other implicit or disclosed relevant with download step Function.
Storage unit is used to implement above-mentioned steps 309 and any other implicit or disclosed relevant with preservation step Function.
Optionally, which further includes:First detection module, download module and the second detection module.
First detection module is used to implement above-mentioned steps 302 and any other implicit or disclosed with detecting step phase The function of pass.
Download module is used to implement above-mentioned steps 304 and any other implicit or disclosed relevant with download step Function.
Second detection module is used to implement above-mentioned steps 303 and any other implicit or disclosed with detecting step phase The function of pass.
In conclusion webpage store method provided in an embodiment of the present invention, plug-in unit is preserved by the multiple of webpage by webpage Interactive relation between page data content and multiple page data contents saves as predetermined webpage file, multiple due to saving Interactive relation between page data content so that when reading the webpage preserved, can plug-in unit be preserved by webpage and recovered Interactive relation between multiple page data contents;So that user can still lead to when reading the webpage preserved offline It crosses and is switched between the different page data contents of the webpage from the interactive operation of page data content.
It should be noted that:The webpage save set provided in above-described embodiment is when preserving webpage, only with above-mentioned each work( Can module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different functions Module is completed, i.e., the internal structure of terminal is divided into different function modules, described above all or part of to complete Function.In addition, the webpage save set that above-described embodiment provides belongs to same design with webpage store method embodiment, it is specific Realization process refers to embodiment of the method, and which is not described herein again.
Fig. 7 is the block diagram of webpage reading device provided in one embodiment of the invention.The present embodiment is with the net Page reading device is applied to illustrate in the terminal for having web page browsing function.As shown in fig. 7, the webpage reading device packet It includes:First acquisition module 710, the second acquisition module 720, the first display module 730 and handover module 740.
First acquisition module 710, be used to implement above-mentioned steps 201, step 401 and it is any other implicit or it is disclosed with The relevant function of obtaining step.
Second acquisition module 720, be used to implement above-mentioned steps 202, step 404 and it is any other implicit or it is disclosed with The relevant function of obtaining step.
First display module 730, be used to implement above-mentioned steps 203, step 411 and it is any other implicit or it is disclosed with The relevant function of step display.
Handover module 740 is used to implement above-mentioned steps 204 and any other implicit or disclosed related to switch step Function.
Optionally, the first display module 730, including:Detection unit, updating unit and display unit.
Detection unit is used to implement above-mentioned steps 405 and any other implicit or disclosed relevant with detecting step Function.
Updating unit is used to implement above-mentioned steps 407, step 410 and any other implicit or disclosed and update and walks Rapid relevant function.
Display unit is used to implement above-mentioned steps 408 and any other implicit or disclosed relevant with step display Function.
Optionally, which further includes:First detection module, the second display module, the second detection module and download module.
First detection module is used to implement above-mentioned steps 406 and any other implicit or disclosed with detecting step phase The function of pass.
Second display module is used to implement above-mentioned steps 409 and any other implicit or disclosed with step display phase The function of pass.
Second detection module is used to implement above-mentioned steps 402 and any other implicit or disclosed with detecting step phase The function of pass.
Download module is used to implement above-mentioned steps 403 and any other implicit or disclosed relevant with download step Function.
In conclusion webpage reading device provided in an embodiment of the present invention, by when reading predetermined webpage file, obtaining The interactive relation of page data content and page data content in predetermined webpage file, target webpage reconstruction is rendered to can The webpage responded to user's operation.Even if what is preserved is the H5 webpages of strong interaction characteristic, can also it read what is preserved offline During H5 webpages, restore the interactive function of H5 webpages so that offline H5 webpages can respond user's operation so that user When reading the webpage preserved offline, still can other page numbers be switched to by the interactive operation with page data content According to content.
It should be noted that:The webpage reading device provided in above-described embodiment is when reading webpage, only with above-mentioned each work( Can module division progress for example, in practical application, can be as needed and by above-mentioned function distribution by different functions Module is completed, i.e., the internal structure of terminal is divided into different function modules, described above all or part of to complete Function.In addition, the webpage reading device that above-described embodiment provides belongs to same design with webpage read method embodiment, it is specific Realization process refers to embodiment of the method, and which is not described herein again.
Shown in Figure 8, it illustrates the block diagrams of the hardware device involved by section Example of the present invention.It should Device 800 is used to implement the webpage store method or webpage read method of above-described embodiment offer.Device 800 in the present invention can To include one or more following component parts:For performing computer program instructions to complete the processing of various flows and method Device, for information and storage program instruction random access memory (RAM) and read-only memory (ROM), for store data with The memory of information, I/O equipment, interface, antenna etc..Specifically:
Device 800 can include RF (Radio Frequency, radio frequency) circuit 810, memory 820, input unit 830, Display unit 840, sensor 850, voicefrequency circuit 860, WiFi (wireless fidelity, Wireless Fidelity) module 870, place Manage the components such as device 880, power supply 882, camera 890.It will be understood by those skilled in the art that the apparatus structure shown in Fig. 8 is simultaneously The not restriction of structure paired terminal can include components more more or fewer than diagram and either combine certain components or different Component is arranged.
Each component parts of device 800 is specifically introduced with reference to Fig. 8:
RF circuits 810 can be used for receive and send messages or communication process in, signal sends and receivees, particularly, by base station After downlink information receives, handled to processor 880;In addition, the data for designing uplink are sent to base station.In general, RF circuit packets Include but be not limited to antenna, at least one amplifier, transceiver, coupler, LNA (Low Noise Amplifier, low noise Amplifier), duplexer etc..In addition, RF circuits 810 can also communicate with network and other equipment by radio communication.The nothing Line communication can use any communication standard or agreement, including but not limited to GSM (Global System of Mobile Communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet without Line service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), electronics Mail, SMS (Short Messaging Service, short message service) etc..
Memory 820 can be used for storage software program and module, and processor 880 is stored in memory 820 by operation Software program and module, so as to executive device 800 various function application and data processing.Memory 820 can be main Including storing program area and storage data field, wherein, storing program area can storage program area, needed at least one function should With program (such as sound-playing function, image player function etc.) etc.;Storage data field can be stored uses institute according to device 800 Data (such as audio data, phone directory etc.) of establishment etc..In addition, memory 820 can include high-speed random access memory, It can also include nonvolatile memory, a for example, at least disk memory, flush memory device or other volatile solid-states are deposited Memory device.
Input unit 830 can be used for receiving the number inputted or character information and generation and the user setting of device 800 And the key signals input that function control is related.Specifically, input unit 830 may include touch panel 831 and other inputs Equipment 832.Touch panel 831, also referred to as touch screen, collect user on it or neighbouring touch operation (for example user makes With the operation of any suitable object such as finger, stylus or attachment on touch panel 831 or near touch panel 831), and Corresponding attachment device is driven according to preset formula.Optionally, touch panel 831 may include touch detecting apparatus and touch Touch two parts of controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect the letter that touch operation is brought Number, transmit a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and is converted into Contact coordinate, then processor 880 is given, and the order that processor 880 is sent can be received and performed.Furthermore, it is possible to using The multiple types such as resistance-type, condenser type, infrared ray and surface acoustic wave realize touch panel 831.It is defeated in addition to touch panel 831 Other input equipments 832 can also be included by entering unit 830.Specifically, other input equipments 832 can include but is not limited to physics It is one or more in keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating lever etc..
Display unit 840 can be used for display by information input by user or be supplied to the information of user and device 800 Various menus.Display unit 840 may include display panel 841, optionally, LCD (Liquid Crystal may be used Display, liquid crystal display), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) come Display panel 841 is configured.Further, touch panel 831 can cover display panel 841, when touch panel 831 is detected at it On or near touch operation after, send to processor 880 with determine touch event type, be followed by subsequent processing device 880 according to touch The type for touching event provides corresponding visual output on display panel 841.Although in fig. 8, touch panel 831 and display surface Plate 841 is input and the input function that the component independent as two carrys out realization device 800, but in certain embodiments, it can Function is output and input so that touch panel 831 and display panel 841 is integrated and realization device 800.
Device 800 may also include at least one sensor 850, such as gyro sensor, magnetic induction sensor, light sensing Device, motion sensor and other sensors.Specifically, optical sensor may include ambient light sensor and proximity sensor, In, ambient light sensor can adjust the brightness of display panel 841 according to the light and shade of ambient light, and proximity sensor can be in device 800 when being moved in one's ear, closes display panel 841 and/or backlight.As one kind of motion sensor, acceleration transducer can The size of (generally three axis) acceleration is detected in all directions, size and the direction of gravity are can detect that when static, can be used for Identify application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), the Vibration identification correlation work(of electronic equipment posture Energy (such as pedometer, percussion) etc.;Barometer, hygrometer, thermometer, the infrared ray sensor that can also configure as device 800 Etc. other sensors, details are not described herein.
Voicefrequency circuit 860, loud speaker 861, microphone 862 can provide the audio interface between user and device 800.Audio The transformed electric signal of the audio data received can be transferred to loud speaker 861, sound is converted to by loud speaker 861 by circuit 860 Sound signal exports;On the other hand, the voice signal of collection is converted to electric signal by microphone 862, after being received by voicefrequency circuit 860 Audio data is converted to, then after audio data output processor 880 is handled, through RF circuits 810 to be sent to such as another end Audio data is exported to memory 820 to be further processed by end.
WiFi belongs to short range wireless transmission technology, and device 800 can help user's transceiver electronics by WiFi module 870 Mail, browsing webpage and access streaming video etc., it has provided wireless broadband internet to the user and has accessed.Although Fig. 8 is shown WiFi module 870, but it is understood that, and must be configured into for device 800 is not belonging to, completely it can exist as needed Do not change in the range of disclosed essence and omit.
Processor 880 is the control centre of device 800, utilizes each of various interfaces and the entire electronic equipment of connection Part is stored in memory by running or performing the software program being stored in memory 820 and/or module and call Data in 820, the various functions of executive device 800 and processing data, so as to carry out integral monitoring to electronic equipment.It is optional , processor 880 may include one or more processing units;Preferably, processor 880 can integrate application processor and modulatedemodulate Processor is adjusted, wherein, the main processing operation system of application processor, user interface and application program etc., modem processor Main processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 880.
Device 800 further includes the power supply 882 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity Management system and processor 880 are logically contiguous, so as to realize management charging, electric discharge and power consumption by power-supply management system The functions such as management.
Camera 890 is generally by groups such as camera lens, imaging sensor, interface, digital signal processor, CPU, display screens Into.Wherein, camera lens is fixed on the top of imaging sensor, can be focused on by adjusting camera lens manually to change;Imaging sensor " film " of traditional camera is equivalent to, is the heart of camera collection image;Interface is used for camera using winding displacement, plate to plate Connector, spring connection mode are connect with electronic equipment mainboard, and the image of acquisition is sent to the memory 820;Number Signal processor is handled the image of acquisition by mathematical operation, and the analog image of acquisition is converted to digital picture and is led to It crosses interface and is sent to memory 820.
Although being not shown, device 800 can also be including bluetooth module etc., and details are not described herein.
Device 800 in addition to including one or more processor 880, further included memory and one or more Program, one or more program are stored in memory, and are configured to be performed by one or more processor.
The embodiment of the present invention additionally provides a kind of computer readable storage medium, which can be Computer readable storage medium included in memory in above-described embodiment;Can also be individualism, without supplying eventually Computer readable storage medium in end.There are one the computer-readable recording medium storages or more than one program, this one A either more than one program is used for performing above-mentioned webpage store method by one or more than one processor or webpage is read Take method.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that hardware can be passed through by realizing all or part of step of above-described embodiment It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.

Claims (24)

1. a kind of webpage store method, which is characterized in that the method includes:
It receives and instruction is preserved to the offline of target webpage;
The interactive relation for at least two page data contents that plug-in unit is obtained in the target webpage, the friendship are preserved by webpage Mutual relation is used to indicate switch logic of the page data content when receiving user's operation;
Plug-in unit is preserved by least two page data contents in the target webpage and the interactive relation by the webpage Save as predetermined webpage file.
2. according to the method described in claim 1, it is characterized in that, described preserve the plug-in unit acquisition target webpage by webpage In at least two page data contents interactive relation, including:
The web page source code of the plug-in unit acquisition target webpage is preserved by the webpage;
Plug-in unit is preserved by the webpage and traverses interaction code segment related with the interactive relation in the web page source code, The interactive relation of at least two page datas content is obtained according to the interaction code segment.
3. according to the method described in claim 2, it is characterized in that, described preserve plug-in unit by the target network by the webpage At least two page data contents and the interactive relation in page save as predetermined webpage file, including:
Plug-in unit is preserved by the webpage and obtains resource address from the web page source code;
Plug-in unit is preserved from all web page resources of the resource address download target webpage, the webpage by the webpage Resource includes the resource for being used to form at least two page datas content;
Plug-in unit is preserved by the web page resources, each corresponding resource address of the web page resources, institute by the webpage It states interactive relation and saves as the predetermined webpage file.
4. method according to any one of claims 1 to 3, which is characterized in that described to be preserved described in plug-in unit acquisition by webpage Before the interactive relation of at least two page data contents in target webpage, further include:
Detect whether that having installed the webpage preserves plug-in unit;
If not yet installing the webpage preserves plug-in unit, download and the webpage preservation plug-in unit is installed.
5. according to the method described in claim 4, it is characterized in that, it is described download and install the webpage preserve plug-in unit it Before, it further includes:
Detect whether the communication network currently connected is the first communication network;
If the communication network currently connected is first communication network, performs the download and the webpage is installed and protect The step of depositing plug-in unit.
6. method according to any one of claims 1 to 5, which is characterized in that it is service that the webpage, which preserves plug-in unit, worker。
7. a kind of webpage read method, which is characterized in that the method includes:
Obtain the predetermined webpage file of target webpage;
Plug-in unit is preserved from the predetermined webpage file by webpage, obtains at least two page datas in the target webpage The interactive relation of content and at least two page datas content, the interactive relation are used to indicate the page data content Switch logic when receiving user's operation;
Show the page data content in the target webpage;
When receiving user's operation, according to the interactive relation of at least two page datas content to the page number It is switched over according to content.
8. the method according to the description of claim 7 is characterized in that described preserve plug-in unit from predetermined webpage text by webpage In part, the interaction of at least two page data contents and at least two page datas content in the target webpage is obtained Relationship, including:
Plug-in unit is preserved from the predetermined webpage file by webpage, obtains the web page resources, each described of the target webpage The corresponding resource address of web page resources and the interactive relation, the web page resources include being used to form described page at least two The resource of face data content;
The page data content in the display target webpage, including:
According to the corresponding resource address of each web page resources, detect whether the web page resources need to update;
If the web page resources need to update, the updated web page resources are obtained by the resource address;
The page data content in the target webpage is shown by the updated web page resources.
It is 9. according to the method described in claim 8, it is characterized in that, described updated described by resource address acquisition Before web page resources, further include:
Detect whether the communication network currently connected is the first communication network;
If the communication network currently connected is first communication network, performs and update is obtained by the resource address The step of rear web page resources.
10. according to the method described in claim 9, it is characterized in that, it is described detect the communication network that currently connects whether be After first communication network, further include:
If the communication network currently connected is the second communication network, update request is shown, the update request is used for please It asks and the web page resources is updated using second communication network;
When receiving confirmation operation, the step of updated web page resources are obtained by the resource address is performed;
Wherein, the priority of second communication network is less than the priority of first communication network.
11. according to any method of claim 7 to 10, which is characterized in that described to preserve plug-in unit from described by webpage In predetermined webpage file, at least two page data contents in the target webpage and at least two page data are obtained Before the interactive relation of content, further include:
Detect whether that having installed the webpage preserves plug-in unit;
If not yet installing the webpage preserves plug-in unit, download and the webpage preservation plug-in unit is installed.
12. according to any method of claim 7 to 10, which is characterized in that it is service that the webpage, which preserves plug-in unit, worker。
13. a kind of webpage save set, which is characterized in that described device includes:
Receiving module preserves instruction for receiving to the offline of target webpage;
Acquisition module, for preserving the friendship for at least two page data contents that plug-in unit is obtained in the target webpage by webpage Mutual relation, the interactive relation are used to indicate switch logic of the page data content when receiving user's operation;
Preserving module is preserved in the target webpage that plug-in unit obtains the acquisition module at least for passing through the webpage Two page data contents and the interactive relation save as predetermined webpage file.
14. device according to claim 13, which is characterized in that the acquisition module, including:
First acquisition unit, for passing through the web page source code that the webpage preserves plug-in unit and obtains the target webpage;
Traversal Unit, for preserving the web page source code of the plug-in unit traversal first acquisition unit acquisition by the webpage In the interaction code segment related with the interactive relation, at least two page number is obtained according to the interaction code segment According to the interactive relation of content.
15. device according to claim 14, which is characterized in that the preserving module, including:
Second acquisition unit, for the web page source generation obtained by webpage preservation plug-in unit from the first acquisition unit Resource address is obtained in code;
Download unit, for passing through the resource address download that the webpage preserves plug-in unit and obtained from the second acquisition unit All web page resources of the target webpage, the web page resources include being used to form at least two page datas content Resource;
Storage unit preserves plug-in unit by the web page resources, each corresponding institute of the web page resources for passing through the webpage State resource address, the interactive relation saves as the predetermined webpage file.
16. according to any device of claim 13 to 15, which is characterized in that described device further includes:
First detection module, for detecting whether having installed the webpage preserves plug-in unit;
Download module preserves plug-in unit if being detected for the first detection module and not yet installing the webpage, downloads and pacify It fills the webpage and preserves plug-in unit.
17. device according to claim 16, which is characterized in that described device further includes:
Second detection module, for detecting whether the communication network currently connected is the first communication network;
The download module, if being additionally operable to second detection module detects that the communication network currently connected is described One communication network then performs described the step of downloading and installing the webpage preservation plug-in unit.
18. according to any device of claim 13 to 17, which is characterized in that it is service that the webpage, which preserves plug-in unit, worker。
19. a kind of webpage reading device, which is characterized in that described device includes:
First acquisition module, for obtaining the predetermined webpage file of target webpage;
Second acquisition module, for the predetermined webpage file read by webpage preservation plug-in unit from first acquisition module In, the interaction for obtaining at least two page data contents and at least two page datas content in the target webpage is closed System, the interactive relation are used to indicate switch logic of the page data content when receiving user's operation;
First display module, for showing the page data content in the target webpage;
Handover module, for when receiving user's operation, being closed according to the interaction of at least two page datas content System switches over the page data content that first display module is shown.
20. device according to claim 19, which is characterized in that
Second acquisition module is additionally operable to preserve plug-in unit from the predetermined webpage file by webpage, obtains the target network The web page resources of page, each corresponding resource address of web page resources and the interactive relation, the web page resources include It is used to form the resource of at least two page datas content;
First display module, including:
Detection unit, for according to each corresponding resource address of the web page resources, detecting whether the web page resources need Update;
If needing to update for the web page resources, the updated net is obtained by the resource address for updating unit Page resource;
Display unit, for passing through in the page data that the updated web page resources are shown in the target webpage Hold.
21. device according to claim 20, which is characterized in that described device further includes:
First detection module, for detecting whether the communication network currently connected is the first communication network;
The updating unit, if being additionally operable to the first detection module detects that the communication network currently connected is described One communication network then performs the step of obtaining the updated web page resources by the resource address.
22. device according to claim 21, which is characterized in that described device further includes:
Second display module, if detecting that the communication network currently connected is the second communication for the first detection module Network, then show update request, it is described update request for ask using second communication network to the web page resources into Row update;
The updating unit is additionally operable to when receiving confirmation operation, is performed and is obtained updated institute by the resource address The step of stating web page resources;
Wherein, the priority of second communication network is less than the priority of first communication network.
23. according to any device of claim 19 to 22, which is characterized in that described device further includes:
Second detection module, for detecting whether having installed the webpage preserves plug-in unit;
Download module preserves plug-in unit if being detected for second detection module and not yet installing the webpage, downloads and pacify It fills the webpage and preserves plug-in unit.
24. according to any device of claim 19 to 22, which is characterized in that it is service that the webpage, which preserves plug-in unit, worker。
CN201611105483.7A 2016-12-05 2016-12-05 Webpage storage method, webpage reading method and device Active CN108153778B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611105483.7A CN108153778B (en) 2016-12-05 2016-12-05 Webpage storage method, webpage reading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611105483.7A CN108153778B (en) 2016-12-05 2016-12-05 Webpage storage method, webpage reading method and device

Publications (2)

Publication Number Publication Date
CN108153778A true CN108153778A (en) 2018-06-12
CN108153778B CN108153778B (en) 2021-05-14

Family

ID=62470059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611105483.7A Active CN108153778B (en) 2016-12-05 2016-12-05 Webpage storage method, webpage reading method and device

Country Status (1)

Country Link
CN (1) CN108153778B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920645A (en) * 2018-06-29 2018-11-30 广州视源电子科技股份有限公司 Method, apparatus, smart machine and the storage medium that the smart machine page is shown
CN110471887A (en) * 2019-07-29 2019-11-19 深圳数位传媒科技有限公司 A kind of method and device obtaining web page contents rendering file
CN110858114A (en) * 2018-08-22 2020-03-03 北京字节跳动网络技术有限公司 Webpage display method, bookmark generation method, device, equipment and medium on mobile terminal
CN111245890A (en) * 2019-12-25 2020-06-05 曙光信息产业(北京)有限公司 Method and device for downloading files in webpage
CN111316618A (en) * 2018-10-11 2020-06-19 华为技术有限公司 Network page storage method and terminal
CN112632425A (en) * 2020-12-10 2021-04-09 京东数字科技控股股份有限公司 Method, device, equipment and storage medium for generating offline resource file
CN113051502A (en) * 2021-03-11 2021-06-29 北京顶象技术有限公司 Webpage saving method, device, equipment and storage medium
CN115982499A (en) * 2022-12-27 2023-04-18 中国电子产业工程有限公司 Page storage method, device, equipment and storage medium
CN116467037A (en) * 2023-06-09 2023-07-21 成都融见软件科技有限公司 Graphic user interface work state recovery method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120016335A (en) * 2010-08-16 2012-02-24 에스케이플래닛 주식회사 Web page pre-caching system and method for offline-executing
CN102457499A (en) * 2010-10-26 2012-05-16 腾讯科技(深圳)有限公司 Offline working method for client, and offline working client
CN103699674A (en) * 2013-12-31 2014-04-02 优视科技有限公司 Webpage storing method, webpage opening method, webpage storing device, webpage opening device and webpage browsing system
CN101690128B (en) * 2007-06-29 2014-05-07 诺基亚公司 Systems, methods, devices, and computer program products for downloading content for offline browsing
CN103873502A (en) * 2012-12-11 2014-06-18 阿里巴巴集团控股有限公司 Cache updating method and system, and update resource providing method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101690128B (en) * 2007-06-29 2014-05-07 诺基亚公司 Systems, methods, devices, and computer program products for downloading content for offline browsing
KR20120016335A (en) * 2010-08-16 2012-02-24 에스케이플래닛 주식회사 Web page pre-caching system and method for offline-executing
CN102457499A (en) * 2010-10-26 2012-05-16 腾讯科技(深圳)有限公司 Offline working method for client, and offline working client
CN103873502A (en) * 2012-12-11 2014-06-18 阿里巴巴集团控股有限公司 Cache updating method and system, and update resource providing method and system
CN103699674A (en) * 2013-12-31 2014-04-02 优视科技有限公司 Webpage storing method, webpage opening method, webpage storing device, webpage opening device and webpage browsing system

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108920645A (en) * 2018-06-29 2018-11-30 广州视源电子科技股份有限公司 Method, apparatus, smart machine and the storage medium that the smart machine page is shown
CN110858114A (en) * 2018-08-22 2020-03-03 北京字节跳动网络技术有限公司 Webpage display method, bookmark generation method, device, equipment and medium on mobile terminal
CN110858114B (en) * 2018-08-22 2021-12-10 北京字节跳动网络技术有限公司 Webpage display method, bookmark generation method, device, equipment and medium on mobile terminal
CN111316618A (en) * 2018-10-11 2020-06-19 华为技术有限公司 Network page storage method and terminal
CN110471887A (en) * 2019-07-29 2019-11-19 深圳数位传媒科技有限公司 A kind of method and device obtaining web page contents rendering file
CN111245890A (en) * 2019-12-25 2020-06-05 曙光信息产业(北京)有限公司 Method and device for downloading files in webpage
CN111245890B (en) * 2019-12-25 2022-08-02 曙光信息产业(北京)有限公司 Method and device for downloading files in webpage
CN112632425B (en) * 2020-12-10 2024-02-06 京东科技控股股份有限公司 Method, device, equipment and storage medium for generating offline resource file
CN112632425A (en) * 2020-12-10 2021-04-09 京东数字科技控股股份有限公司 Method, device, equipment and storage medium for generating offline resource file
CN113051502A (en) * 2021-03-11 2021-06-29 北京顶象技术有限公司 Webpage saving method, device, equipment and storage medium
CN115982499A (en) * 2022-12-27 2023-04-18 中国电子产业工程有限公司 Page storage method, device, equipment and storage medium
CN115982499B (en) * 2022-12-27 2024-04-05 中国电子产业工程有限公司 Page storage method, device, equipment and storage medium
CN116467037A (en) * 2023-06-09 2023-07-21 成都融见软件科技有限公司 Graphic user interface work state recovery method
CN116467037B (en) * 2023-06-09 2023-09-22 成都融见软件科技有限公司 Graphic user interface work state recovery method

Also Published As

Publication number Publication date
CN108153778B (en) 2021-05-14

Similar Documents

Publication Publication Date Title
CN108153778A (en) Webpage store method, webpage read method and device
CN105824641B (en) Graphic code display methods and device
CN103617165B (en) Picture loading method, device and terminal
US10853437B2 (en) Method and apparatus for invoking application programming interface
CN104794396B (en) Across standing posture script loophole detection method and device
CN108984548A (en) Content of pages caching method and device
CN109407930A (en) A kind of applied program processing method and terminal device
CN106547844B (en) A kind for the treatment of method and apparatus of user interface
CN111178012A (en) Form rendering method, device and equipment and storage medium
CN105320687A (en) Webpage display method and device
CN105389259B (en) A kind of method, apparatus and system for carrying out Application testing
CN104298686B (en) The method and apparatus for modifying server profile
CN108536594A (en) Page test method, device and storage device
CN108228230A (en) Upgrade method, terminal and the computer readable storage medium of UFS firmwares
CN107786906A (en) The method and apparatus that a kind of browser plays video in independent window
CN105446726A (en) Method and device for generating webpage
CN109309696A (en) Portfolios method, sender, recipient and storage medium
CN108073647A (en) Webpage display process and device
CN105955739A (en) Graphical interface processing method, apparatus and system
CN104516890B (en) Method for processing business, device and electronic equipment
CN108549826A (en) Method of calibration, terminal, server and the readable storage medium storing program for executing of application program
CN108009033A (en) Simulate touch control method, device and mobile terminal
CN108320148A (en) A kind of resource transfers method and relevant device
CN107957841A (en) Roll screenshotss method and device
CN109491670A (en) A kind of page display method and terminal device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant