CN115658051A - Material synthesizing method and device, electronic device and storage medium - Google Patents

Material synthesizing method and device, electronic device and storage medium Download PDF

Info

Publication number
CN115658051A
CN115658051A CN202211194025.0A CN202211194025A CN115658051A CN 115658051 A CN115658051 A CN 115658051A CN 202211194025 A CN202211194025 A CN 202211194025A CN 115658051 A CN115658051 A CN 115658051A
Authority
CN
China
Prior art keywords
target
request
sub
page
target material
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
CN202211194025.0A
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202211194025.0A priority Critical patent/CN115658051A/en
Publication of CN115658051A publication Critical patent/CN115658051A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application relates to a material synthesis method and device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a target material synthesis request, wherein the target material synthesis request comprises at least one sub-request, the sub-request is used for requesting to synthesize the target material into a target file, and each sub-request has a unique corresponding target material; generating a target browser instance for the target material synthesis request; loading at least one target material page through a target browser instance, wherein the target material page is used for calling a target construction scheme mounted on the global object; and respectively carrying out synthesis processing on each target material in all the target materials through at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used for calling in each target material page in at least one target material page, so as to obtain a target file corresponding to each target material. The technical problem that the advertisements cannot be rapidly produced is solved.

Description

Material synthesizing method and device, electronic device and storage medium
Technical Field
The present application relates to the field of advertisement technologies, and in particular, to a method and an apparatus for synthesizing a material, an electronic device, and a storage medium.
Background
CTV (Connected TV, smart internet TV) refers to a television capable of connecting to the internet, including smart TV devices, game consoles, and video streaming services. With the continuous upgrade of internet technology, CTV gradually becomes the mainstream advertisement delivery platform, and the demand of advertisers for delivery on CTV gradually increases, but the synthesis mode of advertisement materials in the related art needs a lot of manpower to synthesize manually, and cannot produce advertisements quickly.
Aiming at the problem that the advertisement materials in the related technology can not be rapidly produced due to the fact that the advertisement materials need to be manually synthesized by a large amount of manpower, an effective solution is not provided at present.
Disclosure of Invention
The application provides a material synthesis method and device, electronic equipment and a storage medium, which are used for at least solving the technical problem that advertisements cannot be rapidly produced due to the fact that advertisement materials are manually synthesized by a large amount of manpower in the related technology.
According to an aspect of an embodiment of the present application, there is provided a material synthesizing method, including: acquiring a target material synthesis request, wherein the target material synthesis request comprises at least one sub-request, the sub-request is used for requesting to synthesize target materials into a target file, and each sub-request has a unique corresponding target material; generating a target browser instance for the target material synthesis request; loading at least one target material page through a target browser instance, wherein the target material page is used for calling a target construction scheme mounted on the global object; and respectively carrying out synthesis processing on each target material in all the target materials through at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used for calling in each target material page in at least one target material page, so as to obtain a target file corresponding to each target material.
According to another aspect of the embodiments of the present application, there is also provided a material synthesizing apparatus including:
the acquisition module is used for acquiring a target material synthesis request, wherein the target material synthesis request comprises at least one sub-request, the sub-request is used for requesting to synthesize target materials into a target file, and each sub-request has a unique corresponding target material;
the generating module is used for generating a target browser instance for the target material synthesis request; loading at least one target material page through a target browser instance, wherein the target material page is used for calling a target construction scheme mounted on the global object;
and the synthesis module is used for respectively carrying out synthesis processing on each target material in all the target materials through at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used for calling in each target material page in at least one target material page, so as to obtain a target file corresponding to each target material.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method described above through the computer program.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The computer instructions are read by a processor of the computer device from a computer-readable storage medium, and the computer instructions are executed by the processor to cause the computer device to perform the steps of any one of the above-described embodiments of the method.
In the embodiment of the application, a target material synthesis request is obtained, wherein the target material synthesis request comprises at least one sub-request, the sub-request is used for requesting to synthesize a target material into a target file, and each sub-request has a unique corresponding target material; generating a target browser instance for the target material synthesis request; loading at least one target material page through a target browser instance, wherein the target material page is used for calling a target construction scheme; according to the target construction scheme indicated by each sub-request and the target construction scheme called by each target material page in at least one target material page, each target material in all target materials is respectively subjected to synthesis processing through at least one target material page to obtain a target file corresponding to each target material, the construction scheme is mounted on a global object, a browser example is generated for a material synthesis request, the material page is loaded, the calling of the target construction scheme is realized in the target material page according to each sub-request in the material synthesis request, the target materials are synthesized into the target file, the automatic synthesis of advertisement materials can be realized, a back-end service capable of being called in a cross-end mode is provided for the synthesis of the advertisement materials, the purpose of quickly producing advertisements is achieved, and the technical problem that the advertisements cannot be quickly produced due to the fact that the advertisement materials need to be manually synthesized in a large amount of manpower is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a Puppeneer architecture diagram;
FIG. 2 is a schematic diagram of a hardware environment for a material composition method according to an embodiment of the present application;
FIG. 3 is a flow diagram of an alternative material composition method according to an embodiment of the present application;
FIG. 4 is a flow chart of an alternative still picture synthesis method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative material composition service according to an embodiment of the present application;
fig. 6 is a schematic diagram of an alternative material composition apparatus according to an embodiment of the present application; and the number of the first and second groups,
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, 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 obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
First, partial nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:
JavaScript, abbreviated as "JS", is a scripting language running on a client, is a lightweight, interpreted, or just-in-time compilation programming language with function priority, has been widely used for Web application development, and is often used to add various dynamic functions to a Web page to provide a smoother and more beautiful browsing effect for a user.
The Global Object (Global Object) is a predefined Object that is a placeholder for Global properties and Global functions of JavaScript. By using a global object, all other predefined objects, functions and properties can be accessed. In browser JavaScript, typically window is a global object, and node.js (JavaScript interpreter running on the server) is global.
Puppeneer, a Node library for controlling a non-interface (head) Chrome via DevTools protocol. Puppeteer provides advanced APIs and controls Chrome (or Chrome) via the DevTools protocol, colloquially a premium Chrome browser, which can generate web screenshots or PDFs, grab Single Page Applications (SPAs) execution and rendering, make auto-submission of forms, etc. As shown in fig. 1, a Puppeteer architecture, puppeteer communicating with Browser using the DevTools protocol; browser is an instance of a Browser (chrome) that may have multiple pages; page contains at least one Frame; the Frame includes at least one execution environment for executing JavaScript, and multiple execution environments may also be expanded.
According to an aspect of an embodiment of the present application, an embodiment of a method for material synthesis is provided.
Alternatively, in the present embodiment, the above-described material composition method may be applied to a hardware environment constituted by the terminal 101 and the server 103 as shown in fig. 2. As shown in fig. 2, the server 103 is connected to the terminal 101 through a network, which may be used to provide services (such as advertisement composition services, material composition services, etc.) for the terminal or a client installed on the terminal, and a database 105 may be provided on the server or separately from the server to provide data storage services for the server 103, and the network includes, but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like. The material synthesis method according to the embodiment of the present application may be executed by the server 103, the terminal 101, or both the server 103 and the terminal 101. The terminal 101 may execute the material synthesizing method according to the embodiment of the present application by a client installed thereon. A material synthesis method of the embodiment of the present application is performed on a server as an example.
Fig. 3 is a flow chart of an alternative material composition method according to an embodiment of the present application, which may include the following steps, as shown in fig. 3:
step S202, a target material synthesis request is obtained, wherein the target material synthesis request comprises at least one sub-request, the sub-request is used for requesting to synthesize the target material into a target file, and each sub-request has a unique corresponding target material;
step S204, generating a target browser instance for the target material synthesis request; loading at least one target material page through a target browser instance, wherein the target material page is used for calling a target construction scheme mounted on the global object;
step S206, according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in the at least one target material page for calling, respectively performing synthesis processing on each target material in all target materials through the at least one target material page to obtain a target file corresponding to each target material.
Through the steps S202 to S206, the construction scheme is mounted on the global object, the browser instance is generated for the material synthesis request, the material page is loaded, the target construction scheme is called in the target material page according to each sub-request in the material synthesis request, the target material is synthesized into the target file, the automatic synthesis of the advertisement material can be realized, the back-end service capable of being called in a cross-end mode is provided for the synthesis of the advertisement material, the purpose of quickly producing the advertisement is achieved, and the technical problem that the advertisement cannot be quickly produced due to the fact that the advertisement material needs to be manually synthesized by a large amount of manpower is solved.
The application can be applied in scenes including but not limited to automatic generation of advertisements, automatic generation of posters, automatic composition of emoticons, and the like.
In the technical solution provided in step S202, the server obtains a target material composition request, where the target material composition request includes at least one sub-request, the sub-request is used to request to compose the target material into a target file, and each sub-request has a unique corresponding target material.
The method for acquiring the target material synthesis request by the server is not limited, and the material synthesis service adopting the material synthesis method can be operated in the server, a calling party of the material synthesis service can be called, and the material synthesis request can be transmitted when an interface API of the material synthesis service is called. The caller of the material composition service can obtain the result of the material composition service after synthesizing the material only by transmitting the material composition request into the interface API, and does not need to manually synthesize the material.
The target material composition request may include one or more sub-requests, each sub-request corresponds to a material composition task, and each material composition task is configured to combine a target material into a target file.
The form and content of the target materials are not limited, and each target material may include one or more material pictures, one or more material texts, and other information.
In the technical solution provided in step S204, the server generates a target browser instance for the target material composition request; and loading at least one target material page through a target browser instance, wherein the target material page is used for calling a target construction scheme mounted on the global object.
Optionally, the server may generate a target browser instance for the target material composition request through Puppeteer: launch (i.e., a method that starts one Browser instance at a time), calling Puppeteer's Puppeteer, creates one Browser instance (i.e., target Browser instance)
Alternatively, the server may generate the target browser instance in other ways, for example, by using Selenium (automated testing tool for Web applications) to create the browser instance.
By generating the browser instance, some method of the browser can be used at the server, for example, obtaining the window attribute of the browser. One browser instance may own multiple pages.
In a browser environment, the global object is a window object, which means that any created global variable is a property of the window object.
The target construction scheme may be a global construction scheme mounted on the window, where the global construction scheme is a scheme for constructing a target material into a target file, and specifically, the global construction scheme may be a scheme implemented by an SDK (software development kit) in a JavaScript environment, and a target material page is a page of the SDK on which the target construction scheme is loaded.
The function of the global construction scheme is not limited, and the global construction scheme can be set according to actual needs, and can be a construction scheme for synthesizing materials into animation files, a construction scheme for synthesizing materials into static picture files, and a construction scheme for synthesizing materials into web page files.
The number of global building schemes may be one or more. Under the condition that the number of the global construction schemes is one, the global construction scheme can only be used as a target construction scheme, and the browser instance can only load one target material page which is used for calling the target construction scheme; the browser instance may also load multiple material pages, each for invoking the target build solution.
The browser instance can load a plurality of material pages, and the global construction schemes for calling of different material pages can be the same or different. For example, the target browser instance is used for loading a target material page a, a target material page B and a target material page C, where the target material page a is used for calling the target construction scheme a, the target material page B is used for calling the target construction scheme B, and the target material page C is used for calling the target construction scheme a. If a certain global construction scheme is a relatively common scheme, the SDKs of the global construction scheme can be loaded in multiple material pages, so as to improve the efficiency of material synthesis.
In the technical solution provided in step S206, the server performs synthesis processing on each target material in all target materials through at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in at least one target material page for calling, so as to obtain a target file corresponding to each target material.
Optionally, when the number of the global construction schemes is one, the material synthesis can be performed only by using the global construction scheme as the target construction scheme, and the sub-request may not include scheme information indicating the construction scheme.
Optionally, in a case that there are multiple global building schemes, each sub-request includes scheme information for indicating a building scheme, such as a scheme identifier, a scheme name, and the like, and the server may find a uniquely corresponding target building scheme from all global building schemes through the scheme information in the sub-request.
For each sub-request, the server can find any target material page for calling the target construction scheme in all material pages loaded by the browser instance according to the target construction scheme indicated by the sub-request, so that the target materials indicated by the sub-request are synthesized through the target material page to obtain a target file. For example, the target material composition request includes a sub-request 01 and a sub-request 02, and a plurality of target material pages are loaded by the target browser instance, where the target material page a is used to call the target construction scheme a, the target material page B is used to call the target construction scheme B, and the target material page C is used to call the target construction scheme a; if the scheme identifier in the sub-request 01 is a, synthesizing the target material 01 indicated by the sub-request 01 through a target material page a or a target material page C to obtain a target file 01 corresponding to the target material 01; if the scheme identifier in the sub-request 02 is B, the target material 02 indicated by the sub-request 02 may be synthesized through the target material page B, so as to obtain a target file 02 corresponding to the target material 02.
The server can process a plurality of sub-requests simultaneously through a plurality of target material pages loaded by the browser instance to obtain a plurality of target files, and synchronously execute a plurality of material synthesis tasks, so that a large batch of materials can be quickly synthesized.
As an alternative embodiment, in a case that a plurality of target material pages are loaded through the target browser instance, in step S206, according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in at least one target material page for calling, each target material in all target materials is respectively subjected to synthesis processing through at least one target material page, so as to obtain a target file corresponding to each target material, the method includes the following steps:
step S1, determining an appointed material page corresponding to an appointed sub-request according to an appointed construction scheme indicated in the appointed sub-request and a preset corresponding relation in a plurality of target material pages, wherein each target material page is used for calling a unique corresponding target construction scheme, the appointed sub-request is any one of at least one sub-request, and the preset corresponding relation is used for indicating the corresponding relation between the target material page and the target construction scheme;
s2, transmitting the specified material corresponding to the specified sub-request into a specified material page;
and S3, calling a specified construction scheme on a specified material page to process the specified material, and obtaining a specified file synthesized by the specified material, wherein the specified file is one of all target files.
The corresponding relationship between the target material page and the target construction scheme may be one-to-one, or a plurality of target material pages may correspond to the same target construction scheme.
In the case that the designated construction scheme indicated in the designated sub-request has a plurality of corresponding target material pages, one of the plurality of target material pages corresponding to the designated construction scheme may be determined as the designated material page in a plurality of manners, such as determination in a preset order and random determination.
For example, the database stores the corresponding relationship between the construction scheme and the material page, the target construction scheme a corresponds to the target material page a and the target material page D, the target construction scheme B corresponds to the target material page B, and the target construction scheme C corresponds to the target material page C; the specified construction scheme indicated in the sub-request is specified as a target construction scheme A, and the target material page A can be determined as a specified material page in the target material page A and the target material page D according to the sequence of the numbers.
Through the steps S1 to S3, according to the preset corresponding relation between the target material page and the target construction scheme, the corresponding target material page is found for each sub-request in the target material synthesis request, and the multiple target material pages can respectively process different sub-requests, simultaneously perform multiple material processing tasks and perform material synthesis in batches.
As an alternative embodiment, the target construction scheme includes at least one dynamic composition scheme, and in step S206, according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in the at least one target material page for calling, each target material in all the target materials is subjected to composition processing through the at least one target material page, so as to obtain a target file corresponding to each target material, including the following steps:
step S11, according to a target dynamic synthesis scheme indicated by a first sub-request, determining a first target material page corresponding to the target dynamic synthesis scheme from a plurality of target material pages, wherein at least one sub-request comprises a first sub-request, and the first sub-request is used for synthesizing the first target material into an animation file;
step S12, transmitting the first target material indicated by the material parameters in the first sub-request into a first target material page;
and S13, calling a target dynamic synthesis scheme through the first target material page to perform target operation on the first target material to obtain a target animation file serving as a target file, wherein the target operation comprises animation rendering on the first target material according to a preset animation effect.
The preset animation effect is not limited in form, and can be a page turning animation, a rotating animation and the like for a static picture, or an animation effect added with other animation elements, such as snowflakes falling in a snowing scene, or a combination of animation effects in various forms.
Optionally, in this embodiment, the target animation file may be a file in a GIF format, the GIF is a widely used picture file format, most of the display terminals can support display of the file in the GIF format, and the display terminals have good universality and avoid the problems of playing jam, unclear and the like when the target animation file is displayed.
Optionally, in this embodiment, the target operation may further include performing timed frame extraction on a file obtained after performing animation rendering on the first target material according to a preset animation effect to obtain a target animation file (e.g., a target GIF file), and reducing a data amount of the target animation file, so that the target animation file is played more smoothly.
As an alternative embodiment, the target construction scheme includes at least one static composition scheme, and step S206, according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in the at least one target material page for calling, the at least one target material page performs composition processing on each target material in all the target materials respectively to obtain a target file corresponding to each target material, including the following steps:
step S21, according to a target static synthesis scheme indicated by a second sub-request, determining a second target material page corresponding to the target static synthesis scheme from a plurality of target material pages, wherein at least one sub-request comprises a second sub-request, and the second sub-request is used for synthesizing a second target material into a static picture file;
step S22, transmitting a second target material indicated by the material parameter in the second sub-request into a second target material page;
step S23, in the second target material page, performing the following operations by the target static composition scheme: and selecting a target element from the second target material, drawing an image of the target element, and converting the drawn target image into a second target file, wherein the second target file is a file which adopts character coding to represent the target image.
Alternatively, in this embodiment, the second target material may be represented by an HTML address in the second target material page, the HTML element (i.e., the target element) is selected from the second target material page, the HTML element is rendered by using a page generation picture plug-in (HTML 2Canvas plug-in), the HTML element is converted into a Canvas element (i.e., the target image), and the Canvas element is converted into Base64 code.
By the target static synthesis scheme, the function of converting static HTML into Canvas is realized, meanwhile, canvas is converted into Base64 code, and the uploading function of Base64 coded pictures is further realized.
The HTML is converted into Canvas, which has the following advantages: (1) canvas more accurately restores the DOM representation in HTML; (2) the performance is high, the drawing process can be controlled by the user, and WebGL can be used; (3) controllability is high, and pixel level control is realized; (4) the memory occupation is less.
The main advantage of converting Canvas to Base 64: (1) when pictures in a base64 format are used in a webpage (the base64 is equivalent to a local file and can be directly read), a server does not need to be requested to call picture resources, and the access times of the server are reduced; (2) the picture adopting the Base64 is downloaded along with the page, so that the problem of cross-domain request can not exist (the Base64 is a resource format, a file is represented in a character coding mode, and the file is equivalent to the file already existing in a code) (3) the picture in the Base64 is in a text format, the occupied memory is small, the size ratio after conversion is about 1/3, and the consumption of a resource server is reduced.
The static composition scheme may also include other forms of schemes, such as a scheme of synthesizing a plurality of documents into a picture in a JPG format according to a preset rule, without being limited by the above examples.
As an alternative embodiment, in step S206, before synthesizing each target material in all target materials through at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in at least one target material page for calling, and obtaining a target file corresponding to each target material, the method further includes the following steps:
step S101, for each sub-request in the target material synthesis request, according to the scheme identifier in the sub-request, checking whether the material parameters in the sub-request meet the preset requirements corresponding to the target construction scheme indicated by the scheme identifier, and obtaining a sub-checking result, wherein the material parameters comprise material addresses and/or material information;
step S102, under the condition that all the sub-verification results indicate that material parameters in each sub-request in the target material synthesis request meet preset requirements, generating a target request identifier uniquely corresponding to the target material synthesis request, and storing the target request identifier into a request table in a database;
and step S103, storing material information corresponding to each sub-request in the target material synthesis request into a material table of the database, wherein each material information comprises a scheme identifier and a material parameter.
In order to improve the efficiency of material composition and the user experience of the material composition service, the server may perform parameter verification on each sub-request when the target composition request is obtained, and the verification rule may be set according to actual needs, for example, the material parameter in the sub-request cannot be null.
Optionally, in this embodiment, different checking rules may be set for different building schemes, for example, the checking rule corresponding to the target dynamic composition scheme is that the material address in the material parameter must be a base64 address, and the checking rule corresponding to the target static composition scheme is that the material address in the material parameter must be an HTML address.
Optionally, in this embodiment, when there is a situation in the target material composition request that the material parameters in at least one sub-request do not meet the preset requirement, a prompt message is returned to a caller of the material composition service (a party that transmits the target material composition request through the interface API), and the prompt message is used to prompt the caller to modify the target material composition request, so that the target material composition request meets the preset requirement.
The server can provide the material composition service for different material composition requests by generating a browser instance for each material composition request, wherein the request table is a list of information and execution conditions for recording each material composition request in the database, and can comprise material composition request ID, material composition requester information, execution results of the material composition request and the like, the material table is a list of information and processing conditions for recording each sub-request in each material composition request in the database, and can comprise material composition request ID, sub-request ID, scheme ID for indicating a construction scheme in the sub-request, material parameters for indicating target materials in the sub-request and the like.
Optionally, in this embodiment, in step S206, according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in the at least one target material page for calling, each target material in all the target materials is respectively subjected to synthesis processing by the at least one target material page, so as to obtain a target file corresponding to each target material, including the following steps:
step S31, determining the current material information corresponding to each available material page according to the sequence of storing each material information into the material table, the scheme identification in each material information and the available material pages in all target material pages, wherein each available material page is used for calling the current construction scheme indicated by the scheme identification in the current material information corresponding to each available material page;
step S32, performing concurrent material processing operations in all available material pages, including performing material processing operations on current material information corresponding to each available material page as follows: the current target material indicated by the current material information is transmitted into an available material page, a current construction scheme is called through the available material page to process the current target material, a processing result corresponding to the current material information is obtained, and the processing result corresponding to the current material information is stored in a material table, wherein the processing result is used for indicating that the material processing operation corresponding to the material information is finished;
step S33, after executing material processing operation on each material information, generating an execution result corresponding to the target request identifier in the request table according to the corresponding relation between the material information and the target request identifier, wherein the execution result is used for indicating that the material synthesis request corresponding to the request identifier is executed;
step S34, closing the target browser instance.
Optionally, in this embodiment, a material production queue and a waiting queue may be set, and the concurrent material processing operation is performed on the sub-requests in the material production queue, and the remaining sub-requests are in the waiting queue.
For example, the target browser instance loads out 4 target material pages: a target material page a (for calling the target construction scheme a), a target material page B (for calling the target construction scheme B), a target material page C (for calling the target construction scheme C), and a target material page D (for calling the target construction scheme C). The target material composition request comprises 6 sub-requests, and the sub-requests are stored into a material table according to the following sequence: sub-request 01 (solution identification A), sub-request 02 (solution identification B), sub-request 03 (solution identification C), sub-request 04 (solution identification C), sub-request 05 (solution identification C), sub-request 06 (solution identification A). Firstly, adding a sub-request 01, a sub-request 02, a sub-request 03 and a sub-request 04 into a material production queue, performing material processing operation on material information of the sub-request 01 on a target material page A, performing material processing operation on the material information of the sub-request 02 on a target material page B, performing material processing operation on the material information of the sub-request 03 on a target material page C, and performing material processing operation on the material information of the sub-request 04 on a target material page D; at this time, no available material page exists in the target browser instance, and the sub-requests 05 and 06 wait in a waiting queue; and the sub-request 05 is added into a material production queue after the material processing operation in the target material page C or the target material page D is completed, and the sub-request 06 is added into the material production queue after the material processing operation in the target material page A is completed.
Information for recording the execution of each material composition request may be included in the request table, for example, start execution information is recorded for the target material composition request in the request table when there is at least one sub-request to join the production queue in the target material composition request, and complete execution information (e.g., execution result) is recorded for the target material composition request in the request table after all the sub-requests in the target material composition request complete the material processing operation. Therefore, the execution situation of the material composition request in the request table can be determined through the information recorded in the request table.
Optionally, in this embodiment, in step S31, after determining the current material information corresponding to each available material page according to the sequence in which each material information is stored in the material table, the scheme identifier in each material information, and the available material pages in all target material pages, the method further includes:
step S41, under the condition that the server executing the material processing operation recovers from the interruption and the execution result corresponding to the target request identifier does not exist in the request table, determining that the target material synthesis request corresponding to the target request identifier is not executed completely;
step S42, determining the material information without the processing result in the material table as unfinished material information of unfinished material processing operation in all the material information;
and step S43, continuing to perform concurrent material processing operation in all available material pages until all material processing operations corresponding to the unfinished material information are executed.
In the case where the server recovers from the interruption, it is necessary to check the material composition requests that are in progress at the time of the interruption, and it is possible to determine, from the information recorded in the request table, all the material composition requests in the request table, the material composition requests that are in progress at the time of the interruption, and it is possible to determine, from the information recorded in the material table, the sub-requests that are not completed among all the sub-requests of the material composition requests in the material table.
As an alternative example, the following description will schematically describe the technical solution of the present application with reference to the specific embodiments:
in recent years, the internet television industry (Connected TV) is abbreviated as CTV, the market share in the whole television advertising industry is gradually increased, the flow of the CTV is gradually increased, the corresponding CTV advertising flow becomes an important revenue source of advertisements, and corresponding advertisers have more demands from 'quiet' to 'dynamic' on the delivery of materials. At present, advertisements delivered on a CTV are mainly static H5 (i.e. pages without any animation effect), more and more advertisers want to deliver dynamic advertisements, such as dynamic H5, but to meet the delivery requirement of dynamic H5, dynamic H5 needs to be disassembled, and H5 is played and recorded in frames to produce videos for delivery, which has the following disadvantages: (1) the file of the video advertisement is large, (2) the loading is slow and unclear, which affects the user experience, and (3) the CTV low version has low support degree to H5, namely the problem that the H5 cannot be loaded exists on the low version. For the generation of advertisement materials, the problems that H5 support is low on the CTV, for example, android of some low versions cannot be rendered and displayed normally, screen recording is required for producing dynamic H5, the screen recording can cause problems of unsmooth playing and unclear playing materials, and the like, and dynamic H5 cannot be realized perfectly, need to be overcome.
In addition, in various current display forms of advertisements (mostly based on pictures or H5), the CTV has good support for the picture advertisements, so it is proposed to use the picture advertisements instead of H5, not only because the CTV has better support for the picture advertisements, but also because the pictures have better performance than H5, and thus have better user experience, and the pictures naturally support two picture types, namely static pictures and moving pictures (GIF). However, the picture advertisement depends on the splicing of advertisement information, and a large amount of human resources are consumed to manually synthesize advertisement materials. The existing mode for synthesizing the advertisement material not only needs a large amount of manpower to synthesize manually, but also has the following disadvantages: (1) the method comprises the following steps of (1) generating a synthesized GIF-format advertisement by timing frame extraction, (2) monitoring material construction and synthesizing events, and not synchronizing a real-time synthesis state for a user side, and (3) adding a corresponding alarm prompt when picture synthesis fails.
Aiming at the problems, a service for realizing advertisement synthesis based on material and advertisement information combination is needed, functions of constructing, synthesizing and the like of a Headless browser Puppeneer Headless processing service are utilized, only an interface needs to be called for a user side, parameters related to material content are transmitted, the material synthesis service can automatically trigger a construction task of material synthesis, the user is helped to synthesize advertisement materials rapidly in batches, and mass production and rapid release of advertisements are realized.
According to the scheme, a universal material template needs to be constructed, then interface service is achieved based on a headless browser, and a user registers and constructs an event through transmitting advertisement information. And when the headless browser monitors a construction event, rendering the material animation, and periodically extracting frames to generate the synthesized GIF material. And uploading the material and returning the construction result after the construction is finished, and informing the user side. The user can also initiate the construction task in batch, thereby realizing the batch production and release of the advertisement materials and effectively saving the manpower synthesis cost. Because the synthesis of the picture materials is a synchronous task, a user can wait for a result after waiting for several seconds, and therefore, a Puppeneer Headless browser is used for realizing back-end service, processing material frame extraction, synthesis, real-time synchronization of user side states, alarming and the like.
1. Background service (background service for material composition, specifically, material composition service is an API interface deployed in a server, and the material is synthesized by calling the interface)
1. Starting a back-end interface, registering a Puppeneer event: and calling a launch method of Puppeneer, wherein the method is used for generating a browse instance, so that some methods of the browser can be used at the server side, such as acquiring the window attribute of the browser.
2. Entering the address of the participated template and the parameters of the template, and starting the headless browser: because the material composition service is operated in the background server, for the calling party, an interface API is called, so that GIF composition is carried out, and then the addresses of the participating templates and the template parameters are transmitted when the calling party calls the interface API.
3. Call a global build method (e.g., window. Lp. Build new, which is a method in the material composition service. The method is mounted on window, which acts to build GIF material, i.e., the material that interfaces in to build the GIF format.)
4. Waiting for a construction result, and performing subsequent processing: after the construction is successful, the initially registered Puppeteeer instance is closed, namely, the headless browser is closed, and the instance is destroyed.
2. Construction of a global template (the global construction template is an SDK which is a JS file and is loaded in a material template by loading a script tag, and after the SDK is loaded, a construction method of build, direct, etc. can be realized on a page.)
1. The global object is registered and the corresponding build event is registered.
2. Embedding a material composite file corresponding to a material template (namely, a material template can be in a form of converting the material into a GIF, and then needs to be embedded with an SDK for generating the GIF file, or in a form of converting the material into an html, and then needs to be embedded with an SDK for generating an html file), and transmitting construction information through a postMessage (postMessage is a communication mode between browser windows, a background service opens a page of the material template by using a headless browser, a global construction template SDK is introduced on the page, a window, LP, building and reactive method in the SDK is called in a server, and when the method in the SDK is executed, a message is sent to the page through the postMessage).
3. Monitoring and constructing results: the global construction template SDK monitors the self-constructed result.
4. And the global object receives the construction result and waits for monitoring of the headless browser.
3. Material template (the material template is a page of the material template, and the page is loaded with an SDK of the global construction template)
1. Monitoring a construction event, and calling a material template construction method: the material template monitors the execution of the window.
2. Rendering the material animation, and extracting frames to generate a GIF file: the animation effect is written in the SDK, the construction method is called, and meanwhile, the animation is added.
3. Uploading GIF file and returning uploading result
4. Specific synthetic scheme
1. Static image composition service (as shown in fig. 4, it is a flowchart of an optional static image composition method according to an embodiment of the present application, and the static image composition method is a specific material composition method in the material composition service.)
a) Entry (HTML address) pre-check: the address of the material transmitted by the participant cannot be null.
b) HTML elements are selected from the material template, the elements in the material template are drawn and converted into Canvas elements, and the elements need to be selected through the ID of the elements.
c) The HTML element is converted to a Canvas element (Canvas is used to draw graphics on a web page) using a page generation picture plug-in (HTML 2Canvas plug-in).
d) The Canvas element is converted to Base64 encoding.
e) And uploading the pictures.
The static picture synthesis service mainly realizes the function of converting static HTML into Canvas, and simultaneously converts Canvas into Base64 code, thereby realizing the uploading function of the Base64 coded picture. The HTML is converted into Canvas, which has the following advantages: (1) canvas more accurately restores the DOM representation in HTML; (2) the performance is high, the drawing process can be controlled by the user, and WebGL can be used; (3) controllability is high, and pixel level control is realized; (4) the memory occupation is less. The main advantage of converting Canvas to Base 64: (1) when pictures in a base64 format are used in a webpage (the base64 is equivalent to a local file and can be directly read), a server does not need to be requested to call picture resources, and the access times of the server are reduced; (2) the pictures adopting the Base64 are downloaded along with the page, so that the problem of cross-domain request can not exist (the Base64 is a resource format, a file is represented in a character coding mode and is equivalent to the file existing in the code) (3) the pictures in the Base64 format are in a text format, occupy small memory, have the size ratio of 1/3 after conversion, and reduce the consumption of a resource server.
2. Motion picture composition service (GIF composition)
(1) Background services
1) Request interface
a) Defining an interface request mode, a request data template and a return mode: the interface usually defines its own request mode, such as GET and POST requests, an interface needs to know whether to use GET or POST to make a request, a request data template is actually the entry parameter of the corresponding interface, the entry parameter of the interface needs to be defined in advance, the front end makes a request through the parameters required by the interface, and the return mode is that the front end and the back end agree well and return data.
b) Database design, request table, material table: background service needs to be connected with a database, the database consists of tables, for the service, a request table and a material table are needed, the request table is used for recording request information, the material table is used for recording synthesized material information, and the information is fields, such as material addresses, synthesis time and the like)
c) The default verification of the corresponding template parameters based on the template ID, namely the prior verification according to the fields required by the template, saves the production waiting time: according to the template ID, the template can be known, the information required by each template is different, for example, the GIF synthesis template needs a base64 picture address, and the construction cannot be completed if the template is missing.
2) Processing material
a) The method comprises the steps of initializing, maintaining a material production queue and a material waiting queue, and filling (namely adding material data to the two queues) the material production queue and the material waiting queue according to material dimensions.
b) And starting a material production queue simultaneously: the concurrency is to perform multiple material composition tasks simultaneously, and if the tasks are not concurrent, one material composition needs to wait for the completion of the previous material composition.
c) Storing the material production result (the result obtained after the material construction is completed) into the database, and synchronously supplementing and updating a material production queue and a waiting queue: and after the material production result is obtained, supplementing information of the material production result, such as a material address and generation time, wherein the supplementing mode is to add a piece of information into the queue.
d) Triggering request callback: after the front-end page is synthesized, the back-end interface is requested to tell that the interface is synthesized, and the result is recalled by matching request
(2) Template service
1) The global construction template is used as the only connection between the background headless browser and the material template (a global universal template is unified and is transmitted into the address of the material template in the form of url query).
2) And opening a global template embedded in the material template through the headless browser.
3) And finishing the construction of the materials.
Fig. 5 is a schematic diagram of an alternative material composition service according to an embodiment of the present application. The service party: refers to a party that is to use the GIF service. GIF service: namely the material composition service described by the present scheme.
Step (one): the service side requests the GIF service, and requests the GIF service in a mode of interface API calling, and the service side needs to carry the following information when requesting: service party ID, template parameter list, callback address interface, and callback success Key/Value.
Step (II): when the request reaches the GIF service, the GIF service needs to store the parameters of the request in the database, generate a request ID and store the request ID in a request table.
Step (three): and the service starts to process the synthesized material, requests a callback address interface transmitted when the business side requests after the processing is finished, and meanwhile, if the processing is successful, the successful key/Value is called back, and if the processing is failed, the failed key/Value is called back.
Step (IV): during processing synthesis, the GIF service performs service interruption check, traverses the material information stored in the database according to the time node, finds out the un-synthesized material to synthesize again, and continues to execute the step (III).
Step (V): and the GIF service informs the service party of the failed material, records the failed log, sends a monitoring alarm and informs the failed material of the synthesis.
The material synthesis service can realize the mass production of picture advertisements by advertisements, realize the mass production and release of the advertisements, effectively save the manpower synthesis cost, and simultaneously can produce GIF moving pictures and improve the attraction of the advertisements on the CTV, thereby improving the conversion rate of subsequent links of the advertisements and the income of the advertisements.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided a material synthesizing apparatus for implementing the above material synthesizing method. Fig. 6 is a schematic diagram of an alternative material synthesizing apparatus according to an embodiment of the present application, as shown in fig. 6, the apparatus may include:
the acquisition module 22 is configured to acquire a target material composition request, where the target material composition request includes at least one sub-request, the sub-request is used to request to composition a target material into a target file, and each sub-request has a unique corresponding target material;
a generating module 24, configured to generate a target browser instance for the target material composition request; loading at least one target material page through a target browser instance, wherein the target material page is used for calling a target construction scheme mounted on the global object;
and a synthesizing module 26, configured to perform synthesis processing on each target material in all target materials through at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in the at least one target material page for calling, so as to obtain a target file corresponding to each target material.
It should be noted that the obtaining module 22 in this embodiment may be configured to execute step S202 in this embodiment, the generating module 24 in this embodiment may be configured to execute step S204 in this embodiment, and the synthesizing module 26 in this embodiment may be configured to execute step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as part of the apparatus may operate in a hardware environment as shown in fig. 2, and may be implemented by software or hardware.
Through the modules, the construction scheme is mounted on the global object, a browser instance is generated for the material synthesis request, the material page is loaded, the target construction scheme is called in the target material page according to each sub-request in the material synthesis request, the target material is synthesized into the target file, automatic synthesis of the advertisement material can be achieved, cross-end calling back-end service is provided for synthesis of the advertisement material, the purpose of rapid advertisement production is achieved, and the technical problem that the advertisement material cannot be rapidly produced due to the fact that the advertisement material needs to be manually synthesized by a large amount of manpower is solved.
As an alternative embodiment, the generating module 24 further includes:
the system comprises a scheme determining unit, a data processing unit and a data processing unit, wherein the scheme determining unit is used for determining a specified material page corresponding to a specified sub-request according to the specified construction scheme indicated in the specified sub-request and a preset corresponding relation in the multiple target material pages under the condition that the multiple target material pages are loaded through a target browser instance, each target material page is used for calling a unique corresponding target construction scheme, the specified sub-request is any one of at least one sub-request, and the preset corresponding relation is used for indicating the corresponding relation between the target material page and the target construction scheme;
the transmission unit is used for transmitting the specified materials corresponding to the specified sub-requests into the specified material pages;
and the processing unit is used for calling the specified construction scheme at the specified material page to process the specified material so as to obtain a specified file synthesized by the specified material, wherein the specified file is one of all target files.
As an optional embodiment, the scheme determining unit is further configured to determine, according to a target dynamic composition scheme indicated by the first sub-request, a first target material page corresponding to the target dynamic composition scheme from the multiple target material pages, where the target construction scheme includes at least one dynamic composition scheme, and at least one sub-request includes a first sub-request, and the first sub-request is used to synthesize the first target material into the animation file; the transmission unit is also used for transmitting the first target material indicated by the material parameters in the first sub-request into a first target material page; and the processing unit is also used for calling a target dynamic synthesis scheme through the first target material page to perform target operation on the first target material to obtain a target animation file serving as a target file, wherein the target operation comprises animation rendering on the first target material according to a preset animation effect.
As an optional embodiment, the scheme determining unit is further configured to determine, according to a target static composition scheme indicated by the second sub-request, a second target material page corresponding to the target static composition scheme from the multiple target material pages, where the target construction scheme includes at least one static composition scheme, at least one sub-request includes a second sub-request, and the second sub-request is used to synthesize the second target material into a static picture file; the transmission unit is also used for transmitting a second target material indicated by the material parameter in the second sub-request into a second target material page; a processing unit, further configured to perform the following operations in the second target material page by the target static composition scheme: and selecting a target element from the second target material, drawing an image of the target element, and converting the drawn target image into a second target file, wherein the second target file is a file which adopts character coding to represent the target image.
As an alternative embodiment, the apparatus further comprises:
the verification unit is used for verifying whether material parameters in the sub-requests meet preset requirements corresponding to the target construction scheme indicated by the scheme identification according to the scheme identification in the sub-requests and obtaining sub-verification results before synthesizing all target materials in all the target materials through at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used for calling in each target material page in at least one target material page to obtain a target file corresponding to each target material;
the generating unit is used for generating a target request identifier uniquely corresponding to the target material synthesis request under the condition that all the sub-verification results indicate that the material parameters in each sub-request in the target material synthesis request meet the preset requirements, and storing the target request identifier into a request table in the database;
and the storage unit is used for storing material information corresponding to each sub-request in the target material synthesis request into a material table of the database, wherein each material information comprises a scheme identifier and a material parameter.
Optionally, the generating module 24 further includes:
the material determining unit is used for determining the current material information corresponding to each available material page according to the sequence of each piece of material information stored in the material table, the scheme identification in each piece of material information and the available material pages in all target material pages, wherein each available material page is used for calling the current construction scheme indicated by the scheme identification in the current material information corresponding to each available material page;
the concurrent operation unit is used for performing concurrent material processing operation in all the available material pages, and comprises the following steps of performing material processing operation on current material information corresponding to each available material page: the current target material indicated by the current material information is transmitted into an available material page, a current construction scheme is called through the available material page to process the current target material, a processing result corresponding to the current material information is obtained, and the processing result corresponding to the current material information is stored in a material table, wherein the processing result is used for indicating that the material processing operation corresponding to the material information is finished;
a result generation unit, configured to generate, after performing a material processing operation on each piece of material information, an execution result corresponding to the target request identifier in the request table according to a correspondence between the piece of material information and the target request identifier, where the execution result is used to indicate that the material composition request corresponding to the request identifier has been executed;
and the instance closing unit is used for closing the target browser instance.
Alternatively, the material determination unit may include a scheme determination unit.
Optionally, the concurrent operation unit may include a transmission unit and a processing unit.
It should be noted that the modules described above are the same as examples and application scenarios realized by corresponding steps, but are not limited to what is disclosed in the foregoing embodiments. It should be noted that the modules described above as a part of the apparatus may be run in a hardware environment as shown in fig. 2, may be implemented by software, and may also be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the material synthesis method, including: as shown in fig. 7, the electronic device may include: a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 complete communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 is configured to implement the steps of the above-described method embodiments when executing the program stored in the memory 1503.
The bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
It will be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration and is not intended to limit the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
By adopting the embodiment of the application, a scheme for material synthesis is provided. The construction scheme is mounted on the global object, the browser instance is generated for the material synthesis request, the material page is loaded, the target construction scheme is called in the target material page according to each sub-request in the material synthesis request, the target material is synthesized into the target file, automatic synthesis of the advertisement material can be achieved, the back-end service capable of being called in a cross-end mode is provided for synthesis of the advertisement material, the purpose of rapidly producing the advertisement is achieved, and the technical problem that the advertisement cannot be rapidly produced due to the fact that the advertisement material needs to be manually synthesized by a large amount of manpower is solved.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It should be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), PAD, etc. Fig. 7 does not limit the structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Alternatively, in the present embodiment, the storage medium may be a program code for executing the material synthesizing method.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
step S202, a target material synthesis request is obtained, wherein the target material synthesis request comprises at least one sub-request, the sub-request is used for requesting to synthesize the target material into a target file, and each sub-request has a unique corresponding target material;
step S204, generating a target browser instance for the target material synthesis request; loading at least one target material page through a target browser instance, wherein the target material page is used for calling a target construction scheme mounted on the global object;
step S206, according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in the at least one target material page for calling, respectively performing synthesis processing on each target material in all target materials through the at least one target material page to obtain a target file corresponding to each target material.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, 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 related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be implemented in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for synthesizing a material, comprising:
acquiring a target material synthesis request, wherein the target material synthesis request comprises at least one sub-request, the sub-request is used for requesting to synthesize target materials into a target file, and each sub-request has a unique corresponding target material;
generating a target browser instance for the target material synthesis request; loading at least one target material page through the target browser instance, wherein the target material page is used for calling a target construction scheme mounted on a global object;
and respectively synthesizing each target material in all the target materials through the at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used for calling in each target material page in the at least one target material page, so as to obtain a target file corresponding to each target material.
2. The method according to claim 1, wherein, in a case that a plurality of target material pages are loaded by the target browser instance, the synthesizing, according to the target construction scheme indicated by the each sub-request and the target construction scheme used for calling by each target material page in the at least one target material page, each target material in all target materials through the at least one target material page respectively obtains a target file corresponding to each target material, and the method includes:
determining the appointed material pages corresponding to the appointed sub-requests in the multiple object material pages according to the appointed construction schemes indicated in the appointed sub-requests and a preset corresponding relationship, wherein each object material page is used for calling one unique corresponding object construction scheme, the appointed sub-requests are any one of the at least one sub-requests, and the preset corresponding relationship is used for indicating the corresponding relationship between the object material pages and the object construction schemes;
transmitting the specified material corresponding to the specified sub-request into the specified material page;
and calling the specified construction scheme on the specified material page to process the specified material to obtain a specified file synthesized by the specified material, wherein the specified file is one of all the target files.
3. The method according to claim 1, wherein the target construction scheme includes at least one dynamic composition scheme, and the performing composition processing on each target material in all target materials through the at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used by each target material page in the at least one target material page for calling obtains a target file corresponding to each target material by the at least one target material page respectively includes:
determining a first target material page corresponding to a target dynamic synthesis scheme from a plurality of target material pages according to the target dynamic synthesis scheme indicated by a first sub-request, wherein at least one sub-request comprises the first sub-request, and the first sub-request is used for synthesizing a first target material into an animation file;
transmitting first target materials indicated by the material parameters in the first sub-request into the first target material page;
and calling the target dynamic synthesis scheme through the first target material page to perform target operation on the first target material to obtain a target animation file serving as the target file, wherein the target operation comprises animation rendering on the first target material according to a preset animation effect.
4. The method according to claim 1, wherein the target construction scheme includes at least one static composition scheme, and the performing, according to the target construction scheme indicated by each sub-request and the target construction scheme used by each of the at least one target material page for calling, composition processing on each of all target materials through the at least one target material page, respectively, to obtain a target file corresponding to each target material includes:
determining a second target material page corresponding to the target static synthesis scheme from the plurality of target material pages according to the target static synthesis scheme indicated by the second sub-request, wherein the at least one sub-request comprises the second sub-request, and the second sub-request is used for synthesizing a second target material into a static picture file;
transmitting second target materials indicated by the material parameters in the second sub-request into a second target material page;
in the second target material page, performing the following operations by the target static composition scheme: and selecting a target element from the second target material, drawing an image of the target element, and converting the drawn target image into a second target file, wherein the second target file is a file which adopts character coding to represent the target image.
5. The method according to claim 1, wherein before the synthesizing of each target material in all target materials through the at least one target material page according to the target construction scheme indicated by the each sub-request and the target construction scheme used for calling in each target material page in the at least one target material page obtains a target file corresponding to each target material, the method further comprises:
for each sub-request in the target material synthesis request, verifying whether material parameters in the sub-request meet preset requirements corresponding to a target construction scheme indicated by the scheme identifier according to the scheme identifier in the sub-request, and obtaining a sub-verification result, wherein the material parameters comprise material addresses and/or material information;
under the condition that all the sub-verification results indicate that the material parameters in each sub-request in the target material synthesis request meet the preset requirements, generating a target request identifier uniquely corresponding to the target material synthesis request, and storing the target request identifier into a request table in a database;
and storing material information corresponding to each sub-request in the target material synthesis request into a material table of the database, wherein each material information comprises the scheme identifier and the material parameters.
6. The method according to claim 5, wherein the synthesizing, according to the target construction scheme indicated by each sub-request and the target construction scheme used by each of the at least one target material page for calling, each target material in all the target materials through the at least one target material page to obtain a target file corresponding to each target material, comprises:
determining current material information corresponding to each available material page according to the sequence of storing each piece of material information into the material table, the scheme identifier in each piece of material information and the available material pages in all the target material pages, wherein each available material page is used for calling the current construction scheme indicated by the scheme identifier in the current material information corresponding to each available material page;
performing concurrent material processing operations in all the available material pages, including performing material processing operations on current material information corresponding to each available material page as follows: transmitting a current target material indicated by the current material information into an available material page, calling the current construction scheme through the available material page to process the current target material to obtain a processing result corresponding to the current material information, and storing the processing result corresponding to the current material information into a material table, wherein the processing result is used for indicating that the material processing operation corresponding to the material information is finished;
after the material processing operation is executed on each piece of material information, generating an execution result corresponding to the target request identifier in the request table according to the corresponding relation between the material information and the target request identifier, wherein the execution result is used for indicating that the material synthesis request corresponding to the request identifier is executed completely;
and closing the target browser instance.
7. The method of claim 6, wherein after determining the current material information corresponding to each available material page according to the sequence of storing each material information into the material table, the scheme identifier in each material information, and the available material pages in all the target material pages, the method further comprises:
when the server executing the material processing operation recovers from the interruption and the request table does not have an execution result corresponding to the target request identifier, determining that the target material synthesis request corresponding to the target request identifier is not completely executed;
determining the material information without the processing result in the material table as unfinished material information which does not finish the material processing operation in all the material information;
and continuing to perform concurrent material processing operation in all the available material pages until all the material processing operation corresponding to the unfinished material information is completed.
8. A material composing apparatus, comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a target material synthesis request, the target material synthesis request comprises at least one sub-request, the sub-request is used for requesting to synthesize target materials into a target file, and each sub-request has a unique corresponding target material;
the generating module is used for generating a target browser instance for the target material synthesis request; loading at least one target material page through the target browser instance, wherein the target material page is used for calling a target construction scheme mounted on a global object;
and the synthesis module is used for respectively carrying out synthesis processing on each target material in all the target materials through the at least one target material page according to the target construction scheme indicated by each sub-request and the target construction scheme used for calling in each target material page in the at least one target material page so as to obtain a target file corresponding to each target material.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the steps of the material composition method according to any one of the preceding claims 1 to 7 by means of the computer program.
10. A computer-readable storage medium on which a computer program is stored, the computer program, when being executed by a processor, implementing the steps of the material synthesis method according to any one of claims 1 to 7.
CN202211194025.0A 2022-09-28 2022-09-28 Material synthesizing method and device, electronic device and storage medium Pending CN115658051A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211194025.0A CN115658051A (en) 2022-09-28 2022-09-28 Material synthesizing method and device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211194025.0A CN115658051A (en) 2022-09-28 2022-09-28 Material synthesizing method and device, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN115658051A true CN115658051A (en) 2023-01-31

Family

ID=84984763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211194025.0A Pending CN115658051A (en) 2022-09-28 2022-09-28 Material synthesizing method and device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115658051A (en)

Similar Documents

Publication Publication Date Title
CN109327727B (en) Live stream processing method in WebRTC and stream pushing client
CN112839249B (en) Virtual gift display method, device, equipment and storage medium
US8955739B2 (en) Barcode scanner on webpage
US11818496B2 (en) Remotely accessed virtual recording room
US20160328877A1 (en) Method and apparatus for making personalized dynamic emoticon
CN111462281A (en) Poster generation method, device, equipment and storage medium
JP2009515256A (en) System and method for developing, providing and using video applications for multiple mobile platforms
CN109309842B (en) Live broadcast data processing method and device, computer equipment and storage medium
US20180373736A1 (en) Method and apparatus for storing resource and electronic device
CN109743584B (en) Panoramic video synthesis method, server, terminal device and storage medium
CN107430514A (en) Use the low latency application of multiserver
EP4080507A1 (en) Method and apparatus for editing object, electronic device and storage medium
CN114679621A (en) Video display method and device and terminal equipment
CN110930325B (en) Image processing method and device based on artificial intelligence and storage medium
CN112102445A (en) Building poster manufacturing method, device, equipment and computer readable storage medium
CN114339069B (en) Video processing method, video processing device, electronic equipment and computer storage medium
US20190035428A1 (en) Video processing architectures which provide looping video
US20170289612A1 (en) System and methods thereof for displaying video content
CN115658051A (en) Material synthesizing method and device, electronic device and storage medium
CN113596495B (en) Live broadcast push stream processing method and device, equipment and medium thereof
CN111913776B (en) Content display method, device and equipment
CN114257859A (en) Video promotion data generation method and video promotion data display method
CN111885139A (en) Content sharing method, device and system, mobile terminal and server
CN111212269A (en) Unmanned aerial vehicle image display method and device, electronic equipment and storage medium
CN107800618B (en) Picture recommendation method and device, terminal and computer-readable storage medium

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