Interface rendering method and device, electronic equipment and storage medium

By integrating the vertex and shader files of multiple applications into one target file, one-time traversal query is realized, which solves the problem of long query time in the electronic device interface rendering process and improves the rendering efficiency and interface display effect.

CN118760487APending Publication Date: 2024-10-11VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410795445.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

When electronic devices require a GPU to render an application interface, they need to traverse the query vertex information and shader information configuration scheme multiple times, resulting in long query times and slow response and lag in the application interface.

Method used

Integrate the vertex files and shader files of multiple applications into one target file. Through one traversal query, you can find the target vertex file and target shader file corresponding to the interface to be rendered, and directly render the application interface.

Benefits of technology

It saves the time of traversing the query configuration plan multiple times, improves the efficiency of the rendering interface, avoids the problem of slow response and freezing of the application interface, and improves the display effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760487A_ABST
    Figure CN118760487A_ABST
Patent Text Reader

Abstract

The invention discloses an interface rendering method and device, electronic equipment and a readable storage medium, and belongs to the technical field of electronic equipment. The method comprises the steps that N vertex files and N shader files corresponding to N applications are obtained, and one application corresponds to one vertex file and one shader file; n is a positive integer; integrating the N vertex files into a target vertex file, and integrating the N shader files into a target shader file; and under the condition that a request for rendering the application interface is received, rendering the application interface according to the target vertex file and the target shader file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of electronic devices, and specifically relates to an interface rendering method, device, electronic device and storage medium. Background Art

[0002] Generally, the application interface of an electronic device can be presented through rendering by a graphics processing unit (GPU). The GPU needs to apply corresponding vertex information and shader information configuration schemes when rendering.

[0003] However, when an application interface of an electronic device (hereinafter referred to as the interface to be rendered) requires GPU rendering, the electronic device needs to first traverse all vertex files and shader files of the installed applications, and then find the vertex files and shader files of the application to which the interface to be rendered belongs. After finding them, traverse the vertex files and shader files of the application to which they belong, and query whether there is a vertex information configuration scheme and a shader information configuration scheme corresponding to the interface to be rendered. If so, submit the vertex information configuration scheme and shader information configuration scheme corresponding to the interface to be rendered to the GPU for rendering.

[0004] Therefore, when an application requires GPU rendering, it is necessary to traverse and query the configuration scheme of vertex information and shader information corresponding to the rendered interface multiple times. Therefore, it takes a long time to query the configuration scheme, resulting in slow response and jamming of the application interface of the electronic device. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide an interface rendering method, device, electronic device and storage medium, which can avoid the problems of slow response and lag in the application interface of the electronic device and improve the display effect of the application interface of the electronic device.

[0006] In a first aspect, an embodiment of the present application provides an interface rendering method, the method comprising: obtaining N vertex files and N shader files corresponding to N applications, wherein one application corresponds to one vertex file and one shader file; N is a positive integer; integrating the N vertex files into a target vertex file, and integrating the N shader files into a target shader file; upon receiving a request to render an application interface, rendering the application interface according to the target vertex file and the target shader file.

[0007] In a second aspect, an embodiment of the present application provides an interface rendering device, which includes: an acquisition module, an execution module and a rendering module. The acquisition module is used to acquire N vertex files and N shader files corresponding to N applications, wherein one application corresponds to one vertex file and one shader file; N is a positive integer. The execution module is used to integrate the N vertex files acquired by the acquisition module into a target vertex file, and to integrate the N shader files acquired by the acquisition module into a target shader file. The rendering module is used to render the application interface according to the target vertex file and the target shader file when a request to render the application interface is received.

[0008] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0009] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0011] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.

[0012] In an embodiment of the present application, when an electronic device renders an application interface to be rendered of an application, the electronic device can first obtain vertex files and shader files corresponding to each application, wherein one application in each application corresponds to a vertex file and a shader file; N is a positive integer. Then the vertex files of each application are integrated into a target vertex file, and the shader files of each application are integrated into a target shader file. Finally, when a request to render an application interface is received, the target vertex file and the target shader file corresponding to the application interface to be rendered are found from a target vertex file and a target shader file respectively, and the application interface to be rendered is rendered according to the target vertex file and the target shader file. In this way, the present solution can directly find the target vertex file and target shader file corresponding to the application interface to be rendered from a target vertex file and a target shader file that store the vertex files and shader files of each application interface. That is, the solution of the present application can find the target vertex file and target shader file corresponding to the application interface to be rendered through a single traversal query, without the need to traverse multiple times to find the required target vertex file and target shader file. Therefore, the solution of the present application can realize a single specified search and a single query to find the target vertex file and target shader file corresponding to the interface to be rendered in the electronic device, saving the time-consuming multiple traversal query configuration schemes, improving the efficiency of rendering the interface, thereby avoiding the problems of slow response and jamming in the application interface of the electronic device, and improving the display effect of the application interface of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 One of the flowcharts of the interface rendering method provided in the embodiment of the present application;

[0014] Figure 2 The second flowchart of the interface rendering method provided in the embodiment of the present application;

[0015] Figure 3 This is one of the integrated example diagrams of the configuration solution provided in the embodiment of the present application;

[0016] Figure 4 The second schematic diagram of the integrated example of the configuration solution provided in the embodiment of the present application;

[0017] Figure 5 One of the schematic diagrams of the interface rendering device provided in the embodiment of the present application;

[0018] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0019] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0021] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0022] The terms "at least one (item)", "at least one of" and the like in the specification and claims of the present application refer to any one, any two or a combination of more than two of the objects included therein. For example, at least one (item) of a, b, and c can be represented by: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" refers to two or more, and its meaning is similar to that of "at least one (item)".

[0023] The following is a detailed description of the interface rendering method provided by the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0024] The interface rendering method provided in the embodiment of the present application can be applied to the scenario of rendering the interface of an application.

[0025] Usually, the interface needs to be displayed with supporting vertex information files and shader information files. When the application opens the interface, the following three steps are performed:

[0026] Step 1: Check whether the application has corresponding vertex files and shader files. If yes, proceed to step 2. If not, proceed to step 3.

[0027] Step 2: Check whether the image to be rendered has a saved vertex information and shader information configuration scheme. If yes, directly submit the corresponding vertex information and shader information configuration scheme to GPU rendering. If no, proceed to step 3);

[0028] Step 3: 1. Compile the vertex information and shader information configuration scheme to generate new vertex files and new shader files; 2. If there are already vertex files and shader files, store the configuration scheme in the corresponding vertex files and shader files of the application in sequence. The next time you perform a query operation during rendering, you can directly submit it to the GPU for rendering.

[0029] If there is no vertex file and shader file in the folder of the application installed for the first time, the native vertex information and shader information configuration scheme will be copied and compiled to generate the vertex file and shader file corresponding to the application after the application interface is opened for the first time, and stored in the folder of the application. Other configuration schemes generated by the application subsequently will be stored in the vertex information file and shader file in the folder of the application in sequence.

[0030] The vertex information and shader information transmitted by the original application in each frame cannot be directly rendered by the GPU. The GPU can only render the configuration scheme of vertex information and shader information. Therefore, the configuration scheme of vertex information and shader information can only be generated in real time or preset natively.

[0031] Due to the diversity of applications and the autonomy of application development, there are various characteristics in the dynamic effects of opening internal interfaces. The configuration schemes in the native preset vertex files and shader files cannot cover all situations that need to be rendered. Therefore, when most applications open their own interfaces, they need to submit the configuration schemes of vertex information and shader information to the graphics framework for compilation, generate configuration schemes, and then store them in vertex information files and shader files. The process of the graphics framework compiling the vertex information and shader information configuration scheme usually takes between 30 milliseconds and 300 milliseconds, while a smooth user experience requires that the drawing time of each frame be controlled between 8 milliseconds and 16 milliseconds. Therefore, this time-consuming compilation process will reflect the phenomenon that it takes a long time for the application to submit rendering information to the GPU for rendering, resulting in frame drops and freezes.

[0032] In an embodiment of the present application, when an electronic device renders an application interface to be rendered of an application, the electronic device can first obtain vertex files and shader files corresponding to each application, wherein one application in each application corresponds to a vertex file and a shader file; N is a positive integer. Then the vertex files of each application are integrated into a target vertex file, and the shader files of each application are integrated into a target shader file. Finally, when a request to render an application interface is received, the target vertex file and the target shader file corresponding to the application interface to be rendered are found from a target vertex file and a target shader file respectively, and the application interface to be rendered is rendered according to the target vertex file and the target shader file. In this way, the present solution can directly find the target vertex file and target shader file corresponding to the application interface to be rendered from a target vertex file and a target shader file that store the vertex files and shader files of each application interface. That is, the solution of the present application can find the target vertex file and target shader file corresponding to the application interface to be rendered through a single traversal query, without the need to traverse multiple times to find the required target vertex file and target shader file. Therefore, the solution of the present application can realize a single specified search and a single query to find the target vertex file and target shader file corresponding to the interface to be rendered in the electronic device, saving the time-consuming multiple traversal query configuration schemes, improving the efficiency of rendering the interface, thereby avoiding the problems of slow response and jamming in the application interface of the electronic device, and improving the display effect of the application interface of the electronic device.

[0033] The execution subject of the interface rendering method provided in the embodiment of the present application may be an interface rendering device, or an electronic device, or a functional module in an electronic device. The following takes an electronic device as an example to illustrate the technical solution provided in the embodiment of the present application.

[0034] Figure 1 A flowchart of an interface rendering method provided by an embodiment of the present application is shown. Figure 1 As shown, the interface rendering method provided in the embodiment of the present application may include the following steps 201 to 203.

[0035] Step 201: The electronic device obtains N vertex files and N shader files corresponding to N applications.

[0036] In the embodiment of the present application, one application among the above-mentioned N applications corresponds to one vertex file among the N vertex files and one shader file among the N shader files, where N is a positive integer.

[0037] Optionally, in an embodiment of the present application, the above-mentioned N applications are at least one application in the electronic device, or are all applications in the electronic device.

[0038] It should be noted that when the application is not installed or updated, the electronic device can precompile the vertex information and shader information. After the application is installed or updated, the electronic device can perform multi-threaded generation of the vertex file and shader file of the application based on the vertex information and shader information to obtain the precompiled vertex file and shader file of the application. Among them, the vertex file of the application includes the configuration scheme of the vertex information of the application interface in the application, and the shader file of the application includes the configuration scheme of the shader information of the application interface in the application. The electronic device can store the vertex file and shader file of the application in a certain system location in the electronic device for easy maintenance and management. In addition, after the electronic device is restarted or the software is upgraded (it can also be a system upgrade), the graphics framework in the electronic device will bring update-related changes. The application interface in the application can be compiled, or the newly added interface can be compiled to obtain the recompiled vertex file and shader file of the application.

[0039] For example, taking application 1 and application 2 as examples, application 1 will generate vertex file 1 and shader file 1 after installation, and application 2 will generate vertex file 2 and shader file 2 after installation. After application 1 and application 2 are updated once, they will have vertex file 1.1 and shader file 1.1, and vertex file 2.1 and shader file 2.1 respectively. And so on.

[0040] Step 202: The electronic device integrates N vertex files into one target vertex file, and integrates N shader files into one target shader file.

[0041] It can be understood that the electronic device can filter the configuration schemes of duplicate vertex information in N vertex files, delete the configuration schemes of duplicate vertex information in the N vertex files into one configuration scheme, and filter the configuration schemes of duplicate shader information in N shader files, delete the configuration schemes of duplicate shader information in the N shader files into one configuration scheme.

[0042] Example 1, taking application 1 and application 2 as examples. Vertex file 1 of application 1 includes configuration schemes of vertex information of each application interface of application 1, such as configuration scheme a, configuration scheme b, configuration scheme c, ..., configuration scheme y, and shader file 1 of application 1 includes configuration schemes of shader information of each application interface of application 1, such as configuration scheme l, configuration scheme m, configuration scheme n, ..., configuration scheme p; vertex file 2 of application 2 includes configuration schemes of vertex information of each application interface of application 2, such as configuration scheme a, configuration scheme b, configuration scheme d, ..., configuration scheme z, and shader information file 2 of application 2 includes configuration schemes of shader information of each application interface of application 2, such as configuration scheme l, configuration scheme o, configuration scheme p, ..., configuration scheme t. Then the electronic device can integrate the vertex information files of application 1 and application 2 in a first folder, which includes two configuration schemes a, two configuration schemes b, configuration scheme c, configuration scheme d, ..., configuration scheme y, and configuration scheme z, and then the electronic device can merge the repeated vertex information configuration schemes in the first folder into one vertex information configuration scheme to obtain a target vertex file, that is, a target vertex file includes configuration scheme a, configuration scheme b, configuration scheme c, configuration scheme d, ..., configuration scheme y, and configuration scheme z; and the electronic device can integrate the shader files of application 1 and application 2 in a second folder, which includes two configuration schemes l, two configuration schemes m, configuration scheme n, configuration scheme o, ..., two configuration schemes p, and configuration scheme t, and then the electronic device can merge the repeated shader information configuration schemes in the second folder into one shader information configuration scheme to obtain a target shader file, that is, a target shader file includes configuration scheme l, configuration scheme m, configuration scheme n, configuration scheme o, ..., configuration scheme p, and configuration scheme t.

[0043] In this way, when the electronic device integrates N vertex files and N shader files of at least one application, it can filter out and delete duplicate configuration schemes, thereby saving the memory space of the electronic device, and when querying the corresponding vertex information configuration scheme and shader information configuration scheme from a target vertex file and a target shader file, it can save query time.

[0044] Optionally, in the embodiment of the present application, each vertex file includes a vertex configuration scheme of an application interface of an application, and each shader file includes a shader configuration scheme of an application interface of an application. Figure 1 ,like Figure 2 As shown, the above step 202 can be specifically implemented through the following step 301.

[0045] Step 301: When it is detected that the electronic device is in a non-use state for a first period of time, the electronic device integrates N vertex files into a target vertex file and integrates N shader files into a target shader file.

[0046] In an embodiment of the present application, the order of each vertex configuration scheme in the above-mentioned target vertex file is related to the number of times each vertex configuration scheme is repeated, and the order of each shader configuration scheme in a target shader file is related to the number of times each shader configuration scheme is repeated.

[0047] In the embodiment of the present application, the more times each vertex configuration scheme in a target vertex file is repeated, the more frequently the vertex configuration scheme is used, so the more times a vertex configuration scheme is repeated, the higher it is ranked in a target vertex file. The more times each shader configuration scheme in a target shader file is repeated, the more frequently the shader configuration scheme is used, so the more times a shader configuration scheme is repeated, the higher it is ranked in a shader file.

[0048] In an embodiment of the present application, the above-mentioned one target vertex file includes a configuration scheme of vertex information of each application interface in N applications, and the one target shader file includes a configuration scheme of shader information of each application interface in the N applications.

[0049] It should be noted that the electronic device being in a non-use state within the first time period can be understood as: the electronic device has not been operated by the user within the first time period, or the electronic device has been in a screen-off state within the first time period.

[0050] For example, if the screen of the electronic device has been turned off for one hour and the system time is early morning, the electronic device organizes the pre-compiled vertex files and shader files of all applications.

[0051] In this way, when the electronic device detects that the electronic device has not been operated for a certain period of time, that is, in a non-use state, it performs the integration of at least one application's vertex file and shader file, thereby avoiding the smoothness of the use of the electronic device due to file integration. In addition, the electronic device integrates at least N vertex files to obtain the above-mentioned target vertex file, and integrates the N shader files to obtain a target shader file, so that the configuration scheme of the vertex information and the configuration scheme of the shader information corresponding to the application interface to be rendered can be directly searched in a target vertex file and a target shader file, respectively, saving the time consumed by the electronic device in rendering the application interface.

[0052] Optionally, the interface rendering method provided in the embodiment of the present application further includes the following step 401.

[0053] Step 401: The electronic device updates the sorting of vertex configuration schemes in a target vertex file according to the number of times the vertex configuration schemes in the target vertex file are used, and updates the sorting of shader configuration schemes in a target shader file according to the number of times the shader configuration schemes in the target shader file are used.

[0054] Optionally, in an embodiment of the present application, the electronic device may update the order of the configuration schemes in the first set and the second set at a preset time interval, for example, updating the order at a frequency of once a day.

[0055] In an embodiment of the present application, the electronic device can arrange the configuration schemes of the vertex information and the configuration schemes of the shader information of the interface of the application in descending order according to the number of repetitions when first sorting. After sorting, the configuration scheme that is closer to the front in a target vertex file is the configuration scheme with the most repeated occurrences of the configuration schemes of the vertex information in the first folder, and the configuration scheme that is closer to the front in a target shader file is the configuration scheme with the most repeated occurrences of the configuration schemes of the shader information in the second folder. In addition, after sorting, the electronic device can generate a corresponding dictionary for each configuration scheme to help the system quickly match and retrieve the required configuration scheme. It should be noted that the dictionary here can be understood as the serial number, identifier or index of each configuration scheme.

[0056] In an embodiment of the present application, the configuration schemes of vertex information and shader information of the application interface in the electronic device can be sorted in descending order according to the configuration schemes of vertex information and shader information that are used most frequently every day, and a new dictionary can be generated for each sorted configuration scheme.

[0057] It should be noted that as user usage habits gradually become fixed, the order of the configuration schemes for vertex information and shader information and the update frequency of the dictionary will gradually decrease and eventually stabilize.

[0058] Example 2, combined with the above example 1, such as Figure 3As shown, it includes two sorting processes. The first sorting is the first integration sorting according to the number of repetitions of the configuration schemes, and the second sorting is the subsequent integration sorting according to the number of uses of the configuration schemes. Among them, for the first sorting, the configuration schemes of the repeated vertex information in the above-mentioned first folder include configuration scheme a and configuration scheme b, that is, the number of repetitions of configuration scheme a is twice, and the number of repetitions of configuration scheme b is twice, then the electronic device can sort the configuration schemes of each vertex information in the first folder according to the number of repetitions of the configuration schemes of the vertex information in the first folder, so that after sorting and integrating the configuration schemes, the order of the configuration schemes in a target vertex file is configuration scheme a, configuration scheme b, configuration scheme c, configuration scheme d,..., configuration scheme y, configuration scheme z; the configuration schemes of the repeated shader information in the above-mentioned second folder include configuration scheme l and configuration scheme p, that is, the number of repetitions of configuration scheme l is twice, and the number of repetitions of configuration scheme p is twice, then the electronic device can sort the configuration schemes of each shader information in the second folder according to the number of repetitions of the configuration schemes of the shader information in the second folder, so that after sorting and integrating the configuration schemes, the order of the configuration schemes in a target shader file is configuration scheme l, configuration scheme m, configuration scheme n, configuration scheme o,..., configuration scheme p, configuration scheme t. For the second sorting, assuming that the number of times configuration schemes x, e, c, d, a, and y in a target vertex file are used decreases in sequence, then after the electronic device updates the sorting of the configuration schemes of each vertex information in a target vertex file according to the number of times the configuration schemes of the vertex information in the target vertex file are used, the order of the configuration schemes in a target vertex file is configuration scheme x, configuration scheme e, configuration scheme c, configuration scheme d, ..., configuration scheme a, and configuration scheme y; assuming that the number of times configuration schemes r, s, n, p, ..., l, and t in a target shader file are used decreases in sequence, then after the electronic device updates the sorting of the configuration schemes of each shader information in a target shader file according to the number of times the configuration schemes of the shader information in the target shader file are used, the order of the configuration schemes in a target shader file is configuration scheme r, configuration scheme s, n, p, ..., l, and t.

[0059] Optionally, in an embodiment of the present application, the new architecture of the electronic device is a fixed location (not in a certain application folder), without the need for traversal search, and is sorted by frequency of use. The most commonly used vertex information and shader information configuration schemes are at the top, and it is expected to include 100-200 configuration schemes, covering approximately 80% of user usage scenarios, and the time to query and submit GPU rendering is the shortest.

[0060] Optionally, in the embodiment of the present application, the vertex information and shader information configuration schemes that are not commonly used in electronic devices are ranked in the middle, and the user query frequency is low, covering about 15% of user usage scenarios, and the number of vertex information and shader information configuration schemes is about 10,000 to 100,000. The time to query and submit GPU rendering is second.

[0061] Optionally, in the embodiment of the present application, the vertex information and shader information configuration schemes for rare scenes are expected to be a single configuration scheme corresponding to a single application, sorted at the end of the file, with the lowest frequency of use, and the number of vertex information and shader information configuration schemes is about the order of thousands to tens of thousands. The time to query and submit GPU rendering is the longest.

[0062] In this way, the electronic device can sort the configuration schemes of vertex information and shader information according to the number of repeated occurrences of the configuration schemes, that is, in combination with the user's usage habits of the application interface. That is, the number of repeated occurrences of the configuration schemes of the application interface can represent the frequency of use of the application interface. Therefore, when searching for configuration schemes in a target vertex file and a target shader file, the configuration schemes corresponding to the application interfaces with higher usage frequencies can be queried first, thereby increasing the probability of finding the required configuration scheme first.

[0063] It should be noted that the above step 401 may be performed after the above step 202, or may be performed before the following step 203.

[0064] Exemplarily, in the case where step 401 is executed after step 202, step 401 may be executed simultaneously with the step 202 of "integrating N vertex files into one target vertex file, and integrating N shader files into one target shader file", or may be executed before step 203. The embodiment of the present application does not limit the execution order of step 401.

[0065] Step 203: When receiving a request to render an application interface, the electronic device renders the application interface according to the target vertex file and the target shader file.

[0066] In the embodiment of the present application, the GPU in the electronic device can render the first application interface according to the target vertex file and the target shader file.

[0067] An embodiment of the present application provides an interface rendering method, and an electronic device can directly find the target vertex file and target shader file corresponding to the application interface to be rendered from a target vertex file and a target shader file that store the vertex files and shader files of each application interface. That is, the solution of the present application can find the target vertex file and target shader file corresponding to the application interface to be rendered through a single traversal query, without the need to traverse multiple times to find the required target vertex file and target shader file. Therefore, the solution of the present application can realize a single specified search and a single query to find the target vertex file and target shader file corresponding to the interface to be rendered in the electronic device, saving the time-consuming multiple traversal query configuration schemes, improving the efficiency of rendering the interface, thereby avoiding the problems of slow response and jamming in the application interface of the electronic device, and improving the display effect of the application interface of the electronic device.

[0068] Optionally, the interface rendering method provided in the embodiment of the present application also includes the following step 501.

[0069] Step 501, for a first vertex configuration scheme in a target vertex file, or a first shader configuration scheme in a target shader file, when the number of queries within a second time period increases, the electronic device ascends the first vertex configuration scheme in a target vertex file, or ascends the first shader configuration scheme in a target shader file.

[0070] Exemplarily, for a first vertex configuration scheme in a target vertex file, or a first shader configuration scheme in a target shader file, when the number of queries increases within a second time period, if the number of repeated queries of the first vertex configuration scheme and the first shader configuration scheme exceeds N times, the electronic device will ascend the first vertex configuration scheme in the target vertex file, and will ascend the first shader configuration scheme in the target shader file.

[0071] In an embodiment of the present application, when the electronic device is in use, the electronic device can obtain the query frequency of the first vertex configuration scheme in a target vertex file and the first shader configuration scheme in a target shader file. In order to better fit the user's usage habits, if the query frequency of the configuration scheme of vertex information and the configuration scheme of shader information increases within a short period of time (i.e., the second duration), and the repeated query exceeds K times, the electronic device can temporarily ascend the configuration scheme in the one target vertex file and the one target shader file, replace it to the first position, and temporarily change the search order of its dictionary.

[0072] Optionally, in an embodiment of the present application, the second duration may be half a day, one day or three days.

[0073] Optionally, in an embodiment of the present application, when the number of queries for configuration schemes for other vertex information in the above-mentioned target vertex file changes and does not exceed K times, these configuration schemes can be reordered according to the number of queries for the configuration schemes for other vertex information; when the number of queries for configuration schemes for other shader information in the above-mentioned target shader file changes and does not exceed K times, these configuration schemes can be reordered according to the number of queries for the configuration schemes for other shader information.

[0074] Example 3, combined with the above example 1, such as Figure 4 As shown, a target vertex file includes configuration scheme a, configuration scheme b, configuration scheme c, configuration scheme d, ..., configuration scheme y, configuration scheme z, and the second set includes configuration scheme l, configuration scheme m, configuration scheme n, configuration scheme o, ..., configuration scheme p, and configuration scheme t. Assuming that the number of repeated queries of configuration schemes x and e in a target vertex file exceeds K times, and the number of queries of other configuration schemes from large to small are configuration scheme c, configuration scheme d, ..., configuration scheme a, configuration scheme y, then the electronic device reorders the configuration schemes in a target vertex file, and after sorting, the order of the configuration schemes in a target vertex file is configuration scheme x, configuration scheme e, configuration scheme c, configuration scheme d, ..., configuration scheme a, configuration scheme y; assuming that the number of repeated queries of configuration schemes r and configuration scheme s in a target shader file exceeds K times, and the number of queries of other configuration schemes from large to small are configuration scheme n, ..., configuration scheme p, configuration scheme l, configuration scheme t, then the electronic device reorders the configuration schemes in a target shader file, and after sorting, the order of the configuration schemes in a target shader file is configuration scheme r, configuration scheme s, configuration scheme n, ..., configuration scheme p, configuration scheme l, configuration scheme t.

[0075] In an embodiment of the present application, after the number of repeated queries exceeds K times, if the configuration schemes queried M times in succession are configuration schemes for other vertex information and configuration schemes for other shader information, the electronic device restores the order of the first vertex configuration scheme and the first shader configuration scheme.

[0076] It should be noted that the configuration schemes of the other vertex information are configuration schemes in the target vertex file other than the first vertex configuration scheme. The configuration schemes of the other shader information are configuration schemes in the target shader file other than the first shader configuration scheme.

[0077] It can be understood that if the configuration scheme of vertex information and the configuration scheme of shader information do not match the configuration scheme with more than K queries in the subsequent M consecutive queries, the original order of the configuration schemes in a target vertex file and a target shader file will be restored, otherwise the temporary order will be maintained.

[0078] It should be noted that the above step 501 may be performed after the above step 202, or may be performed before the above step 203. The embodiment of the present application does not limit the execution order of step 501.

[0079] In this way, if the number of queries for the first vertex configuration scheme and the first shader configuration scheme increases in a short period of time, it is considered that the first vertex configuration scheme and the first shader configuration scheme are the configuration schemes of the application interface that the user uses more frequently. Therefore, the order of the first vertex configuration scheme and the first shader configuration scheme is moved to the first position, which can facilitate the electronic device to query and save the query time of the first vertex configuration scheme and the first shader configuration scheme.

[0080] Optionally, the interface rendering method provided in the embodiment of the present application also includes the following steps 601 and 602.

[0081] Step 601: When it is detected that the electronic device is restarted or the system is upgraded, the electronic device detects whether a graphics framework in the electronic device is updated.

[0082] In an embodiment of the present application, the above-mentioned graphics framework is used to compile a configuration scheme of vertex information and a configuration scheme of shader information.

[0083] Step 602: When it is detected that the graphic framework is updated, the electronic device recompiles the vertex file and the shader file corresponding to the graphic framework in the electronic device.

[0084] In an embodiment of the present application, when the electronic device is restarted or the system is upgraded, the electronic device can check whether there is an update to the graphics framework. If there is an update, the vertex files and shader files brought about by the changes in the graphics framework are identified. If there is an update, the vertex files and shader files are recompiled based on the changes. Due to the particularity of the graphics framework, there are many algorithms, and it is impossible to cross-extract common parts with the files of the APP. Therefore, the vertex files and shader files of the graphics framework are stored separately.

[0085] For example, if there is a page update in application a in the electronic device, the updated page of application a needs to be recompiled to generate corresponding vertex files and shader files, and then the compiled vertex files and shader files are respectively merged into the above-mentioned target vertex file and target shader file.

[0086] Optionally, in an embodiment of the present application, in view of the risk of lag faced by users after changing their devices, vertex files and shader file sets can be inherited to the system of the new terminal machine through one-click device switching, terminal accounts, cloud services, and other similar system configuration migration functions, to ensure that user usage habits and vertex information files and shader file sets match.

[0087] Optionally, in an embodiment of the present application, considering that some abnormal operations of the user may damage system files, in order to increase security, the vertex files and shader file collections are invisible to the user, the system space is readable and writable, and the user space is read-only. They cannot be obtained through the USB port and can only be copied through functions similar to system configuration migration.

[0088] It should be noted that the above steps 601 and 602 may be performed before the above step 201, or may be performed after the above step 203. The embodiment of the present application does not limit the execution order of step 601 and step 602.

[0089] In this way, by recompiling the vertex files and shader files based on the updated changes of the graphics framework, the configuration scheme of the recompiled vertex information and shader information can be adapted to the changes of the graphics framework, thereby making the configuration scheme of the recompiled vertex information and shader information match the latest status of the electronic device, thereby improving the flexibility of compiling or generating the configuration scheme of the vertex information and shader information.

[0090] Each of the above-mentioned method embodiments, or various possible implementation methods in each method embodiment can be executed separately, or any two or more of them can be executed in combination with each other. The specific implementation method can be determined according to actual usage requirements, and the embodiments of the present application do not limit this.

[0091] The interface rendering method provided in the embodiment of the present application can be executed by an interface rendering device. In the embodiment of the present application, the interface rendering device provided in the embodiment of the present application is described by taking the interface rendering method executed by the interface rendering device as an example.

[0092] Figure 5 A possible structural diagram of an interface rendering device involved in some embodiments of the present application is shown. Figure 5 As shown, the interface rendering device 70 may include: an acquisition module 71 , an execution module 72 and a rendering module 73 .

[0093] The acquisition module 71 is used to acquire N vertex files and N shader files corresponding to N applications, wherein one application corresponds to one vertex file and one shader file; N is a positive integer. The execution module 72 is used to integrate the N vertex files acquired by the acquisition module 71 into one target vertex file, and to integrate the N shader files acquired by the acquisition module into one target shader file. The rendering module 73 is used to render the application interface according to the target vertex file and the target shader file when a request for rendering the application interface is received.

[0094] In a possible implementation, each vertex file includes a vertex configuration scheme of an application interface of an application, and each shader file includes a shader configuration scheme of an application interface of an application. The above-mentioned execution module 72 is specifically used to integrate the N vertex files acquired by the acquisition module into a target vertex file and integrate the N shader files acquired by the acquisition module into a target shader file when it is detected that the electronic device is in a non-use state for a first time period. Among them, the order of each vertex configuration scheme in a target vertex file is related to the number of times each vertex configuration scheme is repeated, and the order of each shader configuration scheme in a target shader file is related to the number of times each shader configuration scheme is repeated.

[0095] In a possible implementation, the above-mentioned execution module 72 is also used to update the sorting of each vertex configuration scheme in a target vertex file according to the number of times the vertex configuration scheme in a target vertex file is used, and to update the sorting of each shader configuration scheme in a target shader file according to the number of times the shader configuration scheme in a target shader file is used.

[0096] In one possible implementation, the above-mentioned execution module 72 is also used to, in a first vertex configuration scheme in a target vertex file, or a first shader configuration scheme in a target shader file, when the number of queries within a second time period increases, ascend the first vertex configuration scheme in a target vertex file, or ascend the first shader configuration scheme in a target shader file.

[0097] In a possible implementation, the interface rendering device 70 provided in the embodiment of the present application further includes: a processing module 74. The processing module 74 is used to detect whether there is an update to the graphics framework in the electronic device when it is detected that the electronic device is restarted or the system is upgraded, and the graphics framework is used to compile the vertex configuration scheme and the shader configuration scheme; and when it is detected that there is an update to the graphics framework, recompile the vertex file and the shader file of the graphics framework.

[0098] An embodiment of the present application provides an interface rendering device, which can directly find the target vertex file and target shader file corresponding to the application interface to be rendered from a target vertex file and a target shader file that store the vertex files and shader files of each application interface. That is, the solution of the present application can find the target vertex file and target shader file corresponding to the application interface to be rendered through a single traversal query, without the need to traverse multiple times to find the required target vertex file and target shader file. Therefore, the solution of the present application can realize a single specified search and a single query to find the target vertex file and target shader file corresponding to the interface to be rendered in the electronic device, saving the time of multiple traversal query configuration schemes, improving the efficiency of rendering the interface, thereby avoiding the problems of slow response and jamming in the application interface of the electronic device, and improving the display effect of the application interface of the electronic device.

[0099] The interface rendering device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or it can be other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0100] The interface rendering device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0101] The interface rendering device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and will not be described again here to avoid repetition.

[0102] Alternatively, if Figure 6As shown, an embodiment of the present application also provides an electronic device 1000, including a processor 1001 and a memory 1002, wherein the memory 1002 stores programs or instructions that can be executed on the processor 1001, and when the program or instructions are executed by the processor 1001, the various steps of the above-mentioned interface rendering method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0103] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0104] Figure 7 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0105] The electronic device 100 includes but is not limited to components such as a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110.

[0106] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 110 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0107] The processor 110 obtains N vertex files and N shader files corresponding to N applications, wherein one application corresponds to one vertex file and one shader file; N is a positive integer. The N vertex files are integrated into one target vertex file, and the N shader files are integrated into one target shader file. When a request to render an application interface is received, the application interface is rendered according to the target vertex file and the target shader file.

[0108] An embodiment of the present application provides an electronic device, which can directly find the target vertex file and target shader file corresponding to the application interface to be rendered from a target vertex file and a target shader file that store the vertex files and shader files of each application interface. That is, the solution of the present application can find the target vertex file and target shader file corresponding to the application interface to be rendered through a single traversal query, without the need to traverse multiple times to find the required target vertex file and target shader file. Therefore, the solution of the present application can realize a single specified search and a single query to find the target vertex file and target shader file corresponding to the interface to be rendered in the electronic device, saving the time of multiple traversal query configuration schemes, improving the efficiency of rendering the interface, thereby avoiding the problems of slow response and jamming in the application interface of the electronic device, and improving the display effect of the application interface of the electronic device.

[0109] Optionally, each of the N vertex files corresponding to the N applications includes a vertex configuration scheme for an application interface of an application, and each of the N shader files corresponding to the N applications includes a shader configuration scheme for an application interface of an application. The processor 110 is specifically configured to integrate the N vertex files into a target vertex file and integrate the N shader files into a target shader file when it is detected that the electronic device is in a non-use state for a first time period. The order of the vertex configuration schemes in a target vertex file is related to the number of times the vertex configuration schemes are repeated, and the order of the shader configuration schemes in a target shader file is related to the number of times the shader configuration schemes are repeated.

[0110] Optionally, the above-mentioned processor 110 is also used to update the sorting of each vertex configuration scheme in a target vertex file according to the number of times the vertex configuration scheme in a target vertex file is used, and to update the sorting of each shader configuration scheme in a target shader file according to the number of times the shader configuration scheme in a target shader file is used.

[0111] Optionally, the above-mentioned processor 110 is also used to, in a first vertex configuration scheme in a target vertex file, or a first shader configuration scheme in a target shader file, when the number of queries within a second time length increases, ascend the first vertex configuration scheme in a target vertex file, or ascend the first shader configuration scheme in a target shader file.

[0112] Optionally, the processor 110 is further configured to detect whether a graphics framework in the electronic device has been updated when a restart of the electronic device or a system upgrade is detected, and the graphics framework is used to compile a vertex configuration scheme and a shader configuration scheme. When an update of the graphics framework is detected, the vertex files and shader files of the graphics framework are recompiled.

[0113] The electronic device provided in the embodiment of the present application can implement each process implemented in the above method embodiment, and can achieve the same technical effect. To avoid repetition, it is not repeated here. The beneficial effects of various implementations in this embodiment can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiment. To avoid repetition, it is not repeated here.

[0114] It should be understood that in the embodiment of the present application, the input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, and the graphics processor 1041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes a touch panel 1071 and at least one of other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0115] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 109 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0116] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 110.

[0117] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned interface rendering method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0118] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0119] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned interface rendering method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0120] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0121] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned interface rendering method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0122] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0124] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An interface rendering method, characterized in that: include: Obtain N vertex files and N shader files corresponding to N applications, where one application corresponds to one vertex file and one shader file; N is a positive integer; Integrate the N vertex files into a target vertex file, and integrate the N shader files into a target shader file; When a request for rendering an application interface is received, the application interface is rendered according to the target vertex file and the target shader file.

2. The method according to claim 1, characterized in that: Each vertex file includes a vertex configuration scheme of an application interface of an application, and each shader file includes a shader configuration scheme of an application interface of an application; The step of integrating the N vertex files into one target vertex file, and integrating the N shader files into one target shader file, comprises: In a case where it is detected that the electronic device is in a non-use state within a first time period, integrating the N vertex files into a target vertex file, and integrating the N shader files into a target shader file; The order of the vertex configuration schemes in the target vertex file is related to the number of times the vertex configuration schemes are repeated, and the order of the shader configuration schemes in the target shader file is related to the number of times the shader configuration schemes are repeated.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: According to the number of times the vertex configuration schemes in the target vertex file are used, the sorting of each vertex configuration scheme in the target vertex file is updated, and according to the number of times the shader configuration schemes in the target shader file are used, the sorting of each shader configuration scheme in the target shader file is updated.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: For the first vertex configuration scheme in the target vertex file, or the first shader configuration scheme in the target shader file, when the number of queries within the second time length increases, the first vertex configuration scheme is sorted in ascending order in the target vertex file, or the first shader configuration scheme is sorted in ascending order in the target shader file.

5. The method according to claim 1 or 2, characterized in that: The method further comprises: In the case of detecting that the electronic device is restarted or the system is upgraded, detecting whether a graphics framework in the electronic device is updated, the graphics framework being used to compile a vertex configuration scheme and a shader configuration scheme; When it is detected that the graphics framework is updated, the vertex file and the shader file of the graphics framework are recompiled.

6. An interface rendering device, characterized in that: The device comprises: an acquisition module, an execution module and a rendering module; The acquisition module is used to acquire N vertex files and N shader files corresponding to N applications, wherein one application corresponds to one vertex file and one shader file; N is a positive integer; The execution module is used to integrate the N vertex files acquired by the acquisition module into a target vertex file, and to integrate the N shader files acquired by the acquisition module into a target shader file; The rendering module is used to render the application interface according to the target vertex file and the target shader file when a request for rendering the application interface is received.

7. The device according to claim 6, characterized in that Each vertex file includes a vertex configuration scheme of an application interface of an application, and each shader file includes a shader configuration scheme of an application interface of an application; The execution module is specifically configured to integrate the N vertex files acquired by the acquisition module into a target vertex file and integrate the N shader files acquired by the acquisition module into a target shader file when it is detected that the electronic device is in a non-use state for a first time period; The order of the vertex configuration schemes in the target vertex file is related to the number of times the vertex configuration schemes are repeated, and the order of the shader configuration schemes in the target shader file is related to the number of times the shader configuration schemes are repeated.

8. The device according to claim 6 or 7, characterized in that The execution module is also used to update the sorting of each vertex configuration scheme in the target vertex file according to the number of times the vertex configuration scheme in the target vertex file is used, and to update the sorting of each shader configuration scheme in the target shader file according to the number of times the shader configuration scheme in the target shader file is used.

9. The device according to claim 6 or 7, characterized in that The execution module is also used to, when the number of queries within the second time period increases, sort the first vertex configuration scheme in the target vertex file, or sort the first shader configuration scheme in the target shader file in ascending order.

10. The device according to claim 6 or 7, characterized in that The device further comprises: a processing module; The processing module is used to detect whether there is an update to the graphics framework in the electronic device when a restart of the electronic device or a system upgrade is detected, and the graphics framework is used to compile vertex configuration schemes and shader configuration schemes; and, when an update to the graphics framework is detected, recompile the vertex files and shader files of the graphics framework.

11. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the interface rendering method as described in any one of claims 1 to 5 are implemented.