CN115567752A - Video template dynamic construction method, device and equipment based on data driving - Google Patents

Video template dynamic construction method, device and equipment based on data driving Download PDF

Info

Publication number
CN115567752A
CN115567752A CN202211166041.9A CN202211166041A CN115567752A CN 115567752 A CN115567752 A CN 115567752A CN 202211166041 A CN202211166041 A CN 202211166041A CN 115567752 A CN115567752 A CN 115567752A
Authority
CN
China
Prior art keywords
data
template
node tree
element node
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211166041.9A
Other languages
Chinese (zh)
Inventor
陈炜宾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Thinkive Information Technology Co ltd
Original Assignee
Shenzhen Thinkive Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Thinkive Information Technology Co ltd filed Critical Shenzhen Thinkive Information Technology Co ltd
Priority to CN202211166041.9A priority Critical patent/CN115567752A/en
Publication of CN115567752A publication Critical patent/CN115567752A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/858Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
    • H04N21/8586Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a data-driven video template dynamic construction method, a device and equipment, wherein the method comprises the following steps: reading the content of the dynamic data template and analyzing the content into an element node tree, wherein a data source in the dynamic data template is analyzed into a data interface; requesting a data interface, obtaining return data, injecting the return data into the element node tree, traversing expressions of all element nodes by the return data, calculating assignment and simultaneously processing all logic conditions until the element node tree is traversed; and checking the assigned element nodes, and if the element nodes pass the checking, constructing the element nodes as template contents and outputting the template contents to obtain the static video template. By the method provided by the invention, the external data source in the dynamic data template is analyzed into the data interface, the data returned by the data interface is injected into the element node tree for calculation and assignment, and all logic conditions can be processed simultaneously, so that the function of dynamically constructing different content video templates according to different data returned by the data interface can be realized.

Description

Video template dynamic construction method, device and equipment based on data driving
Technical Field
The invention relates to the technical field of video template construction, in particular to a dynamic video template construction method, a dynamic video template construction device, a dynamic video template construction equipment and a storage medium based on data driving.
Background
At present, with the rise of short video trends, more and more industries have higher requirements on video output efficiency, and in combination with the continuous rise of big data economy, a video output mode is gradually changed from the past professional video editing engineer production into a large amount of templated configurable variables, and the big data is used as the driven video automatic production.
The traditional implementation scheme of dynamic processing of the video template is limited, for example, global replacement of variable names is performed on the content of the video template in a data dictionary form, so that the complex dynamic requirements are difficult to meet, or a large amount of code redundancy is caused by storing relevant data processing logic in codes in a hard coding form, and the maintenance and the expansion are difficult.
In view of the above, it is necessary to provide further improvements to the current video template dynamic construction method.
Disclosure of Invention
Therefore, the invention aims to solve the defects in the prior art at least to a certain extent, and provides a method, a device and equipment for dynamically constructing a video template based on data driving.
In a first aspect, the present invention provides a method for dynamically constructing a video template based on data driving, where the method includes:
acquiring a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree, wherein the content of the dynamic data template comprises a data source, and the data source is analyzed into a data interface;
automatically requesting the data interface and obtaining return data, injecting the return data into the element node tree, traversing expressions of all element nodes of the element node tree through the return data, calculating and assigning the expressions and simultaneously processing all logic conditions until the element node tree is traversed;
and when the element node tree is traversed, performing data verification on the assigned element nodes, and if the element node tree passes the data verification, constructing the element node tree as template content and outputting the template content to obtain the static video template.
In a second aspect, the present invention provides an apparatus for dynamically constructing a video template based on data driving, the apparatus comprising,
an analysis module: the system comprises a data source, a data interface and a data processing module, wherein the data source is used for acquiring a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree;
an assignment module: the data interface is used for automatically requesting the data interface and obtaining return data, the return data is injected into the element node tree, expressions of all element nodes of the element node tree are traversed through the return data, the expressions are calculated and assigned, and all logic conditions are processed at the same time until the element node tree is traversed;
a checking module: and the static video template is used for carrying out data verification on the assigned element nodes when the element node tree is traversed, and if the element node tree passes the data verification, constructing the element node tree into template content and outputting the template content to obtain the static video template.
In a third aspect, the present invention further provides a data-driven-based video template dynamic construction device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps in the data-driven-based video template dynamic construction method according to the first aspect.
In a fourth aspect, the present invention further provides a storage medium, on which a computer program is stored, which, when executed, implements the steps of the method for dynamically constructing a video template based on data driving according to the first aspect.
The invention provides a data-driven video template dynamic construction method, a device and equipment, wherein the method comprises the following steps: acquiring a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree, wherein the content of the dynamic data template comprises a data source, and the data source is analyzed into a data interface; automatically requesting the data interface and obtaining return data, injecting the return data into the element node tree, traversing expressions of all element nodes of the element node tree through the return data, calculating and evaluating the expressions and simultaneously processing all logic conditions until the element node tree is traversed; and when the element node tree is traversed, performing data verification on the assigned element nodes, and if the element node tree passes the data verification, constructing the element node tree as template content and outputting the template content to obtain a static video template. By the method provided by the invention, the external data source in the dynamic data template is analyzed into the data interface, the data returned by the data interface is injected into the element node tree for calculation and assignment, and all logic conditions can be processed simultaneously, so that the function of dynamically constructing different content video templates according to different data returned by the data interface can be realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a dynamic video template construction method based on data driving according to the present invention;
FIG. 2 is a sub-flow diagram of the dynamic video template construction method based on data driving according to the present invention;
FIG. 3 is a schematic view of another sub-flow of the dynamic video template construction method based on data driving according to the present invention;
FIG. 4 is a schematic diagram illustrating an embodiment of a method for dynamically constructing a video template based on data driving according to the present invention;
FIG. 5 is a schematic diagram of an application scenario of the dynamic video template construction method based on data driving according to the present invention;
fig. 6 is a schematic diagram of program modules of the data-driven-based video template dynamic construction apparatus according to the present invention.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a dynamic video template construction method based on data driving according to an embodiment of the present application, where in the embodiment, the dynamic video template construction method based on data driving includes:
step 101, obtaining a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree, wherein the content of the dynamic data template comprises a data source, and the data source is analyzed into a data interface.
In this embodiment, the dynamic data template is obtained, the content of the dynamic data template is read, and the read content is analyzed into the element node tree, wherein the reading of the content of the dynamic data template and the analysis of the content into the element node tree are both realized by the data model. Specifically, the content of the dynamic data template further includes a data source, and the data source is parsed into a data interface while the content in the dynamic data template is parsed into an element node tree, wherein the data source is an external data source defined in the dynamic data template, the essence of the data source is to specify a data interface supporting the HTTP (S) protocol, and a request method, a request interface URL, a request parameter, and the like are specified in the data source.
And 102, automatically requesting the data interface and obtaining return data, injecting the return data into the element node tree, traversing expressions of all element nodes of the element node tree through the return data, calculating and assigning the expressions, and simultaneously processing all logic conditions until the element node tree is traversed.
In this embodiment, the data interface obtained by parsing in step 101 is automatically requested, so as to obtain the return data, that is, when the dynamic data template is parsed, the corresponding return data is pulled from the data source defined in the dynamic data template, where the return data structure can be completely and freely defined by a back-end developer and a template maker, which provides extremely high flexibility. After the return data is obtained, the return data is injected into the element node tree, the attributes of all element nodes in the element node tree and expressions contained in the element nodes are extracted, the expressions contained in the element nodes are as ({ { a +1} }), the return data is substituted into the expressions for calculation, and after a calculation result is obtained, the expressions are replaced by the calculation result, namely, the calculation result is used for assigning values to the expressions, so that the mapping of video content and data can be realized, and the logical conditions of the element nodes can be realized while the expressions are assigned until the element node tree is traversed. The structure of the returned data is consistent with the data structure referenced by the expression contained in the element node, and extremely high universality is provided.
And 103, when the element node tree is traversed, performing data verification on the assigned element nodes, and if the element node tree passes the data verification, constructing the element node tree as template content and outputting the template content to obtain a static video template.
In this embodiment, after the element node tree is traversed by the return data, data inspection is performed on the assigned element nodes, it is ensured that the assigned element nodes can be constructed as Template contents meeting the minimum standard of a VTL (Video Template Language) specification, and after all the element nodes are inspected, the element node tree is only complete, and the element node tree can be constructed as the Template contents and output, so that the static Video Template is obtained. And constructing the node tree into template contents by the element node tree through a template construction library.
In this embodiment, the data model supports interconversion between the element node tree and the video template, so that the data model can be read in and constructed as the template, the content of the read template can be used for editing, saving, previewing, rendering and the like of a video content editor, and the data model can be conveniently stored and transmitted after being constructed as the template.
The embodiment of the application provides a video template dynamic construction method based on data driving, which comprises the following steps: acquiring a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree, wherein the content of the dynamic data template comprises a data source, and the data source is analyzed into a data interface; automatically requesting the data interface and obtaining return data, injecting the return data into the element node tree, traversing expressions of all element nodes of the element node tree through the return data, calculating and assigning the expressions and simultaneously processing all logic conditions until the element node tree is traversed; and when the element node tree is traversed, performing data verification on the assigned element nodes, and if the element node tree passes the data verification, constructing the element node tree as template content and outputting the template content to obtain a static video template. By the method provided by the invention, the external data source in the dynamic data template is analyzed into the data interface, the data returned by the data interface is injected into the element node tree for calculation and assignment, and all logic conditions can be processed simultaneously, so that the function of dynamically constructing different content video templates according to different data returned by the data interface can be realized.
Further, referring to fig. 2, fig. 2 is a schematic sub-flow diagram of a dynamic video template construction method based on data driving in an embodiment of the present application, where in this embodiment, the injecting the return data into the element node tree, traversing expressions of all element nodes of the element node tree through the return data, calculating and assigning the expressions, and processing all logic conditions at the same time until the element node tree is traversed includes:
step 201, substituting the return data into the element node tree, where the element node tree includes a plurality of element nodes, the element nodes include a plurality of expressions, and the expressions are Lamda expressions;
step 202, substituting the return data into the Lamda expression and calculating, assigning the calculated value to the Lamda expression, and simultaneously processing all logic conditions of the element nodes until the element nodes in the element node tree are traversed, wherein the logic conditions include conditional divergence and cyclic iteration logic.
In this embodiment, the return data is substituted into an element node tree, where the element node tree includes a plurality of element nodes, or the element node tree is formed by element nodes, where the element nodes include a plurality of expressions, and the expressions included in the element nodes use Lamda expressions, and lambda expressions (based on JavaScript syntax) are used to replace static values, so that video element content originally having only static content is "dynamically" (e.g., < text > { {1+2} } will become < text >3</text > after calculation), and external variables or functions (e.g., < text > { (new Date () } will become < text >2022/08/07</text > after calculation) are introduced into the expressions, which will make the video template content change with the produced data, so that the final video content becomes thousands.
In this embodiment, after the return data calculates the Lamda expression included in the element node, the calculated value is given to the Lamda expression, that is, the calculated value is replaced with the Lamda expression. And (3) assigning the Lamda expression, and simultaneously processing the logic condition of the element node, namely defining condition divergence and circularly iterating the expression at the element node until the returned data completely traverses the expressions of all the element nodes of the element node tree. Some elements may need to decide whether to show according to data values, such a scenario will support adding if (if), elif (otherwise), else (otherwise) attributes at an element node for conditional divergence processing (e.g., < text if = "{ { texts [0] } }" > { { texts [0] } } </text >, this text element will be shown if a string with a subscript of 0 in the texts array exists, if elif or else is used, it will need to be immediately after if the last condition is not met, then the elif expression for this node will be judged or else the else node will be used directly. In order to achieve dynamic generation of a large number of uncertain number of video elements, the embodiment of the present application further supports adding for, for-index, and for-item attributes at element nodes for loop generation nodes (e.g., < text for = "{ { texts } }" > { { texts [ index ] } }/text >, < text > reading all character string values in the texts array and generating corresponding number of text nodes and padding character string values, and implementing a loop to read all character string values in the texts array, and a Lamda expression also supports accessing index (current array subscript value of the loop body) and item (element value in the array accessed by the loop body) in the node scope using for, and the Lamda expression is an inner loop value when the two variables accessed in the inner loop body in the nested loop are accessed, and the for-index and the for-item can be used to re-specify their variable names for distinguishing. In particular, the elements support nesting to form an element node tree, and the representation form of the elements in the video template can be freely defined.
Further, performing data check on the assigned element nodes, and if the element nodes pass the data check, constructing the element node tree as template content and outputting the template content, further comprising:
and if the element node fails to check, outputting the data content with the error check and prompting correction.
In this embodiment, when the return data is injected into the element node tree, after the Lamda expressions of all the element nodes are traversed to be calculated and assigned, basic data verification needs to be performed on the assigned element nodes, it is required to ensure that the assigned element nodes meet the minimum standard of the VTL specification when constructing the template, and if the assigned element nodes do not pass the verification, the console warns and outputs data content with a verification error and prompts correction.
Further, referring to fig. 3, fig. 3 is another sub-flow diagram of a video template dynamic construction method based on data driving in the embodiment of the present application, in the embodiment, acquiring a dynamic data template, reading the content of the dynamic data template and parsing into an element node tree, further including:
301, obtaining template contents meeting the video template language specification and storing the template contents in an xml template file, wherein the xml template file in which the template contents are stored is the dynamic data template;
step 302, importing the dynamic data template into a template analysis library, reading the content of the dynamic data template through the template analysis library, and analyzing the content into the element node tree.
In this embodiment, the template content in the dynamic data template needs to conform to the video template language specification (VTL) and needs to be stored in the xml template file, i.e., the VTL language is used to develop the dynamic data template. In the embodiment of the present application, the template content in the dynamic data template may be written by a template maker, where the source of the template content is not limited, but needs to conform to the video template language specification.
And after the qualified dynamic data template is obtained, the dynamic data template is imported into a template analysis library, the content in the dynamic data template is read through the template analysis library, and the dynamic data template is analyzed into an element node tree.
Further, the content of the dynamic data template further comprises an extension script, and the extension script can be used for realizing functions and exposing functions and is used for calculating the complex expression.
In the embodiment, complex expression calculation may occur in an actual application scene, so that the embodiment of the application also increases the capability of an extended script and supports the use of a custom script tag in a template for realizing a function and exposing the function, and the expression can be calculated by using the custom function and returns a result.
Further, the data source is a user-defined data source; the return data is data in application/json format.
In this embodiment, the data source may be a self-defined external data source, where when the data source is parsed into the data interface, the data source may be one data interface or multiple data interfaces, the data interface is generally an interface URL supporting the GET request, the data returned by the data interface is also data in application/json format, and there is no special requirement on the structure of the returned data.
Further, after obtaining the static video template, the method further includes:
and transmitting the static video template to a video editor or a rendering engine for video editing or video rendering output.
In this embodiment, after the static video template is obtained, the static video template may be transmitted to a video editor or a rendering engine to perform video editing or video rendering output on the static video template, and the use of the static video template may not only perform video editing or video rendering output on the static video template, but is not limited herein.
Further, referring to fig. 4, fig. 4 is a schematic diagram of an implementation step of the dynamic video template construction method based on data driving in the embodiment of the present application, where the implementation step of the embodiment of the present application includes:
1. template contents meeting the video template language specification (VTL) provided by the technology are compiled and stored in an xml template file, wherein the xml template file in which the template contents are stored is a dynamic data template.
2. And (3) importing the dynamic data template in the step (1) into an analysis library, and reading the content of the dynamic data template by the analysis library and analyzing the content into an element node tree.
3. The data source (such as < source > < s1URL = "http:// 127.0.0.1.
4. And the analysis library automatically requests a data interface and obtains return data, the data is injected into the element node tree, the Lamda expressions of all element nodes in the element node tree are traversed, the calculation and the assignment are carried out, and all conditional branches and the cyclic iteration logic are processed at the same time until the element node tree is completely traversed.
5. And when the element nodes are assigned by the attributes, basic data verification is carried out, the template content is ensured to meet the minimum standard of the VTL specification, and if the verification fails, the console warns to output data content prompt correction with wrong verification.
6. When all the element nodes are checked, the element node tree is complete, the element node tree can be constructed into template contents through a template construction library, and the constructed template contents are output to an xml file, namely the static video template.
Further, referring to fig. 5, fig. 5 is a schematic view of an application scenario of a data-driven video template dynamic construction method, and a processing flow using a short video scenario in the financial industry has the following steps:
1. the external data source automatically synchronizes fund or stock related data to the database and opens a query data interface.
2. And the template making personnel make the dynamic video data template according to the data structure provided by the data interface.
3. The timing task or front end page selects any dynamic video template and initiates the parsing of a batch or a certain stock/fund.
4. The template model accepts dynamic templates and fund/stock codes and pulls specified data from the data source.
5. And the template compiler analyzes all expressions and performs access calculation to obtain a static template.
6. And transmitting the static template to a video editor or a rendering engine for video editing or video rendering output.
Further, the embodiment of the present application realizes a dynamic construction method of a video template based on data driving, that is, the dynamic construction method of a video template is realized based on a data model, where the data model also realizes other functions in the present application, for example:
1. in order to satisfy some elements with large data volume requirements (such as charts, chart display data are often complex), data are encoded and then persisted on template elements during construction of the elements, and decoding processing is performed during analysis, so that persistence of the chart elements on a video template is possible.
2. The method and the device have the advantages that componentized combined elements (such as combined dynamic texts) often appear in a video production editing scene, the application also supports the analysis and construction of any node and enforces that the whole template must be analyzed or constructed, so that componentization of element nodes is easy, and only the content of the part of the nodes needs to be stored and transmitted.
The embodiment of the application provides a video template language specification (VTL), and template files compiled by using the VTL are combined with a template model analysis library to support the capabilities of external data source injection, lambda expression analysis calculation, variable access, conditional divergence, list traversal, script extension, long data persistence and the like, so that the function of dynamically constructing different content video templates according to different data returned by a data interface is realized. The data model comprises core elements (such as pictures/texts/voice/embedded videos and the like) of video contents, attributes conforming to functions of the elements are defined for the elements, the elements support nesting to form an element node tree, and the expression form of the elements in the videos can be freely defined on the basis of the model.
Further, an embodiment of the present application further provides a video template dynamic construction apparatus 400 based on data driving, fig. 6 is a schematic diagram of program modules of the video template dynamic construction apparatus based on data driving in the embodiment of the present application, and in this embodiment, the video template dynamic construction apparatus 400 based on data driving includes:
the analysis module 401: the system comprises a data source, a data interface and a data processing module, wherein the data source is used for acquiring a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree;
the assignment module 402: the data interface is used for automatically requesting the data interface and obtaining return data, the return data is injected into the element node tree, expressions of all element nodes of the element node tree are traversed through the return data, the expressions are calculated and assigned, and all logic conditions are processed at the same time until the element node tree is traversed;
the verification module 403: and the static video template processing module is used for performing data verification on the assigned element nodes when the element node tree is traversed, and if the element node tree passes the data verification, constructing the element node tree as template content and outputting the template content to obtain the static video template.
The embodiment of the application provides a video template dynamic construction device 400 based on data driving, which can realize: acquiring a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree, wherein the content of the dynamic data template comprises a data source, and the data source is analyzed into a data interface; automatically requesting the data interface and obtaining return data, injecting the return data into the element node tree, traversing expressions of all element nodes of the element node tree through the return data, calculating and assigning the expressions and simultaneously processing all logic conditions until the element node tree is traversed; and when the element node tree is traversed, performing data verification on the assigned element nodes, and if the element node tree passes the data verification, constructing the element node tree as template content and outputting the template content to obtain a static video template. According to the method provided by the invention, the external data source in the dynamic data template is analyzed into the data interface, the data returned by the data interface is injected into the element node tree for calculation and assignment, and all logic conditions can be processed simultaneously, so that the function of dynamically constructing different content video templates according to different data returned by the data interface can be realized.
Further, the present application also provides a data-driven-based video template dynamic construction device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps in the above-mentioned data-driven-based video template dynamic construction method.
Further, the present application also provides a storage medium, on which a computer program is stored, which when being executed by a processor, implements the steps of the method for dynamically constructing a video template based on data driving.
Each functional module in the embodiments of the present invention may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer-readable storage medium.
Based on such understanding, the technical solution of the present invention, which is described in the specification or contributes to the prior art in essence, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present invention is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no acts or modules are necessarily required of the invention. In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
For those skilled in the art, according to the idea of the embodiments of the present application, there may be variations in the specific implementation and application scope, and in summary, the content of the present description should not be construed as a limitation to the present invention.

Claims (10)

1. A dynamic video template construction method based on data driving is characterized by comprising the following steps:
acquiring a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree, wherein the content of the dynamic data template comprises a data source, and the data source is analyzed into a data interface;
automatically requesting the data interface and obtaining return data, injecting the return data into the element node tree, traversing expressions of all element nodes of the element node tree through the return data, calculating and assigning the expressions and simultaneously processing all logic conditions until the element node tree is traversed;
and when the element node tree is traversed, performing data verification on the assigned element nodes, and if the element node tree passes the data verification, constructing the element node tree as template content and outputting the template content to obtain a static video template.
2. The method according to claim 1, wherein the injecting the return data into the element node tree, traversing expressions of all element nodes of the element node tree through the return data, and calculating and evaluating the expressions while processing all logic conditions until the element node tree is traversed, specifically comprises:
substituting the return data into the element node tree, wherein the element node tree comprises a plurality of the element nodes, the element nodes comprise a plurality of the expressions, and the expressions are Lamda expressions;
and substituting the return data into the Lamda expression and calculating, assigning the calculated value to the Lamda expression, and simultaneously processing all logic conditions of the element nodes until the element nodes in the element node tree are traversed, wherein the logic conditions comprise conditional divergence and loop iteration logic.
3. The method of claim 1, wherein the data checking the assigned element nodes, and if the element nodes pass the data checking, constructing the element node tree as a template content and outputting the template content, further comprising:
and if the element node fails to check, outputting the data content with the error check and prompting correction.
4. The method of claim 1, wherein the obtaining a dynamic data template, reading the content of the dynamic data template and parsing into an element node tree, further comprises:
acquiring template contents meeting the video template language specification and storing the template contents in an xml template file, wherein the xml template file in which the template contents are stored is the dynamic data template;
and importing the dynamic data template into a template analysis library, reading the content of the dynamic data template through the template analysis library and analyzing the content into the element node tree.
5. The method of claim 1, wherein the contents of the dynamic data template further comprise an extension script, the extension script operable to implement functions and expose functions for computing the complex expression.
6. The method of claim 1, wherein the data source is a user-defined data source; the return data is data in application/json format.
7. The method of claim 1, wherein after obtaining the static video template, further comprising:
and transmitting the static video template to a video editor or a rendering engine for video editing or video rendering output.
8. An apparatus for dynamically constructing video templates based on data driving, the apparatus comprising:
an analysis module: the system comprises a data source, a data interface and a data processing module, wherein the data source is used for acquiring a dynamic data template, reading the content of the dynamic data template and analyzing the content into an element node tree;
an assignment module: the data interface is used for automatically requesting the data interface and obtaining return data, the return data is injected into the element node tree, expressions of all element nodes of the element node tree are traversed through the return data, the expressions are calculated and assigned, and all logic conditions are processed at the same time until the element node tree is traversed;
a checking module: and the static video template processing module is used for performing data verification on the assigned element nodes when the element node tree is traversed, and if the element node tree passes the data verification, constructing the element node tree as template content and outputting the template content to obtain the static video template.
9. A data-driven-based video template dynamic construction device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the data-driven-based video template dynamic construction method according to any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method for dynamically constructing a video template based on data driving according to any one of claims 1 to 7.
CN202211166041.9A 2022-09-23 2022-09-23 Video template dynamic construction method, device and equipment based on data driving Pending CN115567752A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211166041.9A CN115567752A (en) 2022-09-23 2022-09-23 Video template dynamic construction method, device and equipment based on data driving

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211166041.9A CN115567752A (en) 2022-09-23 2022-09-23 Video template dynamic construction method, device and equipment based on data driving

Publications (1)

Publication Number Publication Date
CN115567752A true CN115567752A (en) 2023-01-03

Family

ID=84740647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211166041.9A Pending CN115567752A (en) 2022-09-23 2022-09-23 Video template dynamic construction method, device and equipment based on data driving

Country Status (1)

Country Link
CN (1) CN115567752A (en)

Similar Documents

Publication Publication Date Title
US11797298B2 (en) Automating identification of code snippets for library suggestion models
US7240279B1 (en) XML patterns language
US20200125482A1 (en) Code examples sandbox
US20020103835A1 (en) Methods and apparatus for constructing semantic models for document authoring
US8850309B2 (en) Optimized methods and devices for the analysis, processing and evaluation of expressions of the XPath type on data of the binary XML type
CN109491658A (en) The generation method and device of computer-executable code data
KR101554424B1 (en) Method and apparatus for auto generation of test case
CN116166236A (en) Code recommendation method, device, computer equipment and storage medium
CN116483850A (en) Data processing method, device, equipment and medium
CN115904480B (en) Code reconstruction method, device, electronic equipment and storage medium
CN117370242A (en) Adapter and method for generating multilingual SDK client by parsing interface document
CN116541020A (en) Code generation method, device, equipment, medium and product based on field model
US8200714B2 (en) Apparatus, systems and methods for configurable defaults for XML data
CN115567752A (en) Video template dynamic construction method, device and equipment based on data driving
CN114816364A (en) Method, device and application for dynamically generating template file based on Swagger
CN115061690A (en) Automatic code generation method and device
Poulding et al. The automated generation of humancomprehensible XML test sets
CN114492321A (en) Neural network model generation method, device and storage medium based on XML
CN110058858B (en) JSON data processing method and device
CN117289905B (en) Application software development method and device, storage medium and electronic equipment
CN117573140B (en) Method, system and device for generating document by scanning codes
JP2007501464A (en) Method and system for probability-based verification of XML documents
CN116451795B (en) Quantum circuit diagram processing method and device, electronic equipment and storage medium
CN117850984A (en) Electronic design automation script pre-checking method, system, equipment and storage medium
JP2009080681A (en) Program structure parsing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination