WO2018141300A1 - Webpage pre-reading method, webpage access method, device, and electronic device - Google Patents
Webpage pre-reading method, webpage access method, device, and electronic device Download PDFInfo
- Publication number
- WO2018141300A1 WO2018141300A1 PCT/CN2018/075366 CN2018075366W WO2018141300A1 WO 2018141300 A1 WO2018141300 A1 WO 2018141300A1 CN 2018075366 W CN2018075366 W CN 2018075366W WO 2018141300 A1 WO2018141300 A1 WO 2018141300A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- reading
- webpage
- page
- memory
- state
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Definitions
- the present invention relates to the field of Internet technologies, and in particular, to a webpage pre-reading method, a webpage accessing method, a device, and an electronic device.
- the current browser or a browser-like application usually pre-reads a webpage that the user may browse, that is, before the user actually accesses the webpage, the main document of the webpage that the user may browse is obtained in advance and saved.
- the main document can be directly obtained from the local, and then the corresponding sub-resource is loaded according to the main document, and then the corresponding webpage rendering is obtained. To the user, thereby shortening the time when the user requests to access the webpage and responding to returning the corresponding webpage, thereby speeding up the webpage access speed.
- a web page pre-reading method comprising:
- the read-ahead state includes at least a network state and a memory state
- the method further includes:
- the pre-reading page that has been stored in the memory and meets the clearing condition is cleared, so that the memory state satisfies the corresponding pre-reading condition.
- the clearing condition is that the target webpage corresponding to the pre-reading page has the least predicted clicks.
- the predicted clicks are calculated according to the total number of historical clicks of the target webpage, the accumulated number of clicks in the first preset time period, and the cumulative number of clicks in the second preset time period.
- the clearing condition is that the target webpage corresponding to the pre-reading page has the least predicted clicks.
- the predicted clicks are calculated according to the total number of historical clicks of the target webpage, the accumulated number of clicks in the first preset time period, and the cumulative number of clicks in the second preset time period.
- a webpage access method including at least:
- the pre-reading page is displayed to complete the access to the target webpage.
- the method further includes:
- the pre-read page is refreshed for presentation.
- a webpage pre-reading device comprising:
- a target determining unit configured to determine a target webpage to be pre-read
- a state acquiring unit acquiring a current pre-reading state, where the pre-reading state includes at least a network state and a memory state;
- a pre-reading processing unit configured to acquire a main document of the target webpage and a corresponding sub-resource when the pre-reading state meets a preset pre-reading condition, and generate a corresponding image based on the main document and the corresponding sub-resource rendering
- the pre-read page is stored in memory for use in response to an access request for the target web page.
- the device further includes:
- a page clearing unit configured to: when the memory state does not satisfy the corresponding pre-reading condition, clear the pre-reading page that is stored in the memory and meets the clearing condition, so that the memory state meets the corresponding Read-ahead conditions.
- a webpage access device including at least:
- the page display unit is configured to, in response to the access request of the target webpage, when the read-ahead page corresponding to the target webpage is stored in the memory, present the pre-reading page to complete the access to the target webpage.
- the device further includes:
- a page update unit configured to refresh the pre-read page for presentation when the number of impressions of the pre-read page is greater than a predetermined threshold.
- an electronic device comprising:
- a memory and a processor for storing instructions for controlling the processor to operate to perform a web page pre-reading method provided in accordance with the first aspect of the present invention.
- an electronic device comprising:
- a memory and a processor for storing instructions for controlling the processor to operate to perform a web page access method provided in accordance with the second aspect of the present invention.
- a computer readable storage medium having stored thereon computer program instructions, wherein the web page read-ahead method provided by the first aspect is implemented when the computer program instructions are executed by a processor And/or the web page access method provided by the second aspect.
- the inventor of the present invention has found that in the prior art, there is no webpage pre-reading method, webpage accessing method, device, and electronic device, which can generate a target webpage when the pre-reading state meets a preset pre-reading condition.
- the read-ahead page is displayed directly when the user visits the target webpage, and reduces the user's access to the target webpage to wait for the response time to be below the second level. Therefore, the technical task to be achieved by the present invention or the technical problem to be solved is not thought of or expected by those skilled in the art, so the present invention is a new technical solution.
- FIG. 1 is a block diagram showing an example of a hardware configuration of an electronic device that can be used to implement an embodiment of the present invention.
- Fig. 2 is a flow chart showing a web page pre-reading method of the first embodiment of the present invention.
- Fig. 3 is a diagram showing an example of a web page pre-reading method of the first embodiment of the present invention.
- Fig. 4 is a schematic block diagram showing a web page pre-reading apparatus of the first embodiment of the present invention.
- FIG. 5 is a flow chart showing a web page access method of a second embodiment of the present invention.
- Fig. 6 shows a schematic block diagram of a web page accessing device of a second embodiment of the present invention.
- the steps for the browser to fully display a page generally include:
- Loading Perform domain name resolution according to the requested URL, initiate a request to the server, and receive the file (HTML, JS, CSS, image, etc.);
- Parsing parsing the DOM tree from html, parsing css to generate css rule tree, js operating DOM tree and CSS rule tree through DOM api and Css api;
- the browser engine constructs the Rendering tree through the DOM tree and CSS rule tree (does not include things that are not required for the Header, etc.), and adds the CSS rule to each DOM node to locate Coordinates and sizes, whether to wrap, etc.;
- the overall concept is to provide a webpage pre-reading method, an access method, a device, and an electronic device, which are required to wait for a response to return a webpage when a user visits a webpage by generating a pre-reading page that can be directly presented in response to a webpage access request.
- the user significantly perceives the increase in web page access speed and improves the user experience.
- FIG. 1 is a block diagram showing a hardware configuration of an electronic device 1000 in which an embodiment of the present invention can be implemented.
- the electronic device 1000 may be a portable computer (1000-1), a desktop computer (1000-2), a mobile phone (1000-3), a tablet computer (1000-4), or the like.
- the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like.
- the processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like.
- the memory 1200 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 1300 includes, for example, a USB interface, a headphone jack, and the like.
- the communication device 1400 can, for example, perform wired or wireless communication, and specifically can include Wifi communication, Bluetooth communication, 2G/3G/4G/5G communication, and the like.
- the display device 1500 is, for example, a liquid crystal display, a touch display, or the like.
- Input device 1600 can include, for example, a touch screen, a keyboard, a somatosensory input, and the like. The user can input/output voice information through the speaker 1700 and the microphone 1800.
- the memory 1200 of the electronic device 1000 is configured to store an instruction for controlling the processor 1100 to perform any one of the webpage pre-reading methods provided by the embodiments of the present invention. Or web page access method. It will be understood by those skilled in the art that although a plurality of devices are illustrated for electronic device 1000 in FIG. 1, the present invention may relate only to some of the devices therein, for example, electronic device 1000 relates only to processor 1100 and storage device 1200. A technician can design instructions in accordance with the disclosed aspects of the present invention. How the instructions control the processor for operation is well known in the art and will not be described in detail herein.
- a webpage pre-reading method is provided, as shown in FIG. 2, including:
- Step S2100 determining a target webpage to be pre-read
- the target webpage is usually a webpage that is frequently accessed by the user, and may be a webpage with a high probability of user access predicted by the user's historical browsing behavior, for example, may be the homepage of the video site that the user often opens, or the user may subscribe according to his own needs.
- the webpage that is expected to be accessed such as a real-time news site webpage, etc.; it may also be a navigation site webpage recommended by the user using a browser or a browser-like application or a user-defined setting.
- Step S2200 Acquire a current pre-read state, where the pre-read state includes at least a network state and a memory state.
- the pre-reading state is a state of a local device that currently implements a webpage pre-reading method, and includes at least a network state and a memory state.
- the network status is a network connection status of the local device, and may include a network type, a network download speed, or a network remaining traffic.
- the network status includes at least a network type.
- the memory state is a usage state of the local memory of the local device, and may include a memory usage ratio, a memory usage, a memory remaining amount, and the like.
- the memory state includes at least a memory footprint.
- the memory usage ratio can be obtained by monitoring the memory usage. For example, the number of the currently running network views (WebView) N1 and the number of open windows N2 can be counted, and it is assumed that the memory occupied by each network view operation is S1, and each After the window is opened, the memory occupied by the operation is S2, and the total memory of the local device is Su, and the memory occupancy ratio Sp can be calculated according to the following formula 1:
- step S2300 when the pre-reading state meets the preset pre-reading condition, the main document of the target webpage and the corresponding sub-resource are acquired, and the corresponding pre-reading page is generated based on the main document and the corresponding sub-resource rendering. And stored in the memory for use in response to the access request of the target web page.
- the pre-reading condition is a pre-reading state that should be possessed when the pre-reading operation of the target webpage is performed to generate a corresponding pre-reading page.
- the network document and the memory state at least included in the pre-reading state, when the network state and the memory state meet the corresponding pre-reading conditions, by loading the main document of the target webpage, the main document may specifically be the HTML corresponding to the target webpage.
- HTML file is a descriptive text composed of HTML commands for web pages, and HTML commands can describe text, images, videos, audio, tables, links, and so on.
- the resources referenced by the URL (Uniform Resource Locator) in the HTML file of the webpage are the corresponding sub-resources.
- the corresponding sub-resource may be loaded according to the URL of the sub-resource referenced in the HTML file of the target webpage, where the sub-resource may include but not limited to the image sub-resource, CSS ( Cascading Style Sheets, cascading style sheets, sub-resources, JS (JavaScript, literal translation scripting language) sub-resources, etc.
- the pre-reading page that can generate and render the corresponding webpage as the target webpage according to the main document of the target webpage and the corresponding sub-resource can be stored in the memory, and the target can be stored during storage.
- the link of the webpage or the URL identifier is used as a storage index of the corresponding pre-reading page to distinguish the pre-reading pages corresponding to different target webpages.
- other identifiers that can distinguish different target webpages may also be used, and are not used in this embodiment. limit.
- the main document of loading the target webpage When the target webpage is accessed by the user, the main document of loading the target webpage, loading the sub-resource according to the main document of the target webpage, and performing the rendering operation based on the main document and the sub-resource to generate the webpage page are not required, but the corresponding pre-processing is directly performed.
- the read page is displayed to the user as a webpage page, which greatly reduces the time for the user to wait for a response to return to the webpage, so that the user can significantly perceive the improvement of the webpage access speed and improve the user experience.
- the pre-reading condition may be that when the network status satisfies the available traffic, the traffic load does not affect the user experience due to the execution of the target webpage read-ahead operation, and the memory state satisfies sufficient memory and is not implemented.
- the pre-reading operation of the target webpage is performed to generate a corresponding pre-reading page when the target webpage read-ahead operation affects the running of the device.
- the network state includes at least a network type
- the memory state includes at least a memory occupation ratio
- the read-ahead condition is that the network type meets the specified network type and the memory occupancy ratio is lower than a preset occupancy ratio threshold.
- the specified network type may be a network type corresponding to sufficient traffic, such as WIFI, or a network type set by the user according to the usage state of the traffic. For example, the user does not think that using the 4G network brings a traffic burden, so the setting is specified.
- the network type is 4G network.
- the occupancy ratio threshold is a corresponding occupation ratio threshold, which can be selected according to engineering experience or experimental simulation. For example, it can be set to 80%.
- the webpage pre-reading method in this embodiment further includes: when the memory state does not satisfy the corresponding pre-reading condition, clearing the pre-reading page that is stored in the memory and meeting the clearing condition, The memory state is made to satisfy the corresponding pre-read condition.
- the pre-reading page that meets the clearing condition may predict that the user access may clear the smaller pre-reading page, and clearing the pre-reading page may ensure that the pre-reading page satisfies the user's access requirement as much as possible.
- the memory state satisfies the corresponding pre-reading condition, so that the subsequent read-ahead operation of the other target web pages is continued.
- the clearing condition is that the number of predicted clicks of the target webpage corresponding to the pre-reading page is the least, wherein the predicted number of clicks is accumulated according to the total number of historical clicks of the target webpage, and is accumulated in the first preset time period.
- the number of clicks and the cumulative number of clicks in the second preset time period are calculated and acquired.
- the first preset time period and the second preset time period may be acquired according to engineering experience or experimental simulation, for example, the first preset time period is set to the last 7 days, and the second preset time period is the last 30 days.
- the predicted click number Dp may be Calculated according to the following formula 2:
- a1 and a2 are corresponding weight parameters, and the value can be set according to engineering experience or experimental simulation. For example, in one example, a1 is 2 and a2 is 1.5.
- the pre-reading condition is that the network type is WIFI and the memory ratio is less than 80%
- the clearing condition is that the target webpage corresponding to the pre-reading page has the least predicted clicks
- Step S301 determining that the webpage of the navigation site is a target webpage to be pre-read
- Step S302 Acquire a current network type.
- Step S303 obtaining a current memory ratio
- Step S304 determining whether the network type is WIFI, if yes, proceeding to step S305, and if not, ending;
- Step S305 it is determined whether the memory ratio is lower than 80%, if yes, proceeds to step S306, if not, meets the pre-reading condition, proceeds to step S307;
- Step S306 the pre-read page with the least number of predicted clicks of the corresponding target webpage stored in the memory is cleared, and then returns to step S305;
- Step S307 loading a main document of the target webpage, and loading the corresponding sub-resource according to the main document;
- Step S308 generating a corresponding pre-read page based on the main document of the target webpage and the corresponding sub-resource rendering and storing in the memory.
- a webpage pre-reading device 4000 is further provided, as shown in FIG. 4, including a target determining unit 4100, a state obtaining unit 4200, and a pre-reading processing unit 4300, and optionally, a page clearing unit 4400.
- the method for implementing the webpage pre-reading provided in this embodiment is not described here.
- Web page read-ahead device 4000 including:
- a target determining unit 4100 configured to determine a target webpage to be pre-read
- the state obtaining unit 4200 acquires a current pre-reading state, where the pre-reading state includes at least a network state and a memory state;
- the pre-reading processing unit 4300 is configured to acquire a main document of the target webpage and a corresponding sub-resource when the pre-reading state satisfies a preset pre-reading condition, and generate and generate the main document and the corresponding sub-resource based on the main document and the corresponding sub-resource
- a corresponding pre-read page is stored in memory for use in response to an access request for the target web page.
- the webpage pre-reading device 4000 further includes:
- the page clearing unit 4400 is configured to: when the memory state does not satisfy the corresponding pre-reading condition, clear the pre-reading page that is stored in the memory and meets the clearing condition, so that the memory state satisfies the corresponding Pre-reading conditions.
- the implementation form of the webpage pre-reading device 4000 is not limited.
- the webpage pre-reading device 4000 may be disposed in a browser or a browser-like application, or may be independent of the browser or the like. In addition to the browser's application, a connection is established with the browser or a browser-like application to implement the corresponding function.
- the web page pre-reading device 4000 can be implemented in a variety of ways.
- web page pre-reading device 4000 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 4000.
- web page pre-reading device 4000 can be cured into a dedicated device (eg, an ASIC).
- the web page pre-reading device 4000 can be divided into mutually independent units, or they can be combined and implemented.
- the web page pre-reading device 4000 may be implemented by one of the various implementations described above, or may be implemented by a combination of two or more of the various implementations described above.
- an electronic device comprising a memory and a processor, the memory for storing instructions for controlling the processor to perform to perform webpage pre-reading provided in the embodiment method.
- the electronic device may be the electronic device 1000 as shown in FIG. 1 , and details are not described herein again.
- a webpage pre-reading method, device, and electronic device are provided. After determining the pre-read target webpage and obtaining the current pre-reading state, When the pre-reading state satisfies the pre-reading condition, the main document of the target webpage and the corresponding sub-resource are acquired to generate a pre-reading page corresponding to the target webpage, so that the pre-reading page can be directly displayed to the user when the user accesses the target webpage, and the user is reduced.
- the time to wait for the response to return to the web page is below the second level, so that the user significantly perceives the improvement of the webpage access speed and improves the user experience.
- a webpage access method is provided, as shown in FIG. 5, including:
- step S5100 in response to the access request of the target webpage, when it is detected that the pre-reading page corresponding to the target webpage is stored in the memory, the pre-reading page is displayed to complete the access to the target webpage;
- the access request of the target webpage is triggered by the user's request to access the target webpage, and the triggering manner is different. For example, the user does not click the icon or the link corresponding to the target webpage by the device that accesses the target webpage. limit.
- the pre-read page When it is detected that the pre-read page corresponding to the target webpage is stored in the memory, the pre-read page may be directly displayed as a page of the target webpage returned by the response, so that it is no longer necessary to execute the main document of the loading target webpage, according to the target.
- the main document of the webpage loads the sub-resource, performs the rendering operation based on the main document and the sub-resource to generate the webpage page, and directly displays the corresponding pre-reading page as the webpage page to the user, which greatly reduces the time for the user to wait for the response to return the webpage.
- the user waits for the response to return the webpage for an average of less than the second, so that the user can significantly perceive the improvement of the webpage access speed and improve the user experience.
- the pre-reading page is a pre-reading page obtained by executing the webpage pre-reading method provided in the first embodiment, and generally corresponds to a webpage with a large user access possibility, such as a webpage of a user-customized navigation site, or A web page of a user-customized news site.
- a webpage with a large user access possibility such as a webpage of a user-customized navigation site, or A web page of a user-customized news site.
- webpages usually have high timeliness. Therefore, the pre-reading page can be refreshed when the corresponding pre-reading page is displayed to the user to obtain the latest page for display, so as to ensure that the user is presented with the timeliness requirement.
- Page page. Therefore, the method for accessing a webpage provided in this embodiment may further include:
- Step S5200 When the number of impressions of the pre-read page is greater than a predetermined threshold, the pre-read page is refreshed for display.
- the number of impressions of the pre-reading page is the number of times the pre-reading page of the real-time detection statistics is displayed to the user, and the predetermined threshold may be set according to engineering experience or experimental simulation.
- the predetermined threshold is 1, which means pre-reading. After the page has been displayed more than once, the pre-read page will be displayed after the refresh operation.
- a webpage accessing device 6000 is further provided, as shown in FIG. 4, including a page displaying unit 6100, and optionally, a page updating unit 6200, for implementing the webpage accessing method provided in this embodiment. , will not repeat them here.
- Web page read-ahead device 6000 including:
- the page display unit 6100 is configured to, in response to the access request of the target webpage, when the read-ahead page corresponding to the target webpage is stored in the memory, present the pre-reading page to complete the access to the target webpage.
- it also includes:
- the page update unit 6200 is configured to refresh the pre-read page for display when the number of impressions of the pre-read page is greater than a predetermined threshold.
- the implementation form of the webpage access device 6000 is not limited.
- the webpage access device 6000 may be disposed in a browser or a browser-like application, or may be independent of the browser or a similar browser. In addition to the application, a connection is established with the browser or a browser-like application to implement the corresponding function.
- the web page access device 6000 can be implemented in a variety of ways.
- the web page access device 6000 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 4000.
- web page access device 6000 can be cured into a dedicated device (eg, an ASIC).
- the web page access device 6000 can be divided into mutually independent units, or they can be implemented together.
- the web page access device 6000 may be implemented by one of the various implementations described above, or may be implemented by a combination of two or more of the various implementations described above.
- an electronic device comprising a memory and a processor, the memory for storing instructions for controlling the processor to perform to perform webpage pre-reading provided in the embodiment method.
- the electronic device may be the electronic device 1000 as shown in FIG. 1 , and details are not described herein again.
- a webpage accessing method When a user visits a target webpage, the corresponding pre-reading page can be directly displayed to the user. Reducing the time that the user waits for the response to return to the web page to below the second level, so that the user significantly perceives the improvement of the webpage access speed and improves the user experience.
- 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 may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers.
- 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 can 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)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
A webpage pre-reading method, a webpage access method, a device, and an electronic device. The webpage pre-reading method comprises: determining a target webpage to be pre-read (S2100); acquiring a current pre-reading state (S2200); when the pre-reading state meets a preset pre-reading condition, acquiring the main document and corresponding sub-resources of the target webpage and, on the basis of the main document and the corresponding sub-resources, rendering a corresponding pre-reading page and storing same in a memory (S2300) for use in response to an access request of the target webpage. The present method reduces the response time that a user waits for accessing a target webpage to less than seconds, such that the user notices a significant increase in webpage access speed, improving the user experience.
Description
本发明涉及互联网技术领域,更具体地,涉及一种网页预读方法、网页访问方法、设备及电子设备。The present invention relates to the field of Internet technologies, and in particular, to a webpage pre-reading method, a webpage accessing method, a device, and an electronic device.
随着互联网技术的发展和终端智能化的普及,通过浏览器或者具有类似浏览器功能的应用访问互联网的网页以获取信息,成为人们日常生活中获取信息的主要途径之一,而用户使用浏览器或者具有类似浏览器功能的应用时,网页访问的速度也成为衡量用户体验的重要指标之一,其中,影响网页访问的速度的关键因素是下载对应的网页内容的时间。With the development of Internet technology and the popularity of terminals, accessing Internet pages through browsers or browser-like applications to obtain information has become one of the main ways for people to obtain information in their daily lives, while users use browsers. Or when there is a browser-like application, the speed of webpage access is also an important indicator to measure the user experience. The key factor affecting the speed of webpage access is the time to download the corresponding webpage content.
为了提升用户体验,目前的浏览器或者具有类似浏览器功能的应用,通常会对用户可能浏览的网页进行预读,即在用户实际访问网页前,预先获取用户可能浏览的网页的主文档并保存在浏览器或具有类似浏览器功能的应用的客户端的本地中,当用户实际访问对应的网页时,可以直接从本地获取主文档,再根据主文档加载对应的子资源后渲染得到对应的网页呈现给用户,从而缩短用户请求访问网页后响应返回对应网页的时间,加快网页访问速度。In order to improve the user experience, the current browser or a browser-like application usually pre-reads a webpage that the user may browse, that is, before the user actually accesses the webpage, the main document of the webpage that the user may browse is obtained in advance and saved. In the browser or a client with a browser-like application, when the user actually accesses the corresponding webpage, the main document can be directly obtained from the local, and then the corresponding sub-resource is loaded according to the main document, and then the corresponding webpage rendering is obtained. To the user, thereby shortening the time when the user requests to access the webpage and responding to returning the corresponding webpage, thereby speeding up the webpage access speed.
但是,在实际应用中,用户访问已预读的网页时,仍然存在1秒乃至数秒的等待响应返回对应网页的时间,使得用户无法忽略,不能显著感知网页访问速度的提升,影响用户体验。However, in a practical application, when a user accesses a pre-read webpage, there is still a time of waiting for a response to return to the corresponding webpage for 1 second or even a few seconds, so that the user cannot ignore the increase in the access speed of the webpage and affect the user experience.
因此,发明人认为,有必要针对上述现有技术中存在的问题进行改进。Therefore, the inventors believe that it is necessary to improve the problems existing in the above prior art.
发明内容Summary of the invention
本发明的一个目的是提供一种用于网页预读的新技术方案。It is an object of the present invention to provide a new technical solution for web page read-ahead.
根据本发明的第一方面,提供了一种网页预读方法,包括:According to a first aspect of the present invention, a web page pre-reading method is provided, comprising:
确定待进行预读的目标网页;Determining the target web page to be pre-read;
获取当前的预读状态,所述预读状态至少包括网络状态和内存状态;Obtaining a current read-ahead state, where the read-ahead state includes at least a network state and a memory state;
当所述预读状态满足预设的预读条件时,获取所述目标网页的主文档以及对应的子资源,并基于所述主文档以及对应的子资源渲染生成对应的预读页面并存储于内存中,以供响应于所述的目标网页的访问请求时使用。And acquiring the main document of the target webpage and the corresponding sub-resource, and generating a corresponding pre-reading page based on the main document and the corresponding sub-resource, and storing the pre-reading page in the pre-reading state. In-memory for use in response to an access request for the target web page.
可选地,所述方法还包括:Optionally, the method further includes:
当所述内存状态不满足对应的所述预读条件时,清除已存储于内存中的符合清除条件的所述预读页面,以使得所述内存状态满足对应的所述预读条件。When the memory state does not satisfy the corresponding pre-reading condition, the pre-reading page that has been stored in the memory and meets the clearing condition is cleared, so that the memory state satisfies the corresponding pre-reading condition.
进一步可选地,Further optionally,
所述清除条件为所述预读页面对应的目标网页的预测点击数最少,The clearing condition is that the target webpage corresponding to the pre-reading page has the least predicted clicks.
其中,所述预测点击数根据所述目标网页的历史总点击数、在第一预设时间段内累计点击数以及在第二预设时间段内累计点击数计算获取。The predicted clicks are calculated according to the total number of historical clicks of the target webpage, the accumulated number of clicks in the first preset time period, and the cumulative number of clicks in the second preset time period.
可选地,Optionally,
所述清除条件为所述预读页面对应的目标网页的预测点击数最少,The clearing condition is that the target webpage corresponding to the pre-reading page has the least predicted clicks.
其中,所述预测点击数根据所述目标网页的历史总点击数、在第一预设时间段内累计点击数以及在第二预设时间段内累计点击数计算获取。The predicted clicks are calculated according to the total number of historical clicks of the target webpage, the accumulated number of clicks in the first preset time period, and the cumulative number of clicks in the second preset time period.
根据本发明的第二方面,提供一种网页访问方法,至少包括:According to a second aspect of the present invention, a webpage access method is provided, including at least:
响应于目标网页的访问请求,检测到内存中存储有与所述目标网页对应的预读页面时,展示所述预读页面以完成对所述目标网页的访问。In response to the access request of the target webpage, when it is detected that the pre-read page corresponding to the target webpage is stored in the memory, the pre-reading page is displayed to complete the access to the target webpage.
可选地,所述方法还包括:Optionally, the method further includes:
当所述预读页面的展示次数大于预定阈值时,刷新所述预读页面以用于展示。When the number of impressions of the pre-read page is greater than a predetermined threshold, the pre-read page is refreshed for presentation.
根据本发明的第三方面,提供一种网页预读设备,其特征在于,包括:According to a third aspect of the present invention, a webpage pre-reading device is provided, comprising:
目标确定单元,用于确定待进行预读的目标网页;a target determining unit, configured to determine a target webpage to be pre-read;
状态获取单元,获取当前的预读状态,所述预读状态至少包括网络状态和内存状态;a state acquiring unit, acquiring a current pre-reading state, where the pre-reading state includes at least a network state and a memory state;
预读处理单元,用于当所述预读状态满足预设的预读条件时,获取所 述目标网页的主文档以及对应的子资源,并基于所述主文档以及对应的子资源渲染生成对应的预读页面并存储于内存中,以供响应于所述的目标网页的访问请求时使用。a pre-reading processing unit, configured to acquire a main document of the target webpage and a corresponding sub-resource when the pre-reading state meets a preset pre-reading condition, and generate a corresponding image based on the main document and the corresponding sub-resource rendering The pre-read page is stored in memory for use in response to an access request for the target web page.
可选地,所述设备还包括:Optionally, the device further includes:
页面清除单元,用于当所述内存状态不满足对应的所述预读条件时,清除已存储于内存中的符合清除条件的所述预读页面,以使得所述内存状态满足对应的所述预读条件。a page clearing unit, configured to: when the memory state does not satisfy the corresponding pre-reading condition, clear the pre-reading page that is stored in the memory and meets the clearing condition, so that the memory state meets the corresponding Read-ahead conditions.
根据本发明的第四方面,还提供一种网页访问设备,至少包括:According to a fourth aspect of the present invention, a webpage access device is further provided, including at least:
页面展示单元,用于响应于目标网页的访问请求,检测到内存中存储有目标网页对应的预读页面时,呈现所述预读页面以完成对所述目标网页的访问。The page display unit is configured to, in response to the access request of the target webpage, when the read-ahead page corresponding to the target webpage is stored in the memory, present the pre-reading page to complete the access to the target webpage.
可选地,所述设备还包括:Optionally, the device further includes:
页面更新单元,用于当所述预读页面的展示次数大于预定阈值时,刷新所述预读页面以用于展示。a page update unit, configured to refresh the pre-read page for presentation when the number of impressions of the pre-read page is greater than a predetermined threshold.
根据本发明的第五方面,提供一种电子设备,包括:According to a fifth aspect of the invention, an electronic device is provided, comprising:
存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据本发明的第一方面提供的网页预读方法。A memory and a processor for storing instructions for controlling the processor to operate to perform a web page pre-reading method provided in accordance with the first aspect of the present invention.
根据本发明的第六方面,提供一种电子设备,包括:According to a sixth aspect of the invention, an electronic device is provided, comprising:
存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据本发明的第二方面提供的网页访问方法。A memory and a processor for storing instructions for controlling the processor to operate to perform a web page access method provided in accordance with the second aspect of the present invention.
根据本发明的第七方面,提供一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,当所述计算机程序指令被处理器执行时实现第一方面提供的网页预读方法和/或第二方面提供的网页访问方法。According to a seventh aspect of the present invention, there is provided a computer readable storage medium having stored thereon computer program instructions, wherein the web page read-ahead method provided by the first aspect is implemented when the computer program instructions are executed by a processor And/or the web page access method provided by the second aspect.
本发明的发明人发现,在现有技术中,尚未存在一种网页预读方法、网页访问方法、设备及电子设备,可以通过在预读状态符合预设的预读条件时,对目标网页生成预读页面供用户访问该目标网页时直接展示,缩减 用户访问目标网页等待响应时间在秒级以下。因此,本发明所要实现的技术任务或者所要解决的技术问题是本领域技术人员从未想到的或者没有预期到的,故本发明是一种新的技术方案。The inventor of the present invention has found that in the prior art, there is no webpage pre-reading method, webpage accessing method, device, and electronic device, which can generate a target webpage when the pre-reading state meets a preset pre-reading condition. The read-ahead page is displayed directly when the user visits the target webpage, and reduces the user's access to the target webpage to wait for the response time to be below the second level. Therefore, the technical task to be achieved by the present invention or the technical problem to be solved is not thought of or expected by those skilled in the art, so the present invention is a new technical solution.
通过以下参照附图对本发明的示例性实施例的详细描述,本发明的其它特征及其优点将会变得清楚。Other features and advantages of the present invention will become apparent from the Detailed Description of the <RTIgt;
被结合在说明书中并构成说明书的一部分的附图示出了本发明的实施例,并且连同其说明一起用于解释本发明的原理。The accompanying drawings, which are incorporated in FIG
图1是显示可用于实现本发明的实施例的电子设备的硬件配置的例子的框图。1 is a block diagram showing an example of a hardware configuration of an electronic device that can be used to implement an embodiment of the present invention.
图2示出了本发明的第一实施例的网页预读方法的流程图。Fig. 2 is a flow chart showing a web page pre-reading method of the first embodiment of the present invention.
图3示出了本发明的第一实施例的网页预读方法的例子的示意图。Fig. 3 is a diagram showing an example of a web page pre-reading method of the first embodiment of the present invention.
图4示出了本发明的第一实施例的网页预读设备的示意性框图。Fig. 4 is a schematic block diagram showing a web page pre-reading apparatus of the first embodiment of the present invention.
图5示出了本发明的第二实施例的网页访问方法的流程图。FIG. 5 is a flow chart showing a web page access method of a second embodiment of the present invention.
图6示出了本发明的第二实施例的网页访问设备的示意性框图。Fig. 6 shows a schematic block diagram of a web page accessing device of a second embodiment of the present invention.
现在将参照附图来详细描述本发明的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本发明的范围。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 a drawing, it is not required to be further discussed in the subsequent drawings.
目前浏览器完整展示一个页面的步骤一般包括:Currently, the steps for the browser to fully display a page generally include:
加载:根据请求的URL进行域名解析,向服务器发起请求,接收文件(HTML、JS、CSS、图像等);Loading: Perform domain name resolution according to the requested URL, initiate a request to the server, and receive the file (HTML, JS, CSS, image, etc.);
解析:从html解析出DOM tree,解析css产生css规则树,js通过DOM api和Css api操作DOM tree和CSS rule tree;Parsing: parsing the DOM tree from html, parsing css to generate css rule tree, js operating DOM tree and CSS rule tree through DOM api and Css api;
渲染:解析完成后,浏览器引擎会通过DOM tree和CSS rule tree来构造Rendering tree(渲染树)(不包含Header等不需要显示的东西),将CSS rule加到每一个DOM结点上,定位坐标和大小,是否换行等;Rendering: After the parsing is completed, the browser engine constructs the Rendering tree through the DOM tree and CSS rule tree (does not include things that are not required for the Header, etc.), and adds the CSS rule to each DOM node to locate Coordinates and sizes, whether to wrap, etc.;
绘制:最后调用操作系统的Native GUI的API绘制。Draw: Finally, the API of the native GUI of the operating system is called.
虽然可以通过预先加载文件以缩减加载网页的过程所耗费的时间,但是在用户实际访问网页时,还是需要进行解析、渲染,仍然影响网页访问速度。Although it is possible to reduce the time taken to load the webpage by preloading the file, when the user actually accesses the webpage, it still needs to be parsed and rendered, which still affects the webpage access speed.
在本发明中,总体构思是提供一种网页预读方法、访问方法、设备及电子设备,通过生成可以响应网页访问请求时直接呈现的预读页面,使得用户访问网页时等待响应返回网页的时间缩减到秒级以下,令用户显著感知网页访问速度的提升,改善用户体验。In the present invention, the overall concept is to provide a webpage pre-reading method, an access method, a device, and an electronic device, which are required to wait for a response to return a webpage when a user visits a webpage by generating a pre-reading page that can be directly presented in response to a webpage access request. Reduced to below the second level, the user significantly perceives the increase in web page access speed and improves the user experience.
<硬件配置><Hardware Configuration>
图1是示出可以实现本发明的实施例的电子设备1000的硬件配置的框图。FIG. 1 is a block diagram showing a hardware configuration of an electronic device 1000 in which an embodiment of the present invention can be implemented.
电子设备1000可以是便携式电脑(1000-1)、台式计算机(1000-2)、手机(1000-3)、平板电脑(1000-4)等。如图1所示,电子设备1000可以包括处理器1100、存储器1200、接口装置1300、通信装置1400、显示装置1500、输入装置1600、扬声器1700、麦克风1800等等。其中,处理器1100可以是中央处理器CPU、微处理器MCU等。存储器1200例如包括ROM(只读存储器)、RAM(随机存取存储器)、诸如硬盘的非易失性存储器等。接口装置1300例如包括USB接口、耳机接口等。通信装置1400例如能够进行有线或无线通信,具体地可以包括Wifi通信、蓝牙通信、 2G/3G/4G/5G通信等。显示装置1500例如是液晶显示屏、触摸显示屏等。输入装置1600例如可以包括触摸屏、键盘、体感输入等。用户可以通过扬声器1700和麦克风1800输入/输出语音信息。The electronic device 1000 may be a portable computer (1000-1), a desktop computer (1000-2), a mobile phone (1000-3), a tablet computer (1000-4), or the like. As shown in FIG. 1, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 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 1300 includes, for example, a USB interface, a headphone jack, and the like. The communication device 1400 can, for example, perform wired or wireless communication, and specifically can include Wifi communication, Bluetooth communication, 2G/3G/4G/5G communication, and the like. The display device 1500 is, for example, a liquid crystal display, a touch display, or the like. Input device 1600 can include, for example, a touch screen, a keyboard, a somatosensory input, and the like. The user can input/output voice information through the speaker 1700 and the microphone 1800.
图1所示的电子设备仅仅是说明性的并且决不意味着对本发明、其应用或使用的任何限制。应用于本发明的实施例中,电子设备1000的所述存储器1200用于存储指令,所述指令用于控制所述处理器1100进行操作以执行本发明实施例提供的任意一项网页预读方法或网页访问方法。本领域技术人员应当理解,尽管在图1中对电子设备1000示出了多个装置,但是,本发明可以仅涉及其中的部分装置,例如,电子设备1000只涉及处理器1100和存储装置1200。技术人员可以根据本发明所公开方案设计指令。指令如何控制处理器进行操作,这是本领域公知,故在此不再详细描述。The electronic device shown in Figure 1 is merely illustrative and is in no way meant to limit the invention, its application or use. In the embodiment of the present invention, the memory 1200 of the electronic device 1000 is configured to store an instruction for controlling the processor 1100 to perform any one of the webpage pre-reading methods provided by the embodiments of the present invention. Or web page access method. It will be understood by those skilled in the art that although a plurality of devices are illustrated for electronic device 1000 in FIG. 1, the present invention may relate only to some of the devices therein, for example, electronic device 1000 relates only to processor 1100 and storage device 1200. A technician can design instructions in accordance with the disclosed aspects of the present invention. How the instructions control the processor for operation is well known in the art and will not be described in detail herein.
<第一实施例><First Embodiment>
<方法><method>
在本实施例中,提供一种网页预读方法,如图2所示,包括:In this embodiment, a webpage pre-reading method is provided, as shown in FIG. 2, including:
步骤S2100,确定待进行预读的目标网页;Step S2100, determining a target webpage to be pre-read;
其中,目标网页通常是用户经常访问的站点网页,可以是通过用户的历史浏览行为预测的用户访问概率较高的网页,例如可以是用户常打开的视频站点首页等;或者是用户根据自身需求订制预期访问的网页,例如实时新闻站点网页等;还可以是用户使用浏览器或者类似浏览器的应用推荐的或者用户自定义设置的导航站点网页等。The target webpage is usually a webpage that is frequently accessed by the user, and may be a webpage with a high probability of user access predicted by the user's historical browsing behavior, for example, may be the homepage of the video site that the user often opens, or the user may subscribe according to his own needs. The webpage that is expected to be accessed, such as a real-time news site webpage, etc.; it may also be a navigation site webpage recommended by the user using a browser or a browser-like application or a user-defined setting.
步骤S2200,获取当前的预读状态,所述预读状态至少包括网络状态和内存状态;Step S2200: Acquire a current pre-read state, where the pre-read state includes at least a network state and a memory state.
其中,所述预读状态是当前实施网页预读方法的本地设备的状态,至少包括网络状态和内存状态。The pre-reading state is a state of a local device that currently implements a webpage pre-reading method, and includes at least a network state and a memory state.
所述网络状态,是所述本地设备的网络连接状态,可以包括网络类型、网络下载速度或者网络剩余流量等。在一个例子中,所述网络状态至少包括网络类型。The network status is a network connection status of the local device, and may include a network type, a network download speed, or a network remaining traffic. In one example, the network status includes at least a network type.
所述内存状态,是表征所述本地设备的本地内存的使用状态,可以包 括内存占用比、内存使用量、内存剩余量等。在一个例子中,所述内存状态至少包括内存占用比。The memory state is a usage state of the local memory of the local device, and may include a memory usage ratio, a memory usage, a memory remaining amount, and the like. In one example, the memory state includes at least a memory footprint.
所述内存占用比可以通过监测内存使用情况来获取,例如,可以统计当前运行的网络视图(WebView)的数目N1以及打开的窗口数目N2,假设每个网络视图运行占用的内存为S1,每个窗口打开以后运行占用的内存是S2,而本地设备的内存总量是Su,则内存占用比Sp可以根据如下公式1计算:The memory usage ratio can be obtained by monitoring the memory usage. For example, the number of the currently running network views (WebView) N1 and the number of open windows N2 can be counted, and it is assumed that the memory occupied by each network view operation is S1, and each After the window is opened, the memory occupied by the operation is S2, and the total memory of the local device is Su, and the memory occupancy ratio Sp can be calculated according to the following formula 1:
Sp=(N1*S1+N2*S2)/Su*100% (公式1)Sp=(N1*S1+N2*S2)/Su*100% (Equation 1)
步骤S2300,当所述预读状态满足预设的预读条件时,获取所述目标网页的主文档以及对应的子资源,并基于所述主文档以及对应的子资源渲染生成对应的预读页面并存储于内存中,以供响应于所述的目标网页的访问请求时使用。In step S2300, when the pre-reading state meets the preset pre-reading condition, the main document of the target webpage and the corresponding sub-resource are acquired, and the corresponding pre-reading page is generated based on the main document and the corresponding sub-resource rendering. And stored in the memory for use in response to the access request of the target web page.
其中,所述预读条件是表征当前符合执行对目标网页的预读操作以生成对应的预读页面时应具有的预读状态。所述预读状态中至少包括的网络状态和内存状态,当网络状态和内存状态都符合对应的预读条件时,通过加载目标网页的主文档,所述主文档具体可以是目标网页对应的HTML(Hyper Text Mark-up Language,超文本标记语言)文件,HTML文件是由HTML命令组成的对网页的描述性文本,HTML命令可以说明文字、图片、视频、声频、表格、链接等。在网页的HTML文件中具体的通过URL(统一资源定位符)引用的资源,例如图片、视频、声频、等资源即为相应的子资源。The pre-reading condition is a pre-reading state that should be possessed when the pre-reading operation of the target webpage is performed to generate a corresponding pre-reading page. The network document and the memory state at least included in the pre-reading state, when the network state and the memory state meet the corresponding pre-reading conditions, by loading the main document of the target webpage, the main document may specifically be the HTML corresponding to the target webpage. (Hyper Text Mark-up Language) file, HTML file is a descriptive text composed of HTML commands for web pages, and HTML commands can describe text, images, videos, audio, tables, links, and so on. The resources referenced by the URL (Uniform Resource Locator) in the HTML file of the webpage, such as pictures, videos, audio, and the like, are the corresponding sub-resources.
根据目标网页的主文档加载对应的子资源,具体地,可以根据目标网页的HTML文件中引用的子资源的URL加载对应的子资源,所述子资源可以包括但不限于图片子资源、CSS(Cascading Style Sheets,层叠样式表)子资源、JS(JavaScript,直译式脚本语言)子资源等。Loading the corresponding sub-resource according to the main document of the target webpage. Specifically, the corresponding sub-resource may be loaded according to the URL of the sub-resource referenced in the HTML file of the target webpage, where the sub-resource may include but not limited to the image sub-resource, CSS ( Cascading Style Sheets, cascading style sheets, sub-resources, JS (JavaScript, literal translation scripting language) sub-resources, etc.
在获取目标网页的主文档以及对应的子资源后,根据目标网页的主文档以及对应的子资源可以渲染生成对应的网页页面作为目标网页的预读页面存储于内存中,在存储时可以将目标网页的链接或者URL标识作为对应预读页面的存储索引以便于区分不同的目标网页对应的预读页面,当然, 还可以使用其他可以区分不同的目标网页的其他标识,在本实施例中不做限制。After obtaining the main document of the target webpage and the corresponding sub-resource, the pre-reading page that can generate and render the corresponding webpage as the target webpage according to the main document of the target webpage and the corresponding sub-resource can be stored in the memory, and the target can be stored during storage. The link of the webpage or the URL identifier is used as a storage index of the corresponding pre-reading page to distinguish the pre-reading pages corresponding to different target webpages. Of course, other identifiers that can distinguish different target webpages may also be used, and are not used in this embodiment. limit.
当目标网页被用户访问时,不必再执行加载目标网页的主文档、根据目标网页的主文档加载子资源、基于主文档以及子资源执行渲染操作生成网页页面等步骤,而是直接将对应的预读页面作为网页页面展示给用户,极大缩减了用户等待响应返回网页的时间,使得用户能显著感知网页访问速度的提升,改善用户体验。When the target webpage is accessed by the user, the main document of loading the target webpage, loading the sub-resource according to the main document of the target webpage, and performing the rendering operation based on the main document and the sub-resource to generate the webpage page are not required, but the corresponding pre-processing is directly performed. The read page is displayed to the user as a webpage page, which greatly reduces the time for the user to wait for a response to return to the webpage, so that the user can significantly perceive the improvement of the webpage access speed and improve the user experience.
具体地,所述预读条件可以是当网络状态满足可使用的流量较为充足,不会因执行目标网页预读操作而带来流量负担影响用户体验,并且内存状态满足内存充足,不会因执行目标网页预读操作而影响设备运行时,才执行对目标网页的预读操作以生成对应的预读页面。Specifically, the pre-reading condition may be that when the network status satisfies the available traffic, the traffic load does not affect the user experience due to the execution of the target webpage read-ahead operation, and the memory state satisfies sufficient memory and is not implemented. The pre-reading operation of the target webpage is performed to generate a corresponding pre-reading page when the target webpage read-ahead operation affects the running of the device.
更具体地,所述网络状态至少包括网络类型,所述内存状态至少包括内存占用比时,所述预读条件是是网络类型符合指定的网络类型并且内存占用比低于预设的占用比阈值。More specifically, the network state includes at least a network type, and when the memory state includes at least a memory occupation ratio, the read-ahead condition is that the network type meets the specified network type and the memory occupancy ratio is lower than a preset occupancy ratio threshold. .
其中,指定的网络类型可以是流量充足对应的网络类型,例如WIFI,也可以是用户根据自身流量使用状态而设置的网络类型,例如,用户不认为使用4G网络会带来流量负担,因此设置指定的网络类型为4G网络。The specified network type may be a network type corresponding to sufficient traffic, such as WIFI, or a network type set by the user according to the usage state of the traffic. For example, the user does not think that using the 4G network brings a traffic burden, so the setting is specified. The network type is 4G network.
所述占用比阈值是表征内存占用较高是对应的占用比阈值,可以根据工程经验或者实验仿真选取,例如,可以设置为80%。The occupancy ratio threshold is a corresponding occupation ratio threshold, which can be selected according to engineering experience or experimental simulation. For example, it can be set to 80%.
在所述内存状态不满足对应的预读条件时,例如,当所述内存占用比不低于所述占用比阈值时,表明当前的内存状态不适合执行目标网页的预读操作,因此,在一个例子中,本实施例中的网页预读方法还包括:当所述内存状态不满足对应的所述预读条件时,清除已存储于内存中的符合清除条件的所述预读页面,以使得所述内存状态满足对应的所述预读条件。When the memory state does not satisfy the corresponding pre-reading condition, for example, when the memory occupancy ratio is not lower than the occupancy ratio threshold, indicating that the current memory state is not suitable for performing a pre-read operation of the target webpage, therefore, In an example, the webpage pre-reading method in this embodiment further includes: when the memory state does not satisfy the corresponding pre-reading condition, clearing the pre-reading page that is stored in the memory and meeting the clearing condition, The memory state is made to satisfy the corresponding pre-read condition.
其中,符合所述清除条件的预读页面,可以预估的用户访问可能清除较小的预读页面,清除这些预读页面,可以在尽可能保证预读页面满足用户访问需求的前提下,使得内存状态满足对应的所述预读条件,使得继续执行后续的其他目标网页的预读操作。Wherein, the pre-reading page that meets the clearing condition may predict that the user access may clear the smaller pre-reading page, and clearing the pre-reading page may ensure that the pre-reading page satisfies the user's access requirement as much as possible. The memory state satisfies the corresponding pre-reading condition, so that the subsequent read-ahead operation of the other target web pages is continued.
具体地,所述清除条件为所述预读页面对应的目标网页的预测点击数 最少,其中,所述预测点击数根据所述目标网页的历史总点击数、在第一预设时间段内累计点击数以及在第二预设时间段内累计点击数计算获取。该第一预设时间段、第二预设时间段可以根据工程经验或实验仿真获取,例如第一预设时间段设置为最近7天,第二预设时间段为最近30天。Specifically, the clearing condition is that the number of predicted clicks of the target webpage corresponding to the pre-reading page is the least, wherein the predicted number of clicks is accumulated according to the total number of historical clicks of the target webpage, and is accumulated in the first preset time period. The number of clicks and the cumulative number of clicks in the second preset time period are calculated and acquired. The first preset time period and the second preset time period may be acquired according to engineering experience or experimental simulation, for example, the first preset time period is set to the last 7 days, and the second preset time period is the last 30 days.
更具体地,假设所述目标网页的历史总点击数为Ds,在第一预设时间段内累计点击数为D1、第二预设时间段内累计点击数为D2,则预测点击数Dp可以根据下述公式2计算:More specifically, it is assumed that the total number of clicks of the target webpage is Ds, and the cumulative number of clicks in the first preset time period is D1, and the cumulative number of clicks in the second preset time period is D2, and the predicted click number Dp may be Calculated according to the following formula 2:
Dp=Ds+D1*a1+D2*a2 (公式2)Dp=Ds+D1*a1+D2*a2 (Equation 2)
其中,a1、a2为对应的权重参数,取值可以根据工程经验或者实验仿真设置,例如,一个例子中a1为2、a2为1.5。Where a1 and a2 are corresponding weight parameters, and the value can be set according to engineering experience or experimental simulation. For example, in one example, a1 is 2 and a2 is 1.5.
<例子><example>
以下加结合图3进一步说明本实施例中提供的网页预读方法。如图3所示,在本例中,预读条件为网络类型为WIFI并且内存占比低于80%,清除条件为预读页面对应的目标网页的预测点击数最少,该方法包括:The webpage pre-reading method provided in this embodiment is further described below in conjunction with FIG. As shown in FIG. 3, in this example, the pre-reading condition is that the network type is WIFI and the memory ratio is less than 80%, and the clearing condition is that the target webpage corresponding to the pre-reading page has the least predicted clicks, and the method includes:
步骤S301,确定导航站点的网页为待进行预读的目标网页;Step S301, determining that the webpage of the navigation site is a target webpage to be pre-read;
步骤S302,获取当前的网络类型;Step S302: Acquire a current network type.
步骤S303,获取当前的内存占比;Step S303, obtaining a current memory ratio;
步骤S304,判断网络类型是否为WIFI,如果是,进入步骤S305,如果否,结束;Step S304, determining whether the network type is WIFI, if yes, proceeding to step S305, and if not, ending;
步骤S305,判断内存占比是否低于80%,如果是,进入步骤S306,如果否,满足预读条件,进入步骤S307;Step S305, it is determined whether the memory ratio is lower than 80%, if yes, proceeds to step S306, if not, meets the pre-reading condition, proceeds to step S307;
步骤S306,将已存储在内存中对应的目标网页的预测点击数最少的预读页面清除,之后转回步骤S305;Step S306, the pre-read page with the least number of predicted clicks of the corresponding target webpage stored in the memory is cleared, and then returns to step S305;
步骤S307,加载目标网页的主文档,在根据主文档加载对应的子资源;Step S307, loading a main document of the target webpage, and loading the corresponding sub-resource according to the main document;
步骤S308,基于目标网页的主文档和对应的子资源渲染生成对应的预读页面并存储于内存中。Step S308, generating a corresponding pre-read page based on the main document of the target webpage and the corresponding sub-resource rendering and storing in the memory.
<装置><device>
在本实施例中,还提供一种网页预读设备4000,如图4所示,包括目 标确定单元4100、状态获取单元4200以及预读处理单元4300,可选地,还包括页面清除单元4400,用于实施本实施例中提供的网页预读方法,在此不再赘述。In this embodiment, a webpage pre-reading device 4000 is further provided, as shown in FIG. 4, including a target determining unit 4100, a state obtaining unit 4200, and a pre-reading processing unit 4300, and optionally, a page clearing unit 4400. The method for implementing the webpage pre-reading provided in this embodiment is not described here.
网页预读设备4000,包括:Web page read-ahead device 4000, including:
目标确定单元4100,用于确定待进行预读的目标网页;a target determining unit 4100, configured to determine a target webpage to be pre-read;
状态获取单元4200,获取当前的预读状态,所述预读状态至少包括网络状态和内存状态;The state obtaining unit 4200 acquires a current pre-reading state, where the pre-reading state includes at least a network state and a memory state;
预读处理单元4300,用于当所述预读状态满足预设的预读条件时,获取所述目标网页的主文档以及对应的子资源,并基于所述主文档以及对应的子资源渲染生成对应的预读页面并存储于内存中,以供响应于所述的目标网页的访问请求时使用。The pre-reading processing unit 4300 is configured to acquire a main document of the target webpage and a corresponding sub-resource when the pre-reading state satisfies a preset pre-reading condition, and generate and generate the main document and the corresponding sub-resource based on the main document and the corresponding sub-resource A corresponding pre-read page is stored in memory for use in response to an access request for the target web page.
可选地,所述网页预读设备4000还包括:Optionally, the webpage pre-reading device 4000 further includes:
页面清除单元4400,用于当所述内存状态不满足对应的所述预读条件时,清除已存储于内存中的符合清除条件的所述预读页面,以使得所述内存状态满足对应的所述预读条件。The page clearing unit 4400 is configured to: when the memory state does not satisfy the corresponding pre-reading condition, clear the pre-reading page that is stored in the memory and meets the clearing condition, so that the memory state satisfies the corresponding Pre-reading conditions.
在本实施例中,并不限制所述网页预读设备4000的实施形式,所述网页预读设备4000可以设置于浏览器或者类似浏览器的应用中,也可以独立于所述浏览器或者类似浏览器的应用之外,与所述浏览器或者类似浏览器的应用建立连接以实现对应的功能。本领域技术人员应当明白,可以通过各种方式来实现网页预读设备4000。例如,可以通过指令配置处理器来实现网页预读设备4000。例如,可以将指令存储在ROM中,并且当启动设备时,将指令从ROM读取到可编程器件中来实现网页预读设备4000。例如,可以将网页预读设备4000固化到专用器件(例如ASIC)中。可以将网页预读设备4000分成相互独立的单元,或者可以将它们合并在一起实现。网页预读设备4000可以通过上述各种实现方式中的一种来实现,或者可以通过上述各种实现方式中的两种或更多种方式的组合来实现。In this embodiment, the implementation form of the webpage pre-reading device 4000 is not limited. The webpage pre-reading device 4000 may be disposed in a browser or a browser-like application, or may be independent of the browser or the like. In addition to the browser's application, a connection is established with the browser or a browser-like application to implement the corresponding function. Those skilled in the art will appreciate that the web page pre-reading device 4000 can be implemented in a variety of ways. For example, web page pre-reading device 4000 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 4000. For example, web page pre-reading device 4000 can be cured into a dedicated device (eg, an ASIC). The web page pre-reading device 4000 can be divided into mutually independent units, or they can be combined and implemented. The web page pre-reading device 4000 may be implemented by one of the various implementations described above, or may be implemented by a combination of two or more of the various implementations described above.
<实体设备><physical device>
在本实施例中,还提供一种电子设备,包括存储器和处理器,所述存 储器用于存储指令,所述指令用于控制所述处理器进行操作以执行本实施例中提供的网页预读方法。具体地,所述电子设备可以是如图1所示的电子设备1000,在此不再赘述。In this embodiment, there is also provided an electronic device comprising a memory and a processor, the memory for storing instructions for controlling the processor to perform to perform webpage pre-reading provided in the embodiment method. Specifically, the electronic device may be the electronic device 1000 as shown in FIG. 1 , and details are not described herein again.
以上已经结合附图描述了本发明的第一实施例,根据本实施例,提供一种网页预读方法、设备及电子设备,通过在确定预读的目标网页以及获取当前的预读状态后,在预读状态满足预读条件时,获取目标网页的主文档以及对应的子资源以生成与目标网页对应的预读页面,使得可以在用户访问目标网页时直接向用户展示预读页面,缩减用户等待响应返回网页的时间至秒级以下,使得用户显著感知网页访问速度的提升,改善用户体验。The first embodiment of the present invention has been described above with reference to the accompanying drawings. According to the embodiment, a webpage pre-reading method, device, and electronic device are provided. After determining the pre-read target webpage and obtaining the current pre-reading state, When the pre-reading state satisfies the pre-reading condition, the main document of the target webpage and the corresponding sub-resource are acquired to generate a pre-reading page corresponding to the target webpage, so that the pre-reading page can be directly displayed to the user when the user accesses the target webpage, and the user is reduced. The time to wait for the response to return to the web page is below the second level, so that the user significantly perceives the improvement of the webpage access speed and improves the user experience.
<第二实施例><Second embodiment>
<方法><method>
在本实施例中,提供一种网页访问方法,如图5所示,包括:In this embodiment, a webpage access method is provided, as shown in FIG. 5, including:
步骤S5100,响应于目标网页的访问请求,检测到内存中存储有与所述目标网页对应的预读页面时,展示所述预读页面以完成对所述目标网页的访问;In step S5100, in response to the access request of the target webpage, when it is detected that the pre-reading page corresponding to the target webpage is stored in the memory, the pre-reading page is displayed to complete the access to the target webpage;
其中,目标网页的访问请求由用户存在访问目标网页的需求时触发,触发方式存在多种,例如用户通过实施访问目标网页的设备点击目标网页对应的图标或者链接等,在本实施例中不做限制。The access request of the target webpage is triggered by the user's request to access the target webpage, and the triggering manner is different. For example, the user does not click the icon or the link corresponding to the target webpage by the device that accesses the target webpage. limit.
检测到内存中存储有与所述目标网页对应的预读页面时,可以直接将该预读页面作为响应返回的目标网页的页面向用户展示,因此不必再执行加载目标网页的主文档、根据目标网页的主文档加载子资源、基于主文档以及子资源执行渲染操作生成网页页面等步骤,而是直接将对应的预读页面作为网页页面展示给用户,极大缩减了用户等待响应返回网页的时间,在具体应用测试中,用户平均等待响应返回网页的时间在秒级以下,使得用户能显著感知网页访问速度的提升,改善用户体验。When it is detected that the pre-read page corresponding to the target webpage is stored in the memory, the pre-read page may be directly displayed as a page of the target webpage returned by the response, so that it is no longer necessary to execute the main document of the loading target webpage, according to the target. The main document of the webpage loads the sub-resource, performs the rendering operation based on the main document and the sub-resource to generate the webpage page, and directly displays the corresponding pre-reading page as the webpage page to the user, which greatly reduces the time for the user to wait for the response to return the webpage. In the specific application test, the user waits for the response to return the webpage for an average of less than the second, so that the user can significantly perceive the improvement of the webpage access speed and improve the user experience.
而所述预读页面,是执行第一实施例中提供的网页预读方法获取的预读页面,通常对应的是用户访问可能性较大的网页,例如用户定制的导航 站点的网页,或者是用户定制的新闻站点的网页。通常这类网页通常具有较高的时效性,因此,可以在向用户展示对应的预读页面时可以刷新该预读页面以获取最新的页面进行展示,以保证向用户展示的是符合时效性要求的网页页面。因此,本实施例中提供的网页访问方法,还可以包括:The pre-reading page is a pre-reading page obtained by executing the webpage pre-reading method provided in the first embodiment, and generally corresponds to a webpage with a large user access possibility, such as a webpage of a user-customized navigation site, or A web page of a user-customized news site. Usually such webpages usually have high timeliness. Therefore, the pre-reading page can be refreshed when the corresponding pre-reading page is displayed to the user to obtain the latest page for display, so as to ensure that the user is presented with the timeliness requirement. Page page. Therefore, the method for accessing a webpage provided in this embodiment may further include:
步骤S5200,当所述预读页面的展示次数大于预定阈值时,刷新所述预读页面以用于展示。Step S5200: When the number of impressions of the pre-read page is greater than a predetermined threshold, the pre-read page is refreshed for display.
其中,所述预读页面的展示次数是实时检测统计的预读页面向用户展示的次数,而预定阈值可以根据工程经验或者实验仿真设置,例如,所述预定阈值为1,即意味着预读页面被展示的次数超过1次后,再展示该预读页面时需执行刷新操作后展示。The number of impressions of the pre-reading page is the number of times the pre-reading page of the real-time detection statistics is displayed to the user, and the predetermined threshold may be set according to engineering experience or experimental simulation. For example, the predetermined threshold is 1, which means pre-reading. After the page has been displayed more than once, the pre-read page will be displayed after the refresh operation.
<装置><device>
在本实施例中,还提供一种网页访问设备6000,如图4所示,包括页面展示单元6100,可选地,还包括页面更新单元6200,用于实施本实施例中提供的网页访问方法,在此不再赘述。In this embodiment, a webpage accessing device 6000 is further provided, as shown in FIG. 4, including a page displaying unit 6100, and optionally, a page updating unit 6200, for implementing the webpage accessing method provided in this embodiment. , will not repeat them here.
网页预读设备6000,包括:Web page read-ahead device 6000, including:
页面展示单元6100,用于响应于目标网页的访问请求,检测到内存中存储有目标网页对应的预读页面时,呈现所述预读页面以完成对所述目标网页的访问。The page display unit 6100 is configured to, in response to the access request of the target webpage, when the read-ahead page corresponding to the target webpage is stored in the memory, present the pre-reading page to complete the access to the target webpage.
可选地,还包括:Optionally, it also includes:
页面更新单元6200,用于当所述预读页面的展示次数大于预定阈值时,刷新所述预读页面以用于展示。The page update unit 6200 is configured to refresh the pre-read page for display when the number of impressions of the pre-read page is greater than a predetermined threshold.
在本实施例中,并不限制所述网页访问设备6000的实施形式,所述网页访问设备6000可以设置于浏览器或者类似浏览器的应用中,也可以独立于所述浏览器或者类似浏览器的应用之外,与所述浏览器或者类似浏览器的应用建立连接以实现对应的功能。本领域技术人员应当明白,可以通过各种方式来实现网页访问设备6000。例如,可以通过指令配置处理器来实现网页访问设备6000。例如,可以将指令存储在ROM中,并且当启动设备时,将指令从ROM读取到可编程器件中来实现网页预读设备4000。例如,可以将网页访问设备6000固化到专用器件(例如ASIC)中。可以将网页 访问设备6000分成相互独立的单元,或者可以将它们合并在一起实现。网页访问设备6000可以通过上述各种实现方式中的一种来实现,或者可以通过上述各种实现方式中的两种或更多种方式的组合来实现。In this embodiment, the implementation form of the webpage access device 6000 is not limited. The webpage access device 6000 may be disposed in a browser or a browser-like application, or may be independent of the browser or a similar browser. In addition to the application, a connection is established with the browser or a browser-like application to implement the corresponding function. Those skilled in the art will appreciate that the web page access device 6000 can be implemented in a variety of ways. For example, the web page access device 6000 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 4000. For example, web page access device 6000 can be cured into a dedicated device (eg, an ASIC). The web page access device 6000 can be divided into mutually independent units, or they can be implemented together. The web page access device 6000 may be implemented by one of the various implementations described above, or may be implemented by a combination of two or more of the various implementations described above.
<实体设备><physical device>
在本实施例中,还提供一种电子设备,包括存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行本实施例中提供的网页预读方法。具体地,所述电子设备可以是如图1所示的电子设备1000,在此不再赘述。In this embodiment, there is also provided an electronic device comprising a memory and a processor, the memory for storing instructions for controlling the processor to perform to perform webpage pre-reading provided in the embodiment method. Specifically, the electronic device may be the electronic device 1000 as shown in FIG. 1 , and details are not described herein again.
以上已经结合附图描述了本发明的第二实施例,根据本实施例,提供一种网页访问方法、设备及电子设备,在用户访问目标网页时,可以直接向用户展示对应的预读页面,缩减用户等待响应返回网页的时间至秒级以下,使得用户显著感知网页访问速度的提升,改善用户体验。The second embodiment of the present invention has been described above with reference to the accompanying drawings. According to the embodiment, a webpage accessing method, a device, and an electronic device are provided. When a user visits a target webpage, the corresponding pre-reading page can be directly displayed to the user. Reducing the time that the user waits for the response to return to the web page to below the second level, so that the user significantly perceives the improvement of the webpage access speed and improves the user experience.
本领域技术人员公知的是,随着诸如大规模集成电路技术的电子信息技术的发展和软件硬件化的趋势,要明确划分计算机系统软、硬件界限已经显得比较困难了。因为,任何操作可以软件来实现,也可以由硬件来实现。任何指令的执行可以由硬件完成,同样也可以由软件来完成。对于某一机器功能采用硬件实现方案还是软件实现方案,取决于价格、速度、可靠性、存储容量、变更周期等非技术性因素。因此,对于电子信息技术领域的普通技术人员来说,更为直接和清楚地描述一个技术方案的方式是描述该方案中的各个操作。在知道所要执行的操作的情况下,本领域技术人员可以基于对所述非技术性因素的考虑直接设计出期望的产品。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. Those skilled in the art can directly design the desired product based on consideration of the non-technical factors, knowing the operation to be performed.
本发明可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本发明的各个方面的计算机可读程序指令。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 may include copper transmission cables, fiber optic transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and/or edge servers. 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 will be understood that each block of the flowchart illustrations and/or block diagrams, and 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 alternative implementations, 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 (13)
- 一种网页预读方法,其特征在于,包括:A webpage pre-reading method, comprising:确定待进行预读的目标网页;Determining the target web page to be pre-read;获取当前的预读状态,所述预读状态至少包括网络状态和内存状态;Obtaining a current read-ahead state, where the read-ahead state includes at least a network state and a memory state;当所述预读状态满足预设的预读条件时,获取所述目标网页的主文档以及对应的子资源,并基于所述主文档以及对应的子资源渲染生成对应的预读页面并存储于内存中,以供响应于所述目标网页的访问请求时使用。And acquiring the main document of the target webpage and the corresponding sub-resource, and generating a corresponding pre-reading page based on the main document and the corresponding sub-resource, and storing the pre-reading page in the pre-reading state. In-memory for use in response to an access request for the target web page.
- 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:当所述内存状态不满足对应的所述预读条件时,清除已存储于内存中的符合清除条件的所述预读页面,以使得所述内存状态满足对应的所述预读条件。When the memory state does not satisfy the corresponding pre-reading condition, the pre-reading page that has been stored in the memory and meets the clearing condition is cleared, so that the memory state satisfies the corresponding pre-reading condition.
- 根据权利要求2所述的方法,其特征在于,The method of claim 2 wherein:所述清除条件为所述预读页面对应的目标网页的预测点击数最少,The clearing condition is that the target webpage corresponding to the pre-reading page has the least predicted clicks.其中,所述预测点击数根据所述目标网页的历史总点击数、在第一预设时间段内累计点击数以及在第二预设时间段内累计点击数计算获取。The predicted clicks are calculated according to the total number of historical clicks of the target webpage, the accumulated number of clicks in the first preset time period, and the cumulative number of clicks in the second preset time period.
- 根据权利要求1-3中任意一项所述的方法,其特征在于,A method according to any one of claims 1 to 3, characterized in that所述网络状态至少包括网络类型;The network status includes at least a network type;所述内存状态至少包括内存占用比;The memory state at least includes a memory occupation ratio;所述预读条件是网络类型符合指定的网络类型并且内存占用比低于预设的占用比阈值。The pre-reading condition is that the network type conforms to the specified network type and the memory occupancy ratio is lower than a preset occupancy ratio threshold.
- 一种网页访问方法,其特征在于,至少包括:A webpage access method, characterized in that it comprises at least:响应于目标网页的访问请求,检测到内存中存储有与所述目标网页对应的预读页面时,展示所述预读页面,以完成对所述目标网页的访问。In response to the access request of the target webpage, when it is detected that the pre-reading page corresponding to the target webpage is stored in the memory, the pre-reading page is displayed to complete the access to the target webpage.
- 根据权利要求5所述的方法,其特征在于,还包括:The method of claim 5, further comprising:当所述预读页面的展示次数大于预定阈值时,刷新所述预读页面以用于展示。When the number of impressions of the pre-read page is greater than a predetermined threshold, the pre-read page is refreshed for presentation.
- 一种网页预读设备,其特征在于,包括:A webpage pre-reading device, comprising:目标确定单元,用于确定待进行预读的目标网页;a target determining unit, configured to determine a target webpage to be pre-read;状态获取单元,获取当前的预读状态,所述预读状态至少包括网络状态和内存状态;a state acquiring unit, acquiring a current pre-reading state, where the pre-reading state includes at least a network state and a memory state;预读处理单元,用于当所述预读状态满足预设的预读条件时,获取所述目标网页的主文档以及对应的子资源,并基于所述主文档以及对应的子资源渲染生成对应的预读页面并存储于内存中,以供响应于所述目标网页的访问请求时使用。a pre-reading processing unit, configured to acquire a main document of the target webpage and a corresponding sub-resource when the pre-reading state meets a preset pre-reading condition, and generate a corresponding image based on the main document and the corresponding sub-resource rendering The pre-read page is stored in memory for use in response to an access request for the target web page.
- 根据权利要求7所述的设备,其特征在于,还包括:The device according to claim 7, further comprising:页面清除单元,用于当所述内存状态不满足对应的所述预读条件时,清除已存储于内存中的符合清除条件的所述预读页面,以使得所述内存状态满足对应的所述预读条件。a page clearing unit, configured to: when the memory state does not satisfy the corresponding pre-reading condition, clear the pre-reading page that is stored in the memory and meets the clearing condition, so that the memory state meets the corresponding Read-ahead conditions.
- 一种网页访问设备,其特征在于,至少包括:A webpage access device, comprising: at least:页面展示单元,用于响应于目标网页的访问请求,检测到内存中存储有目标网页对应的预读页面时,呈现所述预读页面以完成对所述目标网页的访问。The page display unit is configured to, in response to the access request of the target webpage, when the read-ahead page corresponding to the target webpage is stored in the memory, present the pre-reading page to complete the access to the target webpage.
- 根据权利要求9所述的设备,其特征在于,还包括:The device according to claim 9, further comprising:页面更新单元,用于当所述预读页面的展示次数大于预定阈值时,刷新所述预读页面以用于展示。a page update unit, configured to refresh the pre-read page for presentation when the number of impressions of the pre-read page is greater than a predetermined threshold.
- 一种电子设备,其特征在于,包括:An electronic device, comprising:存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据权利要求1-4任意一项中所述的方法。A memory and a processor for storing instructions for controlling the processor to operate to perform the method of any of claims 1-4.
- 一种电子设备,其特征在于,包括:An electronic device, comprising:存储器和处理器,所述存储器用于存储指令,所述指令用于控制所述处理器进行操作以执行根据权利要求5或6所述的方法。A memory and a processor for storing instructions for controlling the processor to operate to perform the method of claim 5 or 6.
- 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,当所述计算机程序指令被处理器执行时实现如权利要求1-6中任一项所述的方法。A computer readable storage medium having stored thereon computer program instructions, wherein the method of any one of claims 1-6 is implemented when the computer program instructions are executed by a processor.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710067074.0 | 2017-02-06 | ||
CN201710067074.0A CN108255896A (en) | 2017-02-06 | 2017-02-06 | Webpage pre-head method, Web access method, equipment and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2018141300A1 true WO2018141300A1 (en) | 2018-08-09 |
Family
ID=62721714
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/075366 WO2018141300A1 (en) | 2017-02-06 | 2018-02-06 | Webpage pre-reading method, webpage access method, device, and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108255896A (en) |
WO (1) | WO2018141300A1 (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110889059A (en) * | 2018-09-11 | 2020-03-17 | 优视科技有限公司 | Method, client, server and system for presetting page resources |
CN109614569B (en) * | 2018-12-07 | 2022-04-01 | 万兴科技股份有限公司 | Page rendering method and device and intelligent terminal |
CN111506841B (en) * | 2019-01-30 | 2023-06-09 | 阿里巴巴集团控股有限公司 | Webpage display method, device, equipment and readable storage medium |
CN113836458A (en) * | 2020-06-23 | 2021-12-24 | 阿里巴巴集团控股有限公司 | Page loading method, device and equipment and computer storage medium |
CN114090139A (en) * | 2020-07-29 | 2022-02-25 | 北京字节跳动网络技术有限公司 | Page processing method and device, electronic equipment and computer readable storage medium |
CN111966642B (en) * | 2020-08-28 | 2022-09-30 | 维沃移动通信有限公司 | Image management method, device and electronic device |
CN113343141A (en) * | 2021-05-12 | 2021-09-03 | 北京三快在线科技有限公司 | Webpage obtaining method and device |
CN113535311A (en) * | 2021-07-29 | 2021-10-22 | 展讯半导体(成都)有限公司 | Page display method and device and electronic equipment |
CN113987397A (en) * | 2021-10-26 | 2022-01-28 | 北京字节跳动网络技术有限公司 | Application page control method, device, medium and electronic device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120151000A1 (en) * | 2003-07-02 | 2012-06-14 | Snodgrass Ryan J | Predictive prefetching to improve parallelization of data retrieval subtasks |
CN103678307A (en) * | 2012-08-31 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Page display method and client-side |
US20140380144A1 (en) * | 2011-05-15 | 2014-12-25 | Guanzhou Ucweb Computer Technology Co., Ltd | Method and apparatus for webpage reading based on mobile terminal |
CN105849724A (en) * | 2013-12-22 | 2016-08-10 | 交互数字专利控股公司 | Web application acceleration using personalized caching or prerendering |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104239562A (en) * | 2014-09-26 | 2014-12-24 | 可牛网络技术(北京)有限公司 | Web page display method and device |
-
2017
- 2017-02-06 CN CN201710067074.0A patent/CN108255896A/en active Pending
-
2018
- 2018-02-06 WO PCT/CN2018/075366 patent/WO2018141300A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120151000A1 (en) * | 2003-07-02 | 2012-06-14 | Snodgrass Ryan J | Predictive prefetching to improve parallelization of data retrieval subtasks |
US20140380144A1 (en) * | 2011-05-15 | 2014-12-25 | Guanzhou Ucweb Computer Technology Co., Ltd | Method and apparatus for webpage reading based on mobile terminal |
CN103678307A (en) * | 2012-08-31 | 2014-03-26 | 腾讯科技(深圳)有限公司 | Page display method and client-side |
CN105849724A (en) * | 2013-12-22 | 2016-08-10 | 交互数字专利控股公司 | Web application acceleration using personalized caching or prerendering |
Also Published As
Publication number | Publication date |
---|---|
CN108255896A (en) | 2018-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2018141300A1 (en) | Webpage pre-reading method, webpage access method, device, and electronic device | |
US10055507B2 (en) | Infinite scrolling | |
US8386955B1 (en) | User-optimized content for web browsing windows | |
US8612418B2 (en) | Mobile web browser for pre-loading web pages | |
US20170371974A1 (en) | Method for loading webpage, client and programmable device | |
US9916285B2 (en) | Generating a preview of a web page for a mobile terminal | |
US11106745B2 (en) | Method and apparatus for notifying a user of updated content for a webpage | |
US9436772B2 (en) | Appending a uniform resource identifier (URI) fragment identifier to a uniform resource locator (URL) | |
US20150074513A1 (en) | Webpage Browsing Method, Webapp Framework, Method and Device for Executing Javascript and Mobile Terminal | |
WO2017206626A1 (en) | Network resource access apparatus, mixed apparatus, and method | |
US9231996B2 (en) | User-influenced page loading of web content | |
WO2018072388A1 (en) | Method for pre-reading webpage, method and device for accessing webpage, and programmable device | |
US10205678B2 (en) | Systems and methods for client-side dynamic information resource activation and deactivation | |
KR20140030299A (en) | Techniques for zooming in and out with dynamic content | |
CN104978358B (en) | The method and intercepting page segment of desktop presentation web page fragments are to desktop presentation system | |
US20140095579A1 (en) | System and method for increasing web site serving performance | |
CN104462571A (en) | Webpage loading method and device and browser client-side | |
CN113590974A (en) | Recommendation page configuration method and device, electronic equipment and computer readable medium | |
KR20120016333A (en) | Pre-caching method for web application and terminal device applying the same | |
KR101462114B1 (en) | System, method and computer readable recording medium for synchronous script lazy loading | |
US10996845B2 (en) | Method, application, browser, and electronic device for providing webpage content | |
US20120284346A1 (en) | Requesting Computer Data Assets | |
CN115495417A (en) | Content loading method, device, equipment, medium and program product | |
US8863035B2 (en) | Dynamic self-reorganizing trees in a user interface | |
CN114547495B (en) | A page loading method, device, equipment and readable storage medium |
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: 18748074 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 22/01/2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18748074 Country of ref document: EP Kind code of ref document: A1 |