Self-rendering component generation method and device, page rendering method and device, equipment and medium
By automatically generating self-rendering components, the problem of high computational resource consumption during the rendering and display process of native UI frameworks is solved, achieving more efficient rendering and a better user experience.
Patent Information
- Application Number
- CN202510796890.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-11-07
AI Technical Summary
In existing technologies, native UI frameworks suffer from high computational resource consumption and low rendering efficiency during the rendering and display process. This is especially true when dealing with complex pages, which leads to longer rendering times and lower frame rates, resulting in a poor user experience.
By generating self-rendering components, independent self-rendering components are automatically generated based on the rendering information of the target application's reference shadow tree, avoiding the merging of multiple components and directly calling the self-rendering components for rendering to meet the display requirements of the target nodes.
It improves rendering efficiency and frame rate, reduces computing resource consumption, and enhances page display performance and user experience.
Smart Images

Figure CN120909577A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of page processing, and in particular to a self-rendering component generation method, a page rendering method, a device, equipment and a medium. BACKGROUND
[0002] The page of an application software needs to be displayed to a display device screen after being rendered. At present, the display device usually renders and displays the page based on the native UI framework of the operating system it carries for all page display requirements of the application software.
[0003] However, the native UI framework needs multiple components to be fused to realize a specific function in the rendering and display process, especially when facing a complex structure page, which will further increase the complexity of the page structure. In addition, the native UI framework will perform state monitoring during the rendering and display process, resulting in the problems of more required computing resources and lower rendering efficiency. Thus, the required computing resources and rendering time are greatly increased during rendering, which reduces the rendering efficiency and display frame rate, and the user experience is poor. SUMMARY
[0004] The present application provides a self-rendering component generation method, a page rendering method, a device, equipment and a medium, which can render map elements with multiple light and shadow effects for different electronic devices.
[0005] In a first aspect, the present application provides a self-rendering component generation method, which comprises:
[0006] Obtaining rendering information of multiple target nodes of a reference shadow tree of a target application; the target nodes are nodes associated with the function to be realized by the self-rendering component to be generated;
[0007] Obtaining generation parameters of the self-rendering component according to the rendering information;
[0008] Generating the self-rendering component based on the generation parameters; wherein the self-rendering component is an independent component automatically generated based on the generation parameters and not generated by multiple component fusion.
[0009] Optionally, the rendering information comprises structure information, style information and interaction information; and the generation parameters comprise basic structure parameters, appearance parameters and behavior logic parameters.
[0010] The basic structure parameters comprise type parameters and hierarchical relationship parameters of the self-rendering component with other self-rendering components; the appearance parameters comprise graphical element parameters and color parameters of the self-rendering component; and the behavior logic parameters comprise user interaction parameters, response event parameters and execution animation parameters of the self-rendering component.
[0011] obtaining the generation parameter of the self-rendering component according to the rendering information comprises:
[0012] determining a basic structure parameter of the self-rendering component according to the structure information;
[0013] determining an appearance parameter of the self-rendering component according to the style information;
[0014] determining a behavior logic parameter of the self-rendering component according to the interaction information;
[0015] fusing the basic structure parameter, the appearance parameter and the behavior logic parameter to obtain the generation parameter of the self-rendering component.
[0016] Optionally, the native UI framework of the running system of the target application comprises a target parameter corresponding to target information in the rendering information;
[0017] obtaining the generation parameter of the self-rendering component according to the rendering information comprises:
[0018] calling a target API interface corresponding to the target information in the native UI framework to obtain the target parameter;
[0019] taking the target parameter as the generation parameter, or adjusting the format of the target parameter according to the format of the generation parameter to generate the generation parameter.
[0020] In a second aspect, the present application provides a page rendering method, and the method comprises:
[0021] in response to a rendering event of a target page of a target application, obtaining a target shadow tree corresponding to the target page; the target shadow tree comprises rendering information of a shadow tree node and a shadow tree structure;
[0022] generating a drawing tree with the same tree structure as the shadow tree structure, the drawing tree comprising at least one self-rendering component corresponding to a shadow tree node, the self-rendering component being generated by the method in any one of the first aspect;
[0023] generating and displaying the target page according to the drawing tree.
[0024] Optionally, the drawing tree with the same tree structure as the shadow tree structure comprises:
[0025] obtaining a self-rendering component corresponding to each shadow tree node according to the rendering information of the shadow tree node, and a mapping relationship between the rendering information of the shadow tree node and the self-rendering component;
[0026] According to the shadow tree structure, an initial drawing tree with the same tree structure as the shadow tree structure is generated;
[0027] According to the position of the shadow tree node in the shadow tree structure, a target position of the self-rendering component in the structure of the initial drawing tree is determined;
[0028] The self-rendering component is filled into the initial drawing tree according to the target position, and the drawing tree is generated.
[0029] Optionally, the method further comprises:
[0030] The self-rendering component is obtained from the target application;
[0031] Alternatively,
[0032] The self-rendering component is obtained from the cloud.
[0033] In a third aspect, the present application provides a self-rendering component generation device, the device comprising:
[0034] A rendering information acquisition module is configured to acquire rendering information of a plurality of target nodes of a reference shadow tree of a target application; the target nodes are nodes associated with a function to be implemented by a self-rendering component to be generated;
[0035] A processing module is configured to obtain generation parameters of the self-rendering component according to the rendering information;
[0036] A control module is configured to generate the self-rendering component based on the generation parameters; the self-rendering component is an independent component automatically generated based on the generation parameters and not generated by multi-component fusion.
[0037] In a fourth aspect, the present application provides a page rendering device, the device comprising:
[0038] A target shadow tree acquisition module is configured to acquire a target shadow tree corresponding to a target page of a target application in response to a rendering event of the target page; the target shadow tree comprises rendering information of a shadow tree node and a shadow tree structure;
[0039] A generation module is configured to generate a drawing tree with the same tree structure as the shadow tree structure; the drawing tree comprises at least one self-rendering component corresponding to a shadow tree node; the self-rendering component is generated by the method of any one of the first aspect;
[0040] A display module is configured to generate and display the target page according to the drawing tree.
[0041] In a fifth aspect, the present application provides an electronic device, comprising a processor and a memory; the processor is in communication connection with the memory;
[0042] The memory stores computer instructions;
[0043] The processor executes the computer instructions stored in the memory to implement the method according to any one of the first aspect.
[0044] In a sixth aspect, the present application provides a display device, comprising: a processor, a memory and a display; the processor is in communication connection with the memory;
[0045] The memory stores computer instructions;
[0046] The processor executes the computer instructions stored in the memory to implement the method according to any one of the second aspect.
[0047] The display displays the page rendered by the processor.
[0048] In a seventh aspect, the present application provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, the computer execution instructions are executed by the processor to implement the method according to any one of the first aspect and the second aspect.
[0049] In an eighth aspect, the present application provides a computer program product, comprising a computer program or instructions, the computer program or instructions are executed by the processor to implement the method according to any one of the first aspect and the second aspect.
[0050] According to the scheme provided by the embodiments of the present application, first, the rendering information of the target node of the reference shadow tree of the target page of the target application is acquired; then, according to the rendering information, the independent component generated by not fusing the target node is generated as a self-rendering component, so that when the target node needs to be rendered, the self-rendering component can be directly called for rendering. Compared with the prior art, the function of the target node is realized by fusing a plurality of components in the original UI framework and then using the fused component generated after the fusion. Since the method of the present application does not increase the structural complexity of the target node due to the fusion of a plurality of components, the required computing resources and rendering time during rendering are not greatly improved, and the rendering efficiency and display frame rate are improved.
[0051] Since the self-rendering component is generated based on the rendering information of the target node, that is, the related parameters of the self-rendering component can be set according to the needs, when rendering the target node according to this, the display needs of the target node can be met as much as possible according to the needs, without the need to call multiple components that can meet the display needs from the native UI framework after fusion, and there is no problem that the existing components that meet part of the display needs do not exist in the native UI framework, resulting in that the better display performance cannot be achieved, thereby improving the display performance of the target page. In addition, since the self-rendering component and the target node have a corresponding relationship, in the process of rendering the target node, the self-rendering component corresponding to the target node can be quickly obtained, the rendering process is accelerated, the rendering efficiency is improved, and the frame rate is improved. BRIEF DESCRIPTION OF DRAWINGS
[0052] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0053] Figure 1 The flowchart of the first self-rendering component generation method provided by the embodiments of the application is shown in the figure.
[0054] Figure 2 The flowchart of the second self-rendering component generation method provided by the embodiments of the application is shown in the figure.
[0055] Figure 3 The flowchart of the third self-rendering component generation method provided by the embodiments of the application is shown in the figure.
[0056] Figure 4 The flowchart of the first page rendering method provided by the embodiments of the application is shown in the figure.
[0057] Figure 5 The flowchart of the page rendering method provided by the embodiments of the application is shown in the figure.
[0058] Figure 6 The flowchart of the second page rendering method provided by the embodiments of the application is shown in the figure.
[0059] Figure 7 The structural diagram of the self-rendering component generation device provided by the embodiments of the application is shown in the figure.
[0060] Figure 8 The structural diagram of the page rendering device provided by the embodiments of the application is shown in the figure.
[0061] Figure 9A structural schematic diagram of an electronic device 800 provided for an embodiment of the present application is shown in FIG. 1.
[0062] Figure 10 A structural schematic diagram of a display device 900 provided for an embodiment of the present application is shown in FIG. 2.
[0063] The specific embodiments of the present application have been shown in the above-described drawings, and will be described in more detail hereinafter. These drawings and written descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0064] In order to make the purposes, technical solutions and advantages of the present application more clear, the technical solutions of the present application will be described clearly and completely in the following with reference to the drawings in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative work fall within the scope of protection of the present application.
[0065] The following explains some terms related to the present application:
[0066] User Interface (UI): is the medium for interaction and information exchange between system and user, which realizes the conversion between internal form of information and form acceptable by human. User interface is the software related to the interaction and communication between user and hardware, which is designed to make user operate hardware conveniently and efficiently to achieve bidirectional interaction, complete the work expected to be completed by hardware, and define widely, including human-computer interaction and graphical user interface. There is user interface in the field of information exchange between human and machine.
[0067] UI rendering: is an important concept in computer graphics, which involves the process of converting user interface elements into visible images on the screen. This process usually involves multiple steps, including calculation, layout, color processing, and final pixel rendering. In UI development, the performance and efficiency of rendering are key factors, as they directly affect user experience and application response speed.
[0068] Shadow Tree: In the field of UI rendering, a shadow tree generally refers to a way of organizing and managing UI elements and their associated behaviors. A shadow tree only includes data, such as rendering information of nodes including pages and the structure of the shadow tree. Rendering information may include, for example, node name, type, attributes, and styles. In practical applications, an independent UI component can be created based on a node in the shadow tree. In this way, complex user interfaces can be better managed and maintained, improving code reusability and reliability.
[0069] Layer Tree: Also known as Layer Tree, it is a virtual tree structure composed of layers, used to describe the superimposition relationship and rendering order of all visible elements on the interface. Each layer represents a visually distinguishable drawing unit, used to organize and represent elements in the UI. In the layer tree, each layer exists as a node, and nodes are connected to each other through parent-child relationships, forming a hierarchical structure. This structure enables developers to more effectively manage and manipulate interface elements.
[0070] The existing application software (hereinafter referred to as "application") page rendering usually relies on the UI framework provided by the operating system of the display device (such as mobile phone, tablet, computer, etc.), also known as native UI framework. In this case, when the application page has display requirements, the display device calls the native UI framework rendering interface to render the page based on the description file (such as XML file) of the page to be displayed.
[0071] However, this rendering method has many disadvantages. For example, some application pages may have special display requirements, such as the display of certain special animations. However, the rendering strategy of the native UI framework may not be able to meet this special display requirement, resulting in limited display performance of the application page. That is, rendering the application page based on the native UI framework will not be able to surpass the performance of the native UI framework.
[0072] In addition, the structure of some pages can be complex and have its own structural organization. For example, the structure of some pages can fit the tree structure of the native UI framework, but the function of the pages of some applications can be complex, such as the function of a node in the tree structure corresponding to the page needs to be implemented by combining multiple original components supported by the native UI framework, that is, the structure of the node is a multi-child node structure, resulting in a tree structure of the page that is different from the tree structure of the native UI framework. In this case, to render and display the pages of the application, the tree structure of the page needs to be converted into the tree structure of the native UI first, and then rendered. This has the problem of low rendering efficiency, not only low frame rate, but also waste of performance, and also cannot fully adapt to the existing component behavior of the pages of the application, reducing the display effect of the pages and affecting the user experience.
[0073] The inventors consider that if the UI rendering strategy can be adapted according to the actual display requirements of the pages of the application, the initial display requirements of the pages of the application can be met, and the display effect of the pages can be improved. Moreover, since the UI rendering strategy is adapted to the pages of the application, the tree structure conversion is not needed, so that the frame rate can be improved during page display, and thus the display efficiency and user experience can be improved.
[0074] Therefore, the present application provides a self-rendering component generation method and a page rendering method. First, according to the rendering information of the target nodes of the reference shadow tree of the target application, a self-rendering component corresponding to the target node is generated, which is an independent component automatically generated based on generation parameters and not generated by multiple component fusion. Subsequently, when the target page of the target application needs to be displayed, the display device acquires the target shadow tree corresponding to the target page, selects the corresponding self-rendering component that has been generated in advance according to the shadow tree nodes in the target shadow tree, constructs a rendering tree with the same structure as the target shadow tree, and renders and displays the target page based on the rendering tree, without calling multiple components that can meet the display requirements from the native UI framework, and without the problem of not being able to achieve good display performance due to the absence of existing components in the native UI framework that can meet part of the display requirements, thereby improving the display performance of the target page. In addition, since the self-rendering component and the target node have a corresponding relationship, the self-rendering component corresponding to the target node can be quickly acquired during rendering of the target node, the rendering process is accelerated, the rendering efficiency is improved, and the frame rate is improved.
[0075] The technical solutions of the present application will be described in detail below in conjunction with specific embodiments. The following specific embodiments can be combined with each other, and some embodiments can not be described in detail for the same or similar concepts or processes.
[0076] The present application includes two parts, which are a self-rendering component generation method and a page rendering method based on the self-rendering component. First, the self-rendering component generation method will be described below. The execution subject of this part is an electronic device, such as a mobile phone, a tablet, a computer, a server, etc.
[0077] Figure 1 The first self-rendering component generation method provided in the embodiments of the present application is shown in the flowchart. As shown in the figure, the method can include the following steps: Figure 1
[0078] S101, obtaining the rendering information of a plurality of target nodes of a reference shadow tree of a target application.
[0079] The target nodes are associated with the functions to be implemented by the self-rendering component to be generated.
[0080] The target application can be any application program. The target application includes a target page to be displayed to a display device (such as a mobile phone, a tablet, a computer, etc.). The target nodes in the reference shadow tree of the target application are associated with the functions to be implemented by the corresponding target page, such as the structure, style, and interactive function of the target page. The reference shadow tree of the target application can be a plurality of shadow trees corresponding to part or all of the target pages included in the target application.
[0081] The self-rendering component is a component automatically generated based on the rendering information of the target nodes, which can implement the functions corresponding to the target nodes. That is, one self-rendering component can implement the functions corresponding to the target nodes without the need to fuse a plurality of components to implement the functions of the target nodes. Compared with the components in the native UI framework, for a target node with relatively complex functions, a plurality of native components need to be fused to implement the functions of the target node, resulting in that one target node actually includes a plurality of child nodes, and each child node corresponds to one of the plurality of native components. However, the self-rendering component of the present application directly corresponds to the target node, that is, the target node does not need to implement the corresponding functions through a plurality of child nodes, that is, one target node is actually only one independent node. The above-mentioned native UI framework can be the UI framework of any operating system, such as the native UI framework of the Android operating system, or the native UI framework of the IOS operating system, etc.
[0082] The present application does not limit the content of the rendering information, which is related to the rendering requirement of the target node. For example, in some embodiments, the rendering information may, for example, include attribute information, style information, and interaction information. The attribute information and style information mentioned herein may, for example, be defined based on the World Wide Web Consortium (W3C) standard. For example, the attribute information may, for example, include the type of the target node (for example, a picture type or a text type), the basic information of the node corresponding to the type, and the relationship between the node and other nodes, for example, the relationship between a child node and a parent node.
[0083] The style information may, for example, include information in the dimensions of color and background, border and shadow, size and position, font and text style, animation, and the like.
[0084] The interaction information may, for example, include user interaction behaviors that can be performed on the target node. For example, if the target node is a node of a type that can be interacted with, the interaction information corresponding to the target node may, for example, include the type and timing of events that can be controlled to be generated by the target node, for example, a click event that can be accepted by the node, a scroll end attribute that indicates that a corresponding event is generated when scrolling to the bottom, and the like.
[0085] For example, the electronic device may, for example, obtain the rendering information of the target node of the reference shadow tree from another electronic device, or the electronic device may, for example, obtain the reference shadow tree of the target page according to the description file of the target page of the target application, and then obtain the rendering information of the target node in the reference shadow tree. The way in which the electronic device obtains the reference shadow tree of the target page according to the description file of the target page of the target application may, for example, refer to the prior art, and will not be described here.
[0086] S102, obtaining the generation parameter of the self-rendering component according to the rendering information.
[0087] For example, the generation parameter of the self-rendering component may, for example, be obtained according to the rendering information and the generation parameter obtaining rule of the self-rendering component. The generation parameter obtaining rule of the self-rendering component is used to automatically obtain the generation parameter of the self-rendering component required to be generated according to the rendering information.
[0088] The electronic device can extract the function, structure, style, and the like of the target node from the rendering information according to the generation parameter acquisition rule, and convert them into generation parameters capable of generating the self-rendering component. For example, the electronic device can determine, according to a preset rule or code, generation parameters associated with the function, structure, style, and the like of the target node extracted from the rendering information, according to the generation parameter acquisition rule, and take these generation parameters as the generation parameters of the self-rendering component.
[0089] The specific content included in the generation parameters and the display device of the target node to be displayed are related, and those skilled in the art can set the parameter dimensions of the generation parameters of the self-rendering component according to the display requirements. For example, if the display device needs to display the target node, it needs to obtain the basic structure parameters of the target node, and the generation parameters of the self-rendering component may, for example, include the basic structure parameters.
[0090] For example, the generation parameters of the self-rendering component may, for example, include one or more of the basic structure parameters, appearance parameters, behavior logic parameters, or other parameters. Among them, the basic structure parameters may, for example, include type parameters and hierarchical relationship parameters of the self-rendering component; the appearance parameters may, for example, include graphical element parameters and color parameters of the self-rendering component; and the behavior logic parameters may, for example, include user interaction parameters, response event parameters, and execution animation parameters of the self-rendering component.
[0091] The type parameters may, for example, include picture type, text type, component type, and the like. The hierarchical relationship parameters may, for example, be parameters representing the hierarchical relationship (e.g., whether it is a parent-child relationship, a parallel relationship, or the like) between the target node and other nodes. The graphical element parameters may, for example, be parameters representing the size and the like of the graphical elements included in the target node. The color parameters are parameters representing the color of the target node. The user interaction parameters are parameters representing the interaction that the user can have with the target node, for example, whether an event can be triggered by a click action or the like. The response event parameters may, for example, be parameters representing the type of event that can be triggered in response to the user's interaction with the target node, for example, a parameter representing that a new page can be opened based on the user's click action on the component represented by the target node. The execution animation parameters may, for example, be parameters representing the animation that will be executed in response to the user's interaction with the target node. It should be understood that the above parameters may, in some scenarios, have other names, but the meanings represented are the same, which are not limited herein.
[0092] In a possible implementation, the function of extracting the function, structure, style, and the like of the target node from the rendering information and converting the information into the corresponding production parameter can be implemented by a corresponding code or program. The specific code and program can be configured according to actual needs. For example, the code or program can extract the key fields such as the parameter configuration and attribute information in the rendering information, and generate the corresponding production parameter according to the fields (for example, the corresponding production parameter can be generated by converting the field format, content, or the like, or a mapping relationship between the field and the production parameter can be pre-constructed, and the corresponding production parameter can be obtained according to the extracted field and the mapping relationship).
[0093] In another possible implementation, after the function, structure, style, and the like of the target node are extracted from the rendering information, the corresponding API interface in the native UI framework can be called according to the information to obtain the corresponding target parameter. Then, the production parameter that can be used to generate the self-rendering component is generated according to the target parameter.
[0094] In S103, the self-rendering component is generated based on the production parameter.
[0095] The self-rendering component is an independent component that is automatically generated based on the production parameter and is not generated by multi-component fusion.
[0096] Since the production parameter is generated based on the function, structure, style, and the like of the target node represented in the rendering information, the production parameter can also represent the function, structure, style, and the like of the target node. Therefore, generating the corresponding self-rendering component based on the production parameter can realize the function, structure, style, and the like of the target node.
[0097] Specifically, how to generate the self-rendering component according to the production parameter can refer to the process of how to construct the native UI component by using a specific parameter when constructing the native UI component, which will not be described herein.
[0098] In this step, the electronic device generates the self-rendering component of the target node according to the production parameter, so that when the display device needs to render the page using the target node, the display device can directly call the self-rendering component corresponding to the target node to realize the rendering of the target node based on the parameters of the corresponding self-rendering component adapted to the target node, so as to better meet the rendering and display requirements of the target node.
[0099] Optionally, the electronic device can generate the self-rendering component of the target node according to the rendering information; or the electronic device can send the rendering information to another electronic device to generate the self-rendering component of the target node.
[0100] In this embodiment, the electronic device first acquires rendering information of a plurality of target nodes of a reference shadow tree of a target application; then, obtains generation parameters of a self-rendering component according to the rendering information, and generates the self-rendering component based on the generation parameters, so that when the target node needs to be rendered, the target node can be separated from the native UI framework and directly implemented self-rendering based on the self-rendering component. Through this implementation manner, the electronic device can automatically and in advance generate the corresponding self-rendering component according to the display requirement of the target node in the reference shadow tree of the target application, and then can implement the rendering of the target node by directly obtaining the self-rendering component suitable for the rendering task without calling the native UI framework when there is a subsequent rendering task of the target application.
[0101] In addition, since the self-rendering component is a component that can separately implement the function of the target node in the target application, in the subsequent rendering task, the target node does not need to be rendered in the manner of fusion of a plurality of native components, which reduces the problem of different tree structures caused by fusion of a plurality of components for rendering one target node, reduces tree conversion in the rendering process, and thus can improve the rendering efficiency, improve the display frame rate of the page obtained by rendering, and reduce the resource consumption of rendering.
[0102] In the following, taking an example of the rendering information including structure information, style information and interaction information, and the generation parameters including basic structure parameters, appearance parameters and behavior logic parameters, the electronic device specifically how to obtain the generation parameters of the self-rendering component according to the rendering information, that is, the step S102 in the above embodiment, is exemplarily described through a specific embodiment. Figure 2 As shown in the flowchart of the second self-rendering component generation method provided by the embodiments of the present application, Figure 2 The method may, for example, include the following steps:
[0103] S201, determining the basic structure parameters of the self-rendering component according to the structure information.
[0104] The basic structure parameters include type parameters and hierarchical relationship parameters of the self-rendering component with other self-rendering components.
[0105] The electronic device can store a mapping relationship between the structure information and the basic structure parameters, and can determine the basic structure parameters of the self-rendering component according to the structure information and the mapping relationship between the structure information and the basic structure parameters. Through this implementation manner of pre-storing the mapping relationship, the electronic device can quickly and accurately obtain the basic structure parameters based on the structure information, and improve the generation efficiency of the generation parameters.
[0106] Alternatively, the electronic device can analyze the structure information through a preset algorithm model according to the structure information. The algorithm model can be trained through a large amount of structure information and basic structure parameter corresponding relationship data, and can identify key features in the structure information, such as component layout mode, function positioning, interaction demand, etc. Through analysis and calculation of these key features, the algorithm model can dynamically derive the basic structure parameters of the self-rendering component that match the current structure information, including but not limited to component type (such as button, text box, list, etc.), hierarchical position of the component in the overall architecture (such as whether it is a parent component, a child component, and the order in the sibling components, etc.). This implementation based on the algorithm model enables the electronic device to flexibly cope with complex and variable structure information, and more accurately determine the basic structure parameters of the self-rendering component.
[0107] S202, determining appearance parameters of the self-rendering component according to the style information.
[0108] The appearance parameters include graphical element parameters and color parameters of the self-rendering component.
[0109] The electronic device can store a mapping relationship between the style information and the appearance parameters, and can determine the appearance parameters of the self-rendering component according to the style information and the mapping relationship between the style information and the appearance parameters.
[0110] Alternatively, the electronic device can process the style information by means of a preset style analysis algorithm according to the style information. The style analysis algorithm can be trained through a large amount of style information and appearance parameter corresponding relationship data, and has strong feature recognition capability. The style analysis algorithm can deeply analyze key elements in the style information, such as shape description (circle, square, polygon, etc.) of the component, size specification (length, width, height or radius, etc.), color coding (RGB value, hexadecimal color code, etc.), etc. Through detailed analysis and calculation of these key elements, the algorithm can dynamically derive the appearance parameters of the self-rendering component that match the current style information. For example, when the style information contains a description of a gradient color, the algorithm can analyze the starting color, ending color, gradient direction, etc. This implementation based on the style analysis algorithm enables the electronic device to flexibly process various complex and diverse style information, and more accurately determines the appearance parameters of the self-rendering component.
[0111] S203, determining behavior logic parameters of the self-rendering component according to the interaction information.
[0112] The behavior logic parameters include user interaction parameters, response event parameters, and execution animation parameters of the self-rendering component.
[0113] The electronic device can store a mapping relationship between the interaction information and the behavior logic parameter, and can determine the appearance parameter of the self-rendering component according to the interaction information and the mapping relationship between the interaction information and the behavior logic parameter.
[0114] Alternatively, the electronic device can determine the behavior logic parameter of the self-rendering component by analyzing the interaction information using a preset interaction logic analysis model. The interaction logic analysis model can be trained by a large amount of interaction information and behavior logic parameter corresponding relationship data, and can perform in-depth analysis on the interaction information. The interaction logic analysis model can identify key interaction intents in the interaction information, such as user gesture operations (swiping, long pressing, double clicking, etc.), target objects of the operations (the component itself, specific elements within the component, etc.), and desired effects (such as data refreshing, page jumping, etc.). Through analysis and processing of these key interaction intents, the interaction logic analysis model can dynamically derive the behavior logic parameter of the self-rendering component that matches the current interaction information.
[0115] S204, fusing the basic structure parameter, the appearance parameter and the behavior logic parameter to obtain the generation parameter of the self-rendering component.
[0116] In this step, the electronic device can directly use the basic structure parameter, the appearance parameter and the behavior logic parameter as the generation parameter of the self-rendering component. Alternatively, the electronic device can adaptively adjust the corresponding parameters according to the parameter influence between at least two of the basic structure parameter, the appearance parameter and the behavior logic parameter, and then fuse the basic structure parameter, the appearance parameter and the behavior logic parameter to obtain the generation parameter of the self-rendering component.
[0117] The method provided by the embodiments of the present application determines the basic structure parameter of the self-rendering component according to the structure information, determines the appearance parameter of the self-rendering component according to the style information, determines the behavior logic parameter of the self-rendering component according to the interaction information, and then fuses the basic structure parameter, the appearance parameter and the behavior logic parameter to obtain the generation parameter of the self-rendering component, so as to accurately obtain the parameters of the self-rendering component for generating the target node according to the structure information, the style information and the interaction information of the target node, so that the self-rendering component can adapt to the structure information, the style information and the interaction information of the target node, and meet the display requirements of the target node in these dimensions.
[0118] The following takes an example of a native UI framework of a running system of a target application including target parameters corresponding to target information, and obtaining the generation parameter through the native UI framework, to illustrate how the electronic device obtains the generation parameter of the self-rendering component according to the rendering information through specific embodiments. Figure 3 The flowchart of the third self-rendering component generation method provided by the embodiments of the present application is as follows: Figure 3As shown, the method may, for example, include the following steps:
[0119] S301, if the target parameter corresponding to the target information is included in the native UI framework, calling the target API interface corresponding to the target information in the native UI framework to obtain the target parameter.
[0120] The target information includes at least one of the structure information, the style information, and the interaction information, that is, the target information is one or more of the rendering information. The target information represents the function to be implemented, and the target parameter corresponding to the target information is a specific parameter for implementing the function.
[0121] For example, if the structure information in the rendering information has a target parameter in the native UI framework that can implement the structure represented by the structure information, the target API interface corresponding to the structure information can be called in the native UI framework to obtain the target parameter corresponding to the structure information. Alternatively, if the structure information and the style information in the rendering information have target parameters in the native UI framework that can implement the structure represented by the structure information and the style represented by the style information, respectively, the target API interfaces corresponding to the structure information and the style information can be called in the native UI framework, respectively, to obtain the target parameters corresponding to the structure information and the style information, respectively.
[0122] For example, the electronic device can store the mapping relationship between the structure information, the style information, and the interaction information of the target node and the interfaces in the API interface library of the native UI framework. The electronic device obtains the target API interface in the API interface library of the native UI framework according to the structure information, the style information, and the interaction information of the target node, and the above mapping relationship. The present application does not limit the number of target API interfaces called, which is determined according to the information included in the structure information, the style information, and the interaction information.
[0123] Some rendering parameters of the native UI framework may be adapted to the rendering requirements of the target node, that is, part or all of the parameters of the self-rendering component that need to be configured may be the same as those in the native UI framework, that is, no additional setting is needed for the parameters. Therefore, by directly calling the target API interface of the native UI framework to obtain the generation parameter, the self-rendering component can be generated without reconfiguring the parameters of the self-rendering component, and only the related parameters of the native UI framework need to be called to obtain the generation parameter of the self-rendering component, improving the operation convenience and the efficiency of obtaining the generation parameter.
[0124] Optionally, all generation parameters of the self-rendering component can be obtained by calling the target API interface of the native UI framework; or, some generation parameters of the self-rendering component can be obtained by calling the target API interface of the native UI framework, while some generation parameters can be obtained by the aforementioned pre-stored mapping relationship. This application does not limit this.
[0125] S302. Use the target parameter as the generation parameter, or adjust the format of the target parameter according to the format of the generation parameter to generate the generation parameter.
[0126] One possible implementation is that if the target parameter is one that can be directly used to generate a self-rendering component, then it can be directly used as part of the generation parameters for the self-rendering component. For example, if the structural information of the target node can be obtained through the target API interface of the native UI framework, but the style and interaction information of the target node cannot be obtained through the target API interface of the native UI framework, then the target parameters corresponding to the structural information can be obtained from the target API interface of the native UI framework, and then... Figure 2 The implementation method generates the appearance parameters and behavioral logic parameters corresponding to the style information and interaction information of the target node, and then merges the target parameters, appearance parameters, and behavioral logic parameters to obtain the generation parameters of the self-rendering component.
[0127] Another possible implementation is that if the target parameter is not directly usable for generating a self-rendering component—for example, if its format needs to be fine-tuned before it can be used—then a corresponding fine-tuning algorithm can be configured based on the difference between the target parameter's format and the format of the generated parameters for the self-rendering component to perform the fine-tuning operation. Then, based on the target parameter and the corresponding fine-tuning operation, the corresponding generated parameters or a portion of the generated parameters are obtained.
[0128] The method provided in this application embodiment, if the native UI framework includes target parameters corresponding to target information, obtains the target parameters by calling the target API interface corresponding to the target information in the native UI framework, and obtains the generation parameters based on the target parameters. This allows direct calling of the target API interface of the native UI framework to obtain the generation parameters, eliminating the need to reconfigure the parameters of the self-rendering component. Instead, it only requires calling the relevant parameters of the native UI framework to obtain the generation parameters of the self-rendering component, thus improving the ease of operation and the efficiency of obtaining the generation parameters.
[0129] The page rendering method provided in this application will be illustrated below through specific embodiments. The execution subject of this method is a display device, such as a mobile phone, tablet, or computer. Figure 4 A flowchart illustrating the first page rendering method provided in this application embodiment is shown below.Figure 4 As shown, the method may, for example, include the following steps:
[0130] S401, in response to a rendering event of a target page of a target application, obtaining a target shadow tree corresponding to the rendering event.
[0131] The target shadow tree includes rendering information of a shadow tree node and a shadow tree structure. The shadow tree node is a node to be rendered included in the target shadow tree. The shadow tree structure represents the hierarchical positional relationship of each node in the shadow tree.
[0132] The target application may be any application program that has generated a corresponding self-rendering component through the aforementioned self-rendering component generation method. The target page may be any page to be displayed of the target application. The rendering event of the target page is that the target page needs to be rendered before being displayed to the display device, i.e., a rendering request for the target page.
[0133] The target shadow tree may be extracted from a description file of the target page. The present application does not limit the type of the description file, which may be an XML file or an HTML file, for example. For example, the display device may generate a target shadow tree corresponding to the rendering data in the description file, so as to implement step-by-step rendering of the target page, and thus display the target page of the target application on the screen of the display device. Alternatively, the display device may generate a target shadow tree corresponding to the target page according to a Document Object Model Tree (DOM Tree) or a Render Tree of the target page. The generation method may refer to the prior art, and thus will not be described here.
[0134] For example, the display device may also store a mapping relationship between the rendering event of the target page of the target application and the target shadow tree. The display device may obtain the target shadow tree corresponding to the rendering event of the target page of the target application by using the mapping relationship.
[0135] S402, generating a drawing tree with the same tree structure as the shadow tree structure.
[0136] The drawing tree includes at least one self-rendering component corresponding to the shadow tree node, which is generated by the self-rendering component generation method of any one of the above embodiments. The drawing tree is a process product in the target page rendering process, which includes the structure of the drawing tree and the self-rendering component corresponding to the structure. The display device may subsequently render and display the target page according to the drawing tree.
[0137] In this step, the hierarchical relationship between the shadow tree nodes in the target shadow tree can be determined by analyzing the shadow tree structure of the target shadow tree. Then, according to the hierarchical relationship between the shadow tree nodes, a drawing tree with the same tree structure and not including components (including self-rendering components) in the nodes is generated. That is, the drawing tree generated at this time is only the initial drawing tree with the same tree structure as the shadow tree structure and the nodes not corresponding to the components.
[0138] Subsequently, according to the self-rendering components corresponding to each shadow tree node, the self-rendering components are filled into the corresponding nodes of the initial drawing tree, and a drawing tree with the same tree structure as the shadow tree structure is generated.
[0139] Exemplarily, Figure 5 A page rendering process schematic diagram provided by an embodiment of the present application is shown in Figure 5 As shown, after the display device obtains the target shadow tree, the display device generates a drawing tree with the same tree structure as the shadow tree structure according to the shadow tree.
[0140] Optionally, the display device can send the target shadow tree to other electronic devices, such as a server of the target application, to obtain a drawing tree corresponding to the target shadow tree sent by the other electronic devices. Alternatively, the display device can generate a drawing tree corresponding to the target shadow tree according to the target shadow tree.
[0141] Exemplarily, the display device can store, for example, a mapping relationship between the rendering information of the shadow tree nodes and the self-rendering components. The display device can obtain the self-rendering components corresponding to the shadow tree nodes in the target shadow tree according to the target shadow tree and the mapping relationship between the rendering information of the shadow tree nodes and the self-rendering components; and then generate a drawing tree corresponding to the shadow tree according to the shadow tree structure and the obtained self-rendering components.
[0142] S403, generating and displaying a rendered target page according to the drawing tree.
[0143] Since the drawing tree includes the structure of the drawing tree and the self-rendering components arranged in the structure. The structure of the drawing tree represents the hierarchical relationship of the nodes of the target page, and the self-rendering components represent the drawing operations that need to be performed on the nodes of the page. Therefore, subsequently, the display device can generate and display a rendered target page by reading the information of the drawing tree.
[0144] Optionally, the display device generates and displays the corresponding target page according to the drawing tree. Alternatively, the display device can send the drawing tree to other electronic devices, obtain the target page generated by the other electronic devices, and then display the target page to the screen of the display device.
[0145] Optionally, continuing to refer to Figure 5According to the structure of the drawing tree included in the drawing tree and the self-rendering component, the display device can generate at least one layer tree corresponding to the drawing tree; the layer tree corresponds to a target page. For example, the display device can draw the node corresponding to the self-rendering component on the layer corresponding to the self-rendering component according to the parameters corresponding to the self-rendering component. Then, according to the structure of the drawing tree, at least one layer tree corresponding to the drawing tree is generated based on the node corresponding to the self-rendering component drawn on the layer. Then, the display device generates a rendered target page by rendering the at least one layer tree. For example, the display device can superimpose each layer according to the structure of the layer tree to generate the rendered target page.
[0146] In this embodiment, the display device first acquires a target shadow tree corresponding to a rendering event of a target page of a target application in response to the rendering event of the target page. Then, according to the shadow tree structure of the target shadow tree, a drawing tree with the same tree structure as the shadow tree structure is generated, and the drawing tree includes at least one self-rendering component corresponding to a shadow tree node. Then, a rendered target page is generated and displayed according to the drawing tree. Since the display device acquires the target shadow tree corresponding to the target page and then implements rendering of the target page by calling the self-rendering component generated by any of the above embodiments, the rendering of the target page can be independent of the performance limitation of the native UI framework, and the corresponding self-rendering component can be called for rendering based on the actual display requirements of the target page, thereby better displaying the target page, meeting the display requirements of the target page, and improving the user browsing experience.
[0147] In addition, since the self-rendering component is configured according to the shadow tree node of the target page, the display device does not need to perform complex tree structure conversion when rendering and displaying the target page to the screen, thereby improving the frame rate and display performance. Furthermore, the self-rendering component can be configured according to requirements, so when the display requirements of the shadow tree node of the target page change, the display of the shadow tree node can be adjusted by adjusting the self-rendering component corresponding to the shadow tree node, which is convenient to operate and further improves the usability of the method.
[0148] The following will illustrate how the display device generates a drawing tree with the same tree structure as the shadow tree structure through specific embodiments, i.e., step S402 in the above embodiments. Figure 6 The flowchart of the second page rendering method provided by the embodiments of the present application is shown in FIG. 4. Figure 6 As shown in FIG. 4, step S402 can include the following steps, for example.
[0149] S601, obtain, according to the rendering information of the shadow tree node and the mapping relationship between the rendering information of the shadow tree node and the self-rendering component, the self-rendering component corresponding to each shadow tree node.
[0150] Optionally, the display device can obtain the self-rendering component from the target application. For example, the installation data packet of the target application can include a self-rendering component library, and the number of self-rendering components included in the self-rendering component library is not limited in the present application. The display device can obtain the self-rendering component corresponding to the shadow tree node from the self-rendering component library according to the rendering information of the shadow tree node in the shadow tree and the mapping relationship between the rendering information and the self-rendering component.
[0151] Alternatively, the display device can obtain the self-rendering component from the cloud. The cloud, for example, can be a server of the target application. The cloud, for example, can store a self-rendering component library. The display device, for example, can obtain the self-rendering component corresponding to the shadow tree node from the self-rendering component library in the cloud according to the rendering information of the shadow tree node and the mapping relationship between the rendering information and the self-rendering component when it needs to render the target page of the target application.
[0152] S602, generate an initial drawing tree with the same structure as the shadow tree structure according to the shadow tree structure.
[0153] The initial drawing tree mentioned here is a tree structure without adding self-rendering components. For example, the display device can identify the shadow tree structure, and then generate the initial drawing tree according to the mapping relationship between the shadow tree structure and the initial drawing tree structure.
[0154] Since the structure of the initial drawing tree is the same as that of the shadow tree structure, and the initial drawing tree is used to fill the component to generate the drawing tree, it is not necessary to convert the tree structure during the rendering process of the rendering event because the structure of the drawing tree is different from that of the shadow tree structure, which reduces the rendering performance loss caused by the tree structure conversion, and further improves the display effect and rendering efficiency of the target page rendered accordingly, improves the display frame rate of the target page, and improves the user experience.
[0155] S603, determine the target position of the self-rendering component in the structure of the initial drawing tree according to the position of the shadow tree node in the shadow tree structure.
[0156] For example, since the nodes and the self-rendering components have a mutual mapping relationship through the rendering information of the nodes, that is, one node corresponds to one self-rendering component, and the shadow tree structure and the structure of the initial drawing tree also have a mutual mapping relationship, therefore, the self-rendering component corresponding to the node can be mapped to the target position corresponding to the position of the node in the shadow tree structure according to the position of the node in the shadow tree structure.
[0157] S604, fill the self-rendering component into the initial drawing tree according to the target position, to generate a drawing tree.
[0158] In this step, the display device fills the self-rendering component into the initial drawing tree according to the target position determined above, to generate a drawing tree corresponding to the shadow tree, so that the nodes in the target page can be drawn based on the drawing tree subsequently.
[0159] In this embodiment, the display device obtains the self-rendering component corresponding to each shadow tree node according to the rendering information of the shadow tree node and the mapping relationship between the rendering information of the shadow tree node and the self-rendering component; then, generates an initial drawing tree with the same structure as the shadow tree structure according to the shadow tree structure, and determines the target position of the self-rendering component in the structure of the initial drawing tree according to the position of the shadow tree node in the shadow tree structure. After that, the self-rendering component is filled into the initial drawing tree according to the target position, to generate a drawing tree. Through this implementation manner, the display device can accurately generate a drawing tree carrying the self-rendering component corresponding to the nodes in the target shadow tree according to the target shadow tree corresponding to the target page, so that the rendering and display of the target page can be realized based on the drawing tree subsequently. Since the tree structure of the drawing tree is the same as the shadow tree structure, the rendering performance loss caused by the conversion of the tree structure in the rendering process is reduced, the rendering efficiency and the display frame rate of the rendered target page are improved, and thus the display effect is improved.
[0160] Figure 7 A structural schematic diagram of a self-rendering component generation apparatus provided by an embodiment of the present application is shown in FIG. 1. As shown in the figure, the apparatus can include a rendering information acquisition module 11, a processing module 12, and a control module 13. Figure 7
[0161] The rendering information acquisition module 11 is configured to acquire rendering information of a plurality of target nodes of a reference shadow tree of a target application. The target node is a node associated with the function to be implemented by the self-rendering component to be generated.
[0162] The processing module 12 is configured to obtain generation parameters of the self-rendering component according to the rendering information.
[0163] The control module 13 is configured to generate the self-rendering component based on the generation parameters. The self-rendering component is an independent component automatically generated based on the generation parameters and not generated by multi-component fusion.
[0164] Optionally, in the case that the rendering information includes structure information, style information and interaction information, the generation parameter includes basic structure parameter, appearance parameter and behavior logic parameter, the basic structure parameter includes type parameter of the self-rendering component and hierarchical relationship parameter with other self-rendering components, the appearance parameter includes graphical element parameter and color parameter of the self-rendering component, and the behavior logic parameter includes user interaction parameter, response event parameter and execution animation parameter of the self-rendering component, the processing module 12 is specifically configured to determine the basic structure parameter of the self-rendering component according to the structure information, determine the appearance parameter of the self-rendering component according to the style information, determine the behavior logic parameter of the self-rendering component according to the interaction information, and obtain the generation parameter of the self-rendering component by fusing the basic structure parameter, the appearance parameter and the behavior logic parameter.
[0165] Optionally, in the case that the target parameter corresponding to the target information in the rendering information is included in the native UI framework of the running system of the target application, the processing module 12 is specifically configured to, if the target parameter corresponding to the target information is included in the native UI framework, call the target API interface corresponding to the target information in the native UI framework to obtain the target parameter, and obtain the generation parameter according to the target parameter.
[0166] The self-rendering component generation apparatus provided by the embodiments of the present application can execute the self-rendering component generation method in the method embodiments, and has similar implementation principles and technical effects, which will not be described herein again.
[0167] Figure 8 A structural schematic diagram of a page rendering apparatus provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the apparatus can include a target shadow tree acquisition module 21, a first generation module 22, a second generation module 23 and a display module 24. Figure 8
[0168] The target shadow tree acquisition module 21 is configured to acquire a target shadow tree corresponding to a target page of a target application in response to a rendering event of the target page. The target shadow tree includes rendering information and a shadow tree structure of a shadow tree node.
[0169] The generation module 22 is configured to generate a drawing tree with the same tree structure as the shadow tree structure, and the drawing tree includes at least one self-rendering component corresponding to the shadow tree node, which is generated by any one of the methods described above.
[0170] The display module 23 is configured to generate and display the target page according to the drawing tree.
[0171] Optionally, the generating module 22 is specifically configured to obtain the self-rendering component corresponding to each shadow tree node according to the rendering information of the shadow tree node and the mapping relationship between the rendering information of the shadow tree node and the self-rendering component. According to the shadow tree structure, an initial drawing tree is generated, which has the same structure as the shadow tree structure. According to the position of the shadow tree node in the shadow tree structure, a target position of the self-rendering component in the structure of the initial drawing tree is determined. The self-rendering component is filled into the initial drawing tree according to the target position, and a drawing tree is generated.
[0172] Optionally, the target shadow tree obtaining module 21 is further configured to obtain the self-rendering component from the target application, or obtain the self-rendering component from the cloud.
[0173] The page rendering apparatus provided by the embodiments of the present application can execute the page rendering method in the method embodiments, and has similar implementation principles and technical effects, which will not be described here.
[0174] Figure 9 A structural schematic diagram of an electronic device 900 is provided in the embodiments of the present application. The electronic device can be used to execute the self-rendering component generation method described above, for example. As shown in the figure, the electronic device 900 can include at least one processor 901 and a memory 902. In a possible implementation manner, the electronic device 900 can further include a communication interface 903. Figure 9
[0175] The memory 902 is used to store programs. Specifically, the programs can include program codes, and the program codes include computer operation instructions.
[0176] The memory 902 can include a high-speed RAM memory, and can also include a non-volatile memory such as at least one disk memory.
[0177] The processor 901 is used to execute the computer operation instructions stored in the memory 902, so as to implement the self-rendering component generation method described in the foregoing method embodiments. The processor 901 can be a CPU, or an ASIC, or one or more integrated circuits configured to implement the embodiments of the present application.
[0178] The processor 901 can communicate with external devices through the communication interface 903, which can be a server located in the cloud as mentioned above. In a specific implementation, if the communication interface 903, the memory 902, and the processor 901 are implemented independently, the communication interface 903, the memory 902, and the processor 901 can be connected to each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.
[0179] Optionally, in a specific implementation, if the communication interface 903, the memory 902, and the processor 901 are integrated on a chip, the communication interface 903, the memory 902, and the processor 901 can complete communication through an internal interface.
[0180] Figure 10 A structure diagram of a display device 1000 provided by an embodiment of the present application is provided. The display device can be used to execute the self-rendering component generation method mentioned above. As shown in the figure, the display device 1000 can include at least one processor 1001, a memory 1002, and a display 1004. In a possible implementation, a communication interface 1003 can also be included. Figure 10
[0181] The memory 1002 is used to store programs. Specifically, the programs can include program codes, and the program codes include computer operation instructions.
[0182] The memory 1002 can include a high-speed RAM memory, and can also include a non-volatile memory such as at least one disk memory.
[0183] The processor 1001 is used to execute the computer execution instructions stored in the memory 1002 to implement the page rendering method described in the foregoing method embodiments. The processor 1001 can be a CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0184] The processor 1001 can communicate with an external device through the communication interface 1003. The external device can be, for example, the server in the cloud as described above. In a specific implementation, if the communication interface 1003, the memory 1002 and the processor 1001 are implemented independently, the communication interface 1003, the memory 1002 and the processor 1001 can be connected to each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or only one type of bus.
[0185] The display 1004 is configured to display a page generated by the processor 1001 by executing page rendering.
[0186] Optionally, in a specific implementation, if the communication interface 1003, the memory 1002 and the processor 1001 are integrated on a chip, the communication interface 1003, the memory 1002 and the processor 1001 can complete communication through an internal interface.
[0187] The application further provides a computer readable storage medium, which can include a U disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk and various storage program codes. Specifically, the computer readable storage medium stores program instructions, and the program instructions are used for the method in any of the above embodiments.
[0188] The application further provides a computer program product, which includes execution instructions stored in a readable storage medium. At least one processor of an electronic device can read the execution instructions from the readable storage medium, and the at least one processor executes the execution instructions to make the electronic device implement the method provided in the various embodiments.
[0189] The term "plurality" in the present document refers to two or more. The term "and / or" in the present document is merely used to describe associated objects, and indicates that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in the present document generally indicates that the associated objects before and after are in an "or" relationship; in the formula, the character " / " indicates that the associated objects before and after are in a "division" relationship. In addition, it should be understood that in the description of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor indicating or implying sequence.
[0190] It can be understood that various numerical numbers involved in the embodiments of the present application are only for the convenience of differentiation, and are not used to limit the scope of the embodiments of the present application.
[0191] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for generating a self-rendering component, characterized in that, The method comprises: obtaining rendering information of a plurality of target nodes of a reference shadow tree of a target application; the target nodes are nodes associated with the function to be implemented by a self-rendering component to be generated; obtaining generation parameters of the self-rendering component according to the rendering information; generating the self-rendering component based on the generation parameters; wherein the self-rendering component is an independent component automatically generated based on the generation parameters and not generated by multi-component fusion.
2. The method of claim 1, wherein, The rendering information comprises structure information, style information and interaction information; the generation parameters comprise basic structure parameters, appearance parameters and behavior logic parameters; The basic structure parameters comprise type parameters and hierarchical relationship parameters of the self-rendering component with other self-rendering components; the appearance parameters comprise graphical element parameters and color parameters of the self-rendering component; and the behavior logic parameters comprise user interaction parameters, response event parameters and execution animation parameters of the self-rendering component. The method comprises: determining the basic structure parameters of the self-rendering component according to the structure information; determining the appearance parameters of the self-rendering component according to the style information; determining the behavior logic parameters of the self-rendering component according to the interaction information; fusing the basic structure parameters, the appearance parameters and the behavior logic parameters to obtain the generation parameters of the self-rendering component.
3. The method of claim 1, wherein, The native UI framework of the running system of the target application comprises target parameters corresponding to target information in the rendering information; The method comprises: calling a target API interface corresponding to the target information in the native UI framework to obtain the target parameters; adjusting the format of the target parameters according to the format of the generation parameters to generate the generation parameters.
4. A method of rendering a page, characterized by, The method comprises: in response to a rendering event of a target page of a target application, obtaining a target shadow tree corresponding to the target page; the target shadow tree comprises rendering information of shadow tree nodes and a shadow tree structure; generating a drawing tree with the same tree structure as the shadow tree structure, the drawing tree comprising at least one self-rendering component corresponding to a shadow tree node, the self-rendering component being generated by the method of any one of claims 1-3; generating and displaying the target page according to the drawing tree.
5. The method of claim 4, wherein, The method of generating a drawing tree with the same tree structure as the shadow tree structure comprises: obtaining a self-rendering component corresponding to each shadow tree node according to the rendering information of the shadow tree nodes and a mapping relationship between the rendering information of the shadow tree nodes and the self-rendering component; generating an initial drawing tree with the same tree structure as the shadow tree structure according to the shadow tree structure; determining a target position of the self-rendering component in the structure of the initial drawing tree according to the position of the shadow tree node in the shadow tree structure; filling the self-rendering component into the initial drawing tree according to the target position to generate the drawing tree.
6. The method according to claim 4 or 5, characterized in that, The method further comprises: obtaining the self-rendering component from the target application; or obtaining the self-rendering component from the cloud.
7. A self-rendering component generation apparatus, characterized by: The device comprises: a rendering information obtaining module, configured to obtain rendering information of a plurality of target nodes of a reference shadow tree of a target application; the target nodes are nodes associated with a function to be implemented by a self-rendering component to be generated; a processing module, configured to obtain generation parameters of the self-rendering component according to the rendering information; a control module, configured to generate the self-rendering component based on the generation parameters; the self-rendering component is an independent component automatically generated based on the generation parameters and not generated by multi-component fusion.
8. A page rendering apparatus characterized by comprising: The device comprises: a target shadow tree obtaining module, configured to obtain a target shadow tree corresponding to a target page of a target application in response to a rendering event of the target page; the target shadow tree comprises rendering information and a shadow tree structure of a shadow tree node; a generation module, configured to generate a drawing tree with the same tree structure as the shadow tree structure; the drawing tree comprises at least one self-rendering component corresponding to a shadow tree node, and the self-rendering component is generated by the method in any one of claims 1-3; a display module, configured to generate and display the target page according to the drawing tree.
9. An electronic device, comprising: comprise: a processor and a memory; the processor is in communication connection with the memory; the memory stores computer instructions; the processor executes the computer instructions stored in the memory to implement the method in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer execution instructions, and the computer execution instructions are executed by the processor to implement the method in any one of claims 1-6.