WO2016082530A1 - 网页页面的截图处理方法及装置 - Google Patents

网页页面的截图处理方法及装置 Download PDF

Info

Publication number
WO2016082530A1
WO2016082530A1 PCT/CN2015/081842 CN2015081842W WO2016082530A1 WO 2016082530 A1 WO2016082530 A1 WO 2016082530A1 CN 2015081842 W CN2015081842 W CN 2015081842W WO 2016082530 A1 WO2016082530 A1 WO 2016082530A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
webpage page
current
instruction
screenshot
Prior art date
Application number
PCT/CN2015/081842
Other languages
English (en)
French (fr)
Inventor
梁捷
黄庆
陈炳辉
Original Assignee
广州市动景计算机科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广州市动景计算机科技有限公司 filed Critical 广州市动景计算机科技有限公司
Publication of WO2016082530A1 publication Critical patent/WO2016082530A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements

Definitions

  • the present invention relates to the field of web page browsing technology, and in particular, to a method and a device for processing a screenshot of a web page.
  • Mobile browsers also known as microbrowsers, mini-browsers or wireless internet browsers, are web browsers designed for mobile devices such as mobile phones or PDAs.
  • animations that move forward and backward between web pages are implemented using screenshots.
  • the first method mentioned above occupies a very large amount of memory, and the second method is inefficient, and it is necessary to wait for the web page to be drawn before the animation can be advanced.
  • the technical problem to be solved by the present invention is to provide a screenshot processing method and device for a web page, which can save memory and has high screenshot efficiency.
  • a technical solution adopted by the present invention is to provide a screenshot processing method for a webpage page, including: after entering the current webpage page, or obtaining an instruction to switch to a new webpage page, saving the current webpage. a drawing instruction of the page; when the screenshot request of the current webpage page is obtained, obtaining a drawing instruction of the saved current webpage page; and executing a drawing instruction of the current webpage page to generate a screenshot of the current webpage page.
  • the obtained instruction to switch to the new webpage page is an instruction that the user clicks to open a new webpage page, or an instruction that the user performs a forward/backward operation on the webpage page.
  • the drawing instruction of the saved current webpage page is a drawing instruction of a visible area of the webpage page. make.
  • the drawing instruction of the saved current webpage page is saved in a history item corresponding to the current webpage page.
  • the obtaining, before acquiring the screenshot request of the current webpage page, obtaining the saved drawing instruction of the current webpage page includes: receiving a forward or backward request of the user for the webpage page; and according to the forward or backward request, Generating a screenshot request for the current web page.
  • a screenshot processing device for a webpage page comprising: a saving module, configured to enter a current webpage page, or obtain a switch to a new one.
  • the drawing instruction of the current webpage page is saved;
  • the obtaining module is configured to acquire the saved drawing instruction of the current webpage page when acquiring the screenshot request of the current webpage page; and execute the module for executing the A drawing instruction of the current webpage page is generated to generate a screenshot of the current webpage page.
  • the obtained instruction to switch to the new webpage page is an instruction that the user clicks to open a new webpage page, or an instruction that the user performs a forward/backward operation on the webpage page.
  • the drawing instruction of the saved current webpage page is a drawing instruction of a visible area of the webpage page.
  • the drawing instruction of the saved current webpage page is saved in a history item corresponding to the current webpage page.
  • the device further includes: a receiving module, configured to receive a forward or backward request of the user on the webpage; and a generating module, configured to generate a screenshot request of the current webpage according to the forward or backward request.
  • the present invention saves the drawing instruction of the current webpage page after entering the current webpage page or after acquiring the instruction to switch to the new webpage page;
  • the drawing instruction of the saved current webpage page is obtained;
  • the drawing instruction is executed to generate a screenshot of the current webpage page; since executing the drawing instruction is far less time-saving than re-writing the webpage page from the cache,
  • the drawing instruction of the web page is only a record of some operations, and the memory consumed is much lower than the memory for saving a screenshot. Therefore, by the above method, the memory can be saved, and the screenshot efficiency is high.
  • FIG. 1 is a flowchart of an embodiment of a screenshot processing method of a web page of the present invention
  • FIG. 2 is a flowchart of another embodiment of a screenshot processing method of a web page of the present invention.
  • FIG. 3 is a schematic structural diagram of an embodiment of a screenshot processing device of a webpage of the present invention.
  • FIG. 4 is a schematic structural diagram of another embodiment of a screenshot processing device of a web page of the present invention.
  • FIG. 1 is a flowchart of an embodiment of a method for processing a screenshot of a web page of the present invention.
  • the execution body of the embodiment is a browser, and the method includes:
  • Step S101 After entering the current webpage page, or obtaining an instruction to switch to a new webpage page, save the drawing instruction of the current webpage page.
  • Step S102 When the screenshot request of the current webpage page is obtained, the saved drawing instruction of the current webpage page is obtained.
  • Step S103 Perform a drawing instruction of the current webpage page to generate a screenshot of the current webpage page.
  • the instruction to switch to a new web page refers to an instruction to switch from the current web page to a new web page.
  • the drawing instruction of the current webpage page is saved.
  • the obtained instruction to switch to the new webpage page is an instruction that the user clicks to open a new webpage page, or an instruction that the user performs a forward/backward operation on the webpage page.
  • the drawing instruction to the current web page may be saved.
  • the browser will draw the newly entered web page. Let's save it.
  • the drawing instruction of the web page is saved, the method saves the drawing instructions of all the incoming web pages.
  • the webpage page is closed and no longer advances to a new webpage page, and the webpage does not switch to a new webpage page, in this case, There is no need to generate a screenshot of the webpage by using the drawing instruction of the webpage, so the drawing instruction of the webpage is not useful in the application, which causes some invalid data to be saved, which wastes storage resources. Therefore, the application can be preferred in this application.
  • the method of saving the drawing instruction of the current web page is saved.
  • a screenshot of a web page is an effective way to retain information about a web page and exchange information with others.
  • a web page screenshot request is a screenshot request triggered by a specific browsing action during use of the web browser. For example, when the user performs a page advance or rewind operation, the browser needs to use a screenshot of the page to display the forward and backward animation, and a screenshot request is generated at this time. When the page advances, a screenshot request for the page that is advanced is generated, and when the page is rewinded, a screenshot request for the page that is back is generated.
  • each web page in the browser is drawn by Skia (which is a 2D vector graphics processing function library).
  • Skia which is a 2D vector graphics processing function library.
  • Each text, each picture, and each background color in the web page have corresponding drawing instructions. .
  • the drawing instruction of the current webpage page is saved, and when the screenshot request of the current webpage page is obtained, the saved webpage page may be obtained.
  • the drawing instruction obtains the drawing instruction of the current webpage page.
  • the presentation of the entire web page is the result of executing a line of drawing instructions. Since the drawing instruction of the webpage page is saved in advance, when the screenshot request of the current webpage page is received, as long as the drawing instruction of the current webpage page has been saved, the drawing instruction of the current webpage page may be obtained from the saved drawing instruction. Then execute these drawing instructions once to generate a screenshot of the current web page.
  • the drawing instruction of the saved current webpage page is a drawing instruction of the visible area of the webpage page.
  • the drawing instruction may not include drawing instructions of the non-page body content such as the title bar and the menu bar in the visible area. In this way, the range of the current web page that needs to be saved can be further reduced, thereby reducing the number of drawing instructions that need to be saved, and reducing the memory space required for saving.
  • the drawing instruction of the saved current webpage page is saved in the history item corresponding to the current webpage page. In this way, it is possible to directly utilize the history items corresponding to the current web page without separately dividing the storage space.
  • the drawing instruction of the current webpage page is saved; when the screenshot request of the current webpage page is obtained, the acquisition has been obtained.
  • FIG. 2 is a flowchart of another embodiment of a method for processing a screenshot of a webpage according to the present invention.
  • the execution body of the present embodiment is a browser, and the embodiment is basically the same as the embodiment of FIG. 1.
  • the method includes:
  • Step S201 After entering the current webpage page, or acquiring an instruction to switch to a new webpage page, acquiring and saving a drawing instruction of the current webpage page. Specifically, after the current webpage page is entered, or after the instruction to switch to the new webpage page is acquired, the drawing instruction of the visible area of the current webpage page is obtained, and is saved in the historical item corresponding to the current webpage page.
  • the obtained instruction to switch to the new webpage page may be an instruction that the user clicks to open a new webpage page, or an instruction that the user performs a forward/backward operation on the webpage page.
  • Step S202 Receive a forward or backward request of the user for the webpage page.
  • Step S203 Generate a screenshot request of the current webpage page according to the forward or backward request.
  • the webpage that needs to be screenshotd is the page that is advanced, that is, the current page refers to the page that needs to be advanced; when the request is backed, the webpage that needs to be screenshotd is the page that is backed up, that is, The current page refers to the page that needs to be retired.
  • Step S204 When the screenshot request of the current webpage page is obtained, the drawing instruction of the current webpage page is obtained from the drawing instruction of the saved webpage page. Specifically, when the screenshot request of the current webpage page is received, in the history item corresponding to the current webpage page, the drawing instruction of the visible area of the current webpage page is obtained from the drawing instruction of the visible area of the saved current webpage page. .
  • Step S205 Execute a drawing instruction of the current webpage page to generate a screenshot of the current webpage page.
  • it may be a drawing instruction to execute a visible area of the current web page to generate a screenshot of the visible area of the current web page.
  • the drawing instruction of the current webpage page is saved; when the screenshot request of the current webpage page is obtained, the saved webpage page is obtained.
  • the drawing instructions of the web page are only records of some operations, and the memory consumed is much lower than the memory for saving a screenshot. Therefore, by the above method, the memory can be saved, and the screenshot efficiency is high.
  • the animation can be made to respond quickly when used for animation.
  • the method for processing the screenshot of the web page of the present invention is verified by the statistical data after the actual line.
  • the method of the present invention has a very good effect on improving the efficiency of the screenshot.
  • the time taken by the browser to obtain the screenshot is generally increased by more than 50%.
  • FIG. 3 is a schematic structural diagram of an embodiment of a screenshot processing device of a webpage of the present invention.
  • the apparatus includes: a saving module 101, an obtaining module 102, and an executing module 103.
  • the saving module 101 is configured to save a drawing instruction of the current webpage page after entering the current webpage page or after acquiring an instruction to switch to the new webpage page.
  • the obtaining module 102 is configured to obtain a drawing instruction of the saved current webpage page when the screenshot request of the current webpage page is obtained.
  • the execution module 103 is configured to execute a drawing instruction of the current webpage page to generate a screenshot of the current webpage page.
  • the instruction to switch to a new web page refers to an instruction to switch from the current web page to a new web page.
  • the drawing instruction of the current webpage page is saved.
  • the obtained instruction to switch to the new webpage page is an instruction that the user clicks to open a new webpage page, or an instruction that the user performs a forward/backward operation on the webpage page.
  • a screenshot of a web page is an effective way to retain information about a web page and exchange information with others.
  • a web page screenshot request is a screenshot request triggered by a specific browsing action during use of the web browser. For example, when the user performs a page advance or rewind operation, the browser needs to use a screenshot of the page to display the forward and backward animation, and a screenshot request is generated at this time. When the page advances, a screenshot request for the page that is advanced is generated, and when the page is rewinded, a screenshot request for the page that is back is generated.
  • each web page in the browser is drawn by Skia (which is a 2D vector graphics processing function library).
  • Skia which is a 2D vector graphics processing function library.
  • Each text, each picture, and each background color in the web page have corresponding drawing instructions.
  • the drawing instruction of the current webpage page is saved in advance, and when the screenshot request of the current webpage page is received, the current webpage may be obtained from the drawing instruction of the saved webpage page.
  • the drawing instruction of the page is a 2D vector graphics processing function library.
  • the presentation of the entire web page is the result of executing a line of drawing instructions. Since the drawing instruction of the webpage page is saved in advance, when the screenshot request of the current webpage page is received, as long as the drawing instruction of the current webpage page has been saved, the drawing instruction of the current webpage page may be obtained from the saved drawing instruction. Then execute these drawing instructions once to generate a screenshot of the current web page.
  • the drawing instruction of the saved webpage page is a drawing instruction of the visible area of the webpage page.
  • the drawing instruction may not include a drawing instruction including a title bar, a menu bar, and the like in the visible area. In this way, the range of web pages that need to be saved can be further reduced, thereby reducing the number of drawing instructions that need to be saved, and reducing the memory space required for saving.
  • the drawing instruction of the saved current webpage page is saved in the history item corresponding to the current webpage page. In this way, it is possible to directly utilize the history items corresponding to the current web page without separately dividing the storage space.
  • the drawing instruction of the current webpage page is saved; when the screenshot request of the current webpage page is obtained, the saved current webpage page is obtained.
  • the drawing instruction is executed to generate a screenshot of the current web page; since the drawing instruction is executed, it is much more time-saving than re-drawing the web page from the cache.
  • the drawing instruction of the web page is only a record of some operations. The memory consumed is much lower than the memory that saves a screenshot, so in this way, you can save memory and the screenshots are efficient.
  • FIG. 4 is a schematic structural diagram of another embodiment of a screenshot processing device of a webpage according to the present invention.
  • the apparatus of the present embodiment is basically the same as the apparatus of FIG. 3.
  • the device includes a receiving module 204, a generating module 205, a saving module 201, an obtaining module 202, and an executing module 203.
  • the saving module 201 is configured to acquire and save a drawing instruction of the current webpage page after entering the current webpage page or acquiring an instruction to switch to the new webpage page.
  • the saving module 201 is configured to: after entering the current webpage page, or obtain an instruction to switch to a new webpage page, obtain a drawing instruction of the visible area of the current webpage page, and save the current instruction in the historical item corresponding to the current webpage page. .
  • the obtained instruction to switch to the new webpage page may be an instruction that the user clicks to open a new webpage page, or an instruction that the user performs a forward/backward operation on the webpage page.
  • the receiving module 204 is configured to receive a forward or backward request of the user for the webpage page.
  • the generating module 205 is configured to generate a screenshot request of the current webpage page according to the forward or backward request.
  • the obtaining module 202 is configured to obtain a drawing instruction of the current webpage page from the drawing instruction of the saved webpage page when the screenshot request of the current webpage page is obtained.
  • the obtaining module 202 may be a drawing instruction for acquiring a visible area of the saved current webpage page in the history item corresponding to the current webpage page when receiving the screenshot request of the current webpage page.
  • the execution module 203 is configured to execute a drawing instruction of the current webpage page to generate a screenshot of the current webpage page.
  • the execution module 203 may be a drawing instruction for executing a visible area of a current web page to generate a screenshot of a visible area of the current web page.
  • the drawing instruction of the current webpage page is saved; when the screenshot request of the current webpage page is obtained, the saved webpage page is obtained.
  • the drawing instruction obtains a drawing instruction of the current webpage page; executing the drawing instruction to generate a screenshot of the current webpage page; since executing the drawing instruction is far less time than re-rendering the webpage page from the cache, and further, drawing the webpage page.
  • the instruction is just a record of some operations, and the memory consumed is much lower than the memory that saves a screenshot. Therefore, in the above manner, memory can be saved, and the screenshot efficiency is high.
  • the animation can be made to respond quickly when used for animation.
  • the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, where the program may include some or all of the embodiments of the screenshot processing method of the webpage provided by the present invention. step.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
  • the techniques in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solution in the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product, which may be stored in a storage medium such as a ROM/RAM. , a disk, an optical disk, etc., including instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present invention or portions of the embodiments.
  • a computer device which may be a personal computer, server, or network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种网页页面的截图处理方法及装置,该方法包括:在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;当获取到当前网页页面的截图请求时,获取已保存的所述当前网页页面的绘制指令;执行所述当前网页页面的绘制指令,以产生所述当前网页页面的截图。通过上述方式,本发明能够节省内存,且截图效率又高。

Description

网页页面的截图处理方法及装置 技术领域
本发明涉及网页浏览技术领域,特别是涉及一种网页页面的截图处理方法及装置。
背景技术
移动浏览器,也叫做微型浏览器、迷你浏览器或无线互联网浏览器,是为移动设备如移动电话或PDA设计的网页浏览器。在目前的移动浏览器中,网页页面间前进后退的动画,都是使用截图去实现的。
现有技术中,截图的方式主要有两种:第一,在进入下一个网页页面后,保存上一个网页页面的截图;这种方式的优点是:获取截图快,用户感觉流畅;第二,在做前进后退的动画时,直接在网页页面缓存中,获取网页缓存进行绘制,这种方法的优点是:不占用内存。
但是,上述第一种方式非常占用内存,第二种方式效率低,需要等待网页页面绘制完成才能进行前进后退的动画。
发明内容
本发明主要解决的技术问题是提供一种网页页面的截图处理方法及装置,能够节省内存,且截图效率又高。
为解决上述技术问题,本发明采用的一个技术方案是:提供一种网页页面的截图处理方法,包括:在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;当获取到当前网页页面的截图请求时,获取已保存的所述当前网页页面的绘制指令;执行所述当前网页页面的绘制指令,以产生所述当前网页页面的截图。
其中,获取到的所述切换到新的网页页面的指令是用户点击打开一个新的网页页面的指令,或者是用户对网页页面进行前进后退操作的指令。
其中,所述已保存的当前网页页面的绘制指令是网页页面的可见区域的绘制指 令。
其中,所述已保存的当前网页页面的绘制指令保存在所述当前网页页面对应的历史项中。
其中,所述当获取到当前网页页面的截图请求时,获取已保存的所述当前网页页面的绘制指令之前,包括:接收用户对网页页面的前进或后退请求;根据所述前进或后退请求,产生所述当前网页页面的截图请求。
为解决上述技术问题,本发明采用的另一个技术方案是:提供一种网页页面的截图处理装置,所述装置包括:保存模块,用于在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;获取模块,用于当获取到当前网页页面的截图请求时,获取已保存的所述当前网页页面的绘制指令;执行模块,用于执行所述当前网页页面的绘制指令,以产生所述当前网页页面的截图。
其中,获取到的所述切换到新的网页页面的指令是用户点击打开一个新的网页页面的指令,或者是用户对网页页面进行前进后退操作的指令。
其中,所述已保存的当前网页页面的绘制指令是网页页面的可见区域的绘制指令。
其中,所述已保存的当前网页页面的绘制指令保存在所述当前网页页面对应的历史项中。
其中,所述装置还包括:接收模块,用于接收用户对网页页面的前进或后退请求;产生模块,用于根据所述前进或后退请求,产生所述当前网页页面的截图请求。
本发明的有益效果是:区别于现有技术的情况,本发明在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;当获取到当前网页页面的截图请求时,获取已保存的当前网页页面的绘制指令;执行该绘制指令,以产生当前网页页面的截图;由于执行绘制指令,远比从缓存中重新将网页页面绘制一遍要节省时间,另外,网页页面的绘制指令只是一些操作的记录,耗费的内存远低于保存一张截图的内存,因此,通过上述方式,能够节省内存,且截图效率又高。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或 现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本发明网页页面的截图处理方法一实施方式的流程图;
图2是本发明网页页面的截图处理方法另一实施方式的流程图;
图3是本发明网页页面的截图处理装置一实施方式的结构示意图;
图4是本发明网页页面的截图处理装置另一实施方式的结构示意图。
具体实施方式
为了使本领域技术人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所述描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
下面结合附图和实施方式对本发明进行详细说明。
参阅图1,图1是本发明网页页面的截图处理方法一实施方式的流程图,本实施方式的执行主体是浏览器,该方法包括:
步骤S101:在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令。
步骤S102:当获取到当前网页页面的截图请求时,获取已保存的所述当前网页页面的绘制指令。
步骤S103:执行所述当前网页页面的绘制指令,以产生所述当前网页页面的截图。
切换到新的网页页面的指令是指从当前的网页页面切换到新的网页页面的指令。在获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令。其中,获取到的切换到新的网页页面的指令是用户点击打开一个新的网页页面的指令,或者是用户对网页页面进行前进后退操作的指令。
另外,还可以在进入到当前网页页面之后,就保存到当前网页页面的绘制指令。这种情况下,每次进入到一个网页页面之后,浏览器就将新进入的网页页面的绘制指 令保存起来。但是,由于每次在进入一个网页页面中,就保存该网页页面的绘制指令,则该方法会保存所有进入的网页页面的绘制指令。而有些情况下,在打开某一网页页面并浏览完毕后,该网页页面就被关闭,不再前进到新的网页页面,通过该网页页面不会切换到新的网页页面,这种情况下,不需要通过该网页页面的绘制指令产生该网页页面的截图,因此该网页页面的绘制指令在本申请中并无用处,导致一些无效数据被保存,浪费存储资源,因此,本申请中可以首选获取到切换到新的网页页面的指令后,再保存当前网页页面的绘制指令的方法。
网页页面截图是一种保留网页页面信息、与其他人交流信息的有效方式。网页页面截图请求是在浏览器使用过程中,由特定浏览动作而触发的截图请求。例如,当用户进行页面前进或后退操作时,浏览器显示前进后退动画需要用到页面截图,这个时候就会产生截图请求。当页面前进时,产生的是前进到的页面的截图请求,当页面后退时,产生的是后退到的页面的截图请求。
浏览器中每个网页页面的绘制,都是通过Skia(是个2D向量图形处理函数库)进行绘制的,网页页面中每一个文字、每一张图片、每一块背景色,都有对应的绘制指令。在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,将当前网页页面的绘制指令保存起来,当获取到当前网页页面的截图请求时,即可从已保存的网页页面的绘制指令中获取当前网页页面的绘制指令。
整个网页页面的展现,是执行一条条的绘制指令的结果。由于预先将网页页面的绘制指令保存下来,当接收到当前网页页面的截图请求时,只要当前网页页面的绘制指令已保存,那么可以从已保存的绘制指令中获取到当前网页页面的绘制指令,然后将这些绘制指令执行一遍,即可产生当前网页页面的截图。
其中,已保存的当前网页页面的绘制指令是网页页面的可见区域的绘制指令。为了减少绘制指令个数,提高绘制截图的速度,绘制指令中可以不包括可见区域中的标题栏、菜单栏等非页面正文内容的绘制指令。通过这种方式,可以进一步缩小需要保存的当前网页页面的范围,从而减少需要保存的绘制指令的个数,减小保存所需要的内存空间。
其中,已保存的当前网页页面的绘制指令保存在当前网页页面对应的历史项中。通过这种方式,可以不需要额外分割存储空间,直接利用当前网页页面对应的历史项。
本发明实施方式在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;当获取到当前网页页面的截图请求时,获取已 保存的当前网页页面的绘制指令;执行该绘制指令,以产生当前网页页面的截图;由于执行绘制指令,远比从缓存中重新将网页页面绘制一遍要节省时间,另外,网页页面的绘制指令只是一些操作的记录,耗费的内存远低于保存一张截图的内存,因此,通过上述方式,能够节省内存,且截图效率又高。
参阅图2,图2是本发明网页页面的截图处理方法另一实施方式的流程图,本实施方式的执行主体是浏览器,本实施方式和图1的实施方式基本相同,相同之处请参见图1以及相应的文字说明。该方法包括:
步骤S201:在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,获取并保存当前网页页面的绘制指令。具体地,可以是在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,获取当前网页页面的可见区域的绘制指令,并保存在当前网页页面对应的历史项中。
获取到的切换到新的网页页面的指令,可以是用户点击打开一个新的网页页面的指令,或者是用户对网页页面进行前进后退操作的指令。
步骤S202:接收用户对网页页面的前进或后退请求。
步骤S203:根据前进或后退请求,产生当前网页页面的截图请求。
前进请求时,需要截图的网页页面是前进到的页面,也就是说,所述当前页面指的是需要前进到的页面;后退请求时,需要截图的网页页面是后退到的页面,也就是说,所述当前页面指的是需要后退到的页面。
步骤S204:当获取到当前网页页面的截图请求时,从已保存的网页页面的绘制指令中获取当前的网页页面的绘制指令。具体地,可以是当接收到当前网页页面的截图请求时,在当前网页页面对应的历史项中,从已保存的当前网页页面的可见区域的绘制指令中获取当前网页页面的可见区域的绘制指令。
步骤S205:执行当前网页页面的绘制指令,以产生当前网页页面的截图。具体地,可以是执行当前网页页面的可见区域的绘制指令,以产生当前网页页面的可见区域的截图。
本发明实施方式在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;当获取到当前网页页面的截图请求时,从已保存的网页页面的绘制指令中获取当前网页页面的绘制指令;执行该绘制指令,以产生当前网页页面的截图;由于执行绘制指令,远比从缓存中重新将网页页面绘制一遍要 节省时间,另外,网页页面的绘制指令只是一些操作的记录,耗费的内存远低于保存一张截图的内存,因此,通过上述方式,能够节省内存,且截图效率又高。另外,当用户对网页页面进行前进或后退时,由于截图效率高,在用于动画时,能够使得动画的响应速度很快。
将本发明网页页面的截图处理方法经过实际上线后的统计数据证实,本发明方法对于提高截图效率有非常好的效果,应用本发明方法后,浏览器获取截图的耗时普遍提高50%以上。
参阅图3,图3是本发明网页页面的截图处理装置一实施方式的结构示意图,该装置包括:保存模块101、获取模块102和执行模块103。
保存模块101用于在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令。
获取模块102用于当获取到当前网页页面的截图请求时,获取已保存的当前网页页面的绘制指令。
执行模块103用于执行所述当前网页页面的绘制指令,以产生当前网页页面的截图。
切换到新的网页页面的指令是指从当前的网页页面切换到新的网页页面的指令。在获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令。其中,获取到的切换到新的网页页面的指令是用户点击打开一个新的网页页面的指令,或者是用户对网页页面进行前进后退操作的指令。
网页页面截图是一种保留网页页面信息、与其他人交流信息的有效方式。网页页面截图请求是在浏览器使用过程中,由特定浏览动作而触发的截图请求。例如,当用户进行页面前进或后退操作时,浏览器显示前进后退动画需要用到页面截图,这个时候就会产生截图请求。当页面前进时,产生的是前进到的页面的截图请求,当页面后退时,产生的是后退到的页面的截图请求。
浏览器中每个网页页面的绘制,都是通过Skia(是个2D向量图形处理函数库)进行绘制的,网页页面中每一个文字、每一张图片、每一块背景色,都有对应的绘制指令。在获取到切换到新的网页页面的指令后,预先将当前网页页面的绘制指令保存起来,当接收到当前网页页面的截图请求时,即可从已保存的网页页面的绘制指令中获取当前网页页面的绘制指令。
整个网页页面的展现,是执行一条条的绘制指令的结果。由于预先将网页页面的绘制指令保存下来,当接收到当前网页页面的截图请求时,只要当前网页页面的绘制指令已保存,那么可以从已保存的绘制指令中获取到当前网页页面的绘制指令,然后将这些绘制指令执行一遍,即可产生当前网页页面的截图。
其中,已保存的网页页面的绘制指令是网页页面的可见区域的绘制指令。为了减少绘制指令个数,提高绘制截图的速度。绘制指令中可以不包括可见区域中的包括标题栏、菜单栏等非页面正文内容的绘制指令。通过这种方式,可以进一步缩小需要保存的网页页面的范围,从而减少需要保存的绘制指令的个数,减小保存所需要的内存空间。
其中,保存的当前网页页面的绘制指令保存在当前网页页面对应的历史项中。通过这种方式,可以不需要额外分割存储空间,直接利用当前网页页面对应的历史项。
本发明实施方式在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;当获取到当前网页页面的截图请求时,获取已保存的当前网页页面的绘制指令;执行该绘制指令,以产生当前网页页面的截图;由于执行绘制指令,远比从缓存中重新将网页页面绘制一遍要节省时间,另外,网页页面的绘制指令只是一些操作的记录,耗费的内存远低于保存一张截图的内存,因此,通过上述方式,能够节省内存,且截图效率又高。
参阅图4,图4是本发明网页页面的截图处理装置另一实施方式的结构示意图,本实施方式的装置和图3的装置基本相同,相同之处请参见图3和相应的文字说明。该装置包括:接收模块204、产生模块205、保存模块201、获取模块202以及执行模块203。
保存模块201用于在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,获取和保存当前网页页面的绘制指令。
具体地,保存模块201用于在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,获取当前网页页面的可见区域的绘制指令,并保存在当前网页页面对应的历史项中。
获取到的切换到新的网页页面的指令,可以是用户点击打开一个新的网页页面的指令,或者是用户对网页页面进行前进后退操作的指令。
接收模块204用于接收用户对网页页面的前进或后退请求。
产生模块205用于根据前进或后退请求,产生当前网页页面的截图请求。
获取模块202用于当获取到当前网页页面的截图请求时,从已保存的网页页面的绘制指令中获取当前网页页面的绘制指令。具体地,获取模块202可以是用于当接收到当前网页页面的截图请求时,在当前网页页面对应的历史项中,获取已保存的当前网页页面的可见区域的绘制指令。
执行模块203用于执行所述当前网页页面的绘制指令,以产生当前网页页面的截图。具体地,执行模块203可以是用于执行当前网页页面的可见区域的绘制指令,以产生当前网页页面的可见区域的截图。
本发明实施方式在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;当获取到当前网页页面的截图请求时,从已保存的网页页面的绘制指令中获取当前网页页面的绘制指令;执行该绘制指令,以产生当前网页页面的截图;由于执行绘制指令,远比从缓存中重新将网页页面绘制一遍要节省时间,另外,网页页面的绘制指令只是一些操作的记录,耗费的内存远低于保存一张截图的内存,因此,通过上述方式,能够节省内存,且截图效率又高。另外,当用户对网页页面进行前进后退时,由于截图效率高,在用于动画时,能够使得动画的响应速度很快。
具体实现中,本发明还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可包括本发明提供的网页页面的截图处理方法的各实施例中的部分或全部步骤。所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、服务器、系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
以上所述仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (10)

  1. 一种网页页面的截图处理方法,其特征在于,所述方法包括:
    在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;
    当获取到当前网页页面的截图请求时,获取已保存的所述当前网页页面的绘制指令;
    执行所述当前网页页面的绘制指令,以产生所述当前网页页面的截图。
  2. 根据权利要求1所述的方法,其特征在于,获取到的所述切换到新的网页页面的指令是用户点击打开一个新的网页页面的指令,或者是用户对网页页面进行前进后退操作的指令。
  3. 根据权利要求1所述的方法,其特征在于,所述已保存的当前网页页面的绘制指令是网页页面的可见区域的绘制指令。
  4. 根据权利要求1所述的方法,其特征在于,所述已保存的当前网页页面的绘制指令保存在所述当前网页页面对应的历史项中。
  5. 根据权利要求1所述的方法,其特征在于,所述当接收到当前网页页面的截图请求时,获取已保存的当前网页页面的绘制指令之前,包括:
    接收用户对网页页面的前进或后退请求;
    根据所述前进或后退请求,产生所述当前网页页面的截图请求。
  6. 一种网页页面的截图处理装置,其特征在于,所述装置包括:
    保存模块,用于在进入当前网页页面之后,或获取到切换到新的网页页面的指令后,保存当前网页页面的绘制指令;
    获取模块,用于当获取到当前网页页面的截图请求时,获取已保存的所述当前网页页面的绘制指令;
    执行模块,用于执行所述当前网页页面的绘制指令,以产生所述当前网页页面的截图。
  7. 根据权利要求6所述的装置,其特征在于,获取到的所述切换到新的网页页面的指令是用户点击打开一个新的网页页面的指令,或者是用户对网页页面进行前进后退操作的指令。
  8. 根据权利要求6所述的装置,其特征在于,所述已保存的当前网页页面的绘制指令是网页页面的可见区域的绘制指令。
  9. 根据权利要求6所述的装置,其特征在于,所述已保存的当前网页页面 的绘制指令保存在所述当前网页页面对应的历史项中。
  10. 根据权利要求6所述的装置,其特征在于,所述装置还包括:
    接收模块,用于接收用户对网页页面的前进或后退请求;
    产生模块,用于根据所述前进或后退请求,产生所述当前网页页面的截图请求。
PCT/CN2015/081842 2014-11-27 2015-06-18 网页页面的截图处理方法及装置 WO2016082530A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410710839.4 2014-11-27
CN201410710839.4A CN105701127A (zh) 2014-11-27 2014-11-27 网页页面的截图处理方法及装置

Publications (1)

Publication Number Publication Date
WO2016082530A1 true WO2016082530A1 (zh) 2016-06-02

Family

ID=56073520

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/081842 WO2016082530A1 (zh) 2014-11-27 2015-06-18 网页页面的截图处理方法及装置

Country Status (2)

Country Link
CN (1) CN105701127A (zh)
WO (1) WO2016082530A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558187B (zh) * 2017-09-27 2022-08-23 斑马智行网络(香港)有限公司 一种用户界面渲染方法及装置
CN111459381B (zh) * 2020-03-30 2021-06-22 维沃移动通信有限公司 信息展示方法、电子设备及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101071380A (zh) * 2007-06-27 2007-11-14 中兴通讯股份有限公司 一种图形用户界面的截取和重现方法
CN103970598A (zh) * 2011-10-26 2014-08-06 华为终端有限公司 用于移动终端的应用屏幕截图方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011128957A1 (ja) * 2010-04-13 2011-10-20 パナソニック株式会社 スクリーンショット表示制御装置、スクリーンショット表示制御方法、スクリーンショット表示制御用集積回路、サーバ装置
CN102521020B (zh) * 2011-10-26 2014-05-21 华为终端有限公司 用于移动终端的应用屏幕截图方法和装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101071380A (zh) * 2007-06-27 2007-11-14 中兴通讯股份有限公司 一种图形用户界面的截取和重现方法
CN103970598A (zh) * 2011-10-26 2014-08-06 华为终端有限公司 用于移动终端的应用屏幕截图方法和装置

Also Published As

Publication number Publication date
CN105701127A (zh) 2016-06-22

Similar Documents

Publication Publication Date Title
US10775971B2 (en) Pinch gestures in a tile-based user interface
CN105630478B (zh) 一种实现页面切换的方法和装置
US9507520B2 (en) Touch-based reorganization of page element
WO2014206372A1 (zh) 已显示页面的切换方法及装置
JP6062438B2 (ja) タイル単位レンダラーを用いてレイヤリングするシステムおよび方法
US9507480B1 (en) Interface optimization application
US20140222947A1 (en) Method and apparatus for browsings webpages, and storage medium
CN108255890B (zh) 页面的处理方法和装置
EP3467679A1 (en) Data processing method and device
US20190080017A1 (en) Method, system, and device that invokes a web engine
EP3295306B1 (en) Converting flash content to html content by generating an instruction list
CN104199684B (zh) 浏览器冷启动的实现方法及装置
CN103856507B (zh) 网络动态图片的静态显示方法和装置
US20160291846A1 (en) Generating carousel user interface with graphics processing unit
CN105869199B (zh) 用于处理动画的装置和方法
US9886465B2 (en) System and method for rendering of hierarchical data structures
US20150370439A1 (en) Gpu-optimized scrolling systems and methods
WO2016192546A1 (zh) 一种动态曲线的数据点更新方法和设备
KR20190059943A (ko) 실시간 컨텐츠 전달을 위한 방법 및 시스템
CN109543127B (zh) 一种页面刷新方法、装置、设备及可读存储介质
US11295492B2 (en) Electronic device and server related to rendering of web content and controlling method thereof
WO2016082530A1 (zh) 网页页面的截图处理方法及装置
TW201820112A (zh) 資訊展示方法和裝置
US20170269893A1 (en) Remote rendering of locally displayed content
US20130120424A1 (en) Method and apparatus for improved rendering of images

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: 15862370

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15862370

Country of ref document: EP

Kind code of ref document: A1