WO2018072388A1 - Method for pre-reading webpage, method and device for accessing webpage, and programmable device - Google Patents

Method for pre-reading webpage, method and device for accessing webpage, and programmable device Download PDF

Info

Publication number
WO2018072388A1
WO2018072388A1 PCT/CN2017/077535 CN2017077535W WO2018072388A1 WO 2018072388 A1 WO2018072388 A1 WO 2018072388A1 CN 2017077535 W CN2017077535 W CN 2017077535W WO 2018072388 A1 WO2018072388 A1 WO 2018072388A1
Authority
WO
WIPO (PCT)
Prior art keywords
webpage
sub
resource
target webpage
reading
Prior art date
Application number
PCT/CN2017/077535
Other languages
French (fr)
Chinese (zh)
Inventor
吴伟勇
Original Assignee
广州市动景计算机科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州市动景计算机科技有限公司 filed Critical 广州市动景计算机科技有限公司
Publication of WO2018072388A1 publication Critical patent/WO2018072388A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • 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/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Definitions

  • the present invention relates to the field of network technologies, and in particular, to a webpage pre-reading method, a webpage accessing method, a device, and a programmable device.
  • the reference on the page of the webpage currently accessed by the user is determined.
  • One or more webpages are webpages that need to be pre-read.
  • the browser used by the user or a browser-like application parses the webpage in the background and loads the webpage frame for the webpage to be read in advance. (eg DOM tree) and all sub-resources;
  • the browser or a browser-like application can directly render the webpage with the loaded webpage framework and all the sub-resources, so that the webpage access response time of the pre-read webpage is perceived by the user side is small, and the user is improved.
  • the perceived speed of accessing a web page can be directly rendered.
  • the inventor has found that the above-mentioned webpage pre-reading scheme ultimately relies on the prediction of the user's webpage access behavior, and only accurate prediction of the user's access behavior can bring about a better actual speed of the user's access to the webpage, but Compared with the actual network access behavior of users, the predicted network access behavior is always different.
  • the best web page read-ahead hit rate (the number of pre-read webpages/read-read webpages actually clicked by users) can only be approximated. 80%, therefore, there will always be pre-read webpages that have been read-ahead but the users do not actually access them.
  • An object of the embodiments of the present invention is to provide a webpage pre-reading method, a webpage accessing method, a device, and a programmable device, so as to effectively save the traffic consumed by pre-reading a webpage to improve the user experience, and reduce the cost of pre-reading the webpage. Processing resources.
  • a webpage pre-reading method including:
  • the step of determining the preloaded sub-resource and the lazy-loaded sub-resource includes:
  • Determining when determining that the sub-resource included in the pre-reading portion of the target webpage is a pre-loaded sub-resource, according to the webpage framework of the target webpage, loading the pre-loaded sub-resource to load the pre-loaded sub-resource The corresponding location to the webpage frame of the target webpage.
  • the pre-read part of the target webpage is the first screen content of the target webpage.
  • the lazy-loading sub-resource includes at least a sized picture sub-resource in the pre-read portion of the target webpage.
  • a webpage access method including:
  • the target webpage is a webpage that has completed the pre-reading process according to any one of the webpage pre-reading methods of the first aspect of the present invention, loading the delayed loading sub-resource of the target webpage to the Corresponding location in the webpage frame of the target webpage to display the pre-read portion of the target webpage.
  • a webpage pre-reading apparatus includes:
  • a sub-resource determining unit configured to determine a pre-loading sub-resource and a lazy-loading sub-resource included in the pre-reading part of the target webpage according to the acquired webpage framework of the target webpage, in response to the pre-reading request to the target webpage ;
  • a sub-resource pre-loading unit configured to load the pre-loaded sub-resource to a corresponding position of a webpage frame of the target webpage, to complete pre-reading processing on the target webpage.
  • the sub-resource determining unit includes:
  • a webpage access device for responding to an access request to a target webpage, wherein the target webpage is any webpage pre-reading method that has been provided according to the first aspect of the present invention.
  • Web page that completes pre-reading And loading a delayed loading sub-resource of the target webpage to a corresponding location in a webpage frame of the target webpage to display a pre-reading portion of the target webpage.
  • a programmable device comprising a memory and a processor, the memory for storing instructions for controlling the processor to operate to perform first according to the present invention Any of the web page read-ahead methods provided by the aspect.
  • a programmable device comprising a memory and a processor, the memory for storing instructions for controlling the processor to operate to perform a second according to the present invention Any of the web page access methods provided by the aspect.
  • the webpage pre-reading method, the webpage accessing method, the device, and the programmable device provided by the embodiment of the present invention determine the preloaded sub-resource and the lazy-loader included in the pre-reading part of the target webpage by using the webpage framework of the obtained target webpage.
  • the resource only loads the preloaded sub-resource when the target webpage is pre-read.
  • the lazy loading resource is loaded, which can save the traffic consumed during the pre-reading webpage and reduce the traffic of the user visiting the webpage.
  • the cost burden increases the user experience, and it also reduces the memory resources and processor resources used to load too many sub-resources during pre-reading web pages.
  • FIG. 1 is a schematic diagram showing an application environment of a programmable device according to an embodiment of the present invention.
  • FIG. 2 is a block schematic diagram of a programmable device in accordance with an embodiment of the present invention.
  • FIG. 3 is a flow chart showing a webpage pre-reading method in an embodiment of the present invention.
  • FIG. 4 is a block diagram showing a webpage pre-reading apparatus in an embodiment of the present invention.
  • FIG. 5 is a flowchart of an example of a webpage pre-reading and webpage accessing method according to an embodiment of the present invention.
  • FIG. 1 it is a server 2000 and an editable embodiment provided by the preferred embodiment of the present invention. Schematic diagram of the interaction of the device 1000 communication.
  • the server 2000 can communicate with one or more of the programmable devices 1000 over a network 3000 to enable data communication or interaction between the server 2000 and the programmable device 1000.
  • the server 2000 may be, but not limited to, a web server, a file transfer protocol (ftp) server, and the like.
  • the programmable device 1000 can be, but not limited to, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile internet device (MID), etc. .
  • the network 3000 can be, but is not limited to, a wired network or a wireless network.
  • the operating system of the programmable device 1000 may be, but not limited to, an Android system, an IOS (iPhone operating system) system, a Windows phone system, a Windows system, and the like.
  • FIG. 2 is a block schematic diagram showing a programmable device 1000 in which embodiments of the present invention may be implemented.
  • programmable device 1000 can include processor 1010, memory 1020, interface device 1030, communication device 1040, display device 1050, input device 1060, speaker 1070, microphone 1080, and the like.
  • the processor 1010 may be a central processing unit CPU, a microprocessor MCU, or the like.
  • the memory 1020 includes, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), a nonvolatile memory such as a hard disk, and the like.
  • the interface device 1030 includes, for example, a USB interface, a headphone interface, a Bluetooth interface, and the like.
  • the communication device 1040 can, for example, perform wired or wireless communication.
  • the display device 1050 is, for example, a liquid crystal display, a touch display, or the like.
  • Input device 1060 for example It can include a touch screen, a keyboard, and the like. The user can input/output voice information through the speaker 1070 and the microphone 1080.
  • the memory 1020 of the programmable device 1000 is configured to store instructions for controlling the processor 1010 to perform operations to perform pre-processing of any one of the web pages provided by the embodiments of the present invention. Read method or web page access method. It will be understood by those skilled in the art that although a plurality of devices are illustrated for the programmable device 1000 in FIG. 2, the present invention may relate only to some of the devices therein, for example, the programmable device 1000 only relates to the processor 1010 and the storage device. 1020 and so on. A technician can design instructions in accordance with the disclosed aspects of the present invention. How the instructions control the processor 1010 to operate is well known in the art and will not be described in detail herein.
  • the webpage pre-reading method includes:
  • Step S2100 In response to the read-ahead request for the target webpage, determine, according to the acquired webpage framework of the target webpage, a preloading sub-resource and a lazy-loading sub-resource included in the pre-reading part of the target webpage.
  • the target webpage is sent by the server 2000 to the programmable device 1000 after receiving the download request sent by the programmable device 1000.
  • the pre-read request of the target webpage is not limited. Generating method The pre-reading request of the webpage may be predicted according to the behavior of the user visiting the webpage or historical habits, for example, according to the keyword of the webpage currently accessed by the user, or generated according to the historical webpage access record of the user, or the current visit of the user.
  • the web page features are generated, and so on.
  • the obtained page is parsed to obtain a webpage frame of the target webpage
  • the webpage framework represents the page structure of the webpage.
  • the page structure includes information such as page layout, sub-resource attributes contained in the page, and location of sub-resources.
  • the webpage frame of the target webpage may be a DOM (Document Object Mode) of the target webpage.
  • the DOM tree treats the elements in the web page as objects that can be edited and retrieved.
  • the DOM tree contains the DOM elements that make up the DOM tree. Each DOM element stores the corresponding content contained in the web page (the size, location, and layout attributes correspond to each other. Placed sub-resource information, etc.).
  • the sub-resource types include CSS (Cascading Style Sheets) sub-resources, JS (JavaScript, literal translation scripting language) sub-resources, Picture sub-resources, video sub-resources, audio sub-resources, etc.
  • the type of the various sub-resources included in the target webpage may be determined according to the acquired webpage framework of the target webpage, and the pre-loaded sub-resources included in the pre-reading part of the target webpage may be determined and the lazy loading may be performed. Child resource.
  • the pre-loading sub-resource is a key sub-resource that needs to be loaded on the pre-reading part of the target webpage when the pre-reading process is performed on the target webpage, for example, a CSS sub-resource, JS sub-resources, non-size image sub-resources of the target web page, background images of the target web page, and the like.
  • the size-in-picture sub-resource needs to be loaded when the webpage is accessed by the external connection method, and the size of the image display is determined according to the image sub-resource defined by the self-size. If it is missing, the layout of the webpage is affected.
  • the background image of the target webpage refers to the background of some interaction-related webpage elements in the target webpage, such as function buttons (input/div nodes, etc.), clickable regions (a node, etc.), etc., if the background image is missing, it will affect The interactive function of the web page.
  • the lazy-loading sub-resource needs to be loaded, but may not be pre-loaded when the webpage is pre-read, but includes a sub-resource, such as a video sub-page of the target webpage, in the pre-reading portion of the target webpage that is reloaded when the user actually accesses the target webpage.
  • a sub-resource such as a video sub-page of the target webpage
  • the size picture sub-resource is required to be loaded when the web page is accessed by the external connection mode, and the size of the picture display is determined according to the layout of the web page. If it is missing, the layout of the web page is not affected.
  • the lazy-loaded sub-resource includes at least a sized picture sub-resource in the pre-read portion of the target web page.
  • the pre-reading part of the target webpage is a corresponding area of the target webpage that is initially rendered and displayed to the user when the user actually accesses the target webpage
  • the pre-reading section may be set or changed according to the user's needs and the application scenario, for example, When the user accesses the webpage through the network provided by the mobile network operator, the pre-reading part may be set as the first screen content of the target webpage, so as to save the traffic consumed by the pre-read webpage, and reduce the traffic cost burden of the user accessing the webpage; Or, when the user switches from the network provided by the mobile operator to the local wireless local area network (for example, wifi) to access the webpage, The change of the pre-reading portion is the entire content of the target webpage.
  • the pre-reading portion may also be set as the first screen content of the target webpage, so as to reduce implementation.
  • the pre-read portion of the target web page is the first screen content of the target web page.
  • the setting or change of the pre-reading part may be automatically triggered in the background by a browser or a browser-like application that implements webpage access, and an interface may be provided for user operation triggering.
  • step S2100 the process proceeds to step S2200, and the preloaded sub-resource is loaded to the corresponding position of the webpage frame of the target webpage to complete the pre-reading process of the target webpage.
  • the pre-reading process on the target webpage loads only the pre-loaded sub-resources in the pre-reading part of the target webpage, and does not load the lazy-loaded sub-resource, which can save the consumption in the process of pre-reading the webpage.
  • Traffic improving the user experience, can also reduce the memory resources and processor (such as CPU) resources used to load too many sub-resources during pre-reading web pages.
  • the size picture sub-resource is used as a lazy loading sub-resource, and is not loaded when performing pre-reading processing on the target webpage, which does not affect the typesetting of the pre-reading part of the target webpage, and can effectively save the pre-reading webpage process.
  • the step S2100 and the step S2200 can also be performed.
  • the fork is reciprocated to complete the pre-reading process on the target webpage.
  • the step of determining the pre-loaded sub-resource and the lazy-loading sub-resource includes:
  • a webpage pre-reading device 3000 is further provided, as shown in FIG. 3, including a sub-resource determining unit 3100 and a sub-resource pre-loading unit 3200, for implementing any webpage pre-preparation provided in this embodiment.
  • the reading method will not be described here.
  • Web page read-ahead device 3000 including:
  • the sub-resource determining unit 3100 is configured to determine, according to the acquired webpage framework of the target webpage, a preloading sub-resource and a lazy-loader included in the pre-reading part of the target webpage, in response to the pre-reading request to the target webpage.
  • the sub-resource pre-loading unit 3200 is configured to load the pre-loaded sub-resource to a corresponding position of the webpage frame of the target webpage to complete the pre-reading process on the target webpage.
  • the sub-resource determining unit 3100 includes:
  • the pre-read portion of the target web page is the first screen content of the target web page.
  • the lazy-loaded sub-resource includes at least a sized picture sub-resource in the pre-read portion of the target web page.
  • the webpage pre-reading device may have multiple physical forms, such as a browser, a browser-like application, or a browser-independent browser-like application. Feature plugins and more.
  • a programmable device is also provided, the memory is configured to store an instruction, and the instruction is used to control the processor to perform the webpage pre-reading method according to any one of the embodiments.
  • the hardware configuration of the programmable device can be as shown in FIG. 2, and details are not described herein again.
  • a method for accessing a webpage comprising: responding to an access request to the target webpage, and when the target webpage is provided by any one of the methods in the embodiment to complete the pre-reading processing webpage, the loading station Deferred loading of the target webpage to a corresponding location in the webpage frame of the target webpage to display a pre-read portion of the target webpage.
  • the target webpage is a method provided by any one of the embodiments to complete the pre-reading
  • the webpage of the rationale has already loaded the preloaded sub-resource of the pre-reading part of the target webpage, and then loads the delayed loading sub-resource of the pre-reading part of the target webpage when actually accessing the target webpage, thereby saving the traffic consumed during the pre-reading webpage. And reduce the memory processing resources used to load too many child resources during the pre-reading of the web page.
  • the size picture sub-resource is used as a lazy loading sub-resource, and is not loaded when performing pre-reading processing on the target webpage, which does not affect the typesetting of the pre-reading part of the target webpage, and can effectively save the pre-reading webpage process.
  • the pre-read portion of the target webpage may be the first screen content of the target webpage. Therefore, the user can directly render the first screen content of the target webpage accessed by the user, and quickly respond to the user request of the user to access the target webpage, thereby improving the user experience. When the user needs to further browse the rest of the content of the target webpage, the user continues to load the sub-resources included in the remaining content for rendering display, which can reduce the traffic consumption of the visited webpage, and make the webpage access more efficient.
  • a webpage accessing device is further configured to: respond to the access request to the target webpage, and when the target webpage is a webpage pre-reading method according to any one of the embodiments provided in this embodiment, When the processed webpage is read, the lazy loading sub-resource of the target webpage is loaded to a corresponding position in the webpage frame of the target webpage to display the pre-reading part of the target webpage.
  • the webpage access device may not be limited to have multiple physical forms, such as a browser having a webpage access function, an application having a browser-like function, and the like.
  • a programmable device including a memory and a processor, where the memory is used to store an instruction, and the instruction is used to control the processor to perform the webpage access method provided in this embodiment.
  • the hardware configuration of the programmable device can be as shown in FIG. 2, and details are not described herein again.
  • the pre-read portion of the target web page is set as the first screen content of the target web page, and the flowchart is as shown in FIG. 5, including:
  • step S401 in response to the pre-read request of the target webpage, the page of the target webpage is obtained according to the URL address of the target webpage to perform page analysis to obtain the DOM tree of the target webpage.
  • step S402 it is determined whether the DOM tree of the target webpage that is parsed meets the first screen content display of the target webpage. If the content display of the first screen is satisfied, the pre-reading processing of the target webpage is completed, and the process proceeds to step S407. Otherwise, the process proceeds to step S403. .
  • Step S403 judging whether the current sub-resource to be processed needs to be loaded according to the DOM tree of the target webpage, if yes, proceeding to step S404, otherwise, returning to step S402.
  • Step S404 determining whether the current sub-resource is a lazy-loaded sub-resource, for example, having a size picture sub-resource, if yes, proceeding to step S405; otherwise, the current sub-resource is a pre-loaded sub-resource, transferring to the pre-loaded sub-resource, and transferring Proceed to step S406.
  • step S405 the current sub-resource is marked as "delayed-loaded sub-resource", and the process proceeds to step S402.
  • Step S406 loading the current sub-resource to the corresponding location in the DOM tree, and proceeding to step S402.
  • Step S407 it is determined whether the target webpage subjected to the pre-reading process is actually accessed by the user, and if accessed by the user, the process proceeds to step S408, otherwise, the process ends.
  • Step S408 determining whether the content of the first screen of the target webpage needs to load the delayed loading sub-resource, if necessary, proceeding to step S409, otherwise proceeding to step S410.
  • Step S409 loading the delayed loading sub-resource of the target webpage to a corresponding location in the DOM tree, and proceeding to step S410.
  • Step S410 rendering the DOM tree to display the first screen content of the target webpage, and proceeding to step S411.
  • step S411 it is determined whether the user further wants to continue browsing the target webpage, and if so, proceeds to step S412, otherwise, ends.
  • Step S412 continuing to load the sub-resources included in the remaining content of the target webpage to corresponding positions in the DOM tree, rendering and displaying, and ending when the target webpage is closed.
  • a webpage pre-reading method, a webpage accessing method, a device, and a programmable device are provided, and the webpage framework of the obtained target webpage is determined to be included in the webpage.
  • the preloaded sub-resources and the lazy-loaded sub-resources in the pre-reading part of the target webpage are only loaded when the target webpage is pre-read, and the lazy loading resource is loaded when the user actually accesses the target webpage, which can save
  • the traffic consumed during the pre-reading of web pages Reduce the traffic cost burden of users accessing web pages, improve user experience, and reduce the memory resources and processor resources consumed by loading too many sub-resources during pre-reading web pages.
  • the webpage pre-reading device and the webpage accessing device provided in this embodiment can be implemented in various manners.
  • the web page pre-reading device and the web page access device can be implemented by an instruction configuration processor.
  • the instructions can be stored in the ROM, and when the device is booted, the instructions are read from the ROM into the programmable device to implement the web page pre-reading device and the web page access device.
  • web page pre-reading devices and web page access devices can be hardened into a dedicated device (eg, an ASIC).
  • the web page pre-reading device and the web page access device can be divided into mutually independent units, or they can be combined and implemented.
  • the webpage pre-reading device and the webpage accessing device provided in this embodiment may be implemented by one of the above various implementation manners, or may be implemented by a combination of two or more of the above various implementation manners.
  • the invention can be a system, method and/or computer program product.
  • the computer program product can comprise a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement various aspects of the present invention.
  • the computer readable storage medium can be a tangible device that can hold and store the instructions used by the instruction execution device.
  • the computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Non-exhaustive list of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, with instructions stored thereon A raised structure in the hole card or groove, and any suitable combination of the above.
  • a computer readable storage medium as used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (eg, a light pulse through a fiber optic cable), or through a wire The electrical signal transmitted.
  • the computer readable program instructions described herein can be downloaded from a computer readable storage medium to various computing/processing devices or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, Switch, gateway computer, and/or edge server.
  • a network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in each computing/processing device .
  • Computer program instructions for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine related instructions, microcode, firmware instructions, state setting data, or in one or more programming languages.
  • the computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer, partly on the remote computer, or entirely on the remote computer or server. carried out.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or wide area network (WAN), or can be connected to an external computer (eg, using an Internet service provider to access the Internet) connection).
  • the customized electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by utilizing state information of computer readable program instructions.
  • Computer readable program instructions are executed to implement various aspects of the present invention.
  • the computer readable program instructions can be provided to a general purpose computer, a special purpose computer, or a processor of other programmable data processing apparatus to produce a machine such that when executed by a processor of a computer or other programmable data processing apparatus Means for implementing the functions/acts specified in one or more of the blocks of the flowcharts and/or block diagrams.
  • the computer readable program instructions can also be stored in a computer readable storage medium that causes the computer, programmable data processing device, and/or other device to operate in a particular manner, such that the computer readable medium storing the instructions includes An article of manufacture that includes instructions for implementing various aspects of the functions/acts recited in one or more of the flowcharts.
  • the computer readable program instructions can also be loaded onto a computer, other programmable data processing device, or other device to perform a series of operational steps on a computer, other programmable data processing device or other device to produce a computer-implemented process.
  • instructions executed on a computer, other programmable data processing apparatus, or other device implement the functions/acts recited in one or more of the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagram can represent a module, a program segment, or a portion of an instruction that includes one or more components for implementing the specified logical functions.
  • Executable instructions In some as a replacement
  • the functions noted in the blocks may also occur in a different order than those illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts can be implemented in a dedicated hardware-based system that performs the specified function or function. Or it can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Provided are a method for pre-reading a webpage, a method and device for accessing a webpage, and a programmable device. The method for pre-reading a webpage comprises: in response to a request requesting pre-reading of a target webpage, determining, according to an acquired webpage frame of the target webpage, a preloaded sub-resource and a lazy-loaded sub-resource in a pre-read portion of the target webpage (S2100); and loading the preloaded sub-resource to a corresponding position at the webpage frame of the target webpage to complete pre-reading processing of the target webpage (S2200). The method can effectively reduce data usage required for pre-reading a webpage, thereby improving user experience. Moreover, the invention can effectively reduce a memory resource and a processor resource consumed for pre-reading a webpage.

Description

网页预读方法、网页访问方法、设备及可编程设备Web page read-ahead method, web page access method, device and programmable device
本申请要求于2016年10月19日提交中国专利局、申请号为CN201610912930.3、发明名称为“网页预读方法、网页访问方法、设备及可编程设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on October 19, 2016, the Chinese Patent Office, the application number is CN201610912930.3, and the invention name is "Web page read-ahead method, web page access method, device and programmable device". The entire contents are incorporated herein by reference.
技术领域Technical field
本发明涉及网络技术领域,更具体地,涉及一种网页预读方法、网页访问方法、设备及可编程设备。The present invention relates to the field of network technologies, and in particular, to a webpage pre-reading method, a webpage accessing method, a device, and a programmable device.
背景技术Background technique
随着互联网技术的蓬勃发展,使用浏览器或者具有类似浏览器功能的应用程序访问网页已经成为人们日常生活中获取信息的常用手段,而随着网络信息量的几何级增长,网页访问速度也成为影响用户体验的关键因素之一。因此,加速网页访问速度的网页预读方案随之出现,其主要的设计思路为:With the rapid development of Internet technology, accessing web pages using browsers or applications with similar browser functions has become a common means of obtaining information in people's daily life. With the geometric growth of network information, web page access speed has become One of the key factors that affect the user experience. Therefore, the webpage pre-reading scheme that speeds up the access speed of webpages appears, and its main design ideas are:
当用户访问某个网页时,通过对于用户访问行为的预测(例如基于访问页面的关键词、基于用户访问历史统计的预测、基于网页功能特性的预测),确定用户当前访问的网页的页面上引用的某个或者多个网页为需要预读的网页,在用户访问当前网页的过程中,用户使用的浏览器或者类似浏览器的应用程序,对需预读的网页在后台解析页面、加载网页框架(例如DOM树)以及全部的子资源;When a user visits a certain webpage, by referring to the prediction of the user's access behavior (for example, based on the keyword of the visited page, the prediction based on the user's access history statistics, the prediction based on the functional characteristics of the webpage), the reference on the page of the webpage currently accessed by the user is determined. One or more webpages are webpages that need to be pre-read. In the process of the user accessing the current webpage, the browser used by the user or a browser-like application parses the webpage in the background and loads the webpage frame for the webpage to be read in advance. (eg DOM tree) and all sub-resources;
当用户随后点击访问该已经预读的网页时,用户所使用的浏 览器或者类似浏览器的应用程序,可以直接将该网页以加载的网页框架和全部子资源进行渲染显示,从而使得在用户侧感知该已预读网页的网页访问响应时间很少,提高了用户访问网页的感知速度。When the user subsequently clicks to access the pre-read web page, the user uses the browsing The browser or a browser-like application can directly render the webpage with the loaded webpage framework and all the sub-resources, so that the webpage access response time of the pre-read webpage is perceived by the user side is small, and the user is improved. The perceived speed of accessing a web page.
但是,发明人发现,上述的网页预读方案归根结底,依赖于对用户网页访问行为的预测,只有精准的预测用户访问行为,才能带来较好的实际达到用户访问网页感知速度加速的目的,但是预测的网络访问行为与用户实际的网络访问行为相比,总是不免存在差异,时下最好的网页预读命中率(用户实际点击已预读网页数/已预读网页数)也只能接近80%,因此,总会存在已经进行预读但是用户却实际没有访问的预读网页,这就会带来资源的浪费:一是浪费预读该网页时为加载该网页的网页框架、全部子资源所耗费的流量,尤其在使用移动运营商网络进行网页访问时会更突出,会给用户造成流量成本负担,影响用户体验;二是浪费浏览器或者类似浏览器的应用程序为预读该网页进行如页面解析、排版、图片解码等逻辑处理所耗费的内存资源以及处理器(例如CPU)资源等。However, the inventor has found that the above-mentioned webpage pre-reading scheme ultimately relies on the prediction of the user's webpage access behavior, and only accurate prediction of the user's access behavior can bring about a better actual speed of the user's access to the webpage, but Compared with the actual network access behavior of users, the predicted network access behavior is always different. The best web page read-ahead hit rate (the number of pre-read webpages/read-read webpages actually clicked by users) can only be approximated. 80%, therefore, there will always be pre-read webpages that have been read-ahead but the users do not actually access them. This will result in waste of resources: one is to waste the pre-reading of the webpage as the webpage frame for loading the webpage, all the sub-pages The traffic consumed by resources, especially when using the mobile operator network for web page access, will be more prominent, causing traffic cost burden to users and affecting user experience. Second, wasting browser or browser-like applications to pre-read the webpage. Perform memory resources such as page parsing, typesetting, and image decoding, as well as processors (such as C PU) resources, etc.
发明内容Summary of the invention
本发明实施例的一个目的是提供一种网页预读方法、网页访问方法、设备及可编程设备,以有效节省预读网页时所耗费的流量以提升用户体验,效降低预读网页时所耗费的处理资源。 An object of the embodiments of the present invention is to provide a webpage pre-reading method, a webpage accessing method, a device, and a programmable device, so as to effectively save the traffic consumed by pre-reading a webpage to improve the user experience, and reduce the cost of pre-reading the webpage. Processing resources.
根据本发明实施例的第一方面,提供了一种网页预读方法,包括:According to a first aspect of the embodiments of the present invention, a webpage pre-reading method is provided, including:
响应对目标网页的预读请求,根据所获取的所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源;Responding to the pre-reading request for the target webpage, determining, according to the acquired webpage framework of the target webpage, the preloaded sub-resources and the lazy-loading sub-resources included in the pre-reading part of the target webpage;
加载所述预加载子资源至所述目标网页的网页框架的对应位置,以完成对所述目标网页的预读处理。Loading the preloaded sub-resource to a corresponding location of a webpage frame of the target webpage to complete a pre-reading process on the target webpage.
可选地,所述确定所述预加载子资源以及所述延迟加载子资源步骤包括:Optionally, the step of determining the preloaded sub-resource and the lazy-loaded sub-resource includes:
根据所述目标网页的网页框架,确定所述目标网页的预读部分内包含的子资源为延迟加载子资源时,标记该子资源为延迟加载子资源;And determining, according to the webpage framework of the target webpage, that the sub-resource included in the pre-reading part of the target webpage is a lazy-loaded sub-resource, marking the sub-resource as a lazy-loaded sub-resource;
根据所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的子资源为预加载子资源时,触发加载所述预加载子资源的步骤,以便加载所述预加载子资源至所述目标网页的网页框架的对应位置。Determining, when determining that the sub-resource included in the pre-reading portion of the target webpage is a pre-loaded sub-resource, according to the webpage framework of the target webpage, loading the pre-loaded sub-resource to load the pre-loaded sub-resource The corresponding location to the webpage frame of the target webpage.
可选地,所述目标网页的预读部分为所述目标网页的首屏内容。Optionally, the pre-read part of the target webpage is the first screen content of the target webpage.
可选地,所述延迟加载子资源至少包括所述目标网页的预读部分中的有尺寸图片子资源。Optionally, the lazy-loading sub-resource includes at least a sized picture sub-resource in the pre-read portion of the target webpage.
根据本发明实施例的第二方面,提供一种网页访问方法,包括: According to a second aspect of the embodiments of the present invention, a webpage access method is provided, including:
响应对目标网页的访问请求,当所述目标网页为已经根据本发明的第一方面的任意一项网页预读方法完成预读处理的网页时,加载所述目标网页的延迟加载子资源至所述目标网页的网页框架中的对应位置,以显示所述目标网页的预读部分。Responding to the access request to the target webpage, when the target webpage is a webpage that has completed the pre-reading process according to any one of the webpage pre-reading methods of the first aspect of the present invention, loading the delayed loading sub-resource of the target webpage to the Corresponding location in the webpage frame of the target webpage to display the pre-read portion of the target webpage.
根据本发明实施例的第三方面,提供一种网页预读设备,包括:According to a third aspect of the embodiments of the present invention, a webpage pre-reading apparatus includes:
子资源确定单元,用于响应对目标网页的预读请求,根据所获取的所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源;a sub-resource determining unit, configured to determine a pre-loading sub-resource and a lazy-loading sub-resource included in the pre-reading part of the target webpage according to the acquired webpage framework of the target webpage, in response to the pre-reading request to the target webpage ;
子资源预加载单元,用于加载所述预加载子资源至所述目标网页的网页框架的对应位置,以完成对所述目标网页的预读处理。a sub-resource pre-loading unit, configured to load the pre-loaded sub-resource to a corresponding position of a webpage frame of the target webpage, to complete pre-reading processing on the target webpage.
可选地,所述子资源确定单元包括:Optionally, the sub-resource determining unit includes:
用于根据所述目标网页的网页框架,确定所述目标网页的预读部分内包含的子资源为延迟加载子资源时,标记该子资源为延迟加载子资源的装置;And determining, according to the webpage framework of the target webpage, a device that marks the sub-resource as a lazy-loaded sub-resource when the sub-resource included in the pre-reading part of the target webpage is a lazy-loaded sub-resource;
用于根据所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的子资源为预加载子资源时,触发所述子资源预加载单元工作以加载该预加载子资源至所述目标网页的网页框架的对应位置的装置。Determining, when the sub-resource included in the pre-read portion of the target webpage is a pre-loaded sub-resource, according to the webpage framework of the target webpage, triggering the sub-resource pre-loading unit to load the pre-loaded sub-resource to A device for a corresponding location of a webpage frame of the target webpage.
根据本发明实施例的第四方面,提供一种网页访问设备,用于响应对目标网页的访问请求,当所述目标网页为已经根据本发明的第一方面提供的任意一项网页预读方法完成预读处理的网页 时,加载所述目标网页的延迟加载子资源至所述目标网页的网页框架中的对应位置,以显示所述目标网页的预读部分。According to a fourth aspect of the present invention, a webpage access device is provided for responding to an access request to a target webpage, wherein the target webpage is any webpage pre-reading method that has been provided according to the first aspect of the present invention. Web page that completes pre-reading And loading a delayed loading sub-resource of the target webpage to a corresponding location in a webpage frame of the target webpage to display a pre-reading portion of the target webpage.
根据本发明实施例的第五方面,提供一种可编程设备,包括存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据本发明第一方面提供的任意一项的网页预读方法。According to a fifth aspect of an embodiment of the present invention, there is provided a programmable device comprising a memory and a processor, the memory for storing instructions for controlling the processor to operate to perform first according to the present invention Any of the web page read-ahead methods provided by the aspect.
根据本发明实施例的第六方面,提供一种可编程设备,包括存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据本发明第二方面提供的任意一项的网页访问方法。According to a sixth aspect of an embodiment of the present invention, there is provided a programmable device comprising a memory and a processor, the memory for storing instructions for controlling the processor to operate to perform a second according to the present invention Any of the web page access methods provided by the aspect.
本发明实施例提供的网页预读方法、网页访问方法、设备及可编程设备,通过所获取目标网页的网页框架确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源,在预读目标网页时只加载所述预加载子资源,当用户实际访问目标网页时再加载所述延迟加载资源,可以节省预读网页过程中所消耗的流量,降低用户访问网页的流量成本负担,提升用户体验,此外也能降低预读网页过程中加载过多子资源所耗费的内存资源以及处理器资源。The webpage pre-reading method, the webpage accessing method, the device, and the programmable device provided by the embodiment of the present invention determine the preloaded sub-resource and the lazy-loader included in the pre-reading part of the target webpage by using the webpage framework of the obtained target webpage. The resource only loads the preloaded sub-resource when the target webpage is pre-read. When the user actually accesses the target webpage, the lazy loading resource is loaded, which can save the traffic consumed during the pre-reading webpage and reduce the traffic of the user visiting the webpage. The cost burden increases the user experience, and it also reduces the memory resources and processor resources used to load too many sub-resources during pre-reading web pages.
附图说明DRAWINGS
被结合在说明书中并构成说明书的一部分的附图示出了本发明的实施例,并且连同其说明一起用于解释本发明的原理。The accompanying drawings, which are incorporated in FIG
图1示出了本发明实施例的可编程设备的应用环境示意图。 FIG. 1 is a schematic diagram showing an application environment of a programmable device according to an embodiment of the present invention.
图2示出了本发明实施例的可编程设备的方框示意图。2 is a block schematic diagram of a programmable device in accordance with an embodiment of the present invention.
图3示出了本发明实施例中网页预读方法的流程图。FIG. 3 is a flow chart showing a webpage pre-reading method in an embodiment of the present invention.
图4示出了本发明实施例中网页预读设备的方框示意图。FIG. 4 is a block diagram showing a webpage pre-reading apparatus in an embodiment of the present invention.
图5是本发明实施例的网页预读以及网页访问方法例子的流程图。FIG. 5 is a flowchart of an example of a webpage pre-reading and webpage accessing method according to an embodiment of the present invention.
具体实施方式detailed description
现在将参照附图来详细描述本发明的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本发明的范围。Various exemplary embodiments of the present invention will now be described in detail with reference to the drawings. It should be noted that the relative arrangement of the components and steps, numerical expressions and numerical values set forth in the embodiments are not intended to limit the scope of the invention unless otherwise specified.
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本发明及其应用或使用的任何限制。The following description of the at least one exemplary embodiment is merely illustrative and is in no way
对于相关领域普通技术人员已知的技术、方法和设备可能不作详细讨论,但在适当情况下,所述技术、方法和设备应当被视为说明书的一部分。Techniques, methods and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but the techniques, methods and apparatus should be considered as part of the specification, where appropriate.
在这里示出和讨论的所有例子中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它例子可以具有不同的值。In all of the examples shown and discussed herein, any specific values are to be construed as illustrative only and not as a limitation. Thus, other examples of the exemplary embodiments may have different values.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。It should be noted that similar reference numerals and letters indicate similar items in the following figures, and therefore, once an item is defined in one figure, it is not required to be further discussed in the subsequent figures.
如图1所示,是本发明较佳实施例提供的服务器2000与可编 程设备1000通信的交互示意图。所述服务器2000可通过网络3000与一个或多个所述可编程设备1000进行通信,以实现服务器2000与可编程设备1000之间的数据通信或交互。As shown in FIG. 1 , it is a server 2000 and an editable embodiment provided by the preferred embodiment of the present invention. Schematic diagram of the interaction of the device 1000 communication. The server 2000 can communicate with one or more of the programmable devices 1000 over a network 3000 to enable data communication or interaction between the server 2000 and the programmable device 1000.
本实施例中,所述服务器2000可以是,但不限于,web(网站)服务器、ftp(file transfer protocol,文件传输协议)服务器等。所述可编程设备1000可以是,但不限于,智能手机、个人电脑(personal computer,PC)、平板电脑、个人数字助理(personal digital assistant,PDA)、移动上网设备(mobile Internet device,MID)等。所述网络3000可以是,但不限于,有线网络或无线网络。所述可编程设备1000的操作系统可以是,但不限于,安卓(Android)系统、IOS(iPhone operating system)系统、Windows phone系统、Windows系统等。In this embodiment, the server 2000 may be, but not limited to, a web server, a file transfer protocol (ftp) server, and the like. The programmable device 1000 can be, but not limited to, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile internet device (MID), etc. . The network 3000 can be, but is not limited to, a wired network or a wireless network. The operating system of the programmable device 1000 may be, but not limited to, an Android system, an IOS (iPhone operating system) system, a Windows phone system, a Windows system, and the like.
图2是示出可以实现本发明的实施例的可编程设备1000的方框示意图。2 is a block schematic diagram showing a programmable device 1000 in which embodiments of the present invention may be implemented.
如图2所示,可编程设备1000可以包括处理器1010、存储器1020、接口装置1030、通信装置1040、显示装置1050、输入装置1060、扬声器1070、麦克风1080,等等。其中,处理器1010可以是中央处理器CPU、微处理器MCU等。存储器1020例如包括ROM(只读存储器)、RAM(随机存取存储器)、诸如硬盘的非易失性存储器等。接口装置1030例如包括USB接口、耳机接口、蓝牙接口等。通信装置1040例如能够进行有线或无线通信。显示装置1050例如是液晶显示屏、触摸显示屏等。输入装置1060例如 可以包括触摸屏、键盘等。用户可以通过扬声器1070和麦克风1080输入/输出语音信息。As shown in FIG. 2, programmable device 1000 can include processor 1010, memory 1020, interface device 1030, communication device 1040, display device 1050, input device 1060, speaker 1070, microphone 1080, and the like. The processor 1010 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1020 includes, for example, a ROM (Read Only Memory), a RAM (Random Access Memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1030 includes, for example, a USB interface, a headphone interface, a Bluetooth interface, and the like. The communication device 1040 can, for example, perform wired or wireless communication. The display device 1050 is, for example, a liquid crystal display, a touch display, or the like. Input device 1060, for example It can include a touch screen, a keyboard, and the like. The user can input/output voice information through the speaker 1070 and the microphone 1080.
图2所示的可编程设备仅是解释性的,并且决不是为了要限制本发明、其应用或用途。应用于本发明的实施例中,可编程设备1000的所述存储器1020用于存储指令,所述指令用于控制所述处理器1010进行操作以执行本发明实施例提供的任意一项网页的预读方法或者网页访问方法。本领域技术人员应当理解,尽管在图2中对可编程设备1000示出了多个装置,但是,本发明可以仅涉及其中的部分装置,例如,可编程设备1000只涉及处理器1010和存储装置1020等。技术人员可以根据本发明所公开方案设计指令。指令如何控制处理器1010进行操作,这是本领域公知,故在此不再详细描述。The programmable device shown in Figure 2 is merely illustrative and is in no way intended to limit the invention, its application or use. In an embodiment of the present invention, the memory 1020 of the programmable device 1000 is configured to store instructions for controlling the processor 1010 to perform operations to perform pre-processing of any one of the web pages provided by the embodiments of the present invention. Read method or web page access method. It will be understood by those skilled in the art that although a plurality of devices are illustrated for the programmable device 1000 in FIG. 2, the present invention may relate only to some of the devices therein, for example, the programmable device 1000 only relates to the processor 1010 and the storage device. 1020 and so on. A technician can design instructions in accordance with the disclosed aspects of the present invention. How the instructions control the processor 1010 to operate is well known in the art and will not be described in detail herein.
<实施例><Example>
本实施例中提供一种网页预读方法,如图3所示,所述网页预读方法包括:In this embodiment, a webpage pre-reading method is provided. As shown in FIG. 3, the webpage pre-reading method includes:
步骤S2100,响应对目标网页的预读请求,根据所获取的所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源。Step S2100: In response to the read-ahead request for the target webpage, determine, according to the acquired webpage framework of the target webpage, a preloading sub-resource and a lazy-loading sub-resource included in the pre-reading part of the target webpage.
本实施例中,目标网页为服务器2000在接收到所述可编程设备1000发送的下载请求后发送给所述可编程设备1000的,在本实施例中,并不限制目标网页的预读请求的产生方法,所述目标 网页的预读请求,可以根据用户访问网页的行为或者历史习惯进行预测产生,例如根据用户当前访问的网页的关键词进行预测产生,或者根据用户的历史网页访问记录预测产生,又或者用户当前访问的网页功能特性产生,等等。In this embodiment, the target webpage is sent by the server 2000 to the programmable device 1000 after receiving the download request sent by the programmable device 1000. In this embodiment, the pre-read request of the target webpage is not limited. Generating method The pre-reading request of the webpage may be predicted according to the behavior of the user visiting the webpage or historical habits, for example, according to the keyword of the webpage currently accessed by the user, or generated according to the historical webpage access record of the user, or the current visit of the user. The web page features are generated, and so on.
在本实施例中,当目标网页的预读请求产生后,响应所述预读请求,将所获取页面进行解析,获取目标网页的网页框架,所述网页框架表征所述网页的页面结构,所述页面结构包括页面排版、页面包含的子资源属性、子资源的位置等信息。例如,目标网页的网页框架可以是目标网页的DOM树(DOM,Document Object Mode,文件对象模型)。DOM树是将网页中的元素均看成一个个可以编辑及获取的对象,DOM树中包含组成DOM树的DOM元素,每个DOM元素存放网页中包含的相应内容(尺寸、位置、排版属性对应放置的子资源信息等)。获取目标网页的DOM树,就可以确定目标网页中包含的子资源类型,所述子资源类型包括CSS(Cascading Style Sheets,层叠样式表)子资源、JS(JavaScript,直译式脚本语言)子资源、图片子资源、视频子资源、音频子资源等。In this embodiment, after the pre-reading request of the target webpage is generated, in response to the pre-reading request, the obtained page is parsed to obtain a webpage frame of the target webpage, and the webpage framework represents the page structure of the webpage. The page structure includes information such as page layout, sub-resource attributes contained in the page, and location of sub-resources. For example, the webpage frame of the target webpage may be a DOM (Document Object Mode) of the target webpage. The DOM tree treats the elements in the web page as objects that can be edited and retrieved. The DOM tree contains the DOM elements that make up the DOM tree. Each DOM element stores the corresponding content contained in the web page (the size, location, and layout attributes correspond to each other. Placed sub-resource information, etc.). Obtaining the DOM tree of the target webpage, and determining the sub-resource types included in the target webpage, the sub-resource types include CSS (Cascading Style Sheets) sub-resources, JS (JavaScript, literal translation scripting language) sub-resources, Picture sub-resources, video sub-resources, audio sub-resources, etc.
根据所获取的所述目标网页的网页框架,可以确定所述目标网页中包含的各种子资源的类型,进而可以确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源。The type of the various sub-resources included in the target webpage may be determined according to the acquired webpage framework of the target webpage, and the pre-loaded sub-resources included in the pre-reading part of the target webpage may be determined and the lazy loading may be performed. Child resource.
其中,所述预加载子资源是对目标网页进行预读处理时,对目标网页的预读部分需要加载的关键子资源,例如,CSS子资源、 JS子资源、目标网页的无尺寸图片子资源、目标网页的背景图等。所述无尺寸图片子资源是通过外联方式置于网页中访问网页时需要加载的,并且图片显示的尺寸根据其自自身尺寸定义的图片子资源,如果缺失,会影响网页的排版。所述目标网页的背景图是指目标网页中一些交互相关的网页元素的背景,例如功能按钮(input/div节点等)、可点击的区域(a节点等)等,如果缺失背景图,会影响网页的交互功能。The pre-loading sub-resource is a key sub-resource that needs to be loaded on the pre-reading part of the target webpage when the pre-reading process is performed on the target webpage, for example, a CSS sub-resource, JS sub-resources, non-size image sub-resources of the target web page, background images of the target web page, and the like. The size-in-picture sub-resource needs to be loaded when the webpage is accessed by the external connection method, and the size of the image display is determined according to the image sub-resource defined by the self-size. If it is missing, the layout of the webpage is affected. The background image of the target webpage refers to the background of some interaction-related webpage elements in the target webpage, such as function buttons (input/div nodes, etc.), clickable regions (a node, etc.), etc., if the background image is missing, it will affect The interactive function of the web page.
所述延迟加载子资源是需要加载,但可以不必在网页预读时预先加载,而是当用户实际访问目标网页时再加载的目标网页的预读部分中包含子资源,例如目标网页的视频子资源、音频子资源、有尺寸图片子资源等。所述有尺寸图片子资源是通过外联方式置于网页中访问网页时需要加载的,并且图片显示的尺寸根据网页的排版定义的图片子资源,如果缺失,不会影响网页的排版。在一个例子中,所述延迟加载子资源至少包括所述目标网页的预读部分中的有尺寸图片子资源。The lazy-loading sub-resource needs to be loaded, but may not be pre-loaded when the webpage is pre-read, but includes a sub-resource, such as a video sub-page of the target webpage, in the pre-reading portion of the target webpage that is reloaded when the user actually accesses the target webpage. Resources, audio sub-resources, size picture sub-resources, etc. The size picture sub-resource is required to be loaded when the web page is accessed by the external connection mode, and the size of the picture display is determined according to the layout of the web page. If it is missing, the layout of the web page is not affected. In one example, the lazy-loaded sub-resource includes at least a sized picture sub-resource in the pre-read portion of the target web page.
并且,所述目标网页的预读部分,是当用户实际访问目标网页时向用户最初渲染显示的目标网页的对应区域,所述预读部分可以根据用户的需求和应用场景进行设置或者变更,例如,当用户通过移动网络运营商提供的网络访问网页时,可以设置所述预读部分为所述目标网页的首屏内容,以节省预读网页消耗的流量,降低用户访问网页的流量成本负担;又或者,当用户从移动运营商提供的网络切换至本地无线局域网(例如wifi)访问网页时,可 以变更所述预读部分为所述目标网页的全部内容。而当某些应用场景下,当实施网页访问的浏览器或者类似浏览器功能的应用程序的内存资源受限时,也可以将所述预读部分设置为目标网页的首屏内容,以便降低实施网页预读时消耗的内存资源以及处理器(例如CPU)资源。因此,在一个例子中,所述目标网页的预读部分为所述目标网页的首屏内容。And the pre-reading part of the target webpage is a corresponding area of the target webpage that is initially rendered and displayed to the user when the user actually accesses the target webpage, and the pre-reading section may be set or changed according to the user's needs and the application scenario, for example, When the user accesses the webpage through the network provided by the mobile network operator, the pre-reading part may be set as the first screen content of the target webpage, so as to save the traffic consumed by the pre-read webpage, and reduce the traffic cost burden of the user accessing the webpage; Or, when the user switches from the network provided by the mobile operator to the local wireless local area network (for example, wifi) to access the webpage, The change of the pre-reading portion is the entire content of the target webpage. In some application scenarios, when the memory resources of the web browser or the browser-like application are limited, the pre-reading portion may also be set as the first screen content of the target webpage, so as to reduce implementation. The memory resources consumed by the web page and the processor (such as CPU) resources. Thus, in one example, the pre-read portion of the target web page is the first screen content of the target web page.
在上述例子中,所述预读部分的设置或者变更,可以由实施网页访问的浏览器或者类似浏览器功能的应用程序,在后台自动触发,可以提供界面供用户操作触发。In the above example, the setting or change of the pre-reading part may be automatically triggered in the background by a browser or a browser-like application that implements webpage access, and an interface may be provided for user operation triggering.
在步骤S2100之后,进入步骤S2200,加载所述预加载子资源至所述目标网页的网页框架的对应位置,以完成对所述目标网页的预读处理。After step S2100, the process proceeds to step S2200, and the preloaded sub-resource is loaded to the corresponding position of the webpage frame of the target webpage to complete the pre-reading process of the target webpage.
在本实施例中,对目标网页的预读处理,只加载目标网页的预读部分中的预加载子资源,对所述延迟加载子资源不做加载,可以节省预读网页过程中所消耗的流量,提升用户体验,此外也能降低预读网页过程中加载过多子资源所耗费的内存资源以及处理器(例如CPU)资源。特别是,将所述有尺寸图片子资源作为延迟加载子资源,在对目标网页做预读处理时不做加载,既不影响目标网页预读部分的排版,也能有效地节省预读网页过程中所消耗的流量,以及降低预读网页过程中加载以及处理子资源所耗费的内存资源以及处理器(例如CPU)资源。In this embodiment, the pre-reading process on the target webpage loads only the pre-loaded sub-resources in the pre-reading part of the target webpage, and does not load the lazy-loaded sub-resource, which can save the consumption in the process of pre-reading the webpage. Traffic, improving the user experience, can also reduce the memory resources and processor (such as CPU) resources used to load too many sub-resources during pre-reading web pages. In particular, the size picture sub-resource is used as a lazy loading sub-resource, and is not loaded when performing pre-reading processing on the target webpage, which does not affect the typesetting of the pre-reading part of the target webpage, and can effectively save the pre-reading webpage process. The traffic consumed in the process, as well as the memory resources and processor (such as CPU) resources consumed to load and process sub-resources during pre-read web pages.
在本实施例中,所述步骤S2100与所述步骤S2200还可以交 叉往复进行,以完成对所述目标网页的预读处理,具体地,所述确定所述预加载子资源以及所述延迟加载子资源步骤包括:In this embodiment, the step S2100 and the step S2200 can also be performed. The fork is reciprocated to complete the pre-reading process on the target webpage. Specifically, the step of determining the pre-loaded sub-resource and the lazy-loading sub-resource includes:
根据所述目标网页的网页框架,确定所述目标网页的预读部分内包含的子资源为延迟加载子资源时,标记该子资源为延迟加载子资源;And determining, according to the webpage framework of the target webpage, that the sub-resource included in the pre-reading part of the target webpage is a lazy-loaded sub-resource, marking the sub-resource as a lazy-loaded sub-resource;
根据所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的子资源为预加载子资源时,触发所述加载预加载子资源的步骤,以加载该预加载子资源至所述目标网页的网页框架的对应位置。Determining, according to the webpage framework of the target webpage, a step of loading the preloaded sub-resource by loading the pre-loaded sub-resource to the sub-resource included in the pre-reading part of the target webpage to be a pre-loaded sub-resource The corresponding location of the webpage frame of the target webpage.
在本实施例中,还提供一种网页预读设备3000,如图3所示,包括子资源确定单元3100以及子资源预加载单元3200,用于实施本实施例中提供的任意一项网页预读方法,在此不再赘述。In this embodiment, a webpage pre-reading device 3000 is further provided, as shown in FIG. 3, including a sub-resource determining unit 3100 and a sub-resource pre-loading unit 3200, for implementing any webpage pre-preparation provided in this embodiment. The reading method will not be described here.
网页预读设备3000,包括:Web page read-ahead device 3000, including:
子资源确定单元3100,用于响应对目标网页的预读请求,根据所获取的所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源;The sub-resource determining unit 3100 is configured to determine, according to the acquired webpage framework of the target webpage, a preloading sub-resource and a lazy-loader included in the pre-reading part of the target webpage, in response to the pre-reading request to the target webpage. Resource
子资源预加载单元3200,用于加载所述预加载子资源至所述目标网页的网页框架的对应位置,以完成对所述目标网页的预读处理。The sub-resource pre-loading unit 3200 is configured to load the pre-loaded sub-resource to a corresponding position of the webpage frame of the target webpage to complete the pre-reading process on the target webpage.
可选地,所述子资源确定单元3100包括:Optionally, the sub-resource determining unit 3100 includes:
用于根据所述目标网页的网页框架,确定所述目标网页的预读部分内包含的子资源为延迟加载子资源时,标记该子资源为延 迟加载子资源的装置;以及用于根据所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的子资源为预加载子资源时,触发所述子资源预加载单元3200工作以加载该预加载子资源至所述目标网页的网页框架的对应位置的装置。And determining, according to the webpage framework of the target webpage, that the sub-resource included in the pre-read part of the target webpage is a lazy-loaded sub-resource, marking the sub-resource as deferred a device for lately loading a sub-resource; and for determining, according to the webpage framework of the target webpage, that the sub-resource included in the pre-read portion of the target webpage is a pre-loaded sub-resource, triggering the sub-resource pre-loading unit 3200 A device that works to load the preloaded sub-resource to a corresponding location of a web page frame of the target web page.
在一个例子中,所述目标网页的预读部分为所述目标网页的首屏内容。In one example, the pre-read portion of the target web page is the first screen content of the target web page.
在另一个例子中,所述延迟加载子资源至少包括所述目标网页的预读部分中的有尺寸图片子资源。In another example, the lazy-loaded sub-resource includes at least a sized picture sub-resource in the pre-read portion of the target web page.
在本实施例中,所述网页预读设备可能具有多种实体形式,例如可以是浏览器、具有类似浏览器功能的应用程序,也可以是独立于浏览器、具有类似浏览器功能的应用程序的功能插件等。In this embodiment, the webpage pre-reading device may have multiple physical forms, such as a browser, a browser-like application, or a browser-independent browser-like application. Feature plugins and more.
本实施例中,还提供一种可编程设备,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行本实施例中任意一项所述的网页预读方法。所述可编程设备的硬件配置可以如图2所示,在此不再赘述。In this embodiment, a programmable device is also provided, the memory is configured to store an instruction, and the instruction is used to control the processor to perform the webpage pre-reading method according to any one of the embodiments. The hardware configuration of the programmable device can be as shown in FIG. 2, and details are not described herein again.
在本实施例中,还提供一种网页访问方法,包括:响应对目标网页的访问请求,当所述目标网页为本实施例中提供任意一项的方法完成预读处理的网页时,加载所述目标网页的延迟加载子资源至所述目标网页的网页框架中的对应位置,以显示所述目标网页的预读部分。In this embodiment, a method for accessing a webpage is further provided, comprising: responding to an access request to the target webpage, and when the target webpage is provided by any one of the methods in the embodiment to complete the pre-reading processing webpage, the loading station Deferred loading of the target webpage to a corresponding location in the webpage frame of the target webpage to display a pre-read portion of the target webpage.
所述目标网页为本实施例中提供任意一项的方法完成预读处 理的网页,已经加载了目标网页的预读部分的预加载子资源,在实际访问目标网页时再加载目标网页的预读部分的延迟加载子资源,可以节省预读网页过程中所消耗的流量,以及降低预读网页过程中加载过多子资源所耗费的内存处理资源。特别是,将所述有尺寸图片子资源作为延迟加载子资源,在对目标网页做预读处理时不做加载,既不影响目标网页预读部分的排版,也能有效地节省预读网页过程中所消耗的流量,以及降低预读网页过程中加载子资源所耗费的内存资源以及处理器(CPU)资源。The target webpage is a method provided by any one of the embodiments to complete the pre-reading The webpage of the rationale has already loaded the preloaded sub-resource of the pre-reading part of the target webpage, and then loads the delayed loading sub-resource of the pre-reading part of the target webpage when actually accessing the target webpage, thereby saving the traffic consumed during the pre-reading webpage. And reduce the memory processing resources used to load too many child resources during the pre-reading of the web page. In particular, the size picture sub-resource is used as a lazy loading sub-resource, and is not loaded when performing pre-reading processing on the target webpage, which does not affect the typesetting of the pre-reading part of the target webpage, and can effectively save the pre-reading webpage process. The traffic consumed in the process, as well as the memory resources and processor (CPU) resources consumed to load the sub-resources during the pre-reading of the web page.
所述目标网页的预读部分可以是所述目标网页的首屏内容。因而,可以对用户先直接渲染其访问的目标网页的首屏内容,快速响应用户访问目标网页的用户请求,提升用户体验。当用户需要进一步浏览目标网页的剩余部分内容时,再继续加载剩余部分内容中包含的子资源进行渲染显示,可以降低访问网页的流量消耗,使得网页访问更有效率。The pre-read portion of the target webpage may be the first screen content of the target webpage. Therefore, the user can directly render the first screen content of the target webpage accessed by the user, and quickly respond to the user request of the user to access the target webpage, thereby improving the user experience. When the user needs to further browse the rest of the content of the target webpage, the user continues to load the sub-resources included in the remaining content for rendering display, which can reduce the traffic consumption of the visited webpage, and make the webpage access more efficient.
在本实施例中,还提供一种网页访问设备,用于:响应对目标网页的访问请求,当所述目标网页为已经根据本实施例中提供任意一项所述的网页预读方法完成预读处理的网页时,加载所述目标网页的延迟加载子资源至所述目标网页的网页框架中的对应位置,以显示所述目标网页的预读部分。In this embodiment, a webpage accessing device is further configured to: respond to the access request to the target webpage, and when the target webpage is a webpage pre-reading method according to any one of the embodiments provided in this embodiment, When the processed webpage is read, the lazy loading sub-resource of the target webpage is loaded to a corresponding position in the webpage frame of the target webpage to display the pre-reading part of the target webpage.
在本实施例中,并不限制网页访问设备可能具有多种实体形式,例如可以是具有网页访问功能的浏览器、具有类似浏览器功能的应用程序等。 In this embodiment, the webpage access device may not be limited to have multiple physical forms, such as a browser having a webpage access function, an application having a browser-like function, and the like.
本实施例中,还提供一种可编程设备,包括存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行本实施例中提供的网页访问方法。所述可编程设备的硬件配置可以如图2所示,在此不再赘述。In this embodiment, a programmable device is further provided, including a memory and a processor, where the memory is used to store an instruction, and the instruction is used to control the processor to perform the webpage access method provided in this embodiment. . The hardware configuration of the programmable device can be as shown in FIG. 2, and details are not described herein again.
<例子><example>
以下将示意性地举例,进一步说明本实施例中提供的网页预读方法以及网页访问方法。本例中,目标网页的预读部分设置为目标网页的首屏内容,流程图如图5所示,包括:The webpage pre-reading method and the webpage accessing method provided in the embodiment are further illustrated below by way of example. In this example, the pre-read portion of the target web page is set as the first screen content of the target web page, and the flowchart is as shown in FIG. 5, including:
步骤S401,响应目标网页的预读请求,根据目标网页的URL地址获取所述目标网页的页面以进行页面解析得到目标网页的DOM树。In step S401, in response to the pre-read request of the target webpage, the page of the target webpage is obtained according to the URL address of the target webpage to perform page analysis to obtain the DOM tree of the target webpage.
步骤S402,判断解析得到的目标网页的DOM树是否满足目标网页的首屏内容显示,如果已满足首屏内容显示,则完成对目标网页的预读处理,转入步骤S407,否则,进入步骤S403。In step S402, it is determined whether the DOM tree of the target webpage that is parsed meets the first screen content display of the target webpage. If the content display of the first screen is satisfied, the pre-reading processing of the target webpage is completed, and the process proceeds to step S407. Otherwise, the process proceeds to step S403. .
步骤S403,根据目标网页的DOM树,判断当前待处理的子资源是否需要加载,如果是,进入步骤S404,否则,转回步骤S402。Step S403, judging whether the current sub-resource to be processed needs to be loaded according to the DOM tree of the target webpage, if yes, proceeding to step S404, otherwise, returning to step S402.
步骤S404,确定当前的子资源是否为延迟加载子资源,例如有尺寸图片子资源,如果是,转入步骤S405,否则,当前的子资源为预加载子资源,转入预加载子资源,转入步骤S406。Step S404, determining whether the current sub-resource is a lazy-loaded sub-resource, for example, having a size picture sub-resource, if yes, proceeding to step S405; otherwise, the current sub-resource is a pre-loaded sub-resource, transferring to the pre-loaded sub-resource, and transferring Proceed to step S406.
步骤S405,将当前的子资源标记为“延迟加载子资源”,转入步骤S402。 In step S405, the current sub-resource is marked as "delayed-loaded sub-resource", and the process proceeds to step S402.
步骤S406,加载当前的子资源到所述DOM树中的对应位置,转入步骤S402。Step S406, loading the current sub-resource to the corresponding location in the DOM tree, and proceeding to step S402.
步骤S407,确定所述经过预读处理的目标网页是否被用户实际访问,如果被用户访问,进入步骤S408,否则,结束。Step S407, it is determined whether the target webpage subjected to the pre-reading process is actually accessed by the user, and if accessed by the user, the process proceeds to step S408, otherwise, the process ends.
步骤S408,判断所述目标网页的首屏内容是否需要加载所述延迟加载子资源,如果需要,转入步骤S409,否则转入步骤S410。Step S408, determining whether the content of the first screen of the target webpage needs to load the delayed loading sub-resource, if necessary, proceeding to step S409, otherwise proceeding to step S410.
步骤S409,加载所述目标网页的延迟加载子资源到DOM树中的对应位置,转入步骤S410。Step S409, loading the delayed loading sub-resource of the target webpage to a corresponding location in the DOM tree, and proceeding to step S410.
步骤S410,渲染所述DOM树以显示所述目标网页的首屏内容,进入步骤S411。Step S410, rendering the DOM tree to display the first screen content of the target webpage, and proceeding to step S411.
步骤S411,确定用户是否还要继续浏览目标网页,如果是,进入步骤S412,否则,结束。In step S411, it is determined whether the user further wants to continue browsing the target webpage, and if so, proceeds to step S412, otherwise, ends.
步骤S412,继续加载目标网页的剩余内容中包含的子资源至所述DOM树中的对应位置,渲染并显示,当目标网页被关闭时,结束。Step S412, continuing to load the sub-resources included in the remaining content of the target webpage to corresponding positions in the DOM tree, rendering and displaying, and ending when the target webpage is closed.
以上已经结合附图以及例子描述了本发明的实施例,根据本实施例,提供一种网页预读方法、网页访问方法、设备及可编程设备,通过所获取目标网页的网页框架确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源,在预读目标网页时只加载所述预加载子资源,当用户实际访问目标网页时加载所述延迟加载资源,可以节省预读网页过程中所消耗的流量, 降低用户访问网页的流量成本负担,提升用户体验,此外也能降低预读网页过程中加载过多子资源所耗费的内存资源以及处理器资源。The embodiment of the present invention has been described above with reference to the accompanying drawings and examples. According to the embodiment, a webpage pre-reading method, a webpage accessing method, a device, and a programmable device are provided, and the webpage framework of the obtained target webpage is determined to be included in the webpage. The preloaded sub-resources and the lazy-loaded sub-resources in the pre-reading part of the target webpage are only loaded when the target webpage is pre-read, and the lazy loading resource is loaded when the user actually accesses the target webpage, which can save The traffic consumed during the pre-reading of web pages, Reduce the traffic cost burden of users accessing web pages, improve user experience, and reduce the memory resources and processor resources consumed by loading too many sub-resources during pre-reading web pages.
本领域技术人员应当明白,可以通过各种方式来实现本实施例中提供的网页预读设备和网页访问设备。例如,可以通过指令配置处理器来实现网页预读设备和网页访问设备。例如,可以将指令存储在ROM中,并且当启动设备时,将指令从ROM读取到可编程器件中来实现网页预读设备和网页访问设备。例如,可以将网页预读设备和网页访问设备固化到专用器件(例如ASIC)中。可以将网页预读设备和网页访问设备分成相互独立的单元,或者可以将它们合并在一起实现。本实施例中提供的网页预读设备和网页访问设备可以通过上述各种实现方式中的一种来实现,或者可以通过上述各种实现方式中的两种或更多种方式的组合来实现。Those skilled in the art should understand that the webpage pre-reading device and the webpage accessing device provided in this embodiment can be implemented in various manners. For example, the web page pre-reading device and the web page access device can be implemented by an instruction configuration processor. For example, the instructions can be stored in the ROM, and when the device is booted, the instructions are read from the ROM into the programmable device to implement the web page pre-reading device and the web page access device. For example, web page pre-reading devices and web page access devices can be hardened into a dedicated device (eg, an ASIC). The web page pre-reading device and the web page access device can be divided into mutually independent units, or they can be combined and implemented. The webpage pre-reading device and the webpage accessing device provided in this embodiment may be implemented by one of the above various implementation manners, or may be implemented by a combination of two or more of the above various implementation manners.
本领域技术人员公知的是,随着诸如大规模集成电路技术的电子信息技术的发展和软件硬件化的趋势,要明确划分计算机系统软、硬件界限已经显得比较困难了。因为,任何操作可以软件来实现,也可以由硬件来实现。任何指令的执行可以由硬件完成,同样也可以由软件来完成。对于某一机器功能采用硬件实现方案还是软件实现方案,取决于价格、速度、可靠性、存储容量、变更周期等非技术性因素。因此,对于电子信息技术领域的普通技术人员来说,更为直接和清楚地描述一个技术方案的方式是描述该方案中的各个操作。在知道所要执行的操作的情况下,本领域 技术人员可以基于对所述非技术性因素的考虑直接设计出期望的产品。It is well known to those skilled in the art that with the development of electronic information technology such as large scale integrated circuit technology and the trend of software hardware, it has become difficult to clearly define the software and hardware boundaries of computer systems. Because any operation can be implemented in software, it can also be implemented by hardware. Execution of any instruction can be done by hardware, as well as by software. Whether a hardware implementation or a software implementation is used for a certain machine function depends on non-technical factors such as price, speed, reliability, storage capacity, and change cycle. Thus, one of ordinary skill in the art of electronic information technology, a more direct and clear way of describing a technical solution is to describe the various operations in the solution. In the case of knowing what to do, the field The skilled person can directly design the desired product based on consideration of the non-technical factors.
本发明可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本发明的各个方面的计算机可读程序指令。The invention can be a system, method and/or computer program product. The computer program product can comprise a computer readable storage medium having computer readable program instructions embodied thereon for causing a processor to implement various aspects of the present invention.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。The computer readable storage medium can be a tangible device that can hold and store the instructions used by the instruction execution device. The computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, for example, with instructions stored thereon A raised structure in the hole card or groove, and any suitable combination of the above. A computer readable storage medium as used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (eg, a light pulse through a fiber optic cable), or through a wire The electrical signal transmitted.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、 交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein can be downloaded from a computer readable storage medium to various computing/processing devices or downloaded to an external computer or external storage device over a network, such as the Internet, a local area network, a wide area network, and/or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, Switch, gateway computer, and/or edge server. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in each computing/processing device .
用于执行本发明操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本发明的各个方面。Computer program instructions for performing the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine related instructions, microcode, firmware instructions, state setting data, or in one or more programming languages. Source code or object code written in any combination, including object oriented programming languages such as Smalltalk, C++, etc., as well as conventional procedural programming languages such as the "C" language or similar programming languages. The computer readable program instructions can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer, partly on the remote computer, or entirely on the remote computer or server. carried out. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or wide area network (WAN), or can be connected to an external computer (eg, using an Internet service provider to access the Internet) connection). In some embodiments, the customized electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the present invention.
这里参照根据本发明实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本发明的各个方面。应当理解, 流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and computer program products according to embodiments of the invention. It should be understood that Each block of the flowcharts and/or block diagrams, as well as combinations of blocks in the flowcharts and/or block diagrams, can be implemented by computer readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。The computer readable program instructions can be provided to a general purpose computer, a special purpose computer, or a processor of other programmable data processing apparatus to produce a machine such that when executed by a processor of a computer or other programmable data processing apparatus Means for implementing the functions/acts specified in one or more of the blocks of the flowcharts and/or block diagrams. The computer readable program instructions can also be stored in a computer readable storage medium that causes the computer, programmable data processing device, and/or other device to operate in a particular manner, such that the computer readable medium storing the instructions includes An article of manufacture that includes instructions for implementing various aspects of the functions/acts recited in one or more of the flowcharts.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。The computer readable program instructions can also be loaded onto a computer, other programmable data processing device, or other device to perform a series of operational steps on a computer, other programmable data processing device or other device to produce a computer-implemented process. Thus, instructions executed on a computer, other programmable data processing apparatus, or other device implement the functions/acts recited in one or more of the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本发明的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换 的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。对于本领域技术人员来说公知的是,通过硬件方式实现、通过软件方式实现以及通过软件和硬件结合的方式实现都是等价的。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a portion of an instruction that includes one or more components for implementing the specified logical functions. Executable instructions. In some as a replacement In the implementations of the figures, the functions noted in the blocks may also occur in a different order than those illustrated in the drawings. For example, two consecutive blocks may be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowcharts, and combinations of blocks in the block diagrams and/or flowcharts, can be implemented in a dedicated hardware-based system that performs the specified function or function. Or it can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。本发明的范围由所附权利要求来限定。 The embodiments of the present invention have been described above, and the foregoing description is illustrative, not limiting, and not limited to the disclosed embodiments. Numerous modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The choice of terms used herein is intended to best explain the principles, practical applications, or technical improvements in the various embodiments of the embodiments, or to enable those of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

  1. 一种网页预读方法,其特征在于,包括:A webpage pre-reading method, comprising:
    响应对目标网页的预读请求,根据所获取的所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源;Responding to the pre-reading request for the target webpage, determining, according to the acquired webpage framework of the target webpage, the preloaded sub-resources and the lazy-loading sub-resources included in the pre-reading part of the target webpage;
    加载所述预加载子资源至所述目标网页的网页框架的对应位置,以完成对所述目标网页的预读处理。Loading the preloaded sub-resource to a corresponding location of a webpage frame of the target webpage to complete a pre-reading process on the target webpage.
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述预加载子资源以及所述延迟加载子资源步骤包括:The method according to claim 1, wherein the determining the preloaded sub-resource and the lazy loading sub-resources comprises:
    根据所述目标网页的网页框架,确定所述目标网页的预读部分内包含的子资源为延迟加载子资源时,标记该子资源为延迟加载子资源;And determining, according to the webpage framework of the target webpage, that the sub-resource included in the pre-reading part of the target webpage is a lazy-loaded sub-resource, marking the sub-resource as a lazy-loaded sub-resource;
    根据所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的子资源为预加载子资源时,触发加载所述预加载子资源的步骤,以便加载所述预加载子资源至所述目标网页的网页框架的对应位置。Determining, when determining that the sub-resource included in the pre-reading portion of the target webpage is a pre-loaded sub-resource, according to the webpage framework of the target webpage, loading the pre-loaded sub-resource to load the pre-loaded sub-resource The corresponding location to the webpage frame of the target webpage.
  3. 根据权利要求1或2所述的方法,其特征在于,Method according to claim 1 or 2, characterized in that
    所述目标网页的预读部分为所述目标网页的首屏内容。The pre-reading portion of the target webpage is the first screen content of the target webpage.
  4. 根据权利要求1或2所述的方法,其特征在于,Method according to claim 1 or 2, characterized in that
    所述延迟加载子资源至少包括所述目标网页的预读部分中的有尺寸图片子资源。The lazy-loaded sub-resource includes at least a sized picture sub-resource in the pre-read portion of the target web page.
  5. 一种网页访问方法,其特征在于,包括: A webpage access method, comprising:
    响应对目标网页的访问请求,当所述目标网页为已经如权利要求1-4中任意一项所述的方法完成预读处理的网页时,加载所述目标网页的延迟加载子资源至所述目标网页的网页框架中的对应位置,以显示所述目标网页的预读部分。Responding to the access request to the target webpage, when the target webpage is a webpage that has completed the pre-reading process by the method according to any one of claims 1-4, loading the delayed loading sub-resource of the target webpage to the A corresponding location in the webpage frame of the target webpage to display the pre-read portion of the target webpage.
  6. 一种网页预读设备,其特征在于,包括:A webpage pre-reading device, comprising:
    子资源确定单元,用于响应对目标网页的预读请求,根据所获取的所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的预加载子资源以及延迟加载子资源;a sub-resource determining unit, configured to determine a pre-loading sub-resource and a lazy-loading sub-resource included in the pre-reading part of the target webpage according to the acquired webpage framework of the target webpage, in response to the pre-reading request to the target webpage ;
    子资源预加载单元,用于加载所述预加载子资源至所述目标网页的网页框架的对应位置,以完成对所述目标网页的预读处理。a sub-resource pre-loading unit, configured to load the pre-loaded sub-resource to a corresponding position of a webpage frame of the target webpage, to complete pre-reading processing on the target webpage.
  7. 根据权利要求6所述的网页预读设备,其特征在于,所述子资源确定单元包括:The webpage pre-reading device according to claim 6, wherein the sub-resource determining unit comprises:
    用于根据所述目标网页的网页框架,确定所述目标网页的预读部分内包含的子资源为延迟加载子资源时,标记该子资源为延迟加载子资源的装置;And determining, according to the webpage framework of the target webpage, a device that marks the sub-resource as a lazy-loaded sub-resource when the sub-resource included in the pre-reading part of the target webpage is a lazy-loaded sub-resource;
    用于根据所述目标网页的网页框架,确定包含于所述目标网页的预读部分内的子资源为预加载子资源时,触发所述子资源预加载单元工作以加载该预加载子资源至所述目标网页的网页框架的对应位置的装置。Determining, when the sub-resource included in the pre-read portion of the target webpage is a pre-loaded sub-resource, according to the webpage framework of the target webpage, triggering the sub-resource pre-loading unit to load the pre-loaded sub-resource to A device for a corresponding location of a webpage frame of the target webpage.
  8. 一种网页访问设备,其特征在于,用于响应对目标网页的访问请求,当所述目标网页为已经根据权利要求1-4中任意一项所述的方法完成预读处理的网页时,加载所述目标网页的延迟加载 子资源至所述目标网页的网页框架中的对应位置,以显示所述目标网页的预读部分。A webpage access device, configured to: in response to an access request to a target webpage, when the target webpage is a webpage that has completed the pre-reading process according to the method of any one of claims 1-4, loading Lazy loading of the landing page a sub-resource to a corresponding location in a webpage frame of the target webpage to display a pre-read portion of the target webpage.
  9. 一种可编程设备,其特征在于,包括存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据权利要求1-4中任意一项所述的方法。A programmable device, comprising: a memory and a processor, the memory for storing instructions for controlling the processor to operate to perform the method of any of claims 1-4 Methods.
  10. 一种可编程设备,其特征在于,包括存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据权利要求5所述的方法。 A programmable device, comprising a memory and a processor, the memory for storing instructions for controlling the processor to operate to perform the method of claim 5.
PCT/CN2017/077535 2016-10-19 2017-03-21 Method for pre-reading webpage, method and device for accessing webpage, and programmable device WO2018072388A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610912930.3 2016-10-19
CN201610912930.3A CN107967278A (en) 2016-10-19 2016-10-19 Webpage pre-head method, Web access method, equipment and programmable device

Publications (1)

Publication Number Publication Date
WO2018072388A1 true WO2018072388A1 (en) 2018-04-26

Family

ID=61996988

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/077535 WO2018072388A1 (en) 2016-10-19 2017-03-21 Method for pre-reading webpage, method and device for accessing webpage, and programmable device

Country Status (2)

Country Link
CN (1) CN107967278A (en)
WO (1) WO2018072388A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110717129A (en) * 2019-10-24 2020-01-21 北京思维造物信息科技股份有限公司 Resource preloading method, device, equipment and storage medium
CN111061633A (en) * 2019-12-05 2020-04-24 北京达佳互联信息技术有限公司 Method, device, terminal and medium for detecting first screen time of webpage
CN111666497A (en) * 2020-06-16 2020-09-15 腾讯科技(上海)有限公司 Application program loading method and device, electronic equipment and readable storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569078B (en) * 2018-05-18 2023-08-08 广州腾讯科技有限公司 Method and device for preloading webpage-level program
CN111158799A (en) * 2019-12-31 2020-05-15 北京百度网讯科技有限公司 Page rendering method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591954A (en) * 2011-12-29 2012-07-18 深圳Tcl新技术有限公司 Method, device and terminal for loading data for browser
US20120240063A1 (en) * 2011-03-18 2012-09-20 International Business Machines Corporation Web site sectioning for mobile web browser usability
CN103530289A (en) * 2012-07-02 2014-01-22 腾讯科技(深圳)有限公司 Webpage displaying method and device
CN104239503A (en) * 2014-09-11 2014-12-24 可牛网络技术(北京)有限公司 Display control method and device for loading progress, browser and electronic equipment
CN104750851A (en) * 2015-04-14 2015-07-01 钱海祥 Webpage content lazy loading method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9756108B2 (en) * 2012-05-29 2017-09-05 Google Inc. Preloading resources of a web page
CN102819560B (en) * 2012-06-29 2018-09-04 北京奇虎科技有限公司 The display methods and device of picture in a kind of webpage
CN102855318B (en) * 2012-08-31 2015-05-27 北京搜狗信息服务有限公司 Method and system for preloading of webpages
CN104657499A (en) * 2015-03-11 2015-05-27 网易(杭州)网络有限公司 Webpage loading method and device of client-side APP (Application)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120240063A1 (en) * 2011-03-18 2012-09-20 International Business Machines Corporation Web site sectioning for mobile web browser usability
CN102591954A (en) * 2011-12-29 2012-07-18 深圳Tcl新技术有限公司 Method, device and terminal for loading data for browser
CN103530289A (en) * 2012-07-02 2014-01-22 腾讯科技(深圳)有限公司 Webpage displaying method and device
CN104239503A (en) * 2014-09-11 2014-12-24 可牛网络技术(北京)有限公司 Display control method and device for loading progress, browser and electronic equipment
CN104750851A (en) * 2015-04-14 2015-07-01 钱海祥 Webpage content lazy loading method and system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110717129A (en) * 2019-10-24 2020-01-21 北京思维造物信息科技股份有限公司 Resource preloading method, device, equipment and storage medium
CN111061633A (en) * 2019-12-05 2020-04-24 北京达佳互联信息技术有限公司 Method, device, terminal and medium for detecting first screen time of webpage
CN111061633B (en) * 2019-12-05 2024-04-30 北京达佳互联信息技术有限公司 Webpage first screen time detection method, device, terminal and medium
CN111666497A (en) * 2020-06-16 2020-09-15 腾讯科技(上海)有限公司 Application program loading method and device, electronic equipment and readable storage medium
CN111666497B (en) * 2020-06-16 2023-06-06 腾讯科技(上海)有限公司 Application program loading method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN107967278A (en) 2018-04-27

Similar Documents

Publication Publication Date Title
WO2018072388A1 (en) Method for pre-reading webpage, method and device for accessing webpage, and programmable device
US10880227B2 (en) Apparatus, hybrid apparatus, and method for network resource access
US10185704B2 (en) Webpage browsing method, webapp framework, method and device for executing javascript and mobile terminal
KR101299670B1 (en) System, method and computer readable recording medium for converting a web page dynamically
US8386955B1 (en) User-optimized content for web browsing windows
US10303526B2 (en) Device specific handling of user interface components
CN108038134B (en) Page display method and device, storage medium and electronic equipment
US20170371974A1 (en) Method for loading webpage, client and programmable device
US8631394B2 (en) Static resource processing
US10339197B2 (en) Method and system for bookmarking a webpage
US20150370912A1 (en) Method and system for displaying customized webpage on double webview
US11360640B2 (en) Method, device and browser for presenting recommended news, and electronic device
WO2018141300A1 (en) Webpage pre-reading method, webpage access method, device, and electronic device
WO2016107325A1 (en) Page resource loading method and device based on mobile terminal
US20170286392A1 (en) Method and electronic device for displaying a web page
CN111368180B (en) Page display method and device and electronic equipment
TW201624253A (en) Method, computer program product and computer system for displaying information of a parent webpage associated with a child tab on a graphical user interface
TW201525836A (en) Method and device for controlling feedback of web pages
US9003309B1 (en) Method and apparatus for customizing content displayed on a display device
US20130036197A1 (en) Method and system for a mobile local server
US10996845B2 (en) Method, application, browser, and electronic device for providing webpage content
US10931610B2 (en) Method, device, user terminal and electronic device for sharing online image
CN110909274A (en) Page browsing method and device and electronic equipment
CN111506848A (en) Webpage processing method, device, equipment and readable storage medium
KR20140039509A (en) System and method for providing contextual user-interface based on mark-up language

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17862323

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17862323

Country of ref document: EP

Kind code of ref document: A1