WO2016150324A1 - 一种页面模块的渲染方法、装置以及显示设备 - Google Patents

一种页面模块的渲染方法、装置以及显示设备 Download PDF

Info

Publication number
WO2016150324A1
WO2016150324A1 PCT/CN2016/076449 CN2016076449W WO2016150324A1 WO 2016150324 A1 WO2016150324 A1 WO 2016150324A1 CN 2016076449 W CN2016076449 W CN 2016076449W WO 2016150324 A1 WO2016150324 A1 WO 2016150324A1
Authority
WO
WIPO (PCT)
Prior art keywords
rendering
page module
task
page
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2016/076449
Other languages
English (en)
French (fr)
Inventor
朱敏琪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Publication of WO2016150324A1 publication Critical patent/WO2016150324A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units

Definitions

  • the present invention relates to the field of computer application technologies, and in particular, to a method, an apparatus, and a display device for rendering a page module.
  • the rendering refers to a process of converting an object model and data inside a computer into a visual object through algorithm instructions; during the running of the software, some modules are visually visible (or can generate corresponding visual effects),
  • the rendering of the module is to use the interface form to render these visualization modules, convert them into text or graphics, and output them to the display screen for users to view.
  • each module for a page performs an independent rendering process when it needs to be rendered. If there are many modules, the number of renderings will be correspondingly large, resulting in excessive CPU consumption.
  • the embodiment of the invention provides a method, a device and a display device for rendering a page module, which are used to implement a page.
  • the periodic rendering of the face module allows multiple modules to be completed in one pass, effectively reducing CPU consumption.
  • the rendering task of the page module in the task queue is executed.
  • the rendering period of the preset page module arrives, it is determined that the rendering of the page module is required.
  • the method before the rendering period of the preset page module arrives, the method further includes:
  • the page module is loaded.
  • the rendering task of the page module in the task queue is a rendering task of the loaded page module.
  • detecting whether there is a rendering task of the page module in the preset task queue includes:
  • the preset timer expires, detecting whether there is a rendering task of the page module in the preset task queue; wherein the timing duration of the timer is a rendering period of the preset page module;
  • the method further includes: restarting the timer.
  • the method further includes: restarting the timer.
  • the method further includes:
  • the method further includes:
  • the rendering task of the page module in the task queue is dumped into a preset cache queue.
  • the rendering task of the page module in the task queue is performed, including:
  • the rendering task of the page module in the task queue is executed according to a preset rule.
  • the first unit is configured to detect whether there is a page module in the task queue when it is determined that the rendering of the page module is required Block rendering task;
  • the second unit is configured to execute a rendering task of the page module in the task queue when detecting a rendering task of the page module in the task queue.
  • the first unit determines that rendering of the page module is required.
  • the first unit is further configured to: load the page module before a rendering period of the preset page module arrives.
  • the rendering task of the page module in the task queue is a rendering task of the loaded page module.
  • the first unit is configured to: when a preset timer expires, detecting whether there is a rendering task of the page module in the preset task queue; wherein the timer duration of the timer is The rendering period of the preset page module;
  • the first unit is further configured to restart the timer when detecting a rendering task of the page module in the task queue.
  • the first unit is further configured to: restart the timer.
  • the method further includes:
  • the method further includes:
  • the rendering task of the page module in the task queue is dumped into a preset cache queue.
  • the rendering task of the page module in the task queue is performed, including:
  • the rendering task of the page module in the task queue is executed according to a preset rule.
  • a display device provided by the embodiment of the present invention includes the rendering device of the page module provided by the embodiment of the present invention.
  • At least one of the first page module and the second page module is rendered after a certain delay time after the loading is completed.
  • FIG. 1 is a schematic diagram of a rendering mode in the prior art
  • FIG. 2 is a schematic flowchart of a method for rendering a page module according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a rendering mode according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a rendering apparatus of a page module according to an embodiment of the present invention.
  • the embodiment of the invention provides a method, a device and a display device for rendering a page module, so as to implement periodic rendering of the page module, so that multiple modules can be completed by one rendering, thereby effectively reducing CPU consumption.
  • the embodiment of the present invention adds a timing function.
  • Each time the timer is executed it can be understood as one frame (ie, triggering one rendering).
  • the rendering process of each module is not directly rendered after the pre-task is completed, but is waited until the timer expires. Rendering, therefore, compared to the prior art, after the original multiple renderings, only a fixed number of renderings occur, which greatly reduces the CPU rendering consumption.
  • a method for rendering a page module includes the following steps:
  • the page described in the embodiment of the present invention may be a webpage; the page module is a structural element frequently used by the page, and is a main content constituting the page.
  • the rendering period of the preset page module arrives, it is determined that the rendering of the page module is required.
  • the period is a fixed time interval, and the actual implementation may also be a non-fixed time interval, that is, not periodically. Test if rendering is required, for example, as long as 3 rendering tasks are loaded and rendering begins.
  • the method before the rendering period of the preset page module arrives, the method further includes:
  • Loading the page module for example, specifically includes pre-task tasks such as initializing data used by the page module, requesting data of the page module, and the like.
  • the loading process of the page module by the general browser includes: when receiving a URL (Uniform/Universal Resource Locator, also referred to as a web address) request submitted by the user equipment (for example, the user equipment inputs a web address in the address bar of the browser, requests data of the webpage module from the corresponding server, and downloads the data of the requested page module to the browser client, and then invokes the rendering module of the page module to the page module.
  • the data is rendered and the rendered page is displayed through a browser window.
  • the rendering task of the page module in the task queue is a rendering task of the loaded page module.
  • the rendering device of the page module executes the process of the rendering task of the loaded page module in the task queue, for example, specifically: first, the rendering device of the page module parses the data of the loaded page module; and then, The rendering device of the page module formats the data of the page module according to the result of the data parsing; finally, the rendering device of the page module draws the page.
  • detecting whether there is a rendering task of the page module in the preset task queue includes:
  • the preset timer expires, detecting whether there is a rendering task of the page module in the preset task queue; wherein the timing duration of the timer is a rendering period of the preset page module;
  • the method further includes: restarting the timer.
  • the method further includes: restarting the timer.
  • the timing duration of the timer is the length of the rendering period of the page module, and when the timer expires, immediately Check whether there is a rendering task to be executed in the task queue. If there is any execution, if there is no rendering task in the task queue, you can wait for a period of time to restart the timer. The timer is restarted immediately after the timer expires, wherein the waiting time is the time required for the rendering task to execute.
  • each time the timer is executed it can be understood as a frame (the gray dotted line perpendicular to the time axis in FIG. 3 indicates the rendering trigger of each frame), and each page
  • the rendering process of the module is not directly rendered after the loading is completed, but is rendered after the frame time arrives, that is, all modules are periodically rendered according to the setting of the timer, so compared with the existing rendering mode in FIG.
  • the rendering process shown in FIG. 3 in the embodiment of the present invention occurs only three times, that is, the rendering process started at times t0, t1, and t2, respectively, so that the rendering process is greatly reduced.
  • the consumption of CPU rendering is performed by the rendering process started at times t0, t1, and t2, respectively.
  • the method further includes:
  • a rendering task of a part of the page module may be released, or a rendering task of all page modules in the task queue may be released.
  • the resource occupancy condition of the rendering device of the page module for example, the occupancy of the CPU
  • the data of the module corresponding to which page is released may be recorded, and the historical access times of the pages that have been rendered may be recorded in advance, and compared with the historical access times of other pages, and the historical access times of the pages may be preferentially released.
  • the data of the modules included in the minimum page This can further save memory usage and keep the page browser running smoothly.
  • the data of the loaded page module may be locally saved after the rendering module of the page module loads the data of the page module.
  • the method further includes:
  • the rendering task of the page module in the task queue (including the data of the loaded page module) is dumped into a preset local cache queue.
  • the rendering task of the page module in the task queue is released according to a preset rule, and it is assumed that the data of the released page module is the data of the first page module, and before the first page
  • the module's data has been saved in the local cache queue, in which case if you want to browse again
  • the data of the first page module corresponds to the first page
  • the data of the first page module stored locally may be directly obtained from the cache queue, and the data of the first page module is reloaded according to the above steps.
  • the browser client when the browser client obtains the data of the page module to be loaded, it may first determine whether the data of the page module to be loaded is saved locally, and if so, directly call the data of the locally saved page module to be loaded, otherwise, Download the data of the page module to be loaded from the network side. In this way, in the case that the data of the page module to be loaded is saved locally, the data of the local page module can be directly used without downloading, thereby effectively reducing the waste of network resources.
  • the rendering task of the page module in the task queue is performed, including:
  • the rendering task of the page module in the task queue is executed according to a preset rule.
  • the task may be executed according to the order of page access requests, or according to the memory size required by the rendering task of the page module, or the number of rendering tasks of the page module that can be executed by each preset rendering task.
  • a rendering task for some or all of the page modules in the queue can be executed at one time, that is, each time the timer expires, the rendering tasks of all the page modules in the task queue are retrieved at one time and parallelized. carried out.
  • the timer is started continuously and the timing is 50 milliseconds
  • a rendering task of a page module or a rendering task of another page module enters the task queue in the task queue within 50 milliseconds
  • Waiting in the task queue waits until all the rendering tasks in the task queue are executed together when the timer expires.
  • the test time is from 2 seconds to 7 seconds after the page starts running, to avoid performance interference such as initial frame loading, the rendering and redraw time is reduced by more than 40% compared with the prior art.
  • CPU execution time increased by 28% and rendering time decreased by 42%.
  • the technical solution provided by the embodiment of the present invention can be used for scenes of frequently operating HTML elements such as web games, webpage animations, and web applications, and improves the fluency thereof.
  • a rendering apparatus of a page module includes:
  • the first unit 11 is configured to detect whether there is a rendering task of the page module in the task queue when it is determined that the rendering of the page module is required;
  • the second unit 12 is configured to execute a rendering task of the page module in the task queue when detecting a rendering task of the page module in the task queue.
  • the first unit determines that rendering of the page module is required.
  • the first unit is further configured to: load the page module before a rendering period of the preset page module arrives.
  • the rendering task of the page module in the task queue is a rendering task of the loaded page module.
  • the first unit is configured to: when a preset timer expires, detecting whether there is a rendering task of the page module in the preset task queue; wherein the timer duration of the timer is The rendering period of the preset page module;
  • the first unit is further configured to restart the timer when detecting a rendering task of the page module in the task queue.
  • the first unit is further configured to: restart the timer.
  • the method further includes:
  • the method further includes:
  • the rendering task of the page module in the task queue is dumped into a preset cache queue.
  • the rendering task of the page module in the task queue is performed, including:
  • the rendering task of the page module in the task queue is executed according to a preset rule.
  • Each of the above units may be implemented by a physical device such as a processor.
  • a display device provided by the embodiment of the present invention includes the rendering device of the page module provided by the embodiment of the present invention.
  • At least one of the first page module and the second page module is rendered after a certain delay time after the loading is completed.
  • the first time interval and the second time interval, and the delay time may be determined according to specific actual needs.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

一种页面模块的渲染方法、装置以及显示设备,用以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染完成,从而有效降低CPU消耗。所述页面模块的渲染方法,包括:当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务(S101);当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务(S102)。

Description

一种页面模块的渲染方法、装置以及显示设备
本申请要求2015年03月24日递交的申请号为201510131848.2、发明名称为“一种页面模块的渲染方法、装置以及显示设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机应用技术领域,尤其涉及一种页面模块的渲染方法、装置以及显示设备。
背景技术
关于手机或者电脑上的页面显示,单页应用及模块化的普及,带来的是产品性能及用户体验上的提升,而一旦应用模块化颗粒度变细,必然带来的是多模块并发渲染的情况,每次渲染都将导致大量的CPU消耗。
所述渲染(Render)是指将计算机内部的对象模型和数据通过算法指令转变成可视对象的过程;在软件运行过程中,有些模块本身是可视的(或者能够产生相应的可视化效果),对模块的渲染,即是采用接口形式去渲染这些可视化模块,将其转换成文字或图形等形式,输出到显示器屏幕上供用户查看。
随着计算机应用的普及,用户对于软件的要求已经不仅仅局限于功能实现方面,画面的好坏也成为评价软件的重要因素之一。为了能够向用户提供更加便捷、美观的可视化操作界面,需要运用大量的可视化模块,相应地,软件运行时,对于这些模块的渲染需要占用大量的系统资源,因此对系统性能也有较高的要求,参见图1,现有的渲染模式下,各页面模块独自渲染,每次渲染都会触发一次页面的CPU消耗,因此模块一多,渲染消耗量必然大增,即有多少模块就有多少次渲染,图1中有M0至M9十个页面模块,因此分别对应从t0至t9十个时刻开始的渲染任务。当系统性能无法满足要求时,会造成画面显示速度的缓慢,严重时甚至会影响基本功能的执行,造成很差的用户体验。
综上所述,现有技术中针对页面的每一模块在需要渲染时都进行一次独立的渲染过程,如果模块较多,则渲染的次数相应的也会很多,导致CPU消耗过大。
发明内容
本发明实施例提供了一种页面模块的渲染方法、装置以及显示设备,用以实现对页 面模块的周期性渲染,使得多个模块可以通过一次渲染完成,从而有效降低CPU消耗。
本发明实施例提供的一种页面模块的渲染方法,包括:
当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;
当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。
通过该方法,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务;当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务,因此可以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染过程完成对这多个模块的渲染,从而有效降低CPU消耗。
较佳地,当预设的页面模块的渲染周期到达时,确定需要进行页面模块的渲染。
较佳地,在预设的页面模块的渲染周期到达之前,该方法还包括:
对所述页面模块进行加载。
较佳地,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。
较佳地,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务,包括:
当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;
当检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。
较佳地,当未检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。
较佳地,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:
释放该任务队列中的页面模块的渲染任务。
较佳地,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:
将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。
较佳地,执行该任务队列中的页面模块的渲染任务,包括:
按照预设规则执行该任务队列中的页面模块的渲染任务。
本发明实施例提供的一种页面模块的渲染装置,包括:
第一单元,用于当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模 块的渲染任务;
第二单元,用于当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。
较佳地,当预设的页面模块的渲染周期到达时,所述第一单元确定需要进行页面模块的渲染。
较佳地,所述第一单元还用于:在预设的页面模块的渲染周期到达之前,对所述页面模块进行加载。
较佳地,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。
较佳地,所述第一单元,具体用于:当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;
当检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于重新启动所述定时器。
较佳地,当未检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于:重新启动所述定时器。
较佳地,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:
释放该任务队列中的页面模块的渲染任务。
较佳地,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:
将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。
较佳地,执行该任务队列中的页面模块的渲染任务,包括:
按照预设规则执行该任务队列中的页面模块的渲染任务。
本发明实施例提供的一种显示设备,包括本发明实施例提供的所述页面模块的渲染装置。
本发明实施例提供的第二种页面模块的渲染方法,包括:
触发页面模块的渲染任务,在同一时间点,对至少两个加载完成的页面模块进行渲染。
本发明实施例提供的第三种页面模块的渲染方法,包括:
在第一时间间隔加载第一页面模块;
在第二时间间隔加载第二页面模块;
所述第一页面模块和第二页面模块之中的至少一者,在加载完成后,经过一定的延迟时间后被渲染。
附图说明
图1为现有技术中的渲染模式示意图;
图2为本发明实施例提供的一种页面模块的渲染方法的总体流程示意图;
图3为本发明实施例提供的渲染模式示意图;
图4为本发明实施例提供的一种页面模块的渲染装置的结构示意图。
具体实施方式
本发明实施例提供了一种页面模块的渲染方法、装置以及显示设备,用以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染完成,从而有效降低CPU消耗。
本发明实施例增加定时功能,定时器每执行一次,可以理解为一个帧(即触发一次渲染),每个模块的渲染过程并非在前置任务完成后直接渲染,而是等到定时器超时时进行渲染,因此,与现有技术相比,原本多次的渲染在这样归组后,只发生了固定的少数几次的渲染,大量减少了CPU渲染的消耗。
下面结合附图对本发明实施例提供的技术方案进行详细说明。
参见图2,本发明实施例提供的一种页面模块的渲染方法,包括步骤:
S101、当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;
本发明实施例中所述的页面,可以是网页;所述的页面模块,为页面经常用到的结构性元素,是构成页面的主要内容。
S102、当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。
通过该方法,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务;当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务,因此可以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染过程完成对这多个模块的渲染,从而有效降低CPU消耗。
较佳地,当预设的页面模块的渲染周期到达时,确定需要进行页面模块的渲染。
周期是固定的时间间隔,实际实施时也可以是非固定时间间隔,即不是周期性地检 测是否需要进行渲染,例如,只要有3个渲染任务加载完成即开始渲染。
较佳地,在预设的页面模块的渲染周期到达之前,该方法还包括:
对所述页面模块进行加载,所谓加载,例如具体包括初始化页面模块所使用的数据、请求页面模块的数据等前置任务。
以浏览器加载页面模块为例,一般浏览器进行页面模块的加载过程包括:当接收到用户设备提交的URL(Uniform/Universal Resource Locator,统一资源定位符,也被称为网页地址)请求时(例如,用户设备在浏览器的地址栏输入网址),向相应服务器请求网页模块的数据,并将请求到的页面模块的数据下载到浏览器客户端,然后调用页面模块的渲染装置对该页面模块的数据进行渲染,通过浏览器窗口展示经渲染处理后的页面。
较佳地,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。
具体的,页面模块的渲染装置执行所述任务队列中的加载完成的页面模块的渲染任务的过程,例如具体包括:首先,页面模块的渲染装置对加载完成的页面模块的数据进行解析;然后,页面模块的渲染装置根据数据解析的结果对页面模块的数据进行排版;最后,页面模块的渲染装置对页面进行绘制。
较佳地,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务,包括:
当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;
当检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。
较佳地,当未检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。
也就是说,本发明实施例中,在监测是否到达页面模块的渲染周期时,是通过定时器来实现的,定时器的定时时长即页面模块的渲染周期的时间长度,定时器超时时,立即检测任务队列中是否有需要执行的渲染任务,有则执行,没有则重新启动定时器,其中当任务队列中有需要执行的渲染任务时,可以等待一段时间后重新启动定时器,也可以在定时器超时后立即重新启动定时器,其中,所述等待的时间即为渲染任务执行所需的时间。
参见图3,由于本发明实施例增加了的定时功能,定时器每执行一次,可以理解为一个帧(图3中垂直于时间轴的灰色虚线即表示每一帧的渲染触发),每个页面模块的渲染过程并非在加载完成后直接渲染,而是等到帧时间到达后进行渲染,即所有模块都按照定时器的设置,周期性的进行渲染,因此与图1中现有的渲染模式相比,在相同页面模块,以及相同的时间长度内,本发明实施例中图3所示的渲染过程,只发生了三次,即分别是在t0、t1、t2时刻开始进行的渲染过程,因此大量减少了CPU渲染的消耗。具体地,参见图3,在t0时刻,有页面模块M2、M3、和M4三个渲染任务开始执行,并且,页面模块M2、M4两个渲染任务经过一定的时间延迟后被执行;在t1时刻,有页面模块M0、M1、和M5三个渲染任务开始执行,并且,页面模块M0、M1、和M5三个渲染任务均经过一定的时间延迟后被执行;在t2时刻,有页面模块M6、M7、M8、和M9四个渲染任务开始执行,并且,页面模块M6、M7、M8、和M9四个渲染任务均经过一定的时间延迟后被执行。
较佳地,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:
释放该任务队列中的页面模块的渲染任务。具体地,可以释放一部分页面模块的渲染任务,也可以释放该任务队列中的全部页面模块的渲染任务。例如,根据页面模块的渲染装置的资源占用情况(例如CPU的占用情况)决定释放哪个或哪些已渲染的页面模块的数据,比较页面模块的数据使用的缓存空间的大小,可以优先释放使用缓存空间最大的页面模块的数据。或者,根据页面的历史访问次数决定释放哪个页面对应的模块的数据,可以提前记录已渲染完成的页面的历史访问次数,并与其他页面的历史访问次数进行比较,可以优先释放页面的历史访问次数最少的页面中包括的模块的数据。这样可以进一步节约内存占用量,使得页面浏览器保持运行流畅。
进一步的,为了减少页面请求时所产生的网络流量,可以在页面模块的渲染装置加载页面模块的数据之后,在本地保存已加载的页面模块的数据。这样,如果用户设备请求再次加载同一页面中的模块的数据,则可以直接调用本地保存的该页面的模块的数据。因此,较佳地,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:
将该任务队列中的页面模块的渲染任务(其中包括已加载的页面模块的数据)转存到预设的本地缓存队列中。
例如,在进行页面模块的渲染任务完成之后,根据预设规则释放该任务队列中的页面模块的渲染任务,假设释放的页面模块的数据为第一页面模块的数据,而在这之前第一页面模块的数据已经保存在了本地的缓存队列中,在此情况下,如果希望再次浏览这 个第一页面模块的数据对应的第一页面时,可以直接从缓存队列中获取本地存储的第一页面模块的数据,并根据上述步骤重新加载该第一页面模块的数据。
因此,在浏览器客户端获取待加载的页面模块的数据时,可以先判断本地是否保存有待加载的页面模块的数据,如果是,则直接调用本地保存的待加载页面模块的数据,否则,可以从网络侧下载该待加载页面模块的数据。这样,在本地已保存了待加载页面模块的数据的情况下,则可以直接使用本地的页面模块的数据,无需下载,有效的减少了网络资源的浪费。
较佳地,执行该任务队列中的页面模块的渲染任务,包括:
按照预设规则执行该任务队列中的页面模块的渲染任务。例如,可以按照页面访问请求的先后顺序,或者按照页面模块的渲染任务所需占用的内存大小,或者按照预设的每次渲染任务最多可以执行的页面模块的渲染任务的个数,执行该任务队列中的一部分或全部的页面模块的渲染任务。一般情况下,可以一次执行该任务队列中的全部的页面模块的渲染任务,即每次定时器超时时,都一次性地调取该任务队列中的全部的页面模块的渲染任务并且进行并行的执行。
以不停地循环启动定时器,并且定时时长是50毫秒的情况为例,在这50毫秒内当任务队列中有页面模块的渲染任务或有其他页面模块的渲染任务进入该任务队列时,会进在该任务队列中进行等待,等到定时器超时时会一起执行该任务队列中所有渲染任务。若测试时间为页面开始运行的第2秒至第7秒,以避免初始化的框架加载等性能干扰,渲染和重绘时间与现有技术相比缩短了40%以上。经过测试,CPU执行时间上升了28%,渲染时间降低了42%。
本发明实施例提供的技术方案,可以用于网页游戏、网页动画、WEB应用等频繁操作HTML元素的场景,并提高其流畅性。
与上述方法相对应地,参见图4,本发明实施例提供的一种页面模块的渲染装置,包括:
第一单元11,用于当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;
第二单元12,用于当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。
较佳地,当预设的页面模块的渲染周期到达时,所述第一单元确定需要进行页面模块的渲染。
较佳地,所述第一单元还用于:在预设的页面模块的渲染周期到达之前,对所述页面模块进行加载。
较佳地,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。
较佳地,所述第一单元,具体用于:当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;
当检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于重新启动所述定时器。
较佳地,当未检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于:重新启动所述定时器。
较佳地,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:
释放该任务队列中的页面模块的渲染任务。
较佳地,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:
将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。
较佳地,执行该任务队列中的页面模块的渲染任务,包括:
按照预设规则执行该任务队列中的页面模块的渲染任务。
以上各个单元,具体地,可以由处理器等实体装置实现。
本发明实施例提供的一种显示设备,包括本发明实施例提供的所述页面模块的渲染装置。
本发明实施例提供的第二种页面模块的渲染方法,包括:
触发页面模块的渲染任务,在同一时间点,对至少两个加载完成的页面模块进行渲染。
本发明实施例提供的第三种页面模块的渲染方法,包括:
在第一时间间隔加载第一页面模块;
在第二时间间隔加载第二页面模块;
所述第一页面模块和第二页面模块之中的至少一者,在加载完成后,经过一定的延迟时间后被渲染。
其中,所述的第一时间间隔和第二时间间隔,以及所述的延迟时间,都可以根据具体的实际需要而定。
综上所述,本发明实施例提供的技术方案中,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务;当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务,因此可以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染过程完成对这多个模块的渲染,从而有效降低CPU消耗。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (21)

  1. 一种页面模块的渲染方法,其特征在于,该方法包括:
    当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;
    当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。
  2. 根据权利要求1所述的方法,其特征在于,当预设的页面模块的渲染周期到达时,确定需要进行页面模块的渲染。
  3. 根据权利要求2所述的方法,其特征在于,在预设的页面模块的渲染周期到达之前,该方法还包括:
    对所述页面模块进行加载。
  4. 根据权利要求3所述的方法,其特征在于,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。
  5. 根据权利要求2所述的方法,其特征在于,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务,包括:
    当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;
    当检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。
  6. 根据权利要求5所述的方法,其特征在于,当未检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。
  7. 根据权利要求1所述的方法,其特征在于,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:
    释放该任务队列中的页面模块的渲染任务。
  8. 根据权利要求7所述的方法,其特征在于,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:
    将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。
  9. 根据权利要求1所述的方法,其特征在于,执行该任务队列中的页面模块的渲染任务,包括:
    按照预设规则执行该任务队列中的页面模块的渲染任务。
  10. 一种页面模块的渲染装置,其特征在于,包括:
    第一单元,用于当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;
    第二单元,用于当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。
  11. 根据权利要求10所述的装置,其特征在于,当预设的页面模块的渲染周期到达时,所述第一单元确定需要进行页面模块的渲染。
  12. 根据权利要求11所述的装置,其特征在于,所述第一单元还用于:在预设的页面模块的渲染周期到达之前,对所述页面模块进行加载。
  13. 根据权利要求12所述的装置,其特征在于,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。
  14. 根据权利要求11所述的装置,其特征在于,所述第一单元,具体用于:当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;
    当检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于重新启动所述定时器。
  15. 根据权利要求14所述的装置,其特征在于,当未检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于:重新启动所述定时器。
  16. 根据权利要求10所述的装置,其特征在于,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:
    释放该任务队列中的页面模块的渲染任务。
  17. 根据权利要求16所述的装置,其特征在于,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:
    将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。
  18. 根据权利要求10所述的装置,其特征在于,执行该任务队列中的页面模块的渲染任务,包括:
    按照预设规则执行该任务队列中的页面模块的渲染任务。
  19. 一种显示设备,其特征在于,包括权利要求10-18任一权项所述的装置。
  20. 一种页面模块的渲染方法,其特征在于,该方法包括:
    触发页面模块的渲染任务,在同一时间点,对至少两个加载完成的页面模块进行渲染。
  21. 一种页面模块的渲染方法,其特征在于,该方法包括:
    在第一时间间隔加载第一页面模块;
    在第二时间间隔加载第二页面模块;
    所述第一页面模块和第二页面模块之中的至少一者,在加载完成后,经过一定的延迟时间后被渲染。
PCT/CN2016/076449 2015-03-24 2016-03-16 一种页面模块的渲染方法、装置以及显示设备 Ceased WO2016150324A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510131848.2A CN106155602A (zh) 2015-03-24 2015-03-24 一种页面模块的渲染方法、装置以及显示设备
CN201510131848.2 2015-03-24

Publications (1)

Publication Number Publication Date
WO2016150324A1 true WO2016150324A1 (zh) 2016-09-29

Family

ID=56977777

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/076449 Ceased WO2016150324A1 (zh) 2015-03-24 2016-03-16 一种页面模块的渲染方法、装置以及显示设备

Country Status (2)

Country Link
CN (1) CN106155602A (zh)
WO (1) WO2016150324A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760678A (zh) * 2021-02-10 2021-12-07 北京沃东天骏信息技术有限公司 一种页面渲染时长的统计方法和装置
CN115802092A (zh) * 2022-11-18 2023-03-14 中船重工鹏力(南京)大气海洋信息系统有限公司 一种基于交互优先级的多窗口显示方法
CN119105873A (zh) * 2024-09-09 2024-12-10 深圳市迪派乐智图科技有限公司 数据处理方法、装置、控制器、介质及程序产品

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777055B (zh) * 2016-12-09 2021-01-01 武汉斗鱼网络科技有限公司 一种实现网站接口化渲染的方法与装置
WO2019047125A1 (zh) * 2017-09-07 2019-03-14 深圳市云中飞网络科技有限公司 界面处理方法、装置、计算机存储介质及电子设备
CN109961331B (zh) * 2017-12-14 2022-09-06 北京京东尚科信息技术有限公司 页面处理方法及其系统、计算机系统和可读存储介质
CN108804164A (zh) * 2018-05-22 2018-11-13 北京五八信息技术有限公司 小程序的数据渲染方法、装置、移动终端及存储介质
CN111340681B (zh) * 2020-02-10 2024-02-20 青岛海信宽带多媒体技术有限公司 一种图像处理方法及装置
CN111338628B (zh) * 2020-03-10 2023-07-18 中国联合网络通信集团有限公司 组件渲染方法及设备
CN112380470A (zh) * 2020-10-29 2021-02-19 北京华胜天成科技股份有限公司 Web应用系统显示方法、装置和应急管理系统
CN112328939B (zh) * 2020-11-16 2024-08-16 北京沃东天骏信息技术有限公司 页面处理方法、装置及存储介质
CN113392353A (zh) * 2021-06-18 2021-09-14 网易(杭州)网络有限公司 网站页面的加载方法、装置、电子设备及存储介质
CN116257713A (zh) * 2022-09-05 2023-06-13 上海壹佰米网络科技有限公司 一种数据处理方法及装置
CN115883921A (zh) * 2022-12-30 2023-03-31 新华智云科技有限公司 一种数据可视化视频合成方法、系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080178286A1 (en) * 2007-01-19 2008-07-24 Microsoft Corporation Rendered Image Collection of Potentially Malicious Web Pages
CN101996073A (zh) * 2009-08-31 2011-03-30 阿里巴巴集团控股有限公司 一种组件渲染方法及装置
CN102902576A (zh) * 2012-09-26 2013-01-30 北京奇虎科技有限公司 一种渲染网页的方法、服务器和系统
CN103456035A (zh) * 2013-09-06 2013-12-18 福建星网视易信息系统有限公司 实现视频三维显示的装置及方法
CN103631565A (zh) * 2013-11-13 2014-03-12 北京像素软件科技股份有限公司 场景资源的加载方法和加载装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6925459B2 (en) * 2000-12-27 2005-08-02 International Business Machines Corporation Apparatus and method for hindering multiple http submission requests
CN102129426B (zh) * 2010-01-13 2015-11-25 深圳市世纪光速信息技术有限公司 显示人物关系的方法及装置
CN102591651B (zh) * 2011-12-26 2015-02-11 Tcl集团股份有限公司 一种网页3d渲染和控制方法及装置
CN103051692B (zh) * 2012-12-11 2015-08-12 中国能源建设集团广东省电力设计研究院有限公司 支持极限网络环境的移动作业系统工作平台

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080178286A1 (en) * 2007-01-19 2008-07-24 Microsoft Corporation Rendered Image Collection of Potentially Malicious Web Pages
CN101996073A (zh) * 2009-08-31 2011-03-30 阿里巴巴集团控股有限公司 一种组件渲染方法及装置
CN102902576A (zh) * 2012-09-26 2013-01-30 北京奇虎科技有限公司 一种渲染网页的方法、服务器和系统
CN103456035A (zh) * 2013-09-06 2013-12-18 福建星网视易信息系统有限公司 实现视频三维显示的装置及方法
CN103631565A (zh) * 2013-11-13 2014-03-12 北京像素软件科技股份有限公司 场景资源的加载方法和加载装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760678A (zh) * 2021-02-10 2021-12-07 北京沃东天骏信息技术有限公司 一种页面渲染时长的统计方法和装置
CN115802092A (zh) * 2022-11-18 2023-03-14 中船重工鹏力(南京)大气海洋信息系统有限公司 一种基于交互优先级的多窗口显示方法
CN119105873A (zh) * 2024-09-09 2024-12-10 深圳市迪派乐智图科技有限公司 数据处理方法、装置、控制器、介质及程序产品

Also Published As

Publication number Publication date
CN106155602A (zh) 2016-11-23

Similar Documents

Publication Publication Date Title
WO2016150324A1 (zh) 一种页面模块的渲染方法、装置以及显示设备
CN112749358B (zh) 页面渲染方法和装置、电子设备以及存储介质
US10540417B2 (en) Determining web page processing state
CN102722559B (zh) 一种异常页面的进程控制方法、装置和系统
CN103345405B (zh) 应用程序的启动方法、装置和客户端
US20190109920A1 (en) Browser resource pre-pulling method, terminal and storage medium
CN103399729A (zh) 一种HTML5 Canvas应用处理方法、装置及处理器
CN111796824A (zh) 页面加载方法、装置、服务器及介质
WO2020034951A1 (zh) 利用前端编程语言优化图片懒加载的方法以及电子设备
CN107807934B (zh) 页面显示方法和装置以及计算设备
CN102368249B (zh) 一种ie内核浏览器的页面下载控制方法和系统
CN109961331A (zh) 页面处理方法及其系统、计算机系统和可读存储介质
CN104778075B (zh) Android系统中native层调用Java层API的方法和装置
CN112052163B (zh) 高并发网页压力测试方法、装置、电子设备以及存储介质
CN110765386A (zh) 网页图像的监控方法、装置、电子设备及可读存储介质
CN111079048A (zh) 一种页面加载方法及装置
CN105359104A (zh) 状态信息的同步点
CN109543127A (zh) 一种页面刷新方法、装置、设备及可读存储介质
CN102368250B (zh) 一种ie内核浏览器的页面下载控制方法和系统
US20120143942A1 (en) Delivering A Webpage To A Client
US9507650B2 (en) Power efficient callback patterns
CN103914299B (zh) 一种Flash硬件加速控制方法及系统
CN108062224B (zh) 基于文件句柄的数据读写方法、装置及计算设备
CN115795191A (zh) 网页运行方法及其装置、计算机可读存储介质
WO2020077681A1 (zh) 一种延迟加载js脚本的方法和装置

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

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

Country of ref document: EP

Kind code of ref document: A1