Template-based resource rendering method and apparatus, and computing device

CN119865564AActive Publication Date: 2025-04-22SHANGHAI BILIBILI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411929117.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-22
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

In the prior art, when rendering template-based multimedia resources, the rendering effect is poor and the rendering error rate is high.

Method used

By generating a directed acyclic graph of the target template, the node weight of the graph node is calculated, and the rendering order of the template elements is determined based on the weight, so that the template elements are rendered according to the rendering order.

Benefits of technology

Improve the effect of multimedia resource rendering, reduce the rendering error rate, and improve rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119865564A_ABST
    Figure CN119865564A_ABST
Patent Text Reader

Abstract

The invention discloses a template-based resource rendering method and apparatus, and a computing device. The method comprises the following steps: generating a directed acyclic graph of a target template according to a rendering dependency relationship among template elements in the target template; for any graph node, calculating the node weight of the graph node according to the rendering complexity of the template element corresponding to the graph node; determining a rendering sequence of template elements in the target template according to the directed acyclic graph and node weights of graph nodes in the directed acyclic graph; and rendering the template elements according to the rendering sequence of the template elements. According to the scheme, the template elements can be rendered according to a correct sequence with a good rendering effect, so that the rendering effect can be improved, and the rendering error rate is reduced; the node weights of the graph nodes are calculated according to the rendering complexity of the template elements, and the rendering sequence of the template elements is determined according to the node weights, so that the template elements with high complexity can be preferentially rendered on the basis that the rendering sequence conforms to the directed acyclic graph, and the overall rendering efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet technology, and in particular to a template-based resource rendering method, apparatus, computing device, computer storage medium, and computer program product. Background Art

[0002] With the continuous development of multimedia technology, users have an increasing demand for the creation of multimedia resources such as audio and video. In order to improve the user experience and the efficiency of creating multimedia resources such as audio and video, some platforms provide users with multimedia resource creation templates, which usually contain at least one template element, such as preset special effects, subtitles, etc.

[0003] However, the inventors found during implementation that the prior art has poor rendering effect and a high rendering error rate when performing template-based multimedia resource rendering. Summary of the invention

[0004] In view of the above problems, the present application is proposed to provide a template-based resource rendering method, apparatus, computing device, computer storage medium and computer program product that overcome the above problems or at least partially solve the above problems.

[0005] According to a first aspect of the present application, a template-based resource rendering method is provided, comprising:

[0006] Generate a directed acyclic graph of the target template according to the rendering dependency relationship between template elements in the target template; wherein the graph nodes in the directed acyclic graph correspond to the template elements in the target template, and the directed edges in the directed acyclic graph correspond to the rendering dependency relationship between template elements in the target template;

[0007] For any graph node, the node weight of the graph node is calculated according to the rendering complexity of the template element corresponding to the graph node;

[0008] Determining a rendering order of template elements in the target template according to the directed acyclic graph and node weights of graph nodes in the directed acyclic graph;

[0009] The template elements are rendered according to a rendering order of the template elements.

[0010] In an optional implementation, the method further includes: acquiring a material added to any template element, and acquiring a material attribute of the material;

[0011] The calculating the node weight of the graph node according to the rendering complexity of the template element corresponding to the graph node includes: calculating the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node;

[0012] Calculate the material weight of the graph node according to the material attribute of the template element corresponding to the graph node;

[0013] The node weight of the graph node is generated according to the element weight and the material weight.

[0014] In an optional implementation, before calculating the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node, the method further includes:

[0015] Pre-obtain rendering data of different elements under corresponding default parameters;

[0016] For any element, the system overhead and rendering time of the element are extracted from the rendering data of the element, and the rendering complexity of the element is generated according to the system overhead and the rendering time.

[0017] In an optional implementation, the calculating the material weight of the graph node according to the material attribute of the template element corresponding to the graph node includes:

[0018] Calculate the difference coefficient between the material attribute of the template element and the default parameter of the template element;

[0019] The material weight of the graph node is generated according to the difference coefficient.

[0020] In an optional implementation, the method further includes: acquiring user historical resource rendering data, and calculating a preference value of any element according to the user historical resource rendering data;

[0021] The step of calculating the node weight of the graph node according to the rendering complexity of the template element corresponding to the graph node includes:

[0022] Calculate the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node;

[0023] Calculate the material weight of the graph node according to the material attribute of the template element corresponding to the graph node;

[0024] Calculate the preference weight of the graph node according to the preference value corresponding to the template element corresponding to the graph node;

[0025] The node weight of the graph node is generated according to the element weight, the material weight, and the preference weight.

[0026] In an optional implementation, determining the rendering order of template elements in the target template according to the directed acyclic graph and the node weights of the graph nodes in the directed acyclic graph includes:

[0027] Splitting the directed acyclic graph into multiple branches;

[0028] For any branch chain, the branch chain weight of the branch chain is calculated according to the node weights of the graph nodes contained in the branch chain;

[0029] The rendering order of the branches is determined according to the branch weights.

[0030] Rendering the template elements according to the rendering order of the template elements includes: using multiple concurrent threads to render each branch chain according to the rendering order of the branch chains.

[0031] In an optional implementation, splitting the directed acyclic graph into multiple branches includes:

[0032] Determine the number of concurrent threads;

[0033] The directed acyclic graph is split into a plurality of branches according to the number of threads.

[0034] According to a second aspect of the present application, a template-based resource rendering device is provided, comprising:

[0035] A directed graph generation module, used to generate a directed acyclic graph of a target template according to the rendering dependency relationship between template elements in the target template; wherein the graph nodes in the directed acyclic graph correspond to the template elements in the target template, and the directed edges in the directed acyclic graph correspond to the rendering dependency relationship between template elements in the target template;

[0036] A weight determination module, used to calculate the node weight of any graph node according to the rendering complexity of the template element corresponding to the graph node;

[0037] An order determination module, used to determine the rendering order of template elements in the target template according to the directed acyclic graph and the node weights of the graph nodes in the directed acyclic graph;

[0038] A rendering module is used to render the template elements according to the rendering order of the template elements.

[0039] In an optional implementation, the device further includes: an acquisition module, configured to acquire a material added to any template element, and acquire a material attribute of the material;

[0040] The weight determination module is used to: calculate the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node;

[0041] Calculate the material weight of the graph node according to the material attribute of the template element corresponding to the graph node;

[0042] The node weight of the graph node is generated according to the element weight and the material weight.

[0043] In an optional implementation, the rendering complexity is obtained by: pre-acquiring rendering data of different elements under corresponding default parameters;

[0044] For any element, the system overhead and rendering time of the element are extracted from the rendering data of the element, and the rendering complexity of the element is generated according to the system overhead and the rendering time.

[0045] In an optional implementation, the weight determination module is used to: calculate a difference coefficient between the material attribute of the template element and the default parameter of the template element;

[0046] The material weight of the graph node is generated according to the difference coefficient.

[0047] In an optional implementation, the weight determination module is used to: obtain user historical resource rendering data, and calculate the preference value of any element according to the user historical resource rendering data;

[0048] Calculate the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node;

[0049] Calculate the material weight of the graph node according to the material attribute of the template element corresponding to the graph node;

[0050] Calculate the preference weight of the graph node according to the preference value corresponding to the template element corresponding to the graph node;

[0051] The node weight of the graph node is generated according to the element weight, the material weight, and the preference weight.

[0052] In an optional implementation, the sequence determination module is used to: split the directed acyclic graph into a plurality of branches;

[0053] For any branch chain, the branch chain weight of the branch chain is calculated according to the node weights of the graph nodes contained in the branch chain;

[0054] The rendering order of the branches is determined according to the branch weights.

[0055] The rendering module is used to render each branch chain according to the rendering order of the branch chain by using multiple concurrent threads.

[0056] In an optional implementation, the sequence determination module is used to: determine the number of concurrent threads; and split the directed acyclic graph into multiple branches according to the number of threads.

[0057] According to a third aspect of the present application, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0058] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned template-based resource rendering method.

[0059] According to a fourth aspect of the present application, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned template-based resource rendering method.

[0060] According to a fifth aspect of the present application, a computer program product is provided, comprising at least one executable instruction, wherein the executable instruction enables a processor to perform operations corresponding to the above-mentioned template-based resource rendering method.

[0061] The embodiment of the present application generates a directed acyclic graph based on the rendering dependency relationship between template elements in the target template, and finally determines the rendering order of template elements in the target template based on the directed acyclic graph, so that the template elements can be rendered in a correct order with good rendering effect, thereby improving the rendering effect and reducing the rendering error rate; moreover, the embodiment of the present application calculates the node weights of the graph nodes according to the rendering complexity of the template elements, and subsequently determines the rendering order of the template elements based on the node weights, so that on the basis of the rendering order conforming to the directed acyclic graph, template elements with high complexity can be rendered preferentially, thereby improving the overall rendering efficiency.

[0062] The embodiment of the present application obtains the element weight of the graph node according to the rendering complexity, and the element weight can reflect the rendering complexity of the template element under the default situation; and obtains the material weight according to the material attribute, and the material weight can reflect the rendering complexity of the current actual material. The node weight is obtained by combining the material weight and the element weight, which can make the node weight accurately reflect the rendering complexity of the element under actual circumstances, thereby improving the determination accuracy of the node weight.

[0063] By testing the system overhead and rendering time of different elements under default parameters, the embodiments of the present application can accurately evaluate the rendering complexity of the elements, achieve precise quantification of the rendering complexity, and improve the determination accuracy of the rendering complexity.

[0064] The embodiment of the present application determines the material weight according to the difference coefficient of the material attributes compared with the default parameters, so that the material weight can accurately reflect the difference in rendering complexity of the actual material compared with the default parameter material, and thus the element weight can be adjusted through the material weight, so that the determined node weight more accurately reflects the rendering complexity of the element under actual circumstances.

[0065] The embodiment of the present application generates preference weights with reference to the user's preference values ​​for elements, and then obtains node weights in combination with the preference weights. The generated node weights include the user's preference information for template elements, which can subsequently enable elements with high user preferences to be rendered first, thereby improving the user experience.

[0066] The embodiment of the present application splits the directed acyclic graph of the target template into multiple branches, and executes the multiple branches concurrently, thereby shortening the resource rendering time and improving the resource rendering efficiency; and the present application calculates the branch weight of the branch according to the node weight of the graph node in the branch, and determines the branch rendering order according to the branch weight, so that branches with high branch weights can be rendered first, thereby enabling priority rendering of branches with high complexity and / or user interest, further improving rendering efficiency and improving user experience.

[0067] The embodiment of the present application splits the directed acyclic graph according to the number of concurrent threads, so that the number of branches after the final split is greater than or equal to the number of concurrent threads, which is beneficial to improving resource rendering efficiency and avoiding waste of system processing capabilities.

[0068] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0070] Figure 1 A schematic diagram of an operating environment provided for implementing at least one embodiment of the present application is shown;

[0071] Figure 2 A flow chart of a template-based resource rendering method provided in Embodiment 1 of the present application is shown;

[0072] Figure 3 A schematic diagram of a directed acyclic graph provided in Example 1 of the present application is shown;

[0073] Figure 4 A flow chart of a template-based resource rendering method provided in Embodiment 2 of the present application is shown;

[0074] Figure 5 A schematic diagram of a directed acyclic graph provided in Embodiment 2 of the present application is shown;

[0075] Figure 6 A structural diagram of a template-based resource rendering device provided in Embodiment 3 of the present application is shown;

[0076] Figure 7 A schematic diagram of the structure of a computing device provided in Embodiment 4 of the present application is shown. DETAILED DESCRIPTION

[0077] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0078] It should be noted that the user-related data involved in the embodiments of the present application, such as user historical resource rendering data (which includes but is not limited to data used for analysis, stored data, displayed data, etc.), are all authorized or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0079] Figure 1 The present invention can be applied to an application environment including, but not limited to, a client 2 , a server 4 , and a network 6 .

[0080] in:

[0081] The server 4 may be composed of a single or multiple computing devices. The multiple computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc. The computing device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., operating system, dedicated application, server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices. A hypervisor may be implemented to manage the use of different virtual machines on the same computing device.

[0082] The server 4 may be configured to communicate with the client 2, etc., via a network 6. The network 6 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 6 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, etc., or wireless links, such as cellular links, satellite links, Wi-Fi links, etc.

[0083] The server 4 can provide storage, reading, downloading, writing, querying, deleting and other services, such as providing static resource download services to clients through multiple domain names.

[0084] Client 2 can be running Windows, Android TM ) or IOS and other operating systems, such as smart phones, tablet devices, laptop computers, virtual reality devices, gaming devices, set-top boxes, car terminals, smart TVs. Based on the above operating systems, various applications, such as browsers, can be run.

[0085] Embodiment 1

[0086] Figure 2 A flow chart of a resource rendering method based on a template provided in Example 1 of the present application is shown. The resource rendering method provided in this embodiment can be executed on the client side, or can be executed collaboratively by the client and the server. This embodiment can be specifically applied in rendering scenarios of multimedia resources such as audio and video using templates.

[0087] Specifically, Figure 2 As shown, the method comprises the following steps:

[0088] Step S210, generating a directed acyclic graph of the target template according to the rendering dependency relationship between template elements in the target template; wherein the graph nodes in the directed acyclic graph correspond to the template elements in the target template, and the directed edges in the directed acyclic graph correspond to the rendering dependency relationship between template elements in the target template.

[0089] The target template is the template selected by the user during the creation of multimedia resources such as audio and video. The target template usually contains at least one template element, and each template element can achieve a corresponding rendering effect. The template elements include but are not limited to: special effects, subtitles, stickers, music, and / or filters, etc.

[0090] During the implementation process, the inventors found that when multiple elements meet the corresponding rendering order, the overall rendering effect will be optimal. For example, rendering the dynamic blur effect after rendering the filter will improve the overall rendering effect. Therefore, the embodiment of the present application pre-configures the rendering order between different elements when the rendering effect is optimal, and generates element rendering dependency configuration data based on the rendering order. The element rendering dependency configuration data records whether any two elements have a dependency relationship (if element A can only have a good rendering effect when rendered after element B, then element A has a dependency relationship with element B, and element B is the upstream element of element A), and records the upstream and downstream relationships between elements with dependencies.

[0091] After determining that the user has selected the target template, the template elements included in the target template are determined, and the rendering dependency between the template elements can be quickly and accurately determined by searching the pre-generated element rendering dependency configuration data. Further, a directed acyclic graph (DAG) of the target template is generated according to the rendering dependency between the template elements. The directed acyclic graph includes graph nodes and directed edges between the graph nodes. Each graph node in the directed acyclic graph of the target template corresponds to a template element in the target template, that is, the graph nodes correspond to the template elements one by one, and the directed edges between the graph nodes correspond to the rendering dependency between the template elements.

[0092] In the specific directed acyclic graph generation process, a graph node corresponding to each template element is generated. For any two graph nodes, determine whether there is a rendering dependency relationship between the template elements corresponding to the two graph nodes; if so, a directed edge is established between the two graph nodes, and the direction of the directed edge is determined according to the upstream and downstream relationship of the two template elements. For example, if template element A is the upstream element of template element B, the graph node corresponding to template element A is N1, and the graph node corresponding to template element B is N2, then there is a directed edge between graph node N1 and graph node N2 in the directed acyclic graph, and the directed edge points from graph node N1 to graph node N2; if not, no directed edge is established between the two graph nodes. Reference Figure 3 , adjusting the volume element depends on adding the music background element, adding the music background element depends on adding the subtitle element, adding the subtitle element depends on the basic video special effects element, adding the sticker element depends on the basic video special effects element, and the motion blur special effects element depends on the basic video special effects element.

[0093] In the actual implementation process, after the target template is determined, the rendering dependency between the template elements can be determined according to the element rendering dependency configuration data, and then the directed acyclic graph of the target template is generated; it is also possible to generate a global directed acyclic graph corresponding to each element in the platform in advance according to the element rendering dependency configuration data. After the target template is determined, a sub-directed graph containing only template elements is extracted from the global directed acyclic graph as the directed acyclic graph of the target template. In the specific extraction process, all links containing the template elements of the target template are first extracted from the global directed acyclic graph, and the directed acyclic graph of the target template is obtained after short-circuiting the non-template elements in the links.

[0094] Step S220 , for any graph node, calculating the node weight of the graph node according to the rendering complexity of the template element corresponding to the graph node.

[0095] For any graph node in the directed acyclic graph, the rendering complexity of the template element corresponding to the graph node is obtained. The rendering complexity is used to describe the difficulty of rendering the template element. The more difficult the template element is to render, the higher its corresponding rendering complexity is. Further, a node weight is generated according to the rendering complexity, and the node weight is positively correlated with the rendering complexity.

[0096] In an optional implementation, the node weight may be generated by combining one or more of the following methods:

[0097] Implementation method one: Calculate the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node, and then determine the node weight according to the element weight. Specifically, the rendering complexity of different elements under default parameters can be pre-generated, and the rendering complexity of the element under default parameters represents the corresponding rendering complexity when the element adopts the material of the default parameters. Among them, the default parameters include: default length, default resolution, default format, etc. For example, the rendering complexity of the sticker element under default parameters may refer to the complexity of the sticker picture with a rendering resolution of 1080p and a JPG format when rendering resources based on the template. This implementation method can obtain the rendering complexity of the template element by searching for the rendering complexity of different elements generated in advance, and then obtain the element weight. For example, the rendering complexity can be directly used as the element weight, or the element weight can be obtained after the rendering complexity is processed accordingly. Therefore, the element weight can reflect the difficulty of rendering the element under the default setting.

[0098] Further optionally, in order to improve the accuracy of determining the rendering complexity, the present embodiment pre-performs an element rendering complexity test, records the rendering time data of the elements rendered by the test end under different default parameters (wherein the default parameters corresponding to different elements may be different), and then obtains the rendering data of different elements under the corresponding default parameters; for any element, the system overhead and rendering time of the element are extracted from the rendering data of the element, and the rendering complexity of the element is further generated based on the system overhead and rendering time.

[0099] Specifically, for any element, the average system overhead and the average rendering time when the test end renders the element with default parameters are statistically analyzed, and the element rendering time under unit system overhead is calculated based on the average rendering time and the average system overhead. For example, the average system overhead is quantified as N*unit system overhead, and the ratio of the average rendering time to the average system overhead is used as the element rendering time under unit system overhead, and then the rendering complexity can be obtained after the element rendering time is processed accordingly (such as normalization, etc.). In this way, accurate quantification of rendering complexity can be achieved, the accuracy of determining rendering complexity can be improved, and the accuracy of determining node weights can be improved.

[0100] Further, in order to improve the resource rendering efficiency of the client, the server can pre-generate the rendering complexity of different elements, and then obtain the element weights of different elements, and the server stores the element weights of different elements. After determining the target template, the client obtains the element weights of the template elements from the server, and then obtains the element weights of the corresponding graph nodes.

[0101] Implementation method 2: After selecting the target template, the user can also add materials to the corresponding template elements, and the client obtains the materials and material attributes added to any template element. The material attributes include resolution, length, bit rate, etc. For example, if the target template contains a subtitle element, the user can add specific subtitle materials to the subtitle element; or if the target template contains a sticker element, the user can add a specific picture to the sticker element, and so on.

[0102] From the description of one of the above embodiments, it can be known that the element weight can reflect the rendering complexity of the element under default conditions. However, in the actual implementation process, the material attributes of the material added to the element may be consistent with the default parameters or inconsistent with the default parameters, and the material attributes of the material actually added to the element will affect the difficulty of rendering the actual element. Therefore, in addition to calculating the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node, the material weight of the graph node is also calculated according to the material attributes of the template element corresponding to the graph node in this embodiment. The material weight can reflect the rendering difficulty of the actual added material, and then generate the node weight of the graph node according to the element weight and the material weight, so as to correct the element weight through the material weight to obtain a more accurate node weight.

[0103] Further optionally, the material weight can be calculated in the following manner: calculate the difference coefficient between the material attributes of the template element and the default parameters of the template element, specifically for each template element, calculate the difference coefficient between the material attributes and the corresponding default parameters, for example, the ratio of the material attributes to the default parameters can be used as the corresponding difference coefficient; generate the material weight of the graph node according to the difference coefficient. For example, the ratio of the material resolution of the template element to the default resolution is calculated as the resolution difference coefficient, and the ratio of the material length of the template element to the default length is calculated as the length difference coefficient, and then the material weight is obtained according to the product of the resolution difference coefficient and the length difference coefficient. This method can accurately determine the difference between the material attributes of the actual added material and the default parameters, so as to facilitate the subsequent accurate correction of the element weight through the material weight.

[0104] Implementation method three: This implementation method pre-acquires the user's historical resource rendering data, and calculates the preference value of any element based on the user's historical resource rendering data. Specifically, the historical resource rendering data of the user corresponding to the client can be obtained, the frequency of occurrence of different elements can be counted, and the current user's preference value for each element can be determined based on the frequency of occurrence. The user's preference value for the element is positively correlated to the frequency of occurrence of the element in the user's historical resource rendering data. The preference value can be generated and stored in advance, and the preference value is obtained in this implementation method later. Moreover, in this implementation method, in addition to calculating the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node, the preference weight of the graph node is also calculated according to the preference value corresponding to the template element corresponding to the graph node, and then the node weight of the graph node is generated according to the preference weight and the element weight (for example, the sum or weighted sum of the preference weight and the element weight can be used as the node weight). Therefore, the node weight contains the user's preference information for the template element, so that elements with high user preference can be rendered first, thereby improving the user experience.

[0105] Implementation method four: Calculate the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node, calculate the material weight of the graph node according to the material attribute of the template element corresponding to the graph node, calculate the preference weight of the graph node according to the preference value corresponding to the template element corresponding to the graph node, and generate the node weight of the graph node according to the element weight, material weight, and preference weight, so that the node weight integrates the element complexity information, material-related information and user preference information, so that the determined node weight is more reasonable and accurate, improves the rendering effect and enhances the user experience. In the specific implementation process, technical personnel in this field can select a suitable node weight function according to the actual situation. For example, the product of the element weight and the material weight can be calculated, and the sum of the product and the preference weight or the weighted summation result is used as the final node weight.

[0106] Step S230, determining the rendering order of the template elements in the target template according to the directed acyclic graph and the node weights of the graph nodes in the directed acyclic graph.

[0107] A weighted directed acyclic graph can be obtained based on the directed acyclic graph obtained in step S210 and the node weights obtained in step S220, so as to determine the rendering order of the template elements based on the weighted directed acyclic graph. For example, based on the dependency relationship of the directed acyclic graph, nodes with high weights are executed first.

[0108] Step S240: rendering the template elements according to the rendering order of the template elements.

[0109] Specifically, the template elements containing the materials are rendered in sequence according to the rendering order of step S230.

[0110] It can be seen that the template-based resource rendering method provided in the embodiment of the present application generates a directed acyclic graph based on the rendering dependency relationship between template elements in the target template, and finally determines the rendering order of template elements in the target template based on the directed acyclic graph, so that the template elements can be rendered in a correct and effective order, thereby improving the rendering effect and reducing the rendering error rate; moreover, the embodiment of the present application calculates the node weights of the graph nodes according to the rendering complexity of the template elements, and subsequently determines the rendering order of the template elements based on the node weights, so that on the basis of the rendering order conforming to the directed acyclic graph, template elements with high complexity can be rendered preferentially, thereby improving the overall rendering efficiency.

[0111] Embodiment 2

[0112] Figure 4 FIG. 1 is a flow chart of a template-based resource rendering method provided in Embodiment 2 of the present application. Specifically, Figure 4 As shown, the method comprises the following steps:

[0113] Step S410, generating a directed acyclic graph of the target template according to the rendering dependency relationship between template elements in the target template, and calculating the node weight of each graph node.

[0114] The specific implementation process of this step can refer to the description in other embodiments and will not be repeated here.

[0115] Step S420, splitting the directed acyclic graph into multiple branches.

[0116] The directed acyclic graph of the target template is split into multiple branches, each branch containing at least one graph node, and there are no overlapping graph nodes between different branches. Preferably, different branches should be independent of each other, that is, there are no overlapping nodes and no directed edge connections between different branches.

[0117] In an optional implementation, the directed acyclic graph can be split specifically in the following manner: determine the number of concurrent threads (which may be referred to as the concurrent thread number for short), which is the number of threads for concurrently rendering the target template resources, and further split the directed acyclic graph into multiple branches based on the number of threads, so that the number of branches obtained by the splitting is greater than or equal to the concurrent thread number, thereby improving rendering efficiency and shortening rendering time.

[0118] Specifically, the directed acyclic graph is initially split according to the directed edge connection relationship between the graph nodes in the directed acyclic graph. There are no overlapping graph nodes between the branches obtained after the initial split, and the branches obtained after the initial split are independent of each other (that is, there are no directed edges between all graph nodes contained in a branch and all graph nodes contained in other branches). It is determined whether the number of branches obtained by the current split is less than the number of concurrent threads; if not, the split is completed; if so, it is split again, and when splitting again, the branch containing the largest number of graph nodes is selected, and the branch is split again. After the split, it is determined again whether the current number of branches is less than the number of concurrent threads, and so on, until the number of branches obtained by the split is equal to the number of concurrent threads, and the split is terminated. This method can ensure that the number of branches obtained by the split is greater than or equal to the number of concurrent threads, improve the overall rendering efficiency, and avoid resource waste.

[0119] by Figure 5Taking the directed acyclic graph shown in FIG. 1 as an example, when the chain is first split, N1-N6 is regarded as branch 1, N7-N9 is regarded as branch 2, and N10-N11 is regarded as branch 3. If the number of concurrent threads is 2 or 3, the current number of branches ≥ the number of concurrent threads, and the split is completed. Branch 1, branch 2 and branch 3 are the branches of the directed acyclic graph after the final split; if the number of concurrent threads is 4, the current number of branches < the number of concurrent threads, and the branch 1 containing the largest number of graph nodes is split again, and N1-N4 is regarded as branch 1-1, and branch N5-N6 is regarded as branch 1-2, or N2-N4 is regarded as branch 1-1, and N1, N5, and N6 are regarded as branch 1-2. After the split again, the current number of branches = the number of concurrent threads, and the split is completed. Branch 1-1, branch 1-2, branch 2 and branch 3 are the branches of the directed acyclic graph after the final split.

[0120] Step S430: For any branch chain, the branch weight of the branch chain is calculated according to the node weights of the graph nodes included in the branch chain.

[0121] For each branch after splitting, the sum of the node weights of all graph nodes in the branch is taken as the branch weight of the branch.

[0122] In an optional implementation, the initial branch weight of the instruction can be generated based on the node weights of all graph nodes in the branch, and then the initial branch weight can be corrected using the preference weights of the graph nodes in the branch, and the weight obtained after correction is used as the final branch weight. For example, the sum of the node weights of all graph nodes in the branch is first calculated as the initial branch weight, and then the sum of the preference weights of all graph nodes in the branch is calculated, and the product of the initial branch weight and the sum of the preference weights is used as the branch weight of the branch, so that the elements preferred by the user can be rendered first, thereby improving the user experience.

[0123] Step S440: determining the rendering order of each branch chain according to the branch chain weight.

[0124] The branches are sorted in descending order according to their branch weights, and the sorting result is used as the corresponding rendering order. That is, the higher the branch weight, the earlier the rendering order, and the branch is rendered first.

[0125] Step S450: Use multiple concurrent threads to render each branch chain according to the rendering order of the branch chains.

[0126] Use multiple concurrent threads to render each branch in parallel. Under the initial distribution condition, select the N branches with the top N rendering order and distribute them to N concurrent idle threads for processing; after any thread finishes processing the currently distributed branch, select the branch with the top rendering order from the branches that have not yet started rendering to perform the corresponding rendering task. During the process of rendering branches, the thread renders the template elements corresponding to each graph node in turn according to the dependency relationship between the graph nodes in the branch.

[0127] In the actual implementation process, since this application usually involves the rendering of multiple different elements, a module registration mechanism for different rendering services (such as special effects processing, subtitle rendering, audio synthesis, etc.) can be provided in advance to support dynamic access and configuration of different rendering services. The different rendering services can enable parallel execution as needed, and a unified parallel calling interface can be used to call the rendering services to ensure that different rendering services do not interfere with each other during execution, thereby improving processing efficiency.

[0128] It can be seen that the template-based resource rendering method provided in the embodiment of the present application splits the directed acyclic graph of the target template into multiple branches, and executes the multiple branches concurrently, thereby shortening the resource rendering time and improving the resource rendering efficiency; and the present application calculates the branch weight of the branch according to the node weight of the graph node in the branch, and determines the branch rendering order according to the branch weight, so that branches with high branch weights can be rendered first, thereby enabling priority rendering of branches with high complexity and / or user interest, further improving rendering efficiency and improving user experience.

[0129] Embodiment 3

[0130] Figure 6 FIG. 4 shows a structural diagram of a resource rendering device based on a template provided in Embodiment 3 of the present application. Figure 6 As shown, the device 600 includes: a directed graph generating module 610 , a weight determining module 620 , an order determining module 630 , and a rendering module 640 .

[0131] A directed graph generation module 610, configured to generate a directed acyclic graph of a target template according to the rendering dependency relationship between template elements in the target template; wherein the graph nodes in the directed acyclic graph correspond to the template elements in the target template, and the directed edges in the directed acyclic graph correspond to the rendering dependency relationship between template elements in the target template;

[0132] A weight determination module 620 is used to calculate, for any graph node, a node weight of the graph node according to the rendering complexity of the template element corresponding to the graph node;

[0133] An order determination module 630 is used to determine a rendering order of template elements in the target template according to the directed acyclic graph and the node weights of the graph nodes in the directed acyclic graph;

[0134] The rendering module 640 is used to render the template elements according to the rendering order of the template elements.

[0135] In an optional implementation, the device further includes: an acquisition module (not shown in the figure), which is used to acquire the material added to any template element and acquire the material attribute of the material;

[0136] The weight determination module 620 is used to: calculate the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node;

[0137] Calculate the material weight of the graph node according to the material attribute of the template element corresponding to the graph node;

[0138] The node weight of the graph node is generated according to the element weight and the material weight.

[0139] In an optional implementation, the rendering complexity is obtained by: pre-acquiring rendering data of different elements under corresponding default parameters;

[0140] For any element, the system overhead and rendering time of the element are extracted from the rendering data of the element, and the rendering complexity of the element is generated according to the system overhead and the rendering time.

[0141] In an optional implementation, the weight determination module 620 is used to: calculate a difference coefficient between the material attribute of the template element and the default parameter of the template element;

[0142] The material weight of the graph node is generated according to the difference coefficient.

[0143] In an optional embodiment, the weight determination module 620 is used to: obtain user historical resource rendering data, and calculate the preference value of any element based on the user historical resource rendering data; calculate the element weight of the graph node based on the rendering complexity of the template element corresponding to the graph node; calculate the material weight of the graph node based on the material attributes of the template element corresponding to the graph node; calculate the preference weight of the graph node based on the preference value corresponding to the template element corresponding to the graph node; generate the node weight of the graph node based on the element weight, the material weight, and the preference weight.

[0144] In an optional implementation, the sequence determination module 630 is used to: split the directed acyclic graph into a plurality of branches;

[0145] For any branch chain, the branch chain weight of the branch chain is calculated according to the node weights of the graph nodes contained in the branch chain;

[0146] The rendering order of the branches is determined according to the branch weights.

[0147] The rendering module 640 is used to render each branch chain according to the rendering order of the branch chain by using multiple concurrent threads.

[0148] In an optional implementation, the sequence determination module 630 is used to: determine the number of concurrent threads; and split the directed acyclic graph into multiple branches according to the number of threads.

[0149] It can be seen that the template-based resource rendering device provided in the embodiment of the present application generates a directed acyclic graph based on the rendering dependency relationship between template elements in the target template, and finally determines the rendering order of template elements in the target template based on the directed acyclic graph, so that the template elements can be rendered in a correct and effective order, thereby improving the rendering effect and reducing the rendering error rate; moreover, the embodiment of the present application calculates the node weights of the graph nodes according to the rendering complexity of the template elements, and subsequently determines the rendering order of the template elements based on the node weights, so that on the basis of the rendering order conforming to the directed acyclic graph, template elements with high complexity can be rendered preferentially, thereby improving the overall rendering efficiency.

[0150] Embodiment 4

[0151] Figure 7 The schematic diagram of the structure of a computing device provided in the fourth embodiment of the present application is shown. The specific embodiments of the present application do not limit the specific implementation of the computing device.

[0152] like Figure 7 As shown, the computing device may include: a processor (processor) 702 , a communications interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .

[0153] The processor 702, the communication interface 704, and the memory 706 communicate with each other via a communication bus 708. The communication interface 704 is used to communicate with other devices such as a client or other server network elements. The processor 702 is used to execute a program 710, which can specifically execute the relevant steps in the above-mentioned template-based resource rendering method embodiment for a computing device.

[0154] Specifically, the program 710 may include program codes, which include computer operation instructions.

[0155] The processor 702 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0156] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. The program 710 may be specifically used to enable the processor 702 to perform the operations in the above method embodiment.

[0157] Embodiment 5

[0158] Embodiment 5 of the present application provides a non-volatile computer storage medium, which stores at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the template-based resource rendering method in any of the above method embodiments.

[0159] Embodiment 6

[0160] Embodiment 6 of the present application provides a computer program product, which includes at least one executable instruction or computer program, and the executable instruction or computer program can enable a processor to perform operations corresponding to the template-based resource rendering method in any of the above method embodiments.

[0161] In summary, according to the computing device, computer storage medium and computer program product provided by the present embodiment, a directed acyclic graph is generated based on the rendering dependency relationship between template elements in the target template, and finally the rendering order of the template elements in the target template is determined based on the directed acyclic graph, so that the template elements can be rendered in a correct order with good rendering effect, thereby improving the rendering effect and reducing the rendering error rate; moreover, the embodiment of the present application calculates the node weights of the graph nodes according to the rendering complexity of the template elements, and subsequently determines the rendering order of the template elements based on the node weights, so that on the basis of the rendering order conforming to the directed acyclic graph, template elements with high complexity can be rendered preferentially, thereby improving the overall rendering efficiency.

[0162] The algorithm or display provided here are not inherently related to any specific computer, virtual system or other equipment. Various general systems can also be used together with the teaching based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present application described here, and the above description of specific languages ​​is to disclose the best mode of implementation of the present application.

[0163] In the description provided herein, a large number of specific details are described. However, it is understood that the embodiments of the present application can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0164] Similarly, it should be understood that in order to streamline the present application and help understand one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present application, the various features of the embodiments of the present application are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be interpreted as reflecting the following intention: the claimed application requires more features than the features clearly stated in each claim. More specifically, as reflected in the claims below, the inventive aspects are less than all the features of the single embodiment disclosed above. Therefore, the claims following the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present application.

[0165] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0166] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0167] The various component embodiments of the present application can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to the embodiments of the present application. The application can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing a part or all of the methods described herein. Such a program implementing the present application can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0168] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In a unit claim that lists several devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A template-based resource rendering method, characterized in that: include: Generate a directed acyclic graph of the target template according to the rendering dependency relationship between template elements in the target template; wherein the graph nodes in the directed acyclic graph correspond to the template elements in the target template, and the directed edges in the directed acyclic graph correspond to the rendering dependency relationship between template elements in the target template; For any graph node, the node weight of the graph node is calculated according to the rendering complexity of the template element corresponding to the graph node; Determining a rendering order of template elements in the target template according to the directed acyclic graph and node weights of graph nodes in the directed acyclic graph; The template elements are rendered according to a rendering order of the template elements.

2. The method according to claim 1, characterized in that The method further comprises: acquiring a material added to any template element, and acquiring a material attribute of the material; The step of calculating the node weight of the graph node according to the rendering complexity of the template element corresponding to the graph node includes: Calculate the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node; Calculate the material weight of the graph node according to the material attribute of the template element corresponding to the graph node; The node weight of the graph node is generated according to the element weight and the material weight.

3. The method according to claim 2, characterized in that Before calculating the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node, the method further includes: Pre-obtain rendering data of different elements under corresponding default parameters; For any element, the system overhead and rendering time of the element are extracted from the rendering data of the element, and the rendering complexity of the element is generated according to the system overhead and the rendering time.

4. The method according to claim 3, characterized in that The calculating the material weight of the graph node according to the material attribute of the template element corresponding to the graph node includes: Calculate the difference coefficient between the material attribute of the template element and the default parameter of the template element; The material weight of the graph node is generated according to the difference coefficient.

5. The method according to any one of claims 2 to 4, characterized in that: The method further comprises: acquiring user historical resource rendering data, and calculating a preference value of any element according to the user historical resource rendering data; The step of calculating the node weight of the graph node according to the rendering complexity of the template element corresponding to the graph node includes: Calculate the element weight of the graph node according to the rendering complexity of the template element corresponding to the graph node; Calculate the material weight of the graph node according to the material attribute of the template element corresponding to the graph node; Calculate the preference weight of the graph node according to the preference value corresponding to the template element corresponding to the graph node; The node weight of the graph node is generated according to the element weight, the material weight, and the preference weight.

6. The method according to any one of claims 1 to 5, characterized in that Determining the rendering order of template elements in the target template according to the directed acyclic graph and the node weights of the graph nodes in the directed acyclic graph includes: Splitting the directed acyclic graph into multiple branches; For any branch chain, the branch chain weight of the branch chain is calculated according to the node weights of the graph nodes contained in the branch chain; Determining a rendering order of the branches according to the branch weights; The rendering of the template elements according to the rendering order of the template elements includes: using multiple concurrent threads to render each branch chain according to the rendering order of the branch chains.

7. The method according to claim 6, characterized in that The step of splitting the directed acyclic graph into a plurality of branches comprises: Determine the number of concurrent threads; The directed acyclic graph is split into a plurality of branches according to the number of threads.

8. A resource rendering device based on a template, characterized in that: include: A directed graph generation module, used to generate a directed acyclic graph of a target template according to the rendering dependency relationship between template elements in the target template; wherein the graph nodes in the directed acyclic graph correspond to the template elements in the target template, and the directed edges in the directed acyclic graph correspond to the rendering dependency relationship between template elements in the target template; A weight determination module, used to calculate the node weight of any graph node according to the rendering complexity of the template element corresponding to the graph node; An order determination module, used to determine the rendering order of template elements in the target template according to the directed acyclic graph and the node weights of the graph nodes in the directed acyclic graph; A rendering module is used to render the template elements according to the rendering order of the template elements.

9. A computing device, characterized in that include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the template-based resource rendering method according to any one of claims 1 to 7.

10. A computer storage medium, characterized in that: The storage medium stores at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the template-based resource rendering method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The method comprises at least one executable instruction, wherein the executable instruction enables a processor to execute operations corresponding to the template-based resource rendering method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Pipeline parallelization method for coarse-grained streaming application

    CN103377035A

  • Data processing method and related device

    CN114511657A

  • Distributed rendering method and device

    CN114968521A

  • Three-dimensional rendering system and method for animation image

    CN118334223A

  • Task-oriented multi-resource scheduling method and device, equipment and storage medium

    CN119003162A