WO2016150324A1 - Page module rendering method, apparatus and display device - Google Patents

Page module rendering method, apparatus and display device 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
Application number
PCT/CN2016/076449
Other languages
French (fr)
Chinese (zh)
Inventor
朱敏琪
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016150324A1 publication Critical patent/WO2016150324A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

A page module rendering method, apparatus and display device, used for periodically rendering a page module, so that a plurality of modules can be rendered at a time, thereby effectively reducing CPU consumption. The page module rendering method comprises: when it is determined that a page module needs to be rendered, detecting whether there is a rendering task of the page module in a task queue (S101); and when it is detected that there is a rendering task of the page module in the task queue, executing the rendering task of the page module in the task queue (S102).

Description

一种页面模块的渲染方法、装置以及显示设备Method, device and display device for rendering page module
本申请要求2015年03月24日递交的申请号为201510131848.2、发明名称为“一种页面模块的渲染方法、装置以及显示设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application No. 201510131848.2, filed on March 24, 2015, entitled,,,,,,,,,,,,,,,,, in.
技术领域Technical field
本发明涉及计算机应用技术领域,尤其涉及一种页面模块的渲染方法、装置以及显示设备。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.
背景技术Background technique
关于手机或者电脑上的页面显示,单页应用及模块化的普及,带来的是产品性能及用户体验上的提升,而一旦应用模块化颗粒度变细,必然带来的是多模块并发渲染的情况,每次渲染都将导致大量的CPU消耗。Regarding the page display on mobile phones or computers, the popularity of single-page applications and modularization brings about an improvement in product performance and user experience. Once the modularity of the application is thinned, it is inevitable that multiple modules are concurrently rendered. In the case, each rendering will result in a lot of CPU consumption.
所述渲染(Render)是指将计算机内部的对象模型和数据通过算法指令转变成可视对象的过程;在软件运行过程中,有些模块本身是可视的(或者能够产生相应的可视化效果),对模块的渲染,即是采用接口形式去渲染这些可视化模块,将其转换成文字或图形等形式,输出到显示器屏幕上供用户查看。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.
随着计算机应用的普及,用户对于软件的要求已经不仅仅局限于功能实现方面,画面的好坏也成为评价软件的重要因素之一。为了能够向用户提供更加便捷、美观的可视化操作界面,需要运用大量的可视化模块,相应地,软件运行时,对于这些模块的渲染需要占用大量的系统资源,因此对系统性能也有较高的要求,参见图1,现有的渲染模式下,各页面模块独自渲染,每次渲染都会触发一次页面的CPU消耗,因此模块一多,渲染消耗量必然大增,即有多少模块就有多少次渲染,图1中有M0至M9十个页面模块,因此分别对应从t0至t9十个时刻开始的渲染任务。当系统性能无法满足要求时,会造成画面显示速度的缓慢,严重时甚至会影响基本功能的执行,造成很差的用户体验。With the popularity of computer applications, users' requirements for software are not limited to functional implementation. The quality of the screen has become one of the important factors for evaluating software. In order to provide users with a more convenient and beautiful visual operation interface, a large number of visualization modules need to be used. Accordingly, when the software is running, the rendering of these modules requires a large amount of system resources, and therefore has high requirements on system performance. Referring to FIG. 1 , in the existing rendering mode, each page module is rendered by itself, and each time the rendering triggers the CPU consumption of the page, so the module consumption is increased, that is, how many modules are rendered, In Figure 1, there are ten page modules from M0 to M9, so they correspond to rendering tasks starting from ten times t0 to t9 respectively. When the system performance cannot meet the requirements, the display speed of the screen will be slow. In severe cases, the execution of the basic functions will be affected, resulting in a poor user experience.
综上所述,现有技术中针对页面的每一模块在需要渲染时都进行一次独立的渲染过程,如果模块较多,则渲染的次数相应的也会很多,导致CPU消耗过大。In summary, in the prior art, 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.
发明内容Summary of the invention
本发明实施例提供了一种页面模块的渲染方法、装置以及显示设备,用以实现对页 面模块的周期性渲染,使得多个模块可以通过一次渲染完成,从而有效降低CPU消耗。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.
本发明实施例提供的一种页面模块的渲染方法,包括:A method for rendering a page module according to an embodiment of the present invention includes:
当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;When it is determined that the rendering of the page module is required, detecting whether there is a rendering task of the page module in the task queue;
当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。When it is detected that there is a rendering task of the page module in the task queue, the rendering task of the page module in the task queue is executed.
通过该方法,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务;当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务,因此可以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染过程完成对这多个模块的渲染,从而有效降低CPU消耗。By the method, when a rendering period of the preset page module arrives, detecting whether there is a rendering task of the page module in the preset task queue; when detecting that the rendering task of the page module is in the task queue, performing the task The rendering task of the page module in the queue, so that the periodic rendering of the page module can be implemented, so that multiple modules can complete rendering of the multiple modules through one rendering process, thereby effectively reducing CPU consumption.
较佳地,当预设的页面模块的渲染周期到达时,确定需要进行页面模块的渲染。Preferably, when the rendering period of the preset page module arrives, it is determined that the rendering of the page module is required.
较佳地,在预设的页面模块的渲染周期到达之前,该方法还包括:Preferably, before the rendering period of the preset page module arrives, the method further includes:
对所述页面模块进行加载。The page module is loaded.
较佳地,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。Preferably, the rendering task of the page module in the task queue is a rendering task of the loaded page module.
较佳地,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务,包括:Preferably, when the rendering period of the preset page module arrives, detecting whether there is a rendering task of the page module in the preset task queue includes:
当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;When 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;
当检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。When it is detected that there is a rendering task of the page module in the task queue, the method further includes: restarting the timer.
较佳地,当未检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。Preferably, when the rendering task of the page module is not detected in the task queue, the method further includes: restarting the timer.
较佳地,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:Preferably, after performing the rendering task of the page module in the task queue, the method further includes:
释放该任务队列中的页面模块的渲染任务。Release the rendering task of the page module in the task queue.
较佳地,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:Preferably, after the rendering task of the page module in the task queue is released, the method further includes:
将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。The rendering task of the page module in the task queue is dumped into a preset cache queue.
较佳地,执行该任务队列中的页面模块的渲染任务,包括:Preferably, 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 rendering device of a page module provided by the embodiment of the invention includes:
第一单元,用于当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模 块的渲染任务;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.
较佳地,当预设的页面模块的渲染周期到达时,所述第一单元确定需要进行页面模块的渲染。Preferably, when the rendering period of the preset page module arrives, the first unit determines that rendering of the page module is required.
较佳地,所述第一单元还用于:在预设的页面模块的渲染周期到达之前,对所述页面模块进行加载。Preferably, the first unit is further configured to: load the page module before a rendering period of the preset page module arrives.
较佳地,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。Preferably, the rendering task of the page module in the task queue is a rendering task of the loaded page module.
较佳地,所述第一单元,具体用于:当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;Preferably, 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.
较佳地,当未检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于:重新启动所述定时器。Preferably, when the rendering task of the page module is not detected in the task queue, the first unit is further configured to: restart the timer.
较佳地,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:Preferably, after performing the rendering task of the page module in the task queue, the method further includes:
释放该任务队列中的页面模块的渲染任务。Release the rendering task of the page module in the task queue.
较佳地,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:Preferably, after the rendering task of the page module in the task queue is released, the method further includes:
将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。The rendering task of the page module in the task queue is dumped into a preset cache queue.
较佳地,执行该任务队列中的页面模块的渲染任务,包括:Preferably, 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.
本发明实施例提供的第二种页面模块的渲染方法,包括:The rendering method of the second page module provided by the embodiment of the present invention includes:
触发页面模块的渲染任务,在同一时间点,对至少两个加载完成的页面模块进行渲染。Triggering the rendering task of the page module, at the same time point, rendering at least two loaded page modules.
本发明实施例提供的第三种页面模块的渲染方法,包括:The rendering method of the third page module provided by the embodiment of the present invention includes:
在第一时间间隔加载第一页面模块;Loading the first page module at the first time interval;
在第二时间间隔加载第二页面模块; Loading the second page module at the second time interval;
所述第一页面模块和第二页面模块之中的至少一者,在加载完成后,经过一定的延迟时间后被渲染。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.
附图说明DRAWINGS
图1为现有技术中的渲染模式示意图;1 is a schematic diagram of a rendering mode in the prior art;
图2为本发明实施例提供的一种页面模块的渲染方法的总体流程示意图;2 is a schematic flowchart of a method for rendering a page module according to an embodiment of the present invention;
图3为本发明实施例提供的渲染模式示意图;FIG. 3 is a schematic diagram of a rendering mode according to an embodiment of the present disclosure;
图4为本发明实施例提供的一种页面模块的渲染装置的结构示意图。FIG. 4 is a schematic structural diagram of a rendering apparatus of a page module according to an embodiment of the present invention.
具体实施方式detailed description
本发明实施例提供了一种页面模块的渲染方法、装置以及显示设备,用以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染完成,从而有效降低CPU消耗。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.
本发明实施例增加定时功能,定时器每执行一次,可以理解为一个帧(即触发一次渲染),每个模块的渲染过程并非在前置任务完成后直接渲染,而是等到定时器超时时进行渲染,因此,与现有技术相比,原本多次的渲染在这样归组后,只发生了固定的少数几次的渲染,大量减少了CPU渲染的消耗。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.
下面结合附图对本发明实施例提供的技术方案进行详细说明。The technical solutions provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
参见图2,本发明实施例提供的一种页面模块的渲染方法,包括步骤:Referring to FIG. 2, a method for rendering a page module according to an embodiment of the present invention includes the following steps:
S101、当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;S101. When it is determined that the rendering of the page module is required, detecting whether there is a rendering task of the page module in the task queue;
本发明实施例中所述的页面,可以是网页;所述的页面模块,为页面经常用到的结构性元素,是构成页面的主要内容。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.
S102、当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。S102. When a rendering task of the page module is detected in the task queue, perform a rendering task of the page module in the task queue.
通过该方法,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务;当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务,因此可以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染过程完成对这多个模块的渲染,从而有效降低CPU消耗。By the method, when a rendering period of the preset page module arrives, detecting whether there is a rendering task of the page module in the preset task queue; when detecting that the rendering task of the page module is in the task queue, performing the task The rendering task of the page module in the queue, so that the periodic rendering of the page module can be implemented, so that multiple modules can complete rendering of the multiple modules through one rendering process, thereby effectively reducing CPU consumption.
较佳地,当预设的页面模块的渲染周期到达时,确定需要进行页面模块的渲染。Preferably, when the rendering period of the preset page module arrives, it is determined that the rendering of the page module is required.
周期是固定的时间间隔,实际实施时也可以是非固定时间间隔,即不是周期性地检 测是否需要进行渲染,例如,只要有3个渲染任务加载完成即开始渲染。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.
较佳地,在预设的页面模块的渲染周期到达之前,该方法还包括:Preferably, before the rendering period of the preset page module arrives, the method further includes:
对所述页面模块进行加载,所谓加载,例如具体包括初始化页面模块所使用的数据、请求页面模块的数据等前置任务。Loading the page module, the so-called loading, 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.
以浏览器加载页面模块为例,一般浏览器进行页面模块的加载过程包括:当接收到用户设备提交的URL(Uniform/Universal Resource Locator,统一资源定位符,也被称为网页地址)请求时(例如,用户设备在浏览器的地址栏输入网址),向相应服务器请求网页模块的数据,并将请求到的页面模块的数据下载到浏览器客户端,然后调用页面模块的渲染装置对该页面模块的数据进行渲染,通过浏览器窗口展示经渲染处理后的页面。Taking the browser loading page module as an example, 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.
较佳地,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。Preferably, the rendering task of the page module in the task queue is a rendering task of the loaded page module.
具体的,页面模块的渲染装置执行所述任务队列中的加载完成的页面模块的渲染任务的过程,例如具体包括:首先,页面模块的渲染装置对加载完成的页面模块的数据进行解析;然后,页面模块的渲染装置根据数据解析的结果对页面模块的数据进行排版;最后,页面模块的渲染装置对页面进行绘制。Specifically, 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.
较佳地,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务,包括:Preferably, when the rendering period of the preset page module arrives, detecting whether there is a rendering task of the page module in the preset task queue includes:
当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;When 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;
当检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。When it is detected that there is a rendering task of the page module in the task queue, the method further includes: restarting the timer.
较佳地,当未检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。Preferably, when the rendering task of the page module is not detected in the task queue, the method further includes: restarting the timer.
也就是说,本发明实施例中,在监测是否到达页面模块的渲染周期时,是通过定时器来实现的,定时器的定时时长即页面模块的渲染周期的时间长度,定时器超时时,立即检测任务队列中是否有需要执行的渲染任务,有则执行,没有则重新启动定时器,其中当任务队列中有需要执行的渲染任务时,可以等待一段时间后重新启动定时器,也可以在定时器超时后立即重新启动定时器,其中,所述等待的时间即为渲染任务执行所需的时间。 That is to say, in the embodiment of the present invention, when monitoring the rendering period of the page module, it is implemented by a timer, and 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.
参见图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四个渲染任务均经过一定的时间延迟后被执行。Referring to FIG. 3, due to the added timing function of the embodiment of the present invention, 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. In the same page module, and the same length of time, 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. Specifically, referring to FIG. 3, at time t0, three rendering tasks of page modules M2, M3, and M4 are started, and two rendering tasks of page modules M2 and M4 are executed after a certain time delay; The three rendering tasks of the page modules M0, M1, and M5 are executed, and the three rendering tasks of the page modules M0, M1, and M5 are executed after a certain time delay; at time t2, there is a page module M6, The four rendering tasks of M7, M8, and M9 are executed, and the four rendering tasks of page modules M6, M7, M8, and M9 are executed after a certain time delay.
较佳地,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:Preferably, after performing the rendering task of the page module in the task queue, the method further includes:
释放该任务队列中的页面模块的渲染任务。具体地,可以释放一部分页面模块的渲染任务,也可以释放该任务队列中的全部页面模块的渲染任务。例如,根据页面模块的渲染装置的资源占用情况(例如CPU的占用情况)决定释放哪个或哪些已渲染的页面模块的数据,比较页面模块的数据使用的缓存空间的大小,可以优先释放使用缓存空间最大的页面模块的数据。或者,根据页面的历史访问次数决定释放哪个页面对应的模块的数据,可以提前记录已渲染完成的页面的历史访问次数,并与其他页面的历史访问次数进行比较,可以优先释放页面的历史访问次数最少的页面中包括的模块的数据。这样可以进一步节约内存占用量,使得页面浏览器保持运行流畅。Release the rendering task of the page module in the task queue. Specifically, 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. For example, according to the resource occupancy condition of the rendering device of the page module (for example, the occupancy of the CPU), it is determined whether the data of the rendered page module is released, and the size of the buffer space used by the data of the page module is compared, and the cache space can be preferentially released. The largest page module data. Or, according to the historical access times of the page, 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.
进一步的,为了减少页面请求时所产生的网络流量,可以在页面模块的渲染装置加载页面模块的数据之后,在本地保存已加载的页面模块的数据。这样,如果用户设备请求再次加载同一页面中的模块的数据,则可以直接调用本地保存的该页面的模块的数据。因此,较佳地,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:Further, in order to reduce the network traffic generated when the page request is generated, 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. In this way, if the user equipment requests to load the data of the module in the same page again, the data of the module of the page saved locally can be directly called. Therefore, after the rendering task of the page module in the task queue is released, 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.
例如,在进行页面模块的渲染任务完成之后,根据预设规则释放该任务队列中的页面模块的渲染任务,假设释放的页面模块的数据为第一页面模块的数据,而在这之前第一页面模块的数据已经保存在了本地的缓存队列中,在此情况下,如果希望再次浏览这 个第一页面模块的数据对应的第一页面时,可以直接从缓存队列中获取本地存储的第一页面模块的数据,并根据上述步骤重新加载该第一页面模块的数据。For example, after the rendering task of the page module is completed, 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 When 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.
因此,在浏览器客户端获取待加载的页面模块的数据时,可以先判断本地是否保存有待加载的页面模块的数据,如果是,则直接调用本地保存的待加载页面模块的数据,否则,可以从网络侧下载该待加载页面模块的数据。这样,在本地已保存了待加载页面模块的数据的情况下,则可以直接使用本地的页面模块的数据,无需下载,有效的减少了网络资源的浪费。Therefore, 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.
较佳地,执行该任务队列中的页面模块的渲染任务,包括:Preferably, 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. For example, 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. In general, the rendering task of all the page modules in the task 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.
以不停地循环启动定时器,并且定时时长是50毫秒的情况为例,在这50毫秒内当任务队列中有页面模块的渲染任务或有其他页面模块的渲染任务进入该任务队列时,会进在该任务队列中进行等待,等到定时器超时时会一起执行该任务队列中所有渲染任务。若测试时间为页面开始运行的第2秒至第7秒,以避免初始化的框架加载等性能干扰,渲染和重绘时间与现有技术相比缩短了40%以上。经过测试,CPU执行时间上升了28%,渲染时间降低了42%。For example, in the case where the timer is started continuously and the timing is 50 milliseconds, when 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. If 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. After testing, CPU execution time increased by 28% and rendering time decreased by 42%.
本发明实施例提供的技术方案,可以用于网页游戏、网页动画、WEB应用等频繁操作HTML元素的场景,并提高其流畅性。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.
与上述方法相对应地,参见图4,本发明实施例提供的一种页面模块的渲染装置,包括:Corresponding to the above method, referring to FIG. 4, a rendering apparatus of a page module according to an embodiment of the present invention includes:
第一单元11,用于当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;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;
第二单元12,用于当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。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.
较佳地,当预设的页面模块的渲染周期到达时,所述第一单元确定需要进行页面模块的渲染。 Preferably, when the rendering period of the preset page module arrives, the first unit determines that rendering of the page module is required.
较佳地,所述第一单元还用于:在预设的页面模块的渲染周期到达之前,对所述页面模块进行加载。Preferably, the first unit is further configured to: load the page module before a rendering period of the preset page module arrives.
较佳地,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。Preferably, the rendering task of the page module in the task queue is a rendering task of the loaded page module.
较佳地,所述第一单元,具体用于:当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;Preferably, 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.
较佳地,当未检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于:重新启动所述定时器。Preferably, when the rendering task of the page module is not detected in the task queue, the first unit is further configured to: restart the timer.
较佳地,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:Preferably, after performing the rendering task of the page module in the task queue, the method further includes:
释放该任务队列中的页面模块的渲染任务。Release the rendering task of the page module in the task queue.
较佳地,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:Preferably, after the rendering task of the page module in the task queue is released, the method further includes:
将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。The rendering task of the page module in the task queue is dumped into a preset cache queue.
较佳地,执行该任务队列中的页面模块的渲染任务,包括:Preferably, 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, in particular, 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.
本发明实施例提供的第二种页面模块的渲染方法,包括:The rendering method of the second page module provided by the embodiment of the present invention includes:
触发页面模块的渲染任务,在同一时间点,对至少两个加载完成的页面模块进行渲染。Triggering the rendering task of the page module, at the same time point, rendering at least two loaded page modules.
本发明实施例提供的第三种页面模块的渲染方法,包括:The rendering method of the third page module provided by the embodiment of the present invention includes:
在第一时间间隔加载第一页面模块;Loading the first page module at the first time interval;
在第二时间间隔加载第二页面模块;Loading the second page module at the second time interval;
所述第一页面模块和第二页面模块之中的至少一者,在加载完成后,经过一定的延迟时间后被渲染。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.
综上所述,本发明实施例提供的技术方案中,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务;当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务,因此可以实现对页面模块的周期性渲染,使得多个模块可以通过一次渲染过程完成对这多个模块的渲染,从而有效降低CPU消耗。In summary, in the technical solution provided by the embodiment of the present invention, when a rendering period of a preset page module arrives, it is detected whether there is a rendering task of the page module in the preset task queue; when the task queue is detected When there is a rendering task of the page module, the rendering task of the page module in the task queue is executed, so that the periodic rendering of the page module can be implemented, so that multiple modules can complete rendering of the multiple modules through one rendering process, thereby Effectively reduce CPU consumption.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that 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 present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。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.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims (21)

  1. 一种页面模块的渲染方法,其特征在于,该方法包括:A method for rendering a page module, the method comprising:
    当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;When it is determined that the rendering of the page module is required, detecting whether there is a rendering task of the page module in the task queue;
    当检测到所述任务队列中有页面模块的渲染任务时,执行该任务队列中的页面模块的渲染任务。When it is detected that there is a rendering task of the page module in the task queue, the rendering task of the page module in the task queue is executed.
  2. 根据权利要求1所述的方法,其特征在于,当预设的页面模块的渲染周期到达时,确定需要进行页面模块的渲染。The method according to claim 1, wherein when the rendering period of the preset page module arrives, it is determined that the rendering of the page module is required.
  3. 根据权利要求2所述的方法,其特征在于,在预设的页面模块的渲染周期到达之前,该方法还包括:The method of claim 2, wherein before the rendering period of the preset page module arrives, the method further comprises:
    对所述页面模块进行加载。The page module is loaded.
  4. 根据权利要求3所述的方法,其特征在于,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。The method according to claim 3, wherein the rendering task of the page module in the task queue is a rendering task of the loaded page module.
  5. 根据权利要求2所述的方法,其特征在于,当预设的页面模块的渲染周期到达时,检测预设的任务队列中是否有页面模块的渲染任务,包括:The method according to claim 2, wherein when the rendering period of the preset page module arrives, detecting whether there is a rendering task of the page module in the preset task queue comprises:
    当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;When 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;
    当检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。When it is detected that there is a rendering task of the page module in the task queue, the method further includes: restarting the timer.
  6. 根据权利要求5所述的方法,其特征在于,当未检测到所述任务队列中有页面模块的渲染任务时,该方法还包括:重新启动所述定时器。The method according to claim 5, wherein when the rendering task of the page module is not detected in the task queue, the method further comprises: restarting the timer.
  7. 根据权利要求1所述的方法,其特征在于,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:The method according to claim 1, wherein after performing the rendering task of the page module in the task queue, the method further comprises:
    释放该任务队列中的页面模块的渲染任务。Release the rendering task of the page module in the task queue.
  8. 根据权利要求7所述的方法,其特征在于,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:The method according to claim 7, wherein after releasing the rendering task of the page module in the task queue, the method further comprises:
    将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。The rendering task of the page module in the task queue is dumped into a preset cache queue.
  9. 根据权利要求1所述的方法,其特征在于,执行该任务队列中的页面模块的渲染任务,包括:The method according to claim 1, wherein the performing a rendering task of the page module in the task queue comprises:
    按照预设规则执行该任务队列中的页面模块的渲染任务。The rendering task of the page module in the task queue is executed according to a preset rule.
  10. 一种页面模块的渲染装置,其特征在于,包括: A rendering device of a page module, comprising:
    第一单元,用于当确定需要进行页面模块的渲染时,检测任务队列中是否有页面模块的渲染任务;a first unit, 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 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.
  11. 根据权利要求10所述的装置,其特征在于,当预设的页面模块的渲染周期到达时,所述第一单元确定需要进行页面模块的渲染。The apparatus according to claim 10, wherein when the rendering period of the preset page module arrives, the first unit determines that rendering of the page module is required.
  12. 根据权利要求11所述的装置,其特征在于,所述第一单元还用于:在预设的页面模块的渲染周期到达之前,对所述页面模块进行加载。The apparatus according to claim 11, wherein the first unit is further configured to: load the page module before a rendering period of the preset page module arrives.
  13. 根据权利要求12所述的装置,其特征在于,所述任务队列中的页面模块的渲染任务,是加载完成的页面模块的渲染任务。The apparatus according to claim 12, wherein the rendering task of the page module in the task queue is a rendering task of the loaded page module.
  14. 根据权利要求11所述的装置,其特征在于,所述第一单元,具体用于:当预设的定时器超时时,检测预设的任务队列中是否有页面模块的渲染任务;其中,所述定时器的定时时长为所述预设的页面模块的渲染周期;The device according to claim 11, wherein the first unit is configured to: when a preset timer expires, detecting whether a rendering task of a page module exists in a preset task queue; The timing duration of the timer is a 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.
  15. 根据权利要求14所述的装置,其特征在于,当未检测到所述任务队列中有页面模块的渲染任务时,所述第一单元还用于:重新启动所述定时器。The apparatus according to claim 14, wherein the first unit is further configured to: restart the timer when the rendering task of the page module is not detected in the task queue.
  16. 根据权利要求10所述的装置,其特征在于,执行该任务队列中的页面模块的渲染任务之后,该方法还包括:The apparatus according to claim 10, wherein after performing the rendering task of the page module in the task queue, the method further comprises:
    释放该任务队列中的页面模块的渲染任务。Release the rendering task of the page module in the task queue.
  17. 根据权利要求16所述的装置,其特征在于,释放该任务队列中的页面模块的渲染任务之后,该方法还包括:The apparatus according to claim 16, wherein after the rendering task of the page module in the task queue is released, the method further comprises:
    将该任务队列中的页面模块的渲染任务转存到预设的缓存队列中。The rendering task of the page module in the task queue is dumped into a preset cache queue.
  18. 根据权利要求10所述的装置,其特征在于,执行该任务队列中的页面模块的渲染任务,包括:The apparatus according to claim 10, wherein the performing a rendering task of the page module in the task queue comprises:
    按照预设规则执行该任务队列中的页面模块的渲染任务。The rendering task of the page module in the task queue is executed according to a preset rule.
  19. 一种显示设备,其特征在于,包括权利要求10-18任一权项所述的装置。A display device comprising the device of any of claims 10-18.
  20. 一种页面模块的渲染方法,其特征在于,该方法包括:A method for rendering a page module, the method comprising:
    触发页面模块的渲染任务,在同一时间点,对至少两个加载完成的页面模块进行渲染。 Triggering the rendering task of the page module, at the same time point, rendering at least two loaded page modules.
  21. 一种页面模块的渲染方法,其特征在于,该方法包括:A method for rendering a page module, the method comprising:
    在第一时间间隔加载第一页面模块;Loading the first page module at the first time interval;
    在第二时间间隔加载第二页面模块;Loading the second page module at the second time interval;
    所述第一页面模块和第二页面模块之中的至少一者,在加载完成后,经过一定的延迟时间后被渲染。 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.
PCT/CN2016/076449 2015-03-24 2016-03-16 Page module rendering method, apparatus and display device WO2016150324A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510131848.2 2015-03-24
CN201510131848.2A CN106155602A (en) 2015-03-24 2015-03-24 The rendering intent of a kind of page module, device and display device

Publications (1)

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

Family

ID=56977777

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/076449 WO2016150324A1 (en) 2015-03-24 2016-03-16 Page module rendering method, apparatus and display device

Country Status (2)

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760678A (en) * 2021-02-10 2021-12-07 北京沃东天骏信息技术有限公司 Statistical method and device for page rendering duration

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106777055B (en) * 2016-12-09 2021-01-01 武汉斗鱼网络科技有限公司 Method and device for realizing website interfacing rendering
CN107995977A (en) * 2017-09-07 2018-05-04 深圳市云中飞网络科技有限公司 Interface processing method, device, computer-readable storage medium and electronic equipment
CN109961331B (en) * 2017-12-14 2022-09-06 北京京东尚科信息技术有限公司 Page processing method and system, computer system and readable storage medium
CN108804164A (en) * 2018-05-22 2018-11-13 北京五八信息技术有限公司 Data rendering method, device, mobile terminal and the storage medium of small routine
CN111340681B (en) * 2020-02-10 2024-02-20 青岛海信宽带多媒体技术有限公司 Image processing method and device
CN111338628B (en) * 2020-03-10 2023-07-18 中国联合网络通信集团有限公司 Component rendering method and device
CN112380470A (en) * 2020-10-29 2021-02-19 北京华胜天成科技股份有限公司 Web application system display method and device and emergency management system
CN112328939B (en) * 2020-11-16 2024-08-16 北京沃东天骏信息技术有限公司 Page processing method, device and storage medium
CN113392353A (en) * 2021-06-18 2021-09-14 网易(杭州)网络有限公司 Website page loading method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080178286A1 (en) * 2007-01-19 2008-07-24 Microsoft Corporation Rendered Image Collection of Potentially Malicious Web Pages
CN101996073A (en) * 2009-08-31 2011-03-30 阿里巴巴集团控股有限公司 Component rendering method and device
CN102902576A (en) * 2012-09-26 2013-01-30 北京奇虎科技有限公司 Method, server and system for rendering webpages
CN103456035A (en) * 2013-09-06 2013-12-18 福建星网视易信息系统有限公司 Device and method for achieving video three-dimensional display
CN103631565A (en) * 2013-11-13 2014-03-12 北京像素软件科技股份有限公司 Loading method and device for scene resources

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 (en) * 2010-01-13 2015-11-25 深圳市世纪光速信息技术有限公司 The method of display character relation and device
CN102591651B (en) * 2011-12-26 2015-02-11 Tcl集团股份有限公司 Webpage 3D (three-dimensional) rendering and controlling method and device
CN103051692B (en) * 2012-12-11 2015-08-12 中国能源建设集团广东省电力设计研究院有限公司 Support the mobile operating system works platform of limit network environment

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 (en) * 2009-08-31 2011-03-30 阿里巴巴集团控股有限公司 Component rendering method and device
CN102902576A (en) * 2012-09-26 2013-01-30 北京奇虎科技有限公司 Method, server and system for rendering webpages
CN103456035A (en) * 2013-09-06 2013-12-18 福建星网视易信息系统有限公司 Device and method for achieving video three-dimensional display
CN103631565A (en) * 2013-11-13 2014-03-12 北京像素软件科技股份有限公司 Loading method and device for scene resources

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760678A (en) * 2021-02-10 2021-12-07 北京沃东天骏信息技术有限公司 Statistical method and device for page rendering duration

Also Published As

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

Similar Documents

Publication Publication Date Title
WO2016150324A1 (en) Page module rendering method, apparatus and display device
US10540417B2 (en) Determining web page processing state
US10666758B2 (en) Browser resource pre-pulling method, terminal and storage medium
US8245125B1 (en) Hybrid rendering for webpages
US20140108909A1 (en) Graceful degradation of level-of-detail in document rendering
WO2020034951A1 (en) Front-end programming language-based method for optimizing image lazy-loading, and electronic apparatus
WO2019085598A1 (en) Method and apparatus for calculating above-the-fold rendering duration of page, and electronic device
US20210240914A1 (en) System and method for dynamic webpage rendering with no flicker or flash of original content
US20170026721A1 (en) System and Methods Thereof for Auto-Playing Video Content on Mobile Devices
CN111737614B (en) Page display method, page display device, electronic equipment and storage medium
US9430808B2 (en) Synchronization points for state information
CN102377799B (en) Mobile phone browser server end and realize the method for the two thread mode of browser
CN111079048A (en) Page loading method and device
US8860735B2 (en) Aligning script animations with display refresh
JP6088531B2 (en) Event service for local client applications through a local server
US9892202B2 (en) Web page load time reduction by optimized authentication
CN105608078A (en) Method and apparatus for previewing webpage in real time
WO2012128947A2 (en) On-demand image spriting
US8667090B2 (en) Delivering a webpage to a client
CN110765386A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN110750744A (en) Page presentation method and device
WO2020077681A1 (en) Method and apparatus for lazy loading of js script
US9507650B2 (en) Power efficient callback patterns
CN112052163B (en) High concurrency webpage pressure testing method and device, electronic equipment and storage medium
WO2023103844A1 (en) Data processing method and apparatus

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