CN111639287A - Page processing method and device, terminal equipment and readable storage medium - Google Patents
Page processing method and device, terminal equipment and readable storage medium Download PDFInfo
- Publication number
- CN111639287A CN111639287A CN202010359843.6A CN202010359843A CN111639287A CN 111639287 A CN111639287 A CN 111639287A CN 202010359843 A CN202010359843 A CN 202010359843A CN 111639287 A CN111639287 A CN 111639287A
- Authority
- CN
- China
- Prior art keywords
- page
- target
- rendered
- component
- object model
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例提供了一种页面处理方法、装置、终端设备及可读存储介质,该页面处理方法应用于终端设备,该页面处理方法包括:接收针对待渲染目标页面的页面更新指令,并基于该页面更新指令对待渲染目标页面进行更新,得到更新后的待渲染目标页面;基于更新后的待渲染目标页面构建第一虚拟文档对象模型树,并对比该第一虚拟文档对象模型树和基于待渲染目标页面构建的第二虚拟文档对象模型树,基于对比结果确定出目标文档对象模型元素节点;根据目标文档对象模型元素节点对基于待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。采用这样的页面处理方法,提升了更新数据的加载速度,提升页面更新效率。
Embodiments of the present invention provide a page processing method, an apparatus, a terminal device, and a readable storage medium. The page processing method is applied to a terminal device, and the page processing method includes: receiving a page update instruction for a target page to be rendered, and based on The page update instruction updates the target page to be rendered to obtain the updated target page to be rendered; builds a first virtual document object model tree based on the updated target page to be rendered, and compares the first virtual document object model tree with the target page based on the to-be-rendered Render the second virtual document object model tree constructed by the target page, and determine the target document object model element node based on the comparison result; update the target page pre-rendered based on the target page to be rendered according to the target document object model element node, and obtain the updated target page. By adopting such a page processing method, the loading speed of the updated data is improved, and the page update efficiency is improved.
Description
技术领域technical field
本发明涉及计算机应用领域,尤其涉及一种页面处理方法、装置、终端设备及可读存储介质。The present invention relates to the field of computer applications, and in particular, to a page processing method, apparatus, terminal device and readable storage medium.
背景技术Background technique
系统界面包含有多个系统对象,用户可以对该系统对象进行操作以对系统界面进行更新。在现有的系统界面显示中,针对系统对象进行操作时,会随着系统中可操作对象的增加,数据复杂度加剧,从而导致系统界面数据展示较慢,系统界面中数据同步展示不及时。可见,如何提供一种页面处理方法能提升页面中更新数据的加载速度,从而提升页面渲染的效率是一个亟待解决的问题。The system interface contains multiple system objects, and the user can operate the system objects to update the system interface. In the existing system interface display, when operating on system objects, the data complexity increases as the number of operable objects in the system increases, resulting in slower data display on the system interface and untimely display of data in the system interface. It can be seen that how to provide a page processing method that can improve the loading speed of the updated data in the page, thereby improving the efficiency of page rendering is an urgent problem to be solved.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种页面处理方法、装置、终端设备及可读存储介质,采用这样的页面处理方法,可以提升数据的加载速度,进而提升页面渲染的效率。Embodiments of the present invention provide a page processing method, an apparatus, a terminal device, and a readable storage medium. By using such a page processing method, the loading speed of data can be improved, thereby improving the efficiency of page rendering.
第一方面,本发明实施例提供了一种页面处理方法,所述方法应用于终端设备,所述方法包括:In a first aspect, an embodiment of the present invention provides a page processing method, the method is applied to a terminal device, and the method includes:
接收针对待渲染目标页面的页面更新指令,并基于所述页面更新指令对所述待渲染目标页面进行更新,得到更新后的待渲染目标页面;receiving a page update instruction for the target page to be rendered, and updating the target page to be rendered based on the page update instruction to obtain an updated target page to be rendered;
基于所述更新后的待渲染目标页面构建第一虚拟文档对象模型树,所述第一虚拟文档对象模型树包括至少一个第一文档对象模型元素节点,各个第一文档对象模型元素节点与所述更新后的待渲染目标页面包括的各个目标组件一一对应;A first virtual document object model tree is constructed based on the updated target page to be rendered. The first virtual document object model tree includes at least one first document object model element node, and each first document object model element node is associated with the Each target component included in the updated target page to be rendered corresponds one by one;
对比所述第一虚拟文档对象模型树和第二虚拟文档对象模型树,并基于对比结果从所述第一文档对象模型元素节点中确定出目标文档对象模型元素节点,其中,所述第二虚拟文档对象模型树是基于所述待渲染目标页面构建的;Comparing the first virtual document object model tree and the second virtual document object model tree, and determining a target document object model element node from the first document object model element node based on the comparison result, wherein the second virtual document object model element node is The document object model tree is constructed based on the to-be-rendered target page;
根据所述目标文档对象模型元素节点对基于所述待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。The target page pre-rendered based on the to-be-rendered target page is updated according to the target document object model element node to obtain the updated target page.
第二方面,本发明实施例提供了一种页面处理装置,所述方法配置于终端设备,所述装置包括:In a second aspect, an embodiment of the present invention provides a page processing apparatus, the method is configured on a terminal device, and the apparatus includes:
数据获取模块,用于接收针对待渲染目标页面的页面更新指令,并基于所述页面更新指令对所述待渲染目标页面进行更新,得到更新后的待渲染目标页面;a data acquisition module, configured to receive a page update instruction for the target page to be rendered, and to update the target page to be rendered based on the page update instruction to obtain an updated target page to be rendered;
数据处理模块,用于基于所述更新后的待渲染目标页面构建第一虚拟文档对象模型树,所述第一虚拟文档对象模型树包括至少一个第一文档对象模型元素节点,各个第一文档对象模型元素节点与所述更新后的待渲染目标页面包括的各个目标组件一一对应;A data processing module, configured to construct a first virtual document object model tree based on the updated target page to be rendered, the first virtual document object model tree includes at least one first document object model element node, each first document object The model element nodes are in one-to-one correspondence with each target component included in the updated target page to be rendered;
所述数据处理模块,还用于将所述第一虚拟文档对象模型树和第二虚拟文档对象模型树对比,并基于对比结果从所述第一文档对象模型元素节点中确定出目标文档对象模型元素节点,其中,所述第二虚拟文档对象模型树是基于所述待渲染目标页面构建的;The data processing module is further configured to compare the first virtual document object model tree with the second virtual document object model tree, and determine a target document object model from the first document object model element node based on the comparison result an element node, wherein the second virtual document object model tree is constructed based on the target page to be rendered;
所述数据处理模块,还用于根据所述目标文档对象模型元素节点对基于所述待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。The data processing module is further configured to update the target page pre-rendered based on the target page to be rendered according to the target document object model element node to obtain the updated target page.
第三方面,本发明实施例提供了一种终端设备,所述终端设备包括输入设备和输出设备,所述终端设备还包括处理器,适于实现一条或多条指令,所述一条或多条指令适于由所述处理器加载并执行上述第一方面所述的页面处理方法。In a third aspect, an embodiment of the present invention provides a terminal device, where the terminal device includes an input device and an output device, and the terminal device further includes a processor adapted to implement one or more instructions, the one or more instructions The instructions are adapted to be loaded by the processor and execute the page processing method of the first aspect above.
第四方面,本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的页面处理方法。In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, when the computer-readable storage medium runs on a computer, the computer executes the page processing described in the first aspect above method.
本发明实施例中,终端设备接收针对待渲染目标页面的页面更新指令,并基于该页面更新指令对待渲染目标页面进行更新,得到更新后的待渲染目标页面,进一步地,终端设备可以基于该更新后的待渲染目标页面构建第一虚拟文档对象模型树,其中,该第一虚拟文档对象模型树包括至少一个第一文档对象模型元素节点,各个第一文档对象模型元素节点与更新后的待渲染目标页面包括的各个目标组件一一对应。进而,终端设备可以对比第一虚拟文档对象模型树和第二虚拟文档对象模型树,并基于对比结果从第一文档对象模型元素节点中确定出目标文档对象模型元素节点,其中,第二虚拟文档对象模型树是基于待渲染目标页面构建的,并根据该目标文档对象模型元素节点对基于待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。采用这样的页面处理方法,通过构建虚拟文档对象模型树来缓解终端设备性能问题,并通过虚拟文档对象模型树的对比技术来提升更新数据的加载速度,从而提升页面渲染的效率。In this embodiment of the present invention, the terminal device receives a page update instruction for the target page to be rendered, and updates the target page to be rendered based on the page update instruction to obtain the updated target page to be rendered. Further, the terminal device may update the target page to be rendered based on the update instruction. A first virtual document object model tree is constructed from the target page to be rendered, wherein the first virtual document object model tree includes at least one first document object model element node, each first document object model element node and the updated to-be-rendered Each target component included in the target page is in one-to-one correspondence. Further, the terminal device can compare the first virtual document object model tree with the second virtual document object model tree, and determine the target document object model element node from the first document object model element node based on the comparison result, wherein the second virtual document The object model tree is constructed based on the target page to be rendered, and the target page pre-rendered based on the target page to be rendered is updated according to the target document object model element node to obtain the updated target page. Using such a page processing method, the performance problem of the terminal device is alleviated by constructing a virtual document object model tree, and the loading speed of the updated data is improved by the comparison technology of the virtual document object model tree, thereby improving the efficiency of page rendering.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.
图1是本发明实施例提供的一种页面处理系统的架构示意图;1 is a schematic diagram of the architecture of a page processing system provided by an embodiment of the present invention;
图2是本发明实施例提供的一种页面处理方法的流程示意图;2 is a schematic flowchart of a page processing method provided by an embodiment of the present invention;
图3是本发明实施例提供的一种目标页面与虚拟DOM树对应的示意图;3 is a schematic diagram corresponding to a target page and a virtual DOM tree provided by an embodiment of the present invention;
图4是本发明实施例提供的另一种页面处理方法的流程示意图;4 is a schematic flowchart of another page processing method provided by an embodiment of the present invention;
图5是本发明实施例提供的一种待更新组件与待更新子组件之间的数据流示意图;5 is a schematic diagram of a data flow between a component to be updated and a subcomponent to be updated according to an embodiment of the present invention;
图6是本发明实施例提供的一种开发编辑页面的示意图;6 is a schematic diagram of a development and editing page provided by an embodiment of the present invention;
图7是本发明实施例提供的一种页面处理装置的结构示意图;7 is a schematic structural diagram of a page processing apparatus provided by an embodiment of the present invention;
图8是本发明实施例提供的一种终端设备的结构示意图。FIG. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
请参见图1,是本发明实施例提供的一种页面处理系统的框架图,该页面处理系统包括终端设备的浏览器模块10和渲染框架模块11。其中:渲染更新框架11为采用组件化开发的angularJS框架与采用虚拟文档对象模型(Document Object Model,DOM)的reactJS框架的结合框架。浏览器模块10对应的终端设备具体可以是智能手机、平板电脑、笔记本电脑、台式电脑、车载智能终端等,本发明实施例不做限定。Please refer to FIG. 1 , which is a frame diagram of a page processing system provided by an embodiment of the present invention, where the page processing system includes a
需要了解的是,真实DOM是W3C制定的标准接口规范,是一种处理HTML和XML文件的标准API。真实DOM树将文档作为一个树形结构,真实DOM树的每个结点表示一个HTML标签或标签内的文本项。真实DOM树形结构精确地描述了HTML文档中标签间的相互关联性,对HTML文档的处理可以通过对真实DOM树的操作实现。在对真实DOM树进行渲染时,JavaScript(简称JS)渲染引擎可以提供真实DOM暴露接口供JS调用,来方便JS操作真实DOM。由于浏览器性能的限制,都应尽可能的减少操作DOM的次数。本方案采用虚拟DOM(即采用js对象模拟DOM节点),使得页面的更新可以先反映在虚拟DOM上,等虚拟DOM更新完后,再将最终的虚拟DOM映射成真实DOM,以减少浏览器的计算压力,操作内存中的虚拟DOM的以提升更新数据的加载速度,进而提升页面更新的效率。What needs to be understood is that the real DOM is a standard interface specification formulated by the W3C, which is a standard API for processing HTML and XML files. The real DOM tree treats the document as a tree structure, and each node of the real DOM tree represents an HTML tag or a text item within a tag. The real DOM tree structure accurately describes the interrelationship between the tags in the HTML document, and the processing of the HTML document can be realized by the operation of the real DOM tree. When rendering a real DOM tree, the JavaScript (JS for short) rendering engine can provide a real DOM exposure interface for JS to call, so as to facilitate JS to operate the real DOM. Due to the limitations of browser performance, the number of DOM manipulations should be reduced as much as possible. This solution uses virtual DOM (that is, using js objects to simulate DOM nodes), so that page updates can be reflected on the virtual DOM first, and after the virtual DOM is updated, the final virtual DOM is mapped into the real DOM to reduce browser complexity. Calculate the pressure and operate the virtual DOM in memory to improve the loading speed of updated data, thereby improving the efficiency of page update.
在一些可行的实施方式中,终端设备展示出浏览器10接收针对目标页面的页面更新指令,并根据渲染更新框架11中的工作流程和该页面更新指令对待渲染目标页面进行更新,得到更新后的待渲染目标页面,进一步地,终端设备可以基于该更新后的待渲染目标页面构建第一虚拟DOM树,其中,该第一虚拟DOM树包括至少一个第一DOM元素节点,各个第一DOM元素节点与更新后的待渲染目标页面包括的各个目标组件一一对应。进而,终端设备可以采用reactJS框架的diff算法对比第一虚拟DOM树和第二虚拟DOM树,并基于对比结果从第一DOM元素节点中确定出目标DOM元素节点,其中,第二虚拟DOM树是基于待渲染目标页面构建的,并根据该目标DOM元素节点对基于待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。采用这样的页面处理方法,通过构建虚拟DOM树来缓解终端设备性能问题,并通过虚拟DOM树的对比技术来提升数据加载的速度,从而提升页面渲染的效率。In some feasible implementations, the terminal device shows that the
请参见图2,是本发明实施例提供的一种页面处理方法的流程示意图,该方法可由终端设备执行,该页面处理方法包括如下步骤:Please refer to FIG. 2, which is a schematic flowchart of a page processing method provided by an embodiment of the present invention. The method can be executed by a terminal device, and the page processing method includes the following steps:
S201:接收针对待渲染目标页面的页面更新指令,并基于该页面更新指令对该待渲染目标页面进行更新,得到更新后的待渲染目标页面。S201: Receive a page update instruction for the target page to be rendered, and update the target page to be rendered based on the page update instruction to obtain an updated target page to be rendered.
终端设备可以展示开发编辑页面,该开发编辑页面中包括待渲染目标页面,终端设备通过交互设备接收针对该待渲染目标页面的页面更新指令,并根据该页面更新指令在前述开发编辑页面对该待渲染目标页面进行更新,得到更新后的待渲染目标页面。其中,交互设备可以是人机交互设备(例如鼠标等),也可以是与该待渲染目标页面进行数据交互的终端(例如电脑、手机和服务器等)。The terminal device can display the development and editing page, the development and editing page includes the target page to be rendered, the terminal device receives the page update instruction for the target page to be rendered through the interactive device, and according to the page update instruction, on the development and editing page, the to-be-rendered page is updated. The rendering target page is updated to obtain the updated target page to be rendered. The interaction device may be a human-computer interaction device (such as a mouse, etc.), or a terminal (such as a computer, a mobile phone, a server, etc.) that performs data interaction with the target page to be rendered.
在一个实施例中,在终端设备接收针对待渲染目标页面的页面更新指令之前,终端设备还可以展示开发编辑页面,该开发编辑页面包括组件列表和页面编辑区,其中,组件列表包括至少一个组件。终端设备从组件列表中确定至少一个目标组件,并在该页面编辑区中对至少一个目标组件中的各个目标组件进行排版处理,得到待渲染目标页面。进一步地,终端设备可以将各个目标组件与数据模型进行双向数据绑定,并获取各个目标组件在数据模型中各自对应的应用数据,并基于各个目标组件对应的应用数据、组件属性和各个目标组件之间的层级信息生成第二虚拟DOM模型树,该第二虚拟DOM树包括至少一个第二DOM元素节点,其中,目标组件与所述第二DOM节点一一对应,进而,终端设备可以基于该第二虚拟DOM树对待渲染目标页面进行渲染,得到目标页面。In one embodiment, before the terminal device receives the page update instruction for the target page to be rendered, the terminal device may further display a development and editing page, where the development and editing page includes a component list and a page editing area, wherein the component list includes at least one component . The terminal device determines at least one target component from the component list, and performs typesetting processing on each target component in the at least one target component in the page editing area to obtain a target page to be rendered. Further, the terminal device can perform two-way data binding between each target component and the data model, and obtain the application data corresponding to each target component in the data model, and based on the application data corresponding to each target component, component attributes and each target component. The hierarchical information between them generates a second virtual DOM model tree, and the second virtual DOM tree includes at least one second DOM element node, wherein the target component corresponds to the second DOM node one-to-one, and further, the terminal device can be based on the The second virtual DOM tree renders the target page to be rendered to obtain the target page.
需要了解的是,将各个目标组件与数据模型进行双向数据绑定,即在目标组件发生变化时会相应的反应至数据模型中,数据模型中的应用数据更新时同样能映射到目标组件里。组件属性可以是组件的形状、大小、颜色以及在待渲染目标页面中的位置中的一种或多种。应用数据可以是组件的内容数据、配置数据或交互数据中的一种或多种。It should be understood that the two-way data binding between each target component and the data model means that when the target component changes, it will be reflected in the data model accordingly, and the application data in the data model can also be mapped to the target component when it is updated. Component properties can be one or more of the component's shape, size, color, and position in the target page to be rendered. Application data can be one or more of content data, configuration data, or interaction data of a component.
示例性地,如图3所示,包括目标页面3a和目标页面3a对应的虚拟DOM树3b,目标页面3a包含三个组件,分别是组件1、组件2和组件3。终端设备根据该目标页面3a生成虚拟DOM树3b,虚拟DOM树3b的根元素节点中保存有目标页面3a的属性信息和状态信息,即该目标页面3a与虚拟DOM树3b中根DOM元素节点对应,虚拟DOM树中DOM元素节点1、DOM元素节点2、DOM元素节点3与目标页面3a中组件1、组件2、组件3一一对应。Exemplarily, as shown in FIG. 3 , it includes a
在一个实施例中,上述组件列表中的组件可以由开发人员根据目标组件功能进行组件开发得到,组件列表中可以包括多种基础组件,如按钮、文本输入框、链接符、下拉框等。In one embodiment, the components in the above component list can be obtained by the developer through component development according to the function of the target component, and the component list can include various basic components, such as buttons, text input boxes, link symbols, drop-down boxes, and the like.
可选地,还可以从组件列表中选取出至少一个组件,将其进行组合封装成组合功能组件,并将该组合功能组件添加至组件列表中,便于用户下次对该组合功能组件的复用。Optionally, at least one component can also be selected from the component list, combined and packaged into a combined functional component, and the combined functional component is added to the component list, so that the user can reuse the combined functional component next time. .
可选地,终端设备可以获取模板页面(即已经排版好的其他待渲染页面),按照业务功能将该模板页面拆分成至少一个业务功能组件模块组件,进而将该业务功能模块组件添加至组件列表中,以便用户下次对该业务功能模块组件的复用。采用这样的方式,可以提升组件的复用性,提高开发效率和代码质量,便于后期代码维护。Optionally, the terminal device can obtain a template page (that is, other pages to be rendered that have been typeset), split the template page into at least one business function component module component according to the business function, and then add the business function module component to the component. list, so that the user can reuse the service function module component next time. In this way, the reusability of components can be improved, development efficiency and code quality can be improved, and later code maintenance can be facilitated.
S202:基于该更新后的待渲染目标页面构建第一虚拟DOM树,该第一虚拟DOM树包括至少一个第一DOM元素节点,各个第一DOM元素节点与更新后的待渲染目标页面包括的各个目标组件一一对应。S202: Build a first virtual DOM tree based on the updated target page to be rendered, where the first virtual DOM tree includes at least one first DOM element node, each of the first DOM element nodes and the updated target page to be rendered include each Target components correspond one-to-one.
终端设备根据更新后的待渲染目标页面中的各个目标组件对应的应用数据、组件属性和所述各个目标组件之间的层级信息构建第一虚拟DOM树。The terminal device constructs a first virtual DOM tree according to application data corresponding to each target component in the updated target page to be rendered, component attributes, and hierarchical information between the various target components.
S203:对比第一虚拟DOM树和第二虚拟DOM树,并基于对比结果从第一DOM元素节点中确定出目标DOM元素节点,其中,该第二虚拟DOM模型树是基于待渲染目标页面构建的。S203: Compare the first virtual DOM tree and the second virtual DOM tree, and determine the target DOM element node from the first DOM element node based on the comparison result, wherein the second virtual DOM model tree is constructed based on the target page to be rendered .
终端设备可以将第一虚拟DOM树中包含的DOM元素节点包含的对应组件的应用数据、组件属性与第二虚拟DOM树种包含的DOM元素节点包含的对应组件的应用数据、组件属性进行对比,从第一虚拟DOM树种包含的第一DOM元素节点中确定出与第二虚拟DOM树种包含的第二DOM元素节点不同的目标DOM元素节点(即更新后组件对应的DOM元素节点)。The terminal device can compare the application data and component attributes of the corresponding components contained in the DOM element nodes contained in the first virtual DOM tree with the application data and component attributes of the corresponding components contained in the DOM element nodes contained in the second virtual DOM tree species, from A target DOM element node (ie, a DOM element node corresponding to the updated component) that is different from the second DOM element node included in the second virtual DOM tree species is determined from the first DOM element node included in the first virtual DOM tree species.
可选地,终端设备可以将第一虚拟DOM树与第二虚拟DOM树进行同层对比,即是依照第一虚拟DOM树的层级关系与第二虚拟DOM树的层级关系,将第一虚拟DOM树与第二虚拟DOM树进行逐级对比,得到同层对比结果。进而可以根据该同层对比结果,从第一DOM元素节点中确定出与第二DOM元素节点不同的DOM元素节点,即目标DOM元素节点。采用这样的方法,减少了第一虚拟DOM树与第二虚拟DOM树的对比计算复杂度,提升了对比效率,从而提升了页面更新的效率。Optionally, the terminal device can compare the first virtual DOM tree with the second virtual DOM tree at the same level, that is, according to the hierarchical relationship of the first virtual DOM tree and the hierarchical relationship of the second virtual DOM tree, the first virtual DOM tree is compared. The tree is compared with the second virtual DOM tree level by level, and a comparison result at the same level is obtained. Further, a DOM element node different from the second DOM element node, that is, a target DOM element node, can be determined from the first DOM element node according to the same-layer comparison result. By adopting such a method, the computational complexity of the comparison between the first virtual DOM tree and the second virtual DOM tree is reduced, the comparison efficiency is improved, and the page update efficiency is improved.
S204:根据该目标DOM元素节点对基于待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。S204: Update the target page pre-rendered based on the target page to be rendered according to the target DOM element node to obtain the updated target page.
终端设备将该目标DOM元素节点中组件对应的应用状态数据和组件属性映射至该目标DOM元素节点在目标页面对应的真实DOM树中对应的元素节点中,并操作该真实DOM树中对应的元素节点对基于待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。The terminal device maps the application state data and component attributes corresponding to the components in the target DOM element node to the corresponding element nodes in the real DOM tree corresponding to the target DOM element node in the target page, and operates the corresponding elements in the real DOM tree The node updates the target page pre-rendered based on the target page to be rendered to obtain the updated target page.
本申请实施例中,终端设备可以接收针对待渲染目标页面的页面更新指令,并基于该页面更新指令对待渲染目标页面进行更新,得到更新后的待渲染目标页面,进一步地,终端设备可以基于该更新后的待渲染目标页面构建第一虚拟DOM树,其中,该第一虚拟DOM树包括至少一个第一DOM元素节点,各个第一DOM元素节点与更新后的待渲染目标页面包括的各个目标组件一一对应。进而,终端设备可以对比第一虚拟DOM树和第二虚拟DOM树,并基于对比结果从第一DOM元素节点中确定出目标DOM元素节点,其中,第二虚拟DOM树是基于待渲染目标页面构建的,并根据该目标DOM元素节点对基于待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。采用这样的页面处理方法,通过构建虚拟DOM树来缓解终端设备性能问题,并通过虚拟DOM树的同层对比技术来提升数据加载的速度,从而提升页面渲染的效率。In this embodiment of the present application, the terminal device may receive a page update instruction for the target page to be rendered, and update the target page to be rendered based on the page update instruction to obtain the updated target page to be rendered. Further, the terminal device may be based on the page update instruction. The updated target page to be rendered builds a first virtual DOM tree, wherein the first virtual DOM tree includes at least one first DOM element node, each first DOM element node and each target component included in the updated target page to be rendered One-to-one correspondence. Further, the terminal device can compare the first virtual DOM tree and the second virtual DOM tree, and determine the target DOM element node from the first DOM element node based on the comparison result, wherein the second virtual DOM tree is constructed based on the target page to be rendered , and update the target page pre-rendered based on the target page to be rendered according to the target DOM element node to obtain the updated target page. Using such a page processing method, the performance problem of the terminal device is alleviated by constructing a virtual DOM tree, and the speed of data loading is improved through the same-layer comparison technology of the virtual DOM tree, thereby improving the efficiency of page rendering.
请参见图4,是本发明实施例提供的另一种页面处理方法的流程示意图,该方法可由终端设备执行,该页面处理方法包括如下步骤:Please refer to FIG. 4 , which is a schematic flowchart of another page processing method provided by an embodiment of the present invention. The method can be executed by a terminal device, and the page processing method includes the following steps:
S401:接收针对待渲染目标页面的页面更新指令,并基于该页面更新指令的指示,从待渲染目标页面中确定出待更新目标组件,并从该待更新目标组件包括的至少一个子组件中确定出待更新子组件。S401: Receive a page update instruction for the target page to be rendered, and based on the instruction of the page update instruction, determine the target component to be updated from the target page to be rendered, and determine from at least one subcomponent included in the target component to be updated Out of the subcomponent to be updated.
终端设备接收针对待渲染目标页面的页面更新指令,并根据该页面更新指令从待渲染目标页面包含的多个目标组件中确定出待更新目标组件,其中,待更新目标组件的个数小于或等于待渲染目标页面包含的目标组件的个数,在此不做具体限定。并且,当该待更新目标组件为至少一个组件合并的业务功能组件时,终端设备根据该页面更新指令从至少一个组件中确定出待更新子组件。The terminal device receives a page update instruction for the target page to be rendered, and determines the target component to be updated from the multiple target components included in the target page to be rendered according to the page update instruction, wherein the number of target components to be updated is less than or equal to The number of target components included in the target page to be rendered is not specifically limited here. And, when the target component to be updated is a service function component merged by at least one component, the terminal device determines the subcomponent to be updated from the at least one component according to the page update instruction.
示例性地,待更新目标组件A由子组件a1和组件子a2组成,其中子组件a1的功能为跳转至指定页面1的链接功能,子组件a2的功能为点击确定的确定功能。一个页面更新指令指示了该待更新组件A的功能更新为跳转至指定页面2的链接功能,由于待更新目标组件A中的跳转至指定页面的链接功能由组件a1实行,这种情况下终端设备将待更新目标组件A中的子组件a1确定为待更新子组件。Exemplarily, the target component A to be updated is composed of a subcomponent a1 and a subcomponent a2, wherein the function of the subcomponent a1 is a link function of jumping to the specified page 1, and the function of the subcomponent a2 is a confirmation function of clicking to confirm. A page update instruction indicates that the function of the component A to be updated is updated to the link function of jumping to the specified page 2. Since the link function of the target component A to be updated to jump to the specified page is implemented by the component a1, in this case The terminal device determines the subcomponent a1 in the target component A to be updated as the subcomponent to be updated.
S402:在该待渲染目标页面中根据该页面更新指令对待更新子组件进行更新,得到更新后的待渲染目标页面。S402: Update the subcomponent to be updated in the target page to be rendered according to the page update instruction to obtain the updated target page to be rendered.
示例性地,如图5所示,根据该页面更新指令的指示,前述待更新组件(即图5中所示父组件)响应该页面更新指令,将该页面更新指令中指示的待更新的组件属性和应用数据传递给待更新子组件(即图5中所示子组件),进而,由该待更新子组件进行该页面更新指令中指示的待更新的组件属性和应用数据的更新,得到更新后的待渲染目标页面。Exemplarily, as shown in FIG. 5 , according to the instruction of the page update instruction, the aforementioned component to be updated (that is, the parent component shown in FIG. 5 ) responds to the page update instruction, and the component to be updated indicated in the page update instruction is updated. Attributes and application data are passed to the sub-component to be updated (ie, the sub-component shown in Figure 5), and then, the sub-component to be updated performs the update of the component attributes and application data to be updated indicated in the page update instruction to obtain an update The target page to be rendered after.
S403:基于该更新后的待渲染目标页面构建第一虚拟DOM树,该第一虚拟DOM树包括至少一个第一DOM元素节点,各个第一DOM元素节点与更新后的待渲染目标页面包括的各个目标组件一一对应。S403: Build a first virtual DOM tree based on the updated target page to be rendered, where the first virtual DOM tree includes at least one first DOM element node, each of the first DOM element nodes and the updated target page to be rendered include each Target components correspond one-to-one.
S404:对比第一虚拟DOM树和第二虚拟DOM树,并基于对比结果从第一DOM元素节点中确定出目标DOM元素节点,其中,该第二虚拟DOM模型树是基于待渲染目标页面构建的。S404: Compare the first virtual DOM tree and the second virtual DOM tree, and determine the target DOM element node from the first DOM element node based on the comparison result, wherein the second virtual DOM model tree is constructed based on the target page to be rendered .
S405:根据该目标DOM元素节点对基于待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。S405: Update the target page pre-rendered based on the target page to be rendered according to the target DOM element node to obtain an updated target page.
其中,步骤S403-S405的具体实施方式可以参见前述实施例中步骤S202-S204的具体实施方式,在此不再过多赘述。For the specific implementation of steps S403-S405, reference may be made to the specific implementation of steps S202-S204 in the foregoing embodiment, which will not be repeated here.
在一个实施例中,终端设备得到基于待渲染目标页面预渲染得到的目标页面之后,还可以接收组件删除指令,并根据该组件删除指令从待渲染目标页面中确定待删除组件。进一步地,终端设备可以将该待删除组件从待渲染目标页面中移除,并对待删除组件占用资源进行释放。其中,占用资源包括内存占用资源、网络请求资源、定时器资源和与待删除组件对应的第二DOM元素节点中的一种或多种。采用这样的方式,在组件删除后对该组件占用资源进行释放,避免了因组件删除出现的内存溢出。In one embodiment, after obtaining the target page pre-rendered based on the target page to be rendered, the terminal device may also receive a component deletion instruction, and determine the to-be-deleted component from the to-be-rendered target page according to the component deletion instruction. Further, the terminal device can remove the to-be-deleted component from the to-be-rendered target page, and release the resources occupied by the to-be-deleted component. The occupied resources include one or more of memory occupied resources, network request resources, timer resources, and second DOM element nodes corresponding to the component to be deleted. In this way, the resources occupied by the component are released after the component is deleted, so as to avoid memory overflow caused by the deletion of the component.
其中,组件删除指令可以是由用户根据业务需求,针对待渲染目标页面中的目标组件发送的。The component deletion instruction may be sent by the user according to business requirements for the target component in the target page to be rendered.
可选地,组件属性还包括生命周期,在基于该第二虚拟文档对象模型树对待渲染目标页面进行渲染,得到目标页面之后,终端设备还可以检测各个目标组件的生命周期,并验证该生命周期是否到达。若前述生命周期到达,则将该生命周期对应的目标组件确定为待删除组件,并将该待删除组件从待渲染目标页面中移除,以及对该待删除组件占用资源进行释放。其中,占用资源包括内存占用资源、网络请求资源、定时器资源和与所述待删除组件对应的第二文档对象模型元素节点中的一种或多种。Optionally, the component properties also include a life cycle. After rendering the target page to be rendered based on the second virtual document object model tree and obtaining the target page, the terminal device can also detect the life cycle of each target component and verify the life cycle. whether to arrive. If the aforementioned life cycle is reached, the target component corresponding to the life cycle is determined as the component to be deleted, the to-be-deleted component is removed from the target page to be rendered, and the resources occupied by the to-be-deleted component are released. The occupied resources include one or more of memory occupied resources, network request resources, timer resources, and second document object model element nodes corresponding to the components to be deleted.
其中,生命周期为开发人员根据目标组件在业务需求中的功能作用设置的,后期可根据具体情况调整。终端设备检测各个目标组件的生命周期和各个目标组件的生效时长,若生效时长等于该生命周期,则判定该生命周期到达,并将该生命周期对应的目标组件确定为待删除组件。需要了解的是,生效时长为组件从开始生效时间(或开始运行时间、开始工作时间)到终端设备检测时的时长。Among them, the life cycle is set by the developer according to the functional role of the target component in the business requirements, and can be adjusted later according to the specific situation. The terminal device detects the life cycle of each target component and the effective duration of each target component. If the effective duration is equal to the life cycle, it is determined that the life cycle has arrived, and the target component corresponding to the life cycle is determined as the component to be deleted. It should be understood that the effective duration is the duration from the effective time of the component (or the running time or the working time) to the time when the terminal device is detected.
在一个实施例中,前述组件属性还包括功能属性,在页面编辑区中对至少一个目标组件中的各个目标组件进行排版操作,得到待渲染目标页面之后,终端设备还可以接收针对组件列表中组件的功能属性管理操作,并根据该功能属性管理操作确定待管理组件,其中,功能属性管理操作为业务功能新增操作、业务功能修改操作和业务功能删除操作的一种或多种,进一步地,终端设备对组件列表中的待管理组件进行功能属性管理,并对待渲染目标页面中和待管理组件匹配的目标组件进行同步功能属性管理。其中,业务功能包括但不限于链接、跳转、下拉、展示等。In one embodiment, the aforementioned component attributes further include function attributes. After performing a typesetting operation on each target component in the at least one target component in the page editing area, and after obtaining the target page to be rendered, the terminal device may also receive the target page for the components in the component list. and determine the component to be managed according to the functional attribute management operation, wherein the functional attribute management operation is one or more of a business function addition operation, a business function modification operation and a business function deletion operation, and further, The terminal device performs functional attribute management on the components to be managed in the component list, and performs synchronous functional attribute management on the target components in the target page to be rendered that match the to-be-managed components. Among them, business functions include but are not limited to links, jumps, pull-downs, and displays.
示例性地,如图6所示,为一种开发编辑页面的示意图。终端设备从组件列表中确定组件1为目标组件构建了待渲染页面1、待渲染页面2和待渲染页面3。用户在开发编辑页面的组件列表中对组件1新增业务链接功能,则终端设备会对待渲染页面1、待渲染页面2和待渲染页面3中包括的组件1同步新增业务链接功能。Exemplarily, as shown in FIG. 6 , it is a schematic diagram of developing an editing page. The terminal device determines from the component list that component 1 builds a page to be rendered 1 , a page to be rendered 2 , and a page to be rendered 3 for the target component. If the user adds a business link function to component 1 in the component list of the development and editing page, the terminal device will add the business link function synchronously to the component 1 included in the page to be rendered 1, the page to be rendered 2, and the page to be rendered 3.
在本申请实施例中,终端设备接收针对待渲染目标页面的页面更新指令,并基于该页面更新指令的指示,从待渲染目标页面中确定出待更新目标组件,并从该待更新目标组件包括的至少一个子组件中确定出待更新子组件。进一步地,终端设备在该待渲染目标页面中根据该页面更新指令对待更新子组件进行更新,得到更新后的待渲染目标页面,并基于该更新后的待渲染目标页面构建第一虚拟DOM树,其中,该第一虚拟DOM树包括至少一个第一DOM元素节点,各个第一DOM元素节点与更新后的待渲染目标页面包括的各个目标组件一一对应。进而,终端设备可以对比第一虚拟DOM树和第二虚拟DOM树,并基于对比结果从第一DOM元素节点中确定出目标DOM元素节点,其中,第二虚拟DOM树是基于待渲染目标页面构建的,并根据该目标DOM元素节点对基于待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。采用这样的页面处理方法,通过构建虚拟DOM树来缓解终端设备性能问题,并通过将页面更新指令中指示的待更新组件属性和应用数据传递至待更新组件中的子组件,由子组件对相关的待更新组件属性和应用数据进行加载更新,从而进一步地提升了数据加载的速度,提升页面渲染的效率。In this embodiment of the present application, the terminal device receives a page update instruction for the target page to be rendered, and based on the instruction of the page update instruction, determines the target component to be updated from the target page to be rendered, and includes The sub-component to be updated is determined from at least one sub-component of . Further, the terminal device updates the subcomponent to be updated in the target page to be rendered according to the page update instruction, obtains the updated target page to be rendered, and builds a first virtual DOM tree based on the updated target page to be rendered, The first virtual DOM tree includes at least one first DOM element node, and each first DOM element node corresponds to each target component included in the updated target page to be rendered. Further, the terminal device can compare the first virtual DOM tree and the second virtual DOM tree, and determine the target DOM element node from the first DOM element node based on the comparison result, wherein the second virtual DOM tree is constructed based on the target page to be rendered , and update the target page pre-rendered based on the target page to be rendered according to the target DOM element node to obtain the updated target page. By adopting such a page processing method, the performance problem of the terminal device is alleviated by constructing a virtual DOM tree, and the attributes of the component to be updated and the application data indicated in the page update instruction are transmitted to the subcomponents in the component to be updated, and the related Attributes of components to be updated and application data are loaded and updated, thereby further improving the speed of data loading and the efficiency of page rendering.
请参见图7,为本申请实施例提供的一种页面处理装置的结构示意图,所述装置配置于终端设备,所述装置包括:Please refer to FIG. 7 , which is a schematic structural diagram of a page processing apparatus provided by an embodiment of the present application. The apparatus is configured on a terminal device, and the apparatus includes:
数据获取模块70,用于接收针对待渲染目标页面的页面更新指令,并基于所述页面更新指令对所述待渲染目标页面进行更新,得到更新后的待渲染目标页面;A
数据处理模块71,用于基于所述更新后的待渲染目标页面构建第一虚拟DOM树,所述第一虚拟DOM树包括至少一个第一DOM元素节点,各个第一DOM元素节点与所述更新后的待渲染目标页面包括的各个目标组件一一对应;The
所述数据处理模块71,还用于对比所述第一虚拟文档对象模型树和第二虚拟文档对象模型树,并基于对比结果从所述第一文档对象模型元素节点中确定出目标文档对象模型元素节点,其中,所述第二虚拟文档对象模型树是基于所述待渲染目标页面构建的;The
所述数据处理模块71,还用于根据所述目标DOM元素节点对基于所述待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。The
在一个实施例中,所述数据处理单元71,具体还用于展示开发编辑页面,所述开发编辑页面包括组件列表和页面编辑区,所述组件列表包括至少一个组件;从所述组件列表中确定至少一个目标组件,并在所述页面编辑区中对所述至少一个目标组件中的各个目标组件进行排版处理,得到待渲染目标页面;将所述各个目标组件与数据模型进行双向数据绑定,并获取所述各个目标组件在所述数据模型中各自对应的应用数据;基于各个目标组件对应的应用数据、组件属性和所述各个目标组件之间的层级信息生成所述第二虚拟DOM树,所述第二虚拟DOM树包括至少一个第二DOM元素节点,所述目标组件与所述第二DOM元素节点一一对应;基于所述第二虚拟DOM树对所述待渲染目标页面进行渲染,得到目标页面。In one embodiment, the
在一个实施例中,所述数据处理单元71,具体用于将所述第一虚拟DOM树与所述第二虚拟DOM树进行同层对比,得到同层对比结果;根据所述同层对比结果,从所述第一DOM元素节点中确定出目标DOM元素节点。In one embodiment, the
在一个实施例中,所述数据处理单元71,具体用于基于所述页面更新指令的指示,从所述待渲染目标页面中确定出待更新目标组件,并从所述待更新目标组件包括的至少一个子组件中确定出待更新子组件;在所述待渲染目标页面中根据所述页面更新指令对所述待更新子组件进行更新,得到更新后的待渲染目标页面。In one embodiment, the
在一个实施例中,所述数据处理单元71,具体还用于接收组件删除指令,并根据所述组件删除指令从所述待渲染目标页面中确定待删除组件;将所述待删除组件从所述待渲染目标页面中移除,并对所述待删除组件占用资源进行释放,所述占用资源包括内存占用资源、网络请求资源、定时器资源和与所述待删除组件对应的第二DOM元素节点中的一种或多种。In one embodiment, the
在一个实施例中,所述组件属性包括生命周期,所述数据处理单元71,具体还用于检测所述各个目标组件的生命周期,并验证所述生命周期是否到达;若所述生命周期到达,则将所述生命周期对应的目标组件确定为待删除组件,并将所述待删除组件从所述待渲染目标页面中移除,并对所述待删除组件占用资源进行释放,所述占用资源包括内存占用资源、网络请求资源、定时器资源和与所述待删除组件对应的第二DOM元素节点中的一种或多种。In one embodiment, the component attribute includes a life cycle, and the
在一个实施例中,所述组件属性还包括功能属性,所述数据处理单元71,具体还用于接收针对所述组件列表中组件的功能属性管理操作,并根据所述功能属性管理操作确定待管理组件,所述功能属性管理操作为业务功能新增操作、业务功能修改操作和业务功能删除操作的一种或多种;对所述组件列表中所述待管理组件进行功能属性管理,并对所述待渲染目标页面中和所述待管理组件匹配的目标组件进行同步功能属性管理。In one embodiment, the component attribute further includes a function attribute, and the
需要说明的是,本发明实施例所描述的页面处理装置的各单元模块的功能可根据图2或者图4所述的方法实施例中的方法具体实现,其具体实现过程可以参照图2或者图4的方法实施例的相关描述,此处不再赘述。It should be noted that the functions of each unit module of the page processing apparatus described in the embodiment of the present invention may be specifically implemented according to the method in the method embodiment described in FIG. 2 or FIG. 4 , and the specific implementation process may refer to FIG. 2 or FIG. 4 . The relevant description of the method embodiment of 4 is not repeated here.
基于上述方法实施例以及装置项实施例的描述,本发明实施例还提供一种终端设备。请参见图8,该终端设备可至少包括处理器801、输入设备802、输出设备803以及存储器804;其中,处理器801、输入设备802、输出设备803以及存储器804可通过总线或者其它连接方式进行连接。所述存储器804中还可以包括计算机可读存储介质,该计算机可读存储介质用于存储计算机程序,所述计算机程序包括程序指令,所述处理器801用于执行所述存储器804存储的程序指令。处理器801(或称CPU(Central Processing Unit,中央处理器))是终端设备的计算核心以及控制核心,其适于实现一条或多条指令,具体适于加载并执行一条或多条指令从而实现上述页面处理方法实施例中的相应方法流程或相应功能。其中,处理器801被配置调用所述程序指令执行:接收针对待渲染目标页面的页面更新指令,并基于所述页面更新指令对所述待渲染目标页面进行更新,得到更新后的待渲染目标页面;基于所述更新后的待渲染目标页面构建第一虚拟DOM树,所述第一虚拟DOM树包括至少一个第一DOM元素节点,各个第一DOM元素节点与所述更新后的待渲染目标页面包括的各个目标组件一一对应;对比所述第一虚拟DOM树和第二虚拟DOM树,并基于对比结果从所述第一DOM元素节点中确定出目标DOM元素节点,其中,所述第二虚拟DOM树是基于所述待渲染目标页面构建的;根据所述目标DOM元素节点对基于所述待渲染目标页面预渲染得到的目标页面进行更新,得到更新后的目标页面。Based on the descriptions of the foregoing method embodiments and apparatus item embodiments, an embodiment of the present invention further provides a terminal device. Referring to FIG. 8 , the terminal device may include at least a
在一个实施例中,所述处理器801,具体还用于展示开发编辑页面,所述开发编辑页面包括组件列表和页面编辑区,所述组件列表包括至少一个组件;从所述组件列表中确定至少一个目标组件,并在所述页面编辑区中对所述至少一个目标组件中的各个目标组件进行排版处理,得到待渲染目标页面;将所述各个目标组件与数据模型进行双向数据绑定,并获取所述各个目标组件在所述数据模型中各自对应的应用数据;基于各个目标组件对应的应用数据、组件属性和所述各个目标组件之间的层级信息生成所述第二虚拟DOM树,所述第二虚拟DOM树包括至少一个第二DOM元素节点,所述目标组件与所述第二DOM元素节点一一对应;基于所述第二虚拟DOM树对所述待渲染目标页面进行渲染,得到目标页面。In one embodiment, the
在一个实施例中,所述处理器801,具体用于将所述第一虚拟DOM树与所述第二虚拟DOM树进行同层对比,得到同层对比结果;根据所述同层对比结果,从所述第一DOM元素节点中确定出目标DOM元素节点。In one embodiment, the
在一个实施例中,所述处理器801,具体用于基于所述页面更新指令的指示,从所述待渲染目标页面中确定出待更新目标组件,并从所述待更新目标组件包括的至少一个子组件中确定出待更新子组件;在所述待渲染目标页面中根据所述页面更新指令对所述待更新子组件进行更新,得到更新后的待渲染目标页面。In one embodiment, the
在一个实施例中,所述处理器801,具体还用于接收组件删除指令,并根据所述组件删除指令从所述待渲染目标页面中确定待删除组件;将所述待删除组件从所述待渲染目标页面中移除,并对所述待删除组件占用资源进行释放,所述占用资源包括内存占用资源、网络请求资源、定时器资源和与所述待删除组件对应的第二DOM元素节点中的一种或多种。In one embodiment, the
在一个实施例中,所述组件属性包括生命周期,所述处理器801,具体还用于检测所述各个目标组件的生命周期,并验证所述生命周期是否到达;若所述生命周期到达,则将所述生命周期对应的目标组件确定为待删除组件,并将所述待删除组件从所述待渲染目标页面中移除,并对所述待删除组件占用资源进行释放,所述占用资源包括内存占用资源、网络请求资源、定时器资源和与所述待删除组件对应的第二DOM元素节点中的一种或多种。In one embodiment, the component attribute includes a life cycle, and the
在一个实施例中,所述组件属性还包括功能属性,所述处理器801,具体还用于接收针对所述组件列表中组件的功能属性管理操作,并根据所述功能属性管理操作确定待管理组件,所述功能属性管理操作为业务功能新增操作、业务功能修改操作和业务功能删除操作的一种或多种;对所述组件列表中所述待管理组件进行功能属性管理,并对所述待渲染目标页面中和所述待管理组件匹配的目标组件进行同步功能属性管理。In one embodiment, the component attribute further includes a function attribute, and the
应当理解,在本发明实施例中,所称处理器801可以是中央处理单元(CentralProcessing Unit,CPU),该处理器801还可以是其他通用处理器、数字信号处理器(DigitalSignal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立a硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that, in this embodiment of the present invention, the
该存储器804可以包括只读存储器和随机存取存储器,并向处理器801提供指令和数据。存储器804的一部分还可以包括非易失性随机存取存储器。例如,存储器804还可以存储设备类型的信息。该输入设备802可以包括触控板、指纹采传感器(用于采集用户的指纹信息)、麦克风、实体键盘等,输出设备803可以包括显示器(LCD等)、扬声器等。The
具体实现中,本发明实施例中所描述的处理器801、存储器804、输入设备802和输出设备803可执行本发明实施例提供的图2或者图4所述的方法实施例所描述的实现方式,也可执行本发明实施例图7所描述的页面处理装置的实现方法,在此不再赘述。In specific implementation, the
在本发明的另一实施例中提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时实现本发明实施例提供的图2或者图4所述的方法实施所描述的实现方式,所述计算机可读存储介质可以是前述任一实施例所述的终端设备的内部存储单元,例如终端设备的硬盘或内存。所述计算机可读存储介质也可以是所述终端设备的外部存储设备,例如所述终端设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述计算机可读存储介质还可以既包括所述终端设备的内部存储单元也包括外部存储设备。所述计算机可读存储介质用于存储所述计算机程序以及所述终端设备所需的其他程序和数据。所述计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。In another embodiment of the present invention, a computer-readable storage medium is provided, and the computer-readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions implement the present invention when executed by a processor The method described in FIG. 2 or FIG. 4 provided in this embodiment implements the described implementation manner, and the computer-readable storage medium may be an internal storage unit of the terminal device described in any of the foregoing embodiments, such as a hard disk of the terminal device or Memory. The computer-readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the terminal device ) card, flash card (Flash Card) and so on. Further, the computer-readable storage medium may also include both an internal storage unit of the terminal device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the terminal device. The computer-readable storage medium can also be used to temporarily store data that has been or will be output.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取可读存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, When the program is executed, it may include the flow of the embodiments of the above-mentioned methods.
其中,所述的可读存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。The readable storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM) or the like.
以上所揭露的仅为本发明的部分实施例而已,当然不能以此来限定本发明之权利范围,本领域普通技术工作人员可以理解实现上述实施例的全部或部分流程,并依本发明权利要求所作的等同变化,仍属于本发明所涵盖的范围。The above disclosure is only a part of the embodiments of the present invention, of course, the scope of the rights of the present invention cannot be limited by this. Those skilled in the art can understand all or part of the process of implementing the above embodiments, and follow the claims of the present invention. The equivalent changes made still belong to the scope covered by the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010359843.6A CN111639287A (en) | 2020-04-29 | 2020-04-29 | Page processing method and device, terminal equipment and readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010359843.6A CN111639287A (en) | 2020-04-29 | 2020-04-29 | Page processing method and device, terminal equipment and readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN111639287A true CN111639287A (en) | 2020-09-08 |
Family
ID=72328803
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010359843.6A Pending CN111639287A (en) | 2020-04-29 | 2020-04-29 | Page processing method and device, terminal equipment and readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111639287A (en) |
Cited By (28)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112100546A (en) * | 2020-09-11 | 2020-12-18 | 东软集团股份有限公司 | Form loading method and device, storage medium and electronic equipment |
| CN112395483A (en) * | 2020-11-13 | 2021-02-23 | 郑州阿帕斯数云信息科技有限公司 | Page rendering method and device based on tree structure |
| CN112540816A (en) * | 2020-11-30 | 2021-03-23 | 北京飞漫软件技术有限公司 | Remote page rendering method, device and equipment and computer storage medium |
| CN112650435A (en) * | 2020-12-23 | 2021-04-13 | 平安普惠企业管理有限公司 | Page content rolling processing method and device, computer equipment and storage medium |
| CN112667330A (en) * | 2020-12-18 | 2021-04-16 | 中国平安人寿保险股份有限公司 | Page display method and computer equipment |
| CN112905279A (en) * | 2021-02-03 | 2021-06-04 | 广州虎牙科技有限公司 | Page component rendering method and device, electronic equipment and storage medium |
| CN112905922A (en) * | 2021-01-26 | 2021-06-04 | 北京达佳互联信息技术有限公司 | Page loading method and device, electronic equipment, storage medium and program product |
| CN113051507A (en) * | 2021-03-29 | 2021-06-29 | 北京智慧星光信息技术有限公司 | Method and system for constructing bidirectional binding web page front end display based on json data |
| CN113760149A (en) * | 2021-01-28 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Page split screen system, method and device |
| CN113761431A (en) * | 2020-09-24 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method and device for checking integrity of page |
| CN113778393A (en) * | 2021-03-22 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Component generation method, device, computer system and computer-readable storage medium |
| CN113779351A (en) * | 2021-04-02 | 2021-12-10 | 北京京东拓先科技有限公司 | Page display method and device, electronic equipment and storage medium |
| CN113987321A (en) * | 2021-10-28 | 2022-01-28 | 北京金堤科技有限公司 | Page implementation method, device, electronic device and storage medium based on React framework |
| CN114003841A (en) * | 2021-10-11 | 2022-02-01 | 浙江安正科技股份有限公司 | A typesetting method and typesetting engine based on virtual tree |
| CN114117274A (en) * | 2021-11-19 | 2022-03-01 | 深圳市绿联科技股份有限公司 | Data rendering method and device, computer equipment and storage medium |
| CN114218052A (en) * | 2021-11-11 | 2022-03-22 | 深圳前海微众银行股份有限公司 | Service interaction graph generation method, device, equipment and storage medium |
| CN114217877A (en) * | 2021-12-17 | 2022-03-22 | 杉数科技(北京)有限公司 | Operation processing method, device, equipment and medium based on page interaction component |
| CN114637505A (en) * | 2020-12-16 | 2022-06-17 | 国信君和(北京)科技有限公司 | Method and device for extracting page content |
| CN114764360A (en) * | 2021-01-14 | 2022-07-19 | 钉钉控股(开曼)有限公司 | Virtual card generation method and interactive realization method and device thereof |
| CN114842117A (en) * | 2022-04-06 | 2022-08-02 | 邦彦技术股份有限公司 | Data processing method, electronic device and storage medium |
| CN114942814A (en) * | 2022-06-01 | 2022-08-26 | 咪咕视讯科技有限公司 | Page component focusing method, system, terminal device and medium |
| CN114969236A (en) * | 2022-07-25 | 2022-08-30 | 倍智智能数据运营有限公司 | Method for realizing user-defined map annotation based on React |
| CN115080892A (en) * | 2021-03-16 | 2022-09-20 | 京东科技控股股份有限公司 | List generation method and device, computer equipment and storage medium |
| CN115129415A (en) * | 2022-07-20 | 2022-09-30 | 平安科技(深圳)有限公司 | Cross-domain dragging method, device, equipment and storage medium based on webpage interface |
| CN115168774A (en) * | 2022-07-28 | 2022-10-11 | 济南浪潮数据技术有限公司 | Webpage rendering method and system, electronic equipment and computer readable storage medium |
| CN115756449A (en) * | 2022-12-02 | 2023-03-07 | 之江实验室 | A page multiplexing method, device, storage medium and electronic equipment |
| WO2023065707A1 (en) * | 2021-10-21 | 2023-04-27 | 深圳前海微众银行股份有限公司 | Method and apparatus for page display |
| CN117648914A (en) * | 2024-01-30 | 2024-03-05 | 深圳云集智造系统技术有限公司 | File generation method and device and terminal equipment |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120072831A1 (en) * | 2010-09-16 | 2012-03-22 | Gemtek Technology Co., Ltd | Method for creating a multi-lingual web page |
| CN109375918A (en) * | 2018-11-23 | 2019-02-22 | 天津字节跳动科技有限公司 | Interface rendering method, device, electronic equipment and the storage medium of small routine |
-
2020
- 2020-04-29 CN CN202010359843.6A patent/CN111639287A/en active Pending
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20120072831A1 (en) * | 2010-09-16 | 2012-03-22 | Gemtek Technology Co., Ltd | Method for creating a multi-lingual web page |
| CN109375918A (en) * | 2018-11-23 | 2019-02-22 | 天津字节跳动科技有限公司 | Interface rendering method, device, electronic equipment and the storage medium of small routine |
Cited By (42)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112100546B (en) * | 2020-09-11 | 2024-05-07 | 东软集团股份有限公司 | Form loading method and device, storage medium and electronic equipment |
| CN112100546A (en) * | 2020-09-11 | 2020-12-18 | 东软集团股份有限公司 | Form loading method and device, storage medium and electronic equipment |
| CN113761431A (en) * | 2020-09-24 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method and device for checking integrity of page |
| CN112395483A (en) * | 2020-11-13 | 2021-02-23 | 郑州阿帕斯数云信息科技有限公司 | Page rendering method and device based on tree structure |
| CN112395483B (en) * | 2020-11-13 | 2024-03-01 | 郑州阿帕斯数云信息科技有限公司 | Page rendering method and device based on tree structure |
| CN112540816A (en) * | 2020-11-30 | 2021-03-23 | 北京飞漫软件技术有限公司 | Remote page rendering method, device and equipment and computer storage medium |
| CN114637505A (en) * | 2020-12-16 | 2022-06-17 | 国信君和(北京)科技有限公司 | Method and device for extracting page content |
| CN112667330A (en) * | 2020-12-18 | 2021-04-16 | 中国平安人寿保险股份有限公司 | Page display method and computer equipment |
| CN112667330B (en) * | 2020-12-18 | 2024-02-09 | 中国平安人寿保险股份有限公司 | Page display method and computer equipment |
| CN112650435A (en) * | 2020-12-23 | 2021-04-13 | 平安普惠企业管理有限公司 | Page content rolling processing method and device, computer equipment and storage medium |
| CN114764360A (en) * | 2021-01-14 | 2022-07-19 | 钉钉控股(开曼)有限公司 | Virtual card generation method and interactive realization method and device thereof |
| CN112905922A (en) * | 2021-01-26 | 2021-06-04 | 北京达佳互联信息技术有限公司 | Page loading method and device, electronic equipment, storage medium and program product |
| CN113760149A (en) * | 2021-01-28 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Page split screen system, method and device |
| CN113760149B (en) * | 2021-01-28 | 2025-08-19 | 北京沃东天骏信息技术有限公司 | Page split screen system, method and device |
| CN112905279A (en) * | 2021-02-03 | 2021-06-04 | 广州虎牙科技有限公司 | Page component rendering method and device, electronic equipment and storage medium |
| CN115080892A (en) * | 2021-03-16 | 2022-09-20 | 京东科技控股股份有限公司 | List generation method and device, computer equipment and storage medium |
| CN113778393A (en) * | 2021-03-22 | 2021-12-10 | 北京沃东天骏信息技术有限公司 | Component generation method, device, computer system and computer-readable storage medium |
| CN113778393B (en) * | 2021-03-22 | 2025-05-16 | 北京沃东天骏信息技术有限公司 | Component generation method, device, computer system and computer readable storage medium |
| CN113051507A (en) * | 2021-03-29 | 2021-06-29 | 北京智慧星光信息技术有限公司 | Method and system for constructing bidirectional binding web page front end display based on json data |
| CN113051507B (en) * | 2021-03-29 | 2023-11-21 | 北京智慧星光信息技术有限公司 | Method and system for constructing bidirectional binding web page front-end display based on json data |
| CN113779351A (en) * | 2021-04-02 | 2021-12-10 | 北京京东拓先科技有限公司 | Page display method and device, electronic equipment and storage medium |
| CN114003841A (en) * | 2021-10-11 | 2022-02-01 | 浙江安正科技股份有限公司 | A typesetting method and typesetting engine based on virtual tree |
| WO2023065707A1 (en) * | 2021-10-21 | 2023-04-27 | 深圳前海微众银行股份有限公司 | Method and apparatus for page display |
| CN113987321A (en) * | 2021-10-28 | 2022-01-28 | 北京金堤科技有限公司 | Page implementation method, device, electronic device and storage medium based on React framework |
| CN114218052A (en) * | 2021-11-11 | 2022-03-22 | 深圳前海微众银行股份有限公司 | Service interaction graph generation method, device, equipment and storage medium |
| CN114218052B (en) * | 2021-11-11 | 2023-08-29 | 深圳前海微众银行股份有限公司 | A method, device, equipment and storage medium for generating a business interaction diagram |
| CN114117274B (en) * | 2021-11-19 | 2024-08-16 | 深圳市绿联科技股份有限公司 | Data rendering method, device, computer equipment and storage medium |
| CN114117274A (en) * | 2021-11-19 | 2022-03-01 | 深圳市绿联科技股份有限公司 | Data rendering method and device, computer equipment and storage medium |
| CN114217877A (en) * | 2021-12-17 | 2022-03-22 | 杉数科技(北京)有限公司 | Operation processing method, device, equipment and medium based on page interaction component |
| CN114842117A (en) * | 2022-04-06 | 2022-08-02 | 邦彦技术股份有限公司 | Data processing method, electronic device and storage medium |
| CN114842117B (en) * | 2022-04-06 | 2025-06-10 | 邦彦技术股份有限公司 | Data processing method, electronic device and storage medium |
| CN114942814B (en) * | 2022-06-01 | 2023-07-11 | 咪咕视讯科技有限公司 | Focus method, system, terminal device and medium of page component |
| CN114942814A (en) * | 2022-06-01 | 2022-08-26 | 咪咕视讯科技有限公司 | Page component focusing method, system, terminal device and medium |
| CN115129415B (en) * | 2022-07-20 | 2025-08-19 | 平安科技(深圳)有限公司 | Cross-domain dragging method, device, equipment and storage medium based on webpage interface |
| CN115129415A (en) * | 2022-07-20 | 2022-09-30 | 平安科技(深圳)有限公司 | Cross-domain dragging method, device, equipment and storage medium based on webpage interface |
| CN114969236A (en) * | 2022-07-25 | 2022-08-30 | 倍智智能数据运营有限公司 | Method for realizing user-defined map annotation based on React |
| CN115168774A (en) * | 2022-07-28 | 2022-10-11 | 济南浪潮数据技术有限公司 | Webpage rendering method and system, electronic equipment and computer readable storage medium |
| CN115168774B (en) * | 2022-07-28 | 2025-08-19 | 济南浪潮数据技术有限公司 | Webpage rendering method, webpage rendering system, electronic equipment and computer readable storage medium |
| US12159125B2 (en) | 2022-12-02 | 2024-12-03 | Zhejiang Lab | Page multiplexing method, page multiplexing device, storage medium and electronic apparatus |
| CN115756449A (en) * | 2022-12-02 | 2023-03-07 | 之江实验室 | A page multiplexing method, device, storage medium and electronic equipment |
| CN117648914B (en) * | 2024-01-30 | 2024-05-17 | 深圳云集智造系统技术有限公司 | File generation method and device and terminal equipment |
| CN117648914A (en) * | 2024-01-30 | 2024-03-05 | 深圳云集智造系统技术有限公司 | File generation method and device and terminal equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111639287A (en) | Page processing method and device, terminal equipment and readable storage medium | |
| CN106648945B (en) | Interface data testing method and device and electronic equipment | |
| US10048946B2 (en) | Converting visual diagrams into code | |
| US9430228B2 (en) | Verification of backward compatibility of software components | |
| US8381094B1 (en) | Incremental visual comparison of web browser screens | |
| US20110161840A1 (en) | Performance of template based javascript widgets | |
| CN110262783B (en) | Interface generation method and device and terminal equipment | |
| CN111580926A (en) | Model publishing method, model deployment method, apparatus, device and storage medium | |
| US20110022943A1 (en) | Document object model (dom) application framework | |
| US20170054790A1 (en) | System and Method for Object Compression and State Synchronization | |
| CN105683957A (en) | Style sheet speculative preloading | |
| CN112835568A (en) | A project construction method and device | |
| CN109725932B (en) | Method and device for generating description document of application component | |
| CN115113898A (en) | Dynamic update method, device, computer equipment and storage medium of micro-application | |
| CN112817595A (en) | Interface rendering method and device, storage medium and electronic equipment | |
| CN117972256A (en) | Linkage form generation method and device, electronic equipment and medium | |
| CN118069012A (en) | Carousel display method, device, electronic device and computer readable medium | |
| WO2024221415A1 (en) | Page rendering method and apparatus, device, and storage medium | |
| CN118673225A (en) | Page processing method, device, electronic device and storage medium | |
| CN110599112A (en) | Method and device for developing and maintaining network page | |
| CN111610908B (en) | Method for generating frame diagram, computer equipment and readable storage medium | |
| CN109783134B (en) | Front-end page configuration method and device and electronic equipment | |
| CN114489774B (en) | Web application packaging method, device, equipment and storage medium | |
| CN114327425B (en) | View generation method, device, electronic equipment and storage medium | |
| US11960560B1 (en) | Methods for analyzing recurring accessibility issues with dynamic web site behavior and devices thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20200908 |
|
| WD01 | Invention patent application deemed withdrawn after publication |