Template processing method and device and terminal equipment
By obtaining the template type and determining the processing steps and parameters in the terminal device, and using a set of sub-steps for template processing, the problem of high template processing complexity in multimedia editing is solved, and more efficient and accurate template processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2024-11-14
- Publication Date
- 2026-05-19
AI Technical Summary
The complexity of template processing in multimedia editing leads to high development costs and low processing efficiency.
The terminal device responds to template selection by obtaining the template type, determining the processing steps and parameters, and performing template processing through a set of sub-steps to achieve the reuse of sub-steps.
It reduces the complexity of template processing, improves the accuracy and efficiency of processing, and reduces development costs.
Smart Images

Figure CN122069409A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of multimedia technology, and in particular to a template processing method, apparatus and terminal device. Background Technology
[0002] In multimedia editing scenarios, templates can include multiple pre-designed effects, animations, filters, and layouts, allowing users to improve the efficiency and quality of multimedia creation.
[0003] Currently, with the increasing number of application scenarios and template types, terminal devices can independently maintain the template consumption process for each application scenario. However, in the above method, the complexity between multiple template consumption processes is high, leading to high complexity in template processing. Summary of the Invention
[0004] This disclosure provides a template processing method, apparatus, and terminal device to solve the technical problems of the prior art.
[0005] In a first aspect, embodiments of this disclosure provide a template processing method, the template processing method comprising: in response to selecting a first template, obtaining the type of the first template;
[0006] Based on the type of the first template, a first processing step and parameters of the first template are determined. The first processing step is determined based on a set of sub-steps, which includes multiple different sub-steps and are associated with the processing of the template.
[0007] Based on the parameters of the first processing step and the first template, the first template is processed.
[0008] Secondly, embodiments of this disclosure provide a template processing apparatus, which includes an acquisition module, a determination module, and a processing module, wherein:
[0009] The acquisition module is used to acquire the type of the first template in response to the selection of the first template;
[0010] The determining module is used to determine a first processing step and parameters of the first template based on the type of the first template. The first processing step is determined based on a set of sub-steps, which includes multiple different sub-steps and are associated with the processing of the template.
[0011] The processing module is used to process the first template based on the parameters of the first processing step and the first template.
[0012] Thirdly, embodiments of this disclosure provide a terminal device including: a processor and a memory;
[0013] The memory stores computer-executed instructions;
[0014] The processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the template processing methods described in the first aspect above and various possible aspects of the first aspect.
[0015] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the template processing methods described in the first aspect and various possible aspects of the first aspect.
[0016] Fifthly, embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the template processing methods described in the first aspect above and various possible aspects of the first aspect.
[0017] This disclosure provides a template processing method, apparatus, and terminal device. The terminal device, in response to the selection of a first template, obtains the type of the first template, and based on the type of the first template, determines a first processing step and parameters of the first template. The first processing step is determined based on a set of sub-steps, which includes multiple different sub-steps associated with template processing. The terminal device can process the first template based on the first processing step and the parameters of the first template. In this method, since the set of sub-steps includes multiple different sub-steps, multiple types of templates can reuse multiple sub-steps in the set, reducing development costs. Furthermore, the terminal device does not need to independently maintain the processing flow for each type of template related to each application scenario, reducing the complexity of template processing and improving its accuracy and efficiency. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this disclosure 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 some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0020] Figure 2 A schematic flowchart illustrating a template processing method provided in an embodiment of this disclosure;
[0021] Figure 3 This is a schematic diagram illustrating a process for determining a first template, as provided in an embodiment of the present disclosure.
[0022] Figure 4 A schematic diagram of a directed acyclic graph provided in an embodiment of this disclosure;
[0023] Figure 5 This is a schematic diagram of a template processing architecture provided in an embodiment of the present disclosure;
[0024] Figure 6 A schematic diagram of a method for determining a first processing step provided in an embodiment of this disclosure;
[0025] Figure 7 A schematic diagram illustrating a set of acquisition sub-steps provided in an embodiment of this disclosure;
[0026] Figure 8 This is a schematic diagram of the structure of a template processing device provided in an embodiment of the present disclosure;
[0027] Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this disclosure. Detailed Implementation
[0028] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0029] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0030] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the terminal device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0031] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the terminal device.
[0032] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0033] For ease of understanding, the concepts involved in the embodiments of this disclosure will be explained below.
[0034] Terminal device: A device with wireless transceiver capabilities. Terminal devices can be deployed on land, including indoors or outdoors, handheld, wearable, or vehicle-mounted. These terminal devices can be mobile phones, tablet computers, computers with wireless transceiver capabilities, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, vehicle-mounted terminal devices, wireless terminals in self-driving vehicles, wireless terminal devices in remote medical care, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, wireless terminal devices in smart homes, wearable terminal devices, etc. The terminal equipment involved in the embodiments of this disclosure may also be referred to as a terminal, user equipment (UE), access terminal equipment, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote terminal equipment, mobile device, UE terminal equipment, wireless communication equipment, UE agent, or UE device, etc. The terminal equipment may also be fixed or mobile.
[0035] Below, in conjunction with Figure 1 The application scenarios of the embodiments of this disclosure will be described.
[0036] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure. Please refer to [link / reference]. Figure 1This includes a terminal device. The page displayed on the terminal device may include a template. After the user clicks the control to use the template on the page, the terminal device can display a photo album, which may include image 1, image 2, image 3, and image 4. After the user clicks on image 2 and image 4, the terminal device can generate a new image based on the template, image 2, and image 3. The left half of this new image is image 2, and the right half is image 4. The above process is the template processing flow, which includes template downloading, image compression, and filling processes.
[0037] In related technologies, as the application scenarios and types of templates increase, terminal devices can independently maintain the template consumption process for each template type corresponding to each application scenario. For example, a terminal device can include templates of type 1, type 2, and type 3, and can maintain the processing flow for templates of type 1, type 2, and type 3. There may be overlapping steps in the processing flows of multiple template types; for example, multiple template processing flows may include template download steps and material compression steps. However, the template processing flows do not reuse these overlapping steps, and after the template functionality is developed, newly added template processing steps need to be added to each processing flow. This results in high development costs and high complexity between multiple template processing flows, leading to high overall template processing complexity.
[0038] To address the technical problems in related technologies, this disclosure provides a template processing method. In response to selecting a first template, a terminal device obtains the type of the first template, determines a first processing step and parameters of the first template based on the type, obtains multiple first sub-steps and their execution order within the first processing step, and processes the first template based on the parameters, the multiple first sub-steps, and the first execution order. In this method, since the first processing step is determined based on a set of sub-steps, and the set of sub-steps includes multiple different sub-steps, the terminal device can reuse multiple sub-steps, reducing development costs. Furthermore, since the terminal device does not need to maintain a processing flow for each type of template related to each application scenario, the number of template processing flows is reduced, the complexity of template processing is lowered, and the accuracy and efficiency of template processing are improved.
[0039] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0040] Figure 2 This is a flowchart illustrating a template processing method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 2 The method process includes:
[0041] S201. In response to the selection of the first template, obtain the type of the first template.
[0042] The execution entity of this disclosure can be a terminal device or a template processing device within the terminal device. The template processing device can be implemented in software, or it can be implemented using a combination of software and hardware; this disclosure does not limit this approach.
[0043] The first template can be used for multimedia creation. For example, the first template can be used for video creation, image creation, etc., and this embodiment of the disclosure does not limit this. For example, the first template may include multiple pre-designed special effects. Users can add multiple video materials to the first template to obtain a new video, wherein the new video may include multiple video materials and pre-designed special effects.
[0044] The first template can be a template selected by the user. For example, the page may include at least one template, and the user can touch at least one template. The terminal device can determine the template touched by the user as the first template.
[0045] Optionally, the terminal device may determine the first template based on the following feasible implementation: displaying the application's page, displaying a shooting page in response to touch of the shooting control on the application's page, displaying at least one template in response to touch of the template control on the shooting page, and determining the touched template as the first template in response to touch of the at least one template.
[0046] The application can be a multimedia-related application. For example, the application can be a short video application, a video editing application, etc., but this disclosure does not limit this.
[0047] Below, in conjunction with Figure 3 The process of determining the first template is explained.
[0048] Figure 3 This is a schematic diagram illustrating a process for determining a first template according to an embodiment of this disclosure. Please refer to [link / reference]. Figure 3This includes a terminal device. The page displayed on the terminal device is the application's page, which can play videos. The bottom of this page includes a homepage control, a message control, and a control to jump to the shooting page. When the user clicks the control to jump to the shooting page, the terminal device can display the shooting page, which may include shooting controls and template controls. When the user clicks the template control, the terminal device can display a template page, which may include template 1 and controls for using the template. When the user swipes left on the template page, template 2 can be displayed. When the user clicks the control to use a template, the terminal device can determine that the user has selected template 2; that is, the terminal device can determine template 2 as the first template.
[0049] Optionally, the terminal device can play a video, wherein the played video may include anchor points of a template. When a user clicks on the anchor point of the template, the terminal device can identify that template as the first template. For example, if user A creates and publishes a video based on a template, and user B views the video, the bottom of the video may include anchor points of the template. When user B clicks on the anchor point of the template, the terminal device can determine that the user has selected that template.
[0050] The type of the first template can include application template types, algorithm template types, and template types from other applications. For example, if the application is a short video application and the other applications are multimedia editing applications, and the type of the first template is an application template type, then the first template is provided by the short video application. If the type of the first template is an algorithm template type, then the first template can include an algorithm (e.g., an algorithm that automatically synthesizes a video from multiple video clips). If the type of the first template is a template type from other applications, then the first template is provided by the multimedia editing application.
[0051] It should be noted that the terminal device can obtain the type of the first template according to any feasible implementation method, and the embodiments disclosed herein do not limit this.
[0052] S202. Based on the type of the first template, determine the first processing step of the first template and the parameters of the first template.
[0053] The parameters of the first template can be those required during the processing of the first template. For example, if the first template needs to be downloaded during processing, the parameters of the first template can include the download link of the first template; if the first template needs to download music during processing, the parameters of the first template can include the download link of the music; if the material filled in the first template is a video, the parameters of the first template can include the number of videos and the limiting information of the videos (e.g., the duration of the videos); if the material filled in the first template is an image, the parameters of the first template can include the number of images and the limiting information of the images (e.g., the images include faces).
[0054] Optionally, the terminal device can obtain the parameters of the first template based on the following feasible implementation: determine the usage scenario of the first template, and based on the usage scenario and the type of the first template, determine the parameters required for processing the first template, thus obtaining the parameters of the first template. In this way, the terminal device can accurately determine the parameters of the first template, and thus accurately process the first template.
[0055] The usage scenario can be any business scenario in which the first template is used. For example, the usage scenario may include automatic editing scenarios, artificial intelligence editing scenarios, template selection scenarios, and template selection scenarios via anchor points, etc., and this disclosure does not limit these scenarios.
[0056] It should be noted that the terminal device can determine the usage scenario corresponding to the first template based on any feasible implementation method, and this embodiment of the disclosure does not limit this. For example, if a user selects the first template through the template anchor point of a video published by another user, then the usage scenario of the first template is the scenario of selecting a template through an anchor point; if the user selects the first template from the templates provided by the application, then the usage scenario of the first template is the scenario of selecting a template.
[0057] Specifically, the terminal device can determine the parameters of the first template based on the usage scenario and the type of the first template. For example, if the usage scenario of the first template is an automatic editing scenario and the type of the first template is an algorithm template type, then the terminal device can determine that the processing of the first template requires downloading both the template and the music. Therefore, the terminal device can determine that the parameters of the first template include the download links for the first template and the music. If the usage scenario of the first template is an automatic editing scenario and the type of the first template is a template type from another application, then the terminal device can determine that the processing of the first template requires downloading the template but not the music. Therefore, the terminal device can determine that the parameters of the first template may include the download link for the first template.
[0058] It should be noted that the terminal device can determine the parameters of the first template based on the correspondence between the usage scenario, the template type and the template parameters. The correspondence between the usage scenario, the template type and the template parameters can be a pre-set correspondence, which is not limited in this embodiment.
[0059] The sub-steps can be associated with template processing. For example, a sub-step can be an indivisible, reusable step in the template processing. For example, a sub-step can be a template atomic capability, which is an indivisible, reusable step in the template processing. For example, a sub-step may include any step associated with template processing, such as music details (providing a music download link), music download, template details (providing a template download link), template download, material compression, material filling, image cutout, and flexible slots; this disclosure does not limit this aspect.
[0060] The first processing step may include multiple sub-steps associated with the processing of the first template, as well as the execution order of these sub-steps. For example, the first processing step may include template details and template download, where the execution order could be template details - template download. The first processing step may be determined based on a set of sub-steps, which may include multiple different sub-steps. For example, the multiple different sub-steps in the set of sub-steps may be associated with processing flows for various types of templates. For instance, the processing flow for type 1 templates includes template download, material filling, and material compression; the processing flow for type 2 templates includes music download, effects download, and material compression. Since material compression is a recurring sub-step, the terminal device can determine that the set of sub-steps includes template download, music download, effects download, material compression, and material filling.
[0061] S203. Based on the parameters of the first processing step and the first template, process the first template.
[0062] The terminal device processes the first template, which can be used for the terminal device to consume the first template. The terminal device can process the first template according to the following feasible implementation method: obtain multiple first sub-steps and the first execution order of the multiple first sub-steps in the first processing step, and process the first template based on the parameters of the first template, the multiple first sub-steps and the first execution order.
[0063] The first processing step can be represented based on a Directed Acyclic Graph (DAG). For example, the terminal device can obtain multiple template atomic capabilities (sub-steps) corresponding to the first template from the atomic capability pool, and assemble the multiple template atomic capabilities into a DAG to obtain the first processing step. For example, the atomic capability pool may include template atomic capability 1, template atomic capability 2, template atomic capability 3, and template atomic capability 4. If template atomic capability 1, template atomic capability 2, and template atomic capability 3 are the template atomic capabilities required in the first template processing, the terminal device can assemble template atomic capability 1, template atomic capability 2, and template atomic capability 3 into a DAG, which may include the execution order between template atomic capability 1, template atomic capability 2, and template atomic capability 3.
[0064] The first sub-step can be a step included in the first processing step. For example, if the first processing step may include sub-step 1, sub-step 2 and sub-step 3, then the first sub-step may include sub-step 1, sub-step 2 and sub-step 3.
[0065] The first execution order can be the execution order among multiple first sub-steps. For example, the first processing step may include first sub-step 1, first sub-step 2, and first sub-step 3, then the first execution order can be the execution order among first sub-step 1, first sub-step 2, and first sub-step 3.
[0066] Optionally, the first sub-step in the first processing step of the first template can be a pre-set sub-step, the first execution order can be a pre-set order, and the terminal device can also determine the first sub-step and the first execution order based on any feasible implementation method. This disclosure embodiment does not limit this.
[0067] Below, in conjunction with Figure 4 The following describes the processing steps for directed acyclic graphs.
[0068] Figure 4 This is a schematic diagram of a directed acyclic graph provided in an embodiment of this disclosure. Please refer to [link to relevant documentation]. Figure 4This includes a Directed Acyclic Graph (DAG). The DAG is used to indicate the template consumption process. The template atomic capabilities in the DAG include material compression, template details, music details, template download, music download, material filling, and video synthesis. Specifically, template download can only be executed after template details are completed; material filling can only be executed after template download and material compression are completed; music download can only be executed after music details are completed; and video synthesis can only be executed after material filling and music download. In this way, the terminal device can quickly and accurately determine the template processing steps based on the DAG, improving the accuracy and efficiency of template consumption.
[0069] Specifically, the terminal device processes the first template based on its parameters, multiple first sub-steps, and a first execution order. This process involves determining the second sub-step corresponding to the parameters of the first template within the multiple first sub-steps, and then processing the first template based on the second sub-step, the parameters of the first template, and the first execution order. This allows the terminal device to quickly determine the second sub-step that needs to be executed, thereby improving the efficiency of template consumption.
[0070] The second sub-step can be a sub-step corresponding to the parameters of the first template. For example, since the first sub-step can include all sub-steps associated with the type of the first template, during the processing of the first template, some of the first sub-steps can be executed, while others can be omitted. The parameters of the first template determined by the terminal device include the parameters corresponding to some of the first sub-steps but not the parameters corresponding to others. Furthermore, the terminal device can determine some of the first sub-steps (the sub-steps that need to be executed) as the second sub-step.
[0071] Optionally, the terminal device can determine the second sub-step based on the parameters of the first template. For example, if the first sub-step includes template details, template download, music details, and music download, and the parameters of the first template include a template download link, then the terminal device can determine that the first template needs to execute template details and template download during processing. Therefore, the terminal device can determine template details and template download as the second sub-step. If the parameters of the first template include a template download link and a music download link, then the terminal device can determine that the first template needs to execute all of the first sub-steps during processing. Therefore, the terminal device can determine template details, template download, music details, and music download as the second sub-step.
[0072] For example, if all sub-steps associated with the type of the first template can include 10 sub-steps, then the first processing step of the first template can include 10 first sub-steps. However, the first template can use 3 of these first sub-steps during processing, and the remaining 7 first sub-steps are not used. Therefore, the terminal device can determine the 3 used first sub-steps as second sub-steps. For example, the sub-steps associated with the template type of the application include music details, music download, template details, template download, material compression, and material filling. If the template type of the first template is the template type of the application, then the first processing step of the first template can include music details, music download, template details, template download, material compression, and material filling, as well as the execution order of music details, music download, template details, template download, material compression, and material filling. However, in the actual use of the first template, template details, template download, material compression, and material filling can be executed, while music details and music download are not executed.
[0073] The terminal device processes the first template based on the second sub-step, the first template parameters, and the first execution order. Specifically, this can be achieved by: determining a preprocessing sub-step within the second sub-step; preprocessing the preprocessing sub-step based on the first execution order and the parameters of the first template; and processing the other second sub-steps besides the preprocessing sub-step based on the first execution order and the parameters of the first template. In this way, after the user selects the first template, the terminal device can preprocess some of the second sub-steps. Therefore, after the user selects materials, the terminal device can quickly generate a video, thereby improving the efficiency of template consumption.
[0074] The preprocessing sub-step can be a second sub-step that can be executed after the user selects the first template. For example, after the user clicks on the first template, the terminal device can obtain the template's download link and download the template based on that link. However, the terminal device cannot perform material compression before the user selects the materials. Therefore, the terminal device can determine that template details and template download can be preprocessing sub-steps, while material compression is a non-preprocessing sub-step.
[0075] Optionally, the terminal device can also pre-set preprocessing sub-steps. For example, the terminal device can pre-set template details, music details, template download, and music download as preprocessing sub-steps. If the second sub-step includes template download and material compression, the terminal device can determine that the preprocessing sub-step is template download.
[0076] Optionally, the terminal device may determine the preprocessing sub-step in the second sub-step based on the first execution order. For example, the terminal device may determine, based on the first execution order, a second sub-step that can be executed without further user action after the user selects the first template, and designate this second sub-step as the preprocessing sub-step. For example, the terminal device may determine that the execution of template details does not require further user action, and based on the first execution order, the terminal device may determine that the execution of template download also does not require further user action after the execution of template details. Therefore, the terminal device may designate template details and template download as preprocessing sub-steps.
[0077] Specifically, the terminal device can preprocess the preprocessing sub-steps based on the parameters corresponding to the preprocessing sub-steps in the parameters of the first execution order and the first template. For example, the terminal device can determine that the preprocessing sub-step is template download, obtain the download link of the first template from the parameters of the first template, and execute the template download sub-step based on the download link of the first template.
[0078] Specifically, the terminal device can process other second sub-steps besides the preprocessing sub-steps based on the first execution order and the parameters of the first template. For example, the second sub-steps may include template details, template download, material compression, and material filling. The terminal device can determine that the preprocessing sub-steps are template details and template download. The terminal device can execute the template details and template download sub-steps based on the parameters required for template details execution and template download execution. Furthermore, after the user selects materials, the terminal device can execute the material compression sub-step based on the parameters corresponding to material compression. After the execution of the template details, template download, and material compression sub-steps is completed, the terminal device can execute the material filling sub-step based on the parameters corresponding to material filling.
[0079] Optionally, before executing the above template processing method, the terminal device can pre-build the template processing architecture. The terminal device can divide the template processing structure into a business layer, a template domain layer, and a dependency layer. This can achieve high cohesion, low coupling, and easy extensibility of the code at each level.
[0080] The business layer can call the corresponding template's exposed interface through the Service Provider Interface (SPI) mechanism.
[0081] The template domain layer can include template atomic capabilities and DAG-assembled template atomic capabilities, and it can also provide a consumption interface for the upper layer.
[0082] The dependency layer consists of dependencies on the audio / video library and the business library. For example, the dependency layer can provide basic multimedia processing capabilities (such as Effext), logging, networking, and event tracking capabilities.
[0083] The class structure of the template processing architecture can include multiple interfaces. For example, the class structure can include an atomic capability abstract interface, which can provide functionality for template atomic capabilities such as task execution, associating directed acyclic graphs, progress notification, cancellation, and task status transition.
[0084] For example, the class structure may include an interface for constructing atomic capability DAGs required for various types of templates, and this interface may provide callbacks for the lifecycle of template consumption (start, progress, end, success, and failure), i.e., an interface for business callbacks and performance tracking.
[0085] For example, the class structure may include a module that handles the passing of DAG parameters for template consumption, where the input and output parameters of each task can be implemented based on this module throughout the execution of the DAG task.
[0086] For example, the class structure may include an interface for template consumption that can call back the lifecycle of the individual template atomic capabilities executed in the DAG.
[0087] For example, the class structure may include a factory design module that can provide preprocessing of templates and assembly of consumed DAGs.
[0088] For example, the class structure may include an interface for template consumption, which may include a template preprocessing interface and a template consumption interface.
[0089] For example, the class structure may include a service module that can implement template preprocessing and template consumption.
[0090] Below, in conjunction with Figure 5 The architecture for template processing will be explained.
[0091] Figure 5 This is a schematic diagram of a template processing architecture provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 5This includes a template processing architecture. This architecture can comprise a business layer, a modular interface layer, a template domain layer, and a dependency layer. The business layer can include use cases such as automatic editing and template selection. The template interface layer can provide an SPI interface. The template domain layer can include capability interfaces, DAG assembly, and an atomic capability pool. Capability interfaces can include preprocessing interfaces and template consumption interfaces. DAG assembly can include DAGs for type 1 templates, DAG assembly for type 2 templates, etc. The atomic capability pool can include multiple template atomic capabilities such as template download, material compression, and image cutout. In this way, terminal devices can reuse repetitive template atomic capabilities based on this template processing architecture. Furthermore, each type of template can maintain a unique DAG, reducing the complexity of template processing and lowering development costs.
[0092] This disclosure provides a template processing method. In response to selecting a first template, a terminal device obtains the type of the first template, determines a first processing step and parameters of the first template based on the type, obtains multiple first sub-steps and their execution order within the first processing step, determines a second sub-step corresponding to the parameters of the first template among the multiple first sub-steps, determines a preprocessing sub-step within the second sub-step, and preprocesses the preprocessing sub-step based on the first execution order and the parameters of the first template. Based on the first execution order and the parameters of the first template, it processes the other second sub-steps besides the preprocessing sub-step. In this method, since the first processing step is determined based on a set of sub-steps, and the set of sub-steps includes multiple different sub-steps, the terminal device can reuse multiple sub-steps, reducing development costs. Furthermore, since the terminal device can reduce the number of template processing flows and decrease the complexity of template processing, it can improve the accuracy and efficiency of template processing.
[0093] exist Figure 2 Based on the embodiments shown, the following, in conjunction with Figure 6 The method for determining the first processing step of the first template based on the type of the first template in the above template processing method is described.
[0094] Figure 6 This is a schematic diagram illustrating a method for determining a first processing step according to an embodiment of this disclosure. Please refer to [link / reference]. Figure 6 The method flow may include:
[0095] S601, Obtain the set of sub-steps.
[0096] The terminal device can obtain all sub-steps corresponding to each type of template, and merge and remove duplicates of all sub-steps to obtain a set of sub-steps.
[0097] Below, in conjunction with Figure 7 The process of obtaining the set of sub-steps is explained.
[0098] Figure 7 This is a schematic diagram illustrating a set of acquisition sub-steps provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 7 This includes sub-steps involved in the template processing of Type 1 and Type 2. Specifically, the sub-steps involved in the template processing of Type 1 may include template details, template download, material compression, and material filling. The sub-steps involved in the template processing of Type 2 may include template details, template download, material compression, material filling, music details, and music download. Since template details and template download are redundant, the terminal device ( Figure 7 (As shown) The set of sub-steps can be identified as including template details, template download, material compression, material filling, music details, and music download.
[0099] S602. Determine the correspondence based on the set of sub-steps.
[0100] The correspondence may include at least one template type and the processing steps corresponding to each template type.
[0101] For any given correspondence, the terminal device can determine the correspondence using the following feasible implementation: Among the multiple sub-steps in the set of sub-steps, determine multiple third sub-steps associated with the processing of the second template, and determine the second execution order of these third sub-steps to obtain the second processing step. Based on the second processing step and the type of the second template, obtain the correspondence between the type of the second template and the second processing step. In this way, the terminal device can pre-determine the correspondence between each type of template and processing step, thereby accurately determining the first processing step of the first template.
[0102] The second template can be any type of template, and the third sub-step can be all the sub-steps required during the processing of the second template. For example, the set of sub-steps may include sub-step 1, sub-step 2, sub-step 3, and sub-step 4. If the second template may involve sub-step 1, sub-step 2, and sub-step 3 during execution, the terminal device can identify sub-step 1, sub-step 2, and sub-step 3 as the third sub-step.
[0103] The second execution order can indicate the execution order of multiple third sub-steps. For example, after the terminal device determines multiple third sub-steps, it can determine the second execution order based on the relationships between these sub-steps. For instance, the relationships between the multiple third sub-steps could include: template details before template download, material filling after material compression, etc.
[0104] The second processing step may include multiple third sub-steps and a second execution order. After the terminal device determines the second processing step, it can obtain a set of correspondences, which includes the correspondence between the type of the second template and the second processing step.
[0105] S603. Based on the type and correspondence of the first template, determine the first processing step.
[0106] Specifically, the terminal device can determine the type that is the same as the type of the first template in the correspondence relationship, and determine the processing step corresponding to that type as the first processing step. For example, the correspondence relationship can include template type 1, template type 2, and template type 3. The processing step corresponding to template type 1 is processing step A, the processing step corresponding to template type 2 is processing step B, and the processing step corresponding to template type 3 is processing step C. If the type of the first template is type 1, the terminal device can determine the first processing step as processing step A; if the type of the first template is type 2, the terminal device can determine the first processing step as processing step B; and if the type of the first template is type 3, the terminal device can determine the first processing step as processing step C.
[0107] This disclosure provides a method for determining a first processing step. A terminal device can obtain a set of sub-steps. Among the multiple sub-steps in the set, multiple third sub-steps associated with the processing of a second template are determined, and a second execution order of the multiple third sub-steps is determined to obtain a second processing step. Based on the types of the second processing step and the second template, a correspondence between the type of the second template and the second processing step is obtained. The terminal device can determine the first processing step based on the type of the first template and the correspondence. In this way, the terminal device can accurately determine the correspondence based on the set of sub-steps, and thus accurately determine the first processing step of the first template. Furthermore, since the set of sub-steps can include multiple different sub-steps, the terminal device can reuse multiple sub-steps, reducing development costs.
[0108] Figure 8 This is a schematic diagram of a template processing apparatus provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 8 The template processing device 800 includes an acquisition module 801, a determination module 802, and a processing module 803, wherein:
[0109] The acquisition module 801 is used to acquire the type of the first template in response to the selection of the first template;
[0110] The determining module 802 is used to determine a first processing step of the first template and parameters of the first template based on the type of the first template. The first processing step is determined based on a set of sub-steps, which includes multiple different sub-steps and are associated with the processing of the template.
[0111] The processing module 803 is used to process the first template based on the parameters of the first processing step and the first template.
[0112] According to one or more embodiments of this disclosure, the processing module 803 is specifically used for:
[0113] Obtain multiple first sub-steps and a first execution order of the multiple first sub-steps in the first processing step; process the first template based on the parameters of the first template, the multiple first sub-steps and the first execution order.
[0114] According to one or more embodiments of this disclosure, the processing module 803 is specifically used for:
[0115] In the plurality of first sub-steps, determine the second sub-step corresponding to the parameters of the first template;
[0116] Based on the second sub-step, the parameters of the first template, and the first execution order, the first template is processed.
[0117] According to one or more embodiments of this disclosure, the processing module 803 is specifically used for:
[0118] In the second sub-step, a preprocessing sub-step is determined, and the preprocessing sub-step is preprocessed based on the first execution order and the parameters of the first template;
[0119] Based on the first execution order and the parameters of the first template, the other second sub-steps besides the preprocessing sub-steps are processed.
[0120] According to one or more embodiments of this disclosure, the determining module 802 is specifically used for:
[0121] Determine the use case of the first template;
[0122] Based on the usage scenario and the type of the first template, the parameters required for processing the first template are determined, and the parameters of the first template are obtained.
[0123] According to one or more embodiments of this disclosure, the determining module 802 is specifically used for:
[0124] Obtain the set of the sub-steps;
[0125] Based on the set of sub-steps, a correspondence is determined, which includes at least one template type and the processing steps corresponding to each template type;
[0126] Based on the type of the first template and the corresponding relationship, the first processing step is determined.
[0127] According to one or more embodiments of this disclosure, the determining module 802 is specifically used for:
[0128] In the set of sub-steps, a plurality of third sub-steps associated with the processing of the second template are determined, and a second execution order of the plurality of third sub-steps is determined to obtain the second processing steps;
[0129] Based on the second processing step and the type of the second template, the correspondence between the type of the second template and the second processing step is obtained.
[0130] The template processing apparatus provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects are similar, and will not be described again here.
[0131] Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 9 The diagram illustrates a structural schematic suitable for implementing the terminal device 900 of the embodiments of the present disclosure. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The terminal device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[0132] like Figure 9As shown, the terminal device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 902 or a program loaded from storage device 908 into random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the terminal device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0133] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows terminal device 900 to exchange data via wireless or wired communication with other devices. Although Figure 9 A terminal device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0134] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0135] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), or any suitable combination thereof.
[0136] The aforementioned computer-readable medium may be included in the aforementioned terminal device; or it may exist independently and not assembled into the terminal device.
[0137] The aforementioned computer-readable medium carries one or more programs, which, when executed by the terminal device, cause the terminal device to perform the method shown in the above embodiments.
[0138] This disclosure provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements various methods that may be involved in the above embodiments.
[0139] This disclosure provides a computer program product, including a computer program that, when executed by a processor, implements various methods that may be involved in the above embodiments.
[0140] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages.
[0141] The program code can execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0142] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. The units described in the embodiments of the present disclosure can be implemented in software or hardware. In some cases, the name of a unit does not constitute a limitation on the unit itself. For example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0143] The functions described above herein can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that may be used, without limitation, include: Field-Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application-Specific Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), etc. In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium.
[0144] Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0145] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0146] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0147] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and provisions. The data may include information, parameters and messages, such as flow switching indication information.
[0148] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0149] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. Multitasking and parallel processing may be advantageous in certain environments. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments. Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely exemplary forms of implementing the claims.
Claims
1. A template processing method, characterized in that, include: In response to the selection of the first template, obtain the type of the first template; Based on the type of the first template, a first processing step and parameters of the first template are determined. The first processing step is determined based on a set of sub-steps, which includes multiple different sub-steps associated with the processing of the template. Based on the first processing step and the parameters of the first template, the first template is processed.
2. The method according to claim 1, characterized in that, The step of processing the first template based on the parameters of the first processing step and the first template includes: Obtain multiple first sub-steps and a first execution order of the multiple first sub-steps in the first processing step; process the first template based on the parameters of the first template, the multiple first sub-steps and the first execution order.
3. The method according to claim 2, characterized in that, The processing of the first template based on the parameters of the first template, the plurality of first sub-steps, and the first execution order includes: In the plurality of first sub-steps, a second sub-step corresponding to the parameters of the first template is determined; based on the second sub-step, the parameters of the first template, and the first execution order, the first template is processed.
4. The method according to claim 3, characterized in that, The processing of the first template based on the second sub-step, the parameters of the first template, and the first execution order includes: In the second sub-step, a preprocessing sub-step is determined, and the preprocessing sub-step is preprocessed based on the first execution order and the parameters of the first template; based on the first execution order and the parameters of the first template, other second sub-steps besides the preprocessing sub-step are processed.
5. The method according to any one of claims 1-4, characterized in that, Based on the type of the first template, the parameters of the first template are determined, including: Determine the use case of the first template; based on the use case and the type of the first template, determine the parameters required for processing the first template, and obtain the parameters of the first template.
6. The method according to any one of claims 1-4, characterized in that, Based on the type of the first template, the first processing step of the first template is determined, including: Obtain a set of sub-steps; based on the set of sub-steps, determine a correspondence, the correspondence including at least one template type and a processing step corresponding to each template type; based on the type of the first template and the correspondence, determine the first processing step.
7. The method according to claim 6, characterized in that, For any given correspondence, determining the correspondence based on the set of sub-steps includes: In the set of sub-steps, multiple third sub-steps associated with the processing of the second template are determined, and a second execution order of the multiple third sub-steps is determined to obtain a second processing step; based on the second processing step and the type of the second template, a correspondence between the type of the second template and the second processing step is obtained.
8. A template processing device, characterized in that, It includes an acquisition module, a determination module, and a processing module, wherein: The acquisition module is used to acquire the type of the first template in response to the selection of the first template; the determination module is used to determine the first processing step of the first template and the parameters of the first template based on the type of the first template, wherein the first processing step is determined based on a set of sub-steps, the set of sub-steps including multiple different sub-steps, the sub-steps being associated with the processing of the template; the processing module is used to process the first template based on the first processing step and the parameters of the first template.
9. A terminal device, characterized in that, include: Processor and memory; The memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the processor to perform the template processing method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the template processing method as described in any one of claims 1-7.
11. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the template processing method as described in any one of claims 1-7.