Data-driven video template dynamic construction method and device and equipment
By using a data-driven method to dynamically construct video templates, and by parsing and validating the element node tree, the complexity and code redundancy of traditional video template processing solutions are resolved, enabling flexible video template generation and maintenance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN THINKIVE INFORMATION TECH CO LTD
- Filing Date
- 2022-09-23
- Publication Date
- 2026-05-08
AI Technical Summary
Traditional video template dynamic processing solutions are difficult to meet complex dynamic requirements and suffer from code redundancy and maintenance difficulties.
Using a data-driven approach, the dynamic data template is parsed into an element node tree, the data interface is automatically requested to obtain the returned data, the element node expressions are traversed and calculated, logical conditions are processed, and data validation is performed after the element node tree traversal is completed to construct a static video template.
It enables the dynamic construction of video templates with different content based on different data, improving the flexibility and maintainability of video output and reducing code redundancy.
Smart Images

Figure CN115567752B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video template construction technology, and in particular to a data-driven method, apparatus, device and storage medium for dynamic construction of video templates. Background Technology
[0002] Currently, with the rise of short videos, more and more industries have higher requirements for video production efficiency. Combined with the continued rise of the big data economy, video production methods will gradually shift from the previous production by professional video editors to automated video production driven by big data, with a large number of templated and configurable variables.
[0003] Traditional solutions for dynamic processing of video templates are quite limited. For example, using a data dictionary to globally replace variable names in the video template content makes it difficult to meet complex dynamic requirements, or storing the relevant data retrieval and processing logic in the code in a hard-coded form results in a lot of code redundancy, making it difficult to maintain and extend.
[0004] In view of this, it is necessary to propose further improvements to the current method of dynamically constructing video templates. Summary of the Invention
[0005] Therefore, the purpose of this invention is to at least partially address the shortcomings of the prior art, thereby proposing a data-driven method, apparatus, and device for dynamically constructing video templates.
[0006] In a first aspect, the present invention provides a data-driven method for dynamically constructing video templates, the method comprising:
[0007] Obtain a dynamic data template, read the content of the dynamic data template and parse it into an element node tree. The content of the dynamic data template includes a data source, and the data source is parsed into a data interface.
[0008] The system automatically requests the data interface and obtains the returned data. The returned data is then injected into the element node tree. The system traverses the expressions of all element nodes in the element node tree using the returned data, calculates and assigns values to the expressions, and processes all logical conditions until the element node tree has been traversed.
[0009] When the element node tree has been traversed, the assigned element nodes are validated. If the element node validation passes, the element node tree is constructed as template content and output to obtain a static video template.
[0010] Secondly, the present invention provides a data-driven video template dynamic construction device, the device comprising,
[0011] Parsing module: used to obtain dynamic data template, read the content of the dynamic data template and parse it into an element node tree. The content of the dynamic data template includes a data source, which is parsed into a data interface.
[0012] Assignment module: used to automatically request the data interface and obtain the returned data, inject the returned data into the element node tree, traverse the expressions of all element nodes in the element node tree through the returned data, calculate and assign values to the expressions, and process all logical conditions until the element node tree has been traversed.
[0013] Verification module: When the element node tree has been traversed, it performs data verification on the assigned element nodes. If the element node passes the verification, the element node tree is constructed into template content and output to obtain a static video template.
[0014] Thirdly, the present invention also provides a data-driven video template dynamic construction device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the data-driven video template dynamic construction method as described in the first aspect.
[0015] Fourthly, the present invention also provides a storage medium having a computer program stored thereon, which, when executed, implements the various steps of the data-driven dynamic video template construction method as described in the first aspect.
[0016] This invention provides a data-driven method, apparatus, and device for dynamically constructing video templates. The method includes: acquiring a dynamic data template; reading the content of the dynamic data template and parsing it into an element node tree, wherein the content of the dynamic data template includes a data source, and the data source is parsed into a data interface; automatically requesting the data interface and obtaining returned data; injecting the returned data into the element node tree; traversing the expressions of all element nodes in the element node tree through the returned data, calculating and assigning values to the expressions while processing all logical conditions, until the element node tree is completely traversed; when the element node tree is completely traversed, performing data verification on the assigned element nodes; if the element node verification passes, constructing the element node tree into template content and outputting it to obtain a static video template. By parsing the external data source in the dynamic data template into a data interface and injecting the data returned by the data interface into the element node tree for calculation and assignment, and by simultaneously processing all logical conditions, the method can dynamically construct different content video templates based on different data returned by the data interface. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating the data-driven dynamic video template construction method of the present invention.
[0019] Figure 2 This is a schematic diagram of a sub-process of the data-driven dynamic video template construction method of the present invention;
[0020] Figure 3 This is a schematic diagram of another sub-process of the data-driven video template dynamic construction method of the present invention;
[0021] Figure 4 This is a schematic diagram illustrating the specific implementation steps of the data-driven video template dynamic construction method of the present invention;
[0022] Figure 5 This is a schematic diagram illustrating an application scenario of the data-driven video template dynamic construction method of the present invention;
[0023] Figure 6 This is a schematic diagram of the program modules of the data-driven video template dynamic construction device of the present invention. Detailed Implementation
[0024] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a data-driven dynamic video template construction method according to an embodiment of this application. In this embodiment, the data-driven dynamic video template construction method includes:
[0026] Step 101: Obtain the dynamic data template, read the content of the dynamic data template and parse it into an element node tree. The content of the dynamic data template includes a data source, which is parsed into a data interface.
[0027] In this embodiment, a dynamic data template is obtained, its content is read, and the read content is parsed into an element node tree. Both reading the dynamic data template content and parsing it into an element node tree are implemented using a data model. Specifically, the dynamic data template content also includes a data source. While the content in the dynamic data template is parsed into an element node tree, the data source is parsed into a data interface. The data source is an external data source defined in the dynamic data template. Essentially, the data source specifies a data interface that supports the HTTP(S) protocol, specifying the request method, request interface URL, request parameters, etc.
[0028] Step 102: Automatically request the data interface and obtain the returned data, inject the returned data into the element node tree, traverse the expressions of all element nodes in the element node tree through the returned data, calculate and assign values to the expressions, and process all logical conditions until the element node tree has been traversed.
[0029] In this embodiment, the data interface parsed in step 101 is automatically requested to obtain the returned data. Specifically, when the dynamic data template is parsed, the corresponding returned data is retrieved from the data source defined in the dynamic data template. The returned data structure can be freely negotiated and defined by the backend developers and template creators, providing high flexibility. After obtaining the returned data, it is injected into the element node tree, and the attributes and contained expressions of all element nodes in the element node tree are extracted. For example, the expression contained in an element node might be ({{a+1}}). The returned data is substituted into the expression for calculation. After obtaining the calculation result, the expression is replaced with the calculation result, i.e., the expression is assigned a value using the calculation result. This enables the mapping between video content and data. Simultaneously, the logical conditions of the element nodes are implemented when assigning values to the expressions, until the element node tree is completely traversed. The structure of the returned data is consistent with the data structure referenced by the expressions contained in the element nodes, providing high versatility.
[0030] Step 103: When the element node tree has been traversed, the assigned element nodes are validated. If the element node validation passes, the element node tree is constructed as template content and output to obtain a static video template.
[0031] In this embodiment, after traversing the element node tree using the returned data, the assigned element nodes are then validated to ensure that they can be used to construct template content that conforms to the minimum standards of the VTL (Video Template Language) specification. Only after all element nodes have passed validation is the element node tree complete, and only then can it be used to construct template content and output, thus obtaining a static video template. Specifically, the element node tree is constructed into template content using a template building library.
[0032] In this embodiment, the data model supports mutual conversion between element node trees and video templates, enabling the data model to read and construct templates. The content of the read templates can be used for editing, saving, previewing, rendering, etc. in the video content editor, and the constructed templates can be conveniently stored and transmitted.
[0033] This application provides a data-driven method for dynamically constructing video templates. The method includes: acquiring a dynamic data template; reading the content of the dynamic data template and parsing it into an element node tree; the content of the dynamic data template includes a data source, which is parsed into a data interface; automatically requesting the data interface and obtaining returned data; injecting the returned data into the element node tree; traversing the expressions of all element nodes in the element node tree using the returned data, calculating and assigning values to the expressions while processing all logical conditions, until the element node tree is completely traversed; when the element node tree is completely traversed, performing data validation on the assigned element nodes; if the element node validation passes, constructing the element node tree into template content and outputting it to obtain a static video template. By parsing the external data source in the dynamic data template into a data interface and injecting the data returned by the data interface into the element node tree for calculation and assignment, and by simultaneously processing all logical conditions, the method can dynamically construct different content video templates based on different data returned by the data interface.
[0034] Further, please refer to Figure 2 , Figure 2 This is a schematic diagram of a sub-process of the data-driven video template dynamic construction method in this embodiment. In this embodiment, the step of injecting the returned data into the element node tree, traversing the expressions of all element nodes in the element node tree through the returned data, calculating and assigning values to the expressions, and processing all logical conditions until the element node tree has been traversed, specifically includes:
[0035] Step 201: Substitute the returned data into the element node tree, wherein the element node tree includes multiple element nodes, and each element node includes multiple expressions, wherein the expressions are Lambda expressions;
[0036] Step 202: Substitute the returned data into the Lambda expression and perform calculation. Assign the calculated value to the Lambda expression. At the same time, process all logical conditions of the element node until all element nodes in the element node tree have been traversed. The logical conditions include conditional branching and loop iteration logic.
[0037] In this embodiment, the returned data is substituted into the element node tree, which includes multiple element nodes. In other words, the element node tree is composed of element nodes. Each element node contains multiple expressions, and the expressions within the element nodes use Lambda expressions. Lambda expressions (based on JavaScript syntax) are used to replace static values, thus making the video element content, which originally only had static content, "dynamic" (e.g., ...). <text> {{1+2}}< / text> After calculation, it will become <text> 3< / text> It also supports referencing external variables or functions (such as...) in expressions. <text> {{newDate().toLocaleDateString()}}< / text> After calculation, it will become <text> 2022 / 08 / 07< / text> This will allow the video template content to change with the data, resulting in a wide variety of final video content.
[0038] In this embodiment, after the returned data calculates the Lambda expression contained in the element node, it assigns the calculated value to the Lambda expression, essentially replacing the Lambda expression with the calculated value. Simultaneously with assigning a value to the Lambda expression, the logical conditions of the element node are also processed. This involves defining conditional branches and iterating over expressions within the element node until the returned data has traversed all the expressions of all element nodes in the element node tree. Some elements may require a decision on whether to display based on data values. In such scenarios, adding if, elif, and else attributes to the element node will support conditional branching handling (e.g., ...).<text if=”{{texts[0]}}”> {{texts[0]}} will only display the text element when the string at index 0 in the texts array exists. If elif or else is used, it needs to follow immediately after if or elif. The elif expression of this node will be judged only when the previous condition is not met, or the else node will be used directly. In order to realize the dynamic generation of a large number of uncertain video elements, this application embodiment also supports adding for, for-index, and for-item attributes to the element node for looping generation of nodes (such as...<text for=”{{texts}}”> `{{texts[index]}}` will iterate through all string values in the `texts` array, generating the corresponding number of `text` nodes and filling them with string values. Lambda expressions, besides accessing external variables or functions, also support accessing the `index` (the current array index in the loop body) and `item` (the element value in the array accessed by the loop body) within the scope of the node using the `for` loop. When these two variables are accessed in the inner loop body of a nested loop, they are the values of the inner loop. You can use `for-index` and `for-item` to rename them for differentiation. Specifically, elements support nesting to form an element node tree, allowing for a high degree of freedom in defining the representation of elements within the video template.
[0039] Furthermore, the assigned element nodes undergo data validation. If the element node validation passes, the element node tree is constructed as template content and output. This also includes:
[0040] If the element node fails the verification, the data content with the verification error will be output and a correction prompt will be given.
[0041] In this embodiment, when the returned data is injected into the element node tree, and after traversing all element nodes, calculating and assigning values to their Lambda expressions, basic data validation needs to be performed on the assigned element nodes. It is necessary to ensure that the assigned element nodes conform to the minimum standards of the VTL specification when constructing their templates. If the assigned element nodes fail the validation, the console will output a warning about the validation error and prompt for correction.
[0042] Further, please refer to Figure 3 , Figure 3 This is a schematic diagram of another sub-process of the data-driven video template dynamic construction method in this embodiment. In this embodiment, the process of obtaining a dynamic data template, reading the content of the dynamic data template and parsing it into an element node tree, further includes:
[0043] Step 301: Obtain template content that conforms to the video template language specification and store it in an XML template file, wherein the XML template file storing the template content is the dynamic data template;
[0044] Step 302: Import the dynamic data template into the template parsing library, and read the content of the dynamic data template through the template parsing library and parse it into the element node tree.
[0045] In this embodiment, the template content in the dynamic data template needs to conform to the Video Template Language (VTL) specification and needs to be stored in an XML template file; that is, dynamic data templates can be developed using the VTL language. In this embodiment, the template content in the dynamic data template can be written by template creators; the source of the template content is not limited, but it must conform to the Video Template Language specification.
[0046] After obtaining a qualified dynamic data template, the dynamic data template is imported into the template parsing library. The template parsing library reads the content in the dynamic data template and parses it into an element node tree.
[0047] Furthermore, the dynamic data template also includes extended scripts, which can be used to implement and expose functions for calculating complex expressions.
[0048] In this embodiment, complex expression calculations may occur in actual application scenarios. Therefore, this embodiment of the application also adds extended script capabilities, supporting the use of custom script tags in templates to implement and expose functions. In this way, custom functions can be used to calculate and return results in expressions.
[0049] Furthermore, the data source is a user-defined data source; the returned data is in application / json format.
[0050] In this embodiment, the data source can be a custom external data source. When the data source is resolved to a data interface, there can be one data interface or multiple data interfaces. The data interface is generally an interface URL that supports GET requests. The data returned by the data interface is also data in application / json format. There are no special requirements for the structure of the returned data.
[0051] Furthermore, after obtaining the static video template, the process also includes:
[0052] The static video template is then transmitted to a video editor or rendering engine for video editing or rendering output.
[0053] In this embodiment, after obtaining the static video template, the static video template can be transferred to a video editor or rendering engine for video editing or rendering output. The use of the static video template is not limited to video editing or rendering output.
[0054] Further, please refer to Figure 4 , Figure 4 This is a schematic diagram illustrating the specific implementation steps of the data-driven dynamic video template construction method in this application embodiment. The specific implementation steps of this application embodiment include:
[0055] 1. Write template content that conforms to the Video Template Language (VTL) specification provided in this technology and store it in an XML template file. The XML template file containing the template content is a dynamic data template.
[0056] 2. Import the dynamic data template from step 1 into the parsing library. The parsing library will read the content of the dynamic data template and parse it into an element node tree.
[0057] 3. The data source defined in the dynamic data template (such as...) <source> <s1url=”http: / / 127.0.0.1:8080 / data”> The data source (i.e., data interface) is parsed into a dynamic data template. The s1 tag is one of the sources, and multiple sources are allowed. The source is generally an interface URL that supports GET requests. The data interface needs to return data in application / json format (no special requirements for the internal data structure).
[0058] 4. The parsing library automatically requests the data interface and obtains the returned data, then injects the data into the element node tree. It traverses all element nodes in the element node tree, calculates and assigns values to their Lambda expressions, and handles all conditional branching and loop iteration logic until the entire element node tree has been traversed.
[0059] 5. When an element node is assigned a value by an attribute, basic data validation will be performed to ensure that the template content meets the minimum standards of the VTL specification. If the validation fails, the console will output a warning message indicating the data content with the validation error and prompting for correction.
[0060] 6. Once all element nodes have been validated, the element node tree is complete. At this point, the element node tree can be used to build template content using a template building library. Outputting the built template content to an XML file will then create a static video template.
[0061] Further, please refer to Figure 5 , Figure 5 This is a schematic diagram illustrating an application scenario of a data-driven dynamic video template construction method. The processing flow for a short video scenario in the financial industry includes the following steps:
[0062] 1. External data sources automatically synchronize fund or stock-related data to the database and open a data query interface.
[0063] 2. Template creators produce dynamic video data templates based on the data structure provided by the data interface.
[0064] 3. Schedule a task or front-end page to select any dynamic video template and initiate the analysis of a batch or a specific stock / fund.
[0065] 4. The template model accepts dynamic templates and fund / stock codes and pulls specified data from the data source.
[0066] 5. The template compiler parses and performs calculations on all expressions to obtain static templates.
[0067] 6. The static template is transferred to the video editor or rendering engine for video editing or rendering output.
[0068] Furthermore, the embodiments of this application implement a dynamic video template construction method based on data-driven approaches. That is, the dynamic video template construction method is implemented based on a data model, which in this patent application also implements other functions, such as:
[0069] 1. To meet the needs of certain elements with large data requirements (such as charts, which often display complex data), the data will be encoded and persisted on the template element when such elements are built. During parsing, the data will be decoded, making it possible to persist the chart element on the video template.
[0070] 2. In video production and editing scenarios, componentized combined elements (such as combined dynamic text) often appear. For this scenario, this application also supports the parsing and construction of any node and forces that the entire template must be parsed or constructed. This makes it easy to componentize element nodes, and only the node content of that part needs to be stored and transmitted.
[0071] Specifically, this application proposes a video template technology that allows data injection and dynamic changes in corresponding media elements based on that data. This application provides a Video Template Language (VTL) specification. Template files written using this specification, combined with a template model parsing library, support capabilities such as external data source injection, lambda expression parsing and calculation, variable data retrieval, conditional branching, list traversal, extended scripts, and long data persistence. This enables the dynamic construction of different content video templates based on different data returned by the data interface. Furthermore, the data model contains the core elements of the video content (such as images / text / audio / embedded video, etc.) and defines attributes for these elements that conform to their functions. Elements support nesting to form an element node tree. Based on this model, the representation of elements in the video can be freely defined.
[0072] Furthermore, embodiments of this application also provide a data-driven video template dynamic construction device 400. Figure 6 This is a schematic diagram of the program modules of the data-driven video template dynamic construction device in this embodiment of the application. In this embodiment, the data-driven video template dynamic construction device 400 includes:
[0073] Parsing module 401: used to obtain a dynamic data template, read the content of the dynamic data template and parse it into an element node tree, wherein the content of the dynamic data template includes a data source, and the data source is parsed into a data interface;
[0074] Assignment module 402: is used to automatically request the data interface and obtain the returned data, inject the returned data into the element node tree, traverse the expressions of all element nodes in the element node tree through the returned data, calculate and assign values to the expressions, and process all logical conditions until the element node tree has been traversed.
[0075] Verification module 403: When the element node tree has been traversed, it performs data verification on the assigned element nodes. If the element node verification passes, the element node tree is constructed as template content and output to obtain a static video template.
[0076] This application provides a data-driven video template dynamic construction device 400, which can: acquire a dynamic data template; read the content of the dynamic data template and parse it into an element node tree, wherein the content of the dynamic data template includes a data source, and the data source is parsed into a data interface; automatically request the data interface and obtain returned data; inject the returned data into the element node tree; traverse the expressions of all element nodes in the element node tree through the returned data, calculate and assign values to the expressions, and process all logical conditions simultaneously, until the element node tree is completely traversed; when the element node tree is completely traversed, perform data verification on the assigned element nodes; if the element node verification passes, construct the element node tree into template content and output it to obtain a static video template. Through the method provided by this invention, by parsing the external data source in the dynamic data template into a data interface, injecting the data returned by the data interface into the element node tree for calculation and assignment, and simultaneously processing all logical conditions, it is possible to dynamically construct different content video templates based on different data returned by the data interface.
[0077] Furthermore, this application also provides a data-driven video template dynamic construction device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps in the data-driven video template dynamic construction method described above.
[0078] Furthermore, this application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the various steps of the data-driven dynamic video template construction method described above.
[0079] In the various embodiments of this invention, the functional modules can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.
[0080] Based on this understanding, the technical solutions of this invention, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0081] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, as some steps can be performed in other orders or simultaneously according to the present invention. Secondly, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention. In the above embodiments, the descriptions of each embodiment have their own emphasis; for parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0082] For those skilled in the art, based on the ideas of the embodiments of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A data-driven method for dynamically constructing video templates, characterized in that, The method includes: A dynamic data template is obtained, its content is read and parsed into an element node tree. The content of the dynamic data template includes a data source, which is parsed into a data interface. The content of the dynamic data template also includes an extension script, which can be used to implement and expose functions for calculating complex expressions. The system automatically requests the data interface and obtains the returned data. The returned data is then injected into the element node tree. The system traverses the expressions of all element nodes in the element node tree using the returned data, calculates and assigns values to the expressions, and processes all logical conditions until the element node tree has been completely traversed. The returned data is then substituted into the element node tree. The element node tree includes multiple element nodes, and each element node includes multiple expressions, which are Lambda expressions. Substitute the returned data into the Lambda expression and perform calculation. Assign the calculated value to the Lambda expression. At the same time, process all logical conditions of the element node until all element nodes in the element node tree have been traversed. The logical conditions include conditional branching and loop iteration logic. When the element node tree has been traversed, the assigned element nodes are validated. If the element node validation passes, the element node tree is constructed as template content and output to obtain a static video template.
2. The method according to claim 1, characterized in that, The step of performing data validation on the assigned element nodes, and if the element node validation passes, then constructing the element node tree as template content and outputting it, also includes: If the element node fails the verification, the data content with the verification error will be output and a correction prompt will be given.
3. The method according to claim 1, characterized in that, The process of obtaining a dynamic data template, reading the content of the dynamic data template, and parsing it into an element node tree also includes: Obtain template content that conforms to the video template language specification and store it in an XML template file, wherein the XML template file storing the template content is the dynamic data template; The dynamic data template is imported into the template parsing library, and the content of the dynamic data template is read and parsed into the element node tree through the template parsing library.
4. The method according to claim 1, characterized in that, The data source is a user-defined data source; the returned data is in application / json format.
5. The method according to claim 1, characterized in that, After obtaining the static video template, the process also includes: The static video template is then transmitted to a video editor or rendering engine for video editing or rendering output.
6. A data-driven video template dynamic construction device, characterized in that, The device includes: Parsing module: used to obtain dynamic data template, read the content of the dynamic data template and parse it into an element node tree. The content of the dynamic data template includes a data source, which is parsed into a data interface. The content of the dynamic data template also includes an extension script, which can be used to implement and expose functions for calculating complex expressions. Assignment module: used to automatically request the data interface and obtain returned data, inject the returned data into the element node tree, traverse the expressions of all element nodes in the element node tree through the returned data, calculate and assign values to the expressions, and process all logical conditions until the element node tree is completely traversed. The returned data is substituted into the element node tree, which includes multiple element nodes, and each element node includes multiple expressions, which are Lambda expressions. Substitute the returned data into the Lambda expression and perform calculation. Assign the calculated value to the Lambda expression. At the same time, process all logical conditions of the element node until all element nodes in the element node tree have been traversed. The logical conditions include conditional branching and loop iteration logic. Verification module: When the element node tree has been traversed, it performs data verification on the assigned element nodes. If the element node passes the verification, the element node tree is constructed into template content and output to obtain a static video template.
7. A data-driven video template dynamic construction device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements each step of the data-driven video template dynamic construction method as described in any one of claims 1-5.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements each step of the data-driven video template dynamic construction method as described in any one of claims 1-5.