A poster picture generation method and device, electronic equipment and storage medium

By acquiring and storing poster template configuration data, poster images that match the text layout are generated, solving the problem of poor flexibility of poster templates in existing technologies, realizing the efficient generation of personalized posters, and improving the information dissemination rate.

CN122492854APending Publication Date: 2026-07-31TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2025-01-24
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies generate poster images based on default fixed poster templates, which lacks flexibility, cannot meet users' personalized needs for information sharing, and reduces the information dissemination rate.

Method used

By obtaining the poster template configuration data of the target object, including the target image and text regional information, storing the target poster template, and responding to the poster generation request, calling the rendering program instance to generate the poster image, ensuring that the text layout matches the image, the user-customized poster template is realized.

Benefits of technology

It improves the flexibility and efficiency of poster image generation, meets users' personalized needs, and enhances the willingness to share information and the rate of dissemination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122492854A_ABST
    Figure CN122492854A_ABST
Patent Text Reader

Abstract

This application discloses a poster image generation method, apparatus, electronic device, and storage medium. The method includes: acquiring poster template configuration data configured by a target object based on a poster template configuration page, the poster template configuration data including a target image and text regional information indicating the layout of poster text in the target image; storing the target poster template in a poster template library based on the poster template configuration data; responding to a poster generation request sent by the target object for the target poster template, acquiring the target image and text regional information, the poster generation request including poster text information; invoking a rendering program instance, generating and returning a target poster image with the target image as the background and including the poster text information, based on the target image, text regional information, and poster text information, wherein the layout of the poster text information in the target poster image matches the text regional information. This application improves the flexibility and efficiency of generating poster images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for generating poster images. Background Technology

[0002] With the development of internet technology, sharing information of interest through poster images has become an important way of information sharing.

[0003] However, the related technologies generate poster images based on default fixed poster templates, which lacks flexibility, cannot meet users' personalized needs for information sharing, and reduces the information dissemination rate. Summary of the Invention

[0004] To address the problems of existing technologies, this application provides a poster image generation method, apparatus, electronic device, and storage medium. The technical solution is as follows:

[0005] On the one hand, a method for generating poster images is provided, the method comprising:

[0006] Obtain the poster template configuration data of the target object based on the poster template configuration page. The poster template configuration data includes the target image and text regional information. The text regional information indicates the layout of the poster text in the target image.

[0007] Based on the poster template configuration data, the target poster template is stored in the poster template library;

[0008] In response to a poster generation request sent by the target object for the target poster template, the target image and the text region information are obtained; the poster generation request includes poster text information for displaying on the target poster image to be generated;

[0009] A rendering program instance is invoked to generate a target poster image with the target image as the background and including the poster text information, based on the target image, the text region information, and the poster text information; the layout of the poster text information in the target poster image matches the text region information.

[0010] Return the target poster image to the target object.

[0011] On the other hand, a poster image generation apparatus is provided, the apparatus comprising:

[0012] The template configuration data acquisition module is used to acquire the poster template configuration data of the target object based on the poster template configuration page. The poster template configuration data includes the target image and text regional information, and the text regional information indicates the layout of the poster text in the target image.

[0013] The target poster template storage module is used to store target poster templates in the poster template library based on the poster template configuration data;

[0014] A request-response module is used to respond to a poster generation request sent by the target object for the target poster template, and to obtain the target image and the text region information; the poster generation request includes poster text information for displaying on the target poster image to be generated;

[0015] The poster image rendering module is used to call a rendering program instance to generate a target poster image with the target image as the background and including the poster text information, based on the target image, the text region information, and the poster text information; the layout of the poster text information in the target poster image matches the text region information.

[0016] The poster image return module is used to return the target poster image to the target object.

[0017] In one exemplary embodiment, the target poster template storage module includes:

[0018] The storage address determination module is used to store the target image in the poster template configuration data to a specified storage space and determine the storage address of the target image in the specified storage space.

[0019] The template identifier determination module is used to determine the target template identifier corresponding to the target poster template;

[0020] The correspondence establishment module is used to establish the correspondence between the target template identifier, the storage address, and the text regional information in the poster template library.

[0021] In one exemplary implementation, the request-response generation module includes:

[0022] A request generation module is used to obtain a poster generation request sent by the target object for the target poster template, wherein the poster generation request includes the target template identifier;

[0023] The target correspondence determination module is used to determine the target correspondence in the poster template library that matches the target template identifier;

[0024] The information acquisition module is used to acquire the textual geographic information in the target correspondence and the storage address in the target correspondence.

[0025] In one exemplary embodiment, the apparatus further includes:

[0026] The adjustment instruction response module is used to respond to the adjustment instruction for the target poster template and display the poster template configuration data based on the poster template configuration page;

[0027] The data acquisition module is adjusted to acquire the adjusted poster template configuration data based on the poster template configuration page.

[0028] The poster template update module is used to update the target poster template stored in the poster template library based on the adjusted poster template configuration data.

[0029] In one exemplary embodiment, the poster image rendering module includes:

[0030] The browser instance invocation module is used to invoke a headless browser instance to access the storage address and create a first page based on the target image in the storage address; the size of the first page matches the size of the target image, and the first page uses the target image as its background;

[0031] The block-level element adding module is used to add target block-level elements to the first page based on the text region information and the poster text information to obtain the target page;

[0032] The screenshot module is used to take a screenshot of the target page to obtain the target poster image.

[0033] In one exemplary embodiment, the browser instance invocation module is specifically configured to: send a headless browser instance retrieval request to the instance resource library, so that the instance resource library, in response to the headless browser instance retrieval request, searches for an idle headless browser instance in the instance resource library and returns a response result based on the search result; upon receiving a first response result returned by the instance resource library, add the headless browser instance retrieval request to a waiting queue, so that when the instance resource library determines that an idle headless browser instance exists, it returns a second response result based on the idle headless browser instance and in the order of the headless browser instance retrieval requests in the waiting queue; the first response result indicates that no idle headless browser instance was found, and the second response result includes any idle headless browser instance; upon receiving the second response result returned by the instance resource library, invoke the idle headless browser instance in the second response result to access the storage address.

[0034] On the other hand, an electronic device is provided, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the poster image generation method of any of the above aspects.

[0035] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the poster image generation method as described above.

[0036] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the poster image generation method of any of the above aspects.

[0037] This application embodiment obtains poster template configuration data configured by a target object based on a poster template configuration page. This poster template configuration data includes a target image and text regional information. The text regional information indicates the layout of the poster text in the target image. Based on this poster template configuration data, the target poster template is stored in a poster template library. In response to a poster generation request sent by the target object for the target poster template, the target image and text regional information are obtained. The poster generation request includes poster text information to be displayed on the target poster image to be generated. Then, a rendering program instance is invoked to generate a target poster image with the target image as the background and including the poster text information, based on the target image, text regional information, and poster text information. The layout of the poster text information in the target poster image matches the text regional information. The target poster image is then returned to the target object. This enables users to customize poster templates and automatically generate personalized target poster images containing user-input text based on the customized poster templates. This improves the flexibility and efficiency of poster image generation, meets users' personalized needs for information sharing, and helps to increase users' willingness to share based on poster images, thereby increasing the information dissemination rate. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;

[0040] Figure 2 This is a flowchart illustrating a poster image generation method provided in an embodiment of this application;

[0041] Figure 3 This is a flowchart illustrating a poster image generation method provided in an embodiment of this application;

[0042] Figure 4 This is a structural block diagram of a poster image generation device provided in an embodiment of this application;

[0043] Figure 5 This is a hardware structure block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0045] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0046] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0047] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0048] Please see Figure 1 The diagram shown is an implementation environment provided in this application embodiment. The implementation environment includes a terminal 110 and a server 120, wherein the terminal 110 and the server 120 can communicate through a wired or wireless network connection.

[0049] Terminal 110 includes, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, and aircraft. Terminal 110 runs client software, such as an application (App), that has poster generation functionality. This application can be a standalone application or a subroutine within an application. Specifically, the application can be a dedicated poster generation application or an application that includes poster generation functionality and other interactive functions, such as e-book reading and social networking functions. Users of terminal 110 can log in to the application using pre-registered user information to access the poster generation service. It should be noted that terminal 110 can refer to one of multiple terminals; this embodiment only uses terminal 110 as an example. Those skilled in the art will understand that the number of terminals 110 can be more or less.

[0050] Server 120 can provide background services for applications in terminal 110, specifically poster generation services. Specifically, server 120 can display a poster template configuration page to its users through terminal 110. Users of terminal 110 can configure a target poster template according to their personal needs based on this page. Terminal 110 sends the poster template configuration data configured on the page to server 120. Server 120 can then obtain the poster template configuration data configured by the user of terminal 110, which includes a target image and text location information. This text location information indicates the layout of the poster text within the target image. Server 120 then stores the target poster template in the poster template library based on this configuration data and, in response to a poster generation request sent by the user of terminal 110 for the target poster template, retrieves the target image and text. The system includes a regional information component, where the poster generation request includes poster text information to be displayed on the target poster image to be generated. This then calls a rendering program instance to generate a target poster image with the target image as the background and including the poster text information, based on the target image, the regional text information, and the poster text information. The layout of the poster text information in the target poster image matches the regional text information. The target poster image is then returned to the user of terminal 110. This enables user-defined poster templates and allows for the automatic generation of personalized target poster images containing user-inputted text based on these templates. This improves the flexibility and efficiency of poster image generation, meets users' personalized information sharing needs, and encourages users to share poster images, thereby increasing the information dissemination rate.

[0051] It should be noted that the server involved in the embodiments of this application can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0052] In a specific application scenario, a poster generation request can be initiated through an application with sharing capabilities. This application can provide users with a variety of images with brand logos and text layouts to choose from. Users can then select their favorite images and text layouts to obtain a personalized target poster template. This personalized target poster template is then combined with the text information they want to share to create a personalized target poster image, which can then be shared. This allows users to experience a rich and diverse sharing experience, and they will feel that sharing is fresh and personalized, thus encouraging them to share more actively and increasing the information dissemination rate.

[0053] In another specific application scenario, the poster generation request can be initiated based on an e-book reading application. Specifically, when a user reads an e-book using an e-book reading application, they can generate a personalized target poster image based on their written book reviews or sentences of interest from the text using the poster generation method of this application embodiment. This personalized target poster image can then be shared, for example, to a social media platform. When generating their personalized target poster image, the user can select their preferred image and layout to obtain a personalized target poster template. This personalized target poster template is then combined with the text information they wish to share (such as book reviews or sentences of interest from the text) to obtain the personalized target poster image.

[0054] Please see Figure 2 The diagram shown is a flowchart illustrating a poster image generation method provided in an embodiment of this application. This method can be applied to... Figure 1 The server in the middle. It should be noted that this specification provides the operation steps of the method as described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operation steps may be included. The order of steps listed in the embodiments is only one of many possible execution orders and does not represent the only execution order. In actual system or product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the figures... Figure 2 As shown, the method may include:

[0055] S201, Obtain the poster template configuration data of the target object based on the poster template configuration page.

[0056] The poster template configuration data includes a target image and text location information, wherein the text location information indicates the layout of the poster text in the target image.

[0057] The target object can be the account of the end user to whom the target poster image is to be generated.

[0058] The target image can be an image selected by the target object. The source of the target image can be an existing image in the terminal corresponding to the target object, a current screenshot of the target object, a real-time captured image, or an image selected from the Internet.

[0059] Textual geographic information can indicate the layout of poster text in the target image from multiple dimensions. Specifically, these multiple dimensions can include the region location dimension, font dimension, and region format dimension. The region location dimension can include the start position, end position, and size of the region (including the height and width of the region), the font dimension can include the font size and font color, and the region format dimension can include the text alignment within the region.

[0060] In specific implementation, the poster template configuration page can be implemented based on multiple configuration components. These multiple configuration components may include a first configuration component for configuring the target image and a second configuration component for configuring text and geographic information. Thus, the server can respond to the poster template configuration request of the target object and display the poster template configuration page on the terminal corresponding to the target object based on these multiple configuration components. This allows the target object to perform personalized poster template configuration based on the poster template configuration page to obtain poster template configuration data.

[0061] S203, Based on the poster template configuration data, store the target poster template in the poster template library.

[0062] Specifically, the database fields that the poster template library saves for poster templates can be:

[0063] {

[0064] ID: Template ID

[0065] ImgUrl: The URL of the image

[0066] Textareas: Text-based geographic information}

[0067] Based on this, in some exemplary embodiments, such as Figure 3 As shown, step S203 above may include the following when implemented:

[0068] S301, store the target image in the poster template configuration data to a designated storage space, and determine the storage address of the target image in the designated storage space.

[0069] The specified storage space can be a content delivery network or the server's local storage space. The storage address of the target image can indicate the storage location of the target image in the specified storage space. Specifically, the storage address of the target image can be in the form of a Uniform Resource Locator (URL).

[0070] S303, determine the target template identifier corresponding to the target poster template.

[0071] The target template identifier is used to uniquely identify the target poster template, and the server can generate this unique target template identifier.

[0072] S305, establish a correspondence between the target template identifier, the storage address, and the text regional information in the poster template library.

[0073] In the above embodiments, by establishing a correspondence between the target template identifier, storage address, and text regional information in the poster template library to store the configured target poster template in the poster template library, the amount of data in the poster template library can be reduced, which is conducive to improving the efficiency of subsequent poster generation based on the poster template library.

[0074] In practical applications, after establishing the correspondence between the target template identifier, the storage address, and the textual geographic information in the poster template library, the storage address of the target image can be returned to the terminal corresponding to the target object for display to the target object.

[0075] S205, in response to the poster generation request sent by the target object for the target poster template, the target image and the text region information are obtained, the poster generation request including poster text information for display on the target poster image to be generated.

[0076] Specifically, the target device's terminal can display a poster generation entry point (such as a corresponding control). When the target device triggers this entry point, it can display the target poster template in the poster template library, such as displaying the target template identifier for the target device to select. At the same time, the terminal can also obtain the poster text information input by the target device, such as a book review or a sentence of interest, and then send a poster generation request for the target poster template to the server based on the target template identifier selected by the target device and the input poster text information.

[0077] Based on this, see further. Figure 3 In response to a poster generation request sent by the target object for the target poster template, the server may obtain the target image and the textual geographic information, including:

[0078] S307, Obtain the poster generation request sent by the target object for the target poster template, wherein the poster generation request includes the target template identifier.

[0079] S309, determine the target correspondence in the poster template library that matches the target template identifier.

[0080] Specifically, the correspondence between the template identifier in the poster template library and the target template identifier is determined as the target correspondence.

[0081] S311, Obtain the textual regional information in the target correspondence relationship, and the storage address in the target correspondence relationship.

[0082] In the above embodiments, the target template identifier in the poster generation request is used to find the matching target correspondence in the poster template, thereby obtaining the text regional information and the storage address of the target image in the target correspondence, which helps to improve the efficiency of poster generation.

[0083] S207, Invoke a rendering program instance, and generate a target poster image with the target image as the background and including the poster text information based on the target image, the text region information and the poster text information, wherein the layout of the poster text information in the target poster image matches the text region information.

[0084] The rendering program instance is a browser front-end framework running on the server side, specifically a Node.js framework running on the server side. It can be a headless browser instance. This headless browser instance can perform rendering processing based on the target image, the text regional information, and the poster text information, and generate a rendering screenshot, which is the target poster image.

[0085] Therefore, in some exemplary embodiments, see below. Figure 3 The above step S207 may include the following when implemented:

[0086] S313, invoke a headless browser instance to access the storage address, create a first page based on the target image in the storage address, the size of the first page matches the size of the target image, and the first page uses the target image as its background.

[0087] Specifically, a new browser page can be created using a headless browser, and this browser page can be navigated to the storage address of the target image to obtain the target image. The size of the target image can then be determined, and the size of the browser page can be adjusted according to the size of the target image so that the size of the browser page matches that of the target image. For example, if the size of the target image is (width:600, height:800), the size of the browser page created above can be adjusted to (width:600, height:800) using the "page.setViewport()" method. At the same time, the target image can be set as the background of the browser page created above by using the "page.setContent()" method, thus obtaining the first page.

[0088] S315, Based on the text location information and the poster text information, add a target block-level element to the first page to obtain the target page.

[0089] The target block-level element can contain textual regional information and poster text information. Object. In specific implementation, the "page.addStyleTag()" and "page.evaluate()" methods can be used to create the target block-level element based on the text location information and poster text information, and then add it to the first page to obtain the target page.

[0090] S317, Take a screenshot of the target page to obtain the target poster image.

[0091] In practice, the "page.screenshot()" method can be used to take a screenshot of the target page, and the resulting image will be the target poster image.

[0092] In the above implementation, the storage address of the target image is accessed by calling a headless browser. A first page with the target image as the background is created based on the target image in the storage address. Then, target block-level elements are added to the first page based on the text region information and poster text information to obtain the target page. The target page is then screenshotted to obtain the target poster image. This allows for the automatic addition of poster text information to a custom target poster template to obtain the target poster template, thus improving the efficiency of generating personalized poster images.

[0093] In some exemplary embodiments, in order to stably generate poster images under high load and thus improve the stability of poster image generation, step S313 above may include, when implementing the call to the headless browser instance to access the storage address:

[0094] Send a request to the instance repository to obtain a headless browser instance, so that the instance repository responds to the request, searches for an idle headless browser instance in the instance repository, and returns a response result based on the search result;

[0095] Upon receiving the first response result returned by the instance repository, the request to acquire the headless browser instance is added to the waiting queue, so that when the instance repository determines that there is an idle headless browser instance, it returns a second response result based on the idle headless browser instance and in the order of the headless browser instance acquisition requests in the waiting queue; the first response result indicates that no idle headless browser instance was found, and the second response result includes any idle headless browser instance;

[0096] Upon receiving the second response result returned by the instance resource library, the idle headless browser instance in the second response result is invoked to access the storage address.

[0097] The instance resource library includes multiple pre-created headless browser instances. Each headless browser instance can be in an idle or non-idle state. A non-idle state indicates that the instance is currently occupied due to invocation, while an idle state indicates that the instance is not currently being invoked. In practical applications, each headless browser instance can also have a usage count attribute, which records the number of times the instance has been used.

[0098] In practice, a resource factory can be defined first, containing methods for creating, destroying, and validating headless browser instances. In the method for creating a headless browser instance, the `puppeteer.launch()` method can be used to create the instance and initialize a usage count property to record the number of times the instance has been used. In the method for destroying a headless browser instance, the `instance.close()` method can be used to close the instance. In the method for validating a headless browser instance, the return value of the provided validator function and the usage count of the instance can be checked to see if they exceed the maximum usage count. If they do, the instance is destroyed.

[0099] Next, you can create an instance repository. For example, you can use the genericPool.createPool() method to create an instance repository, passing in the resource factory defined above and some configuration parameters. These configuration parameters can include the instance repository's capacity limit, capacity limit, and resource acquisition timeout. The capacity limit indicates the upper limit of the total number of headless browser instances in the instance repository, the capacity limit indicates the lower limit of the total number of headless browser instances in the instance repository, and the resource acquisition timeout indicates the longest response time for the instance repository to request a headless browser instance. That is, if no idle headless browser instance is found within the resource acquisition timeout period, it indicates that the resource acquisition has failed.

[0100] The instance repository can determine the status of each headless browser instance based on its usage history. If a headless browser instance is invoked, it is currently in a non-idle state until it is released back to the instance repository, at which point it will be in an idle state. The usage count of each headless browser instance can be recorded in a corresponding usage count attribute. The instance repository can then determine whether the usage count of a given headless browser instance exceeds its maximum usage count. If it does, the instance can be destroyed to improve the stability of each headless browser instance.

[0101] In the above implementation, the server sends a request to the instance repository to obtain a headless browser instance. In response to this request, the instance repository searches for an idle headless browser instance and returns a response result based on the search result. It is understood that the search result includes "found" and "not found." If an idle headless browser instance is found, it indicates that resources are currently available. In this case, the instance repository can return a second response result based on any idle headless browser instance, which includes that idle headless browser instance. If no idle headless browser instance is found, it indicates that no resources are currently available. In this case, the instance repository returns a first response result, which indicates that no idle headless browser instance was found.

[0102] Upon receiving the first response, the server adds the request to acquire the headless browser instance to a waiting queue, awaiting resource availability. Specifically, when the instance repository determines that an idle headless browser instance exists, it returns a second response based on that idle instance and in the order of the headless browser instance acquisition requests in the waiting queue. Upon receiving the second response, the server can access the storage address of the target image using the idle headless browser instance mentioned in the second response, thereby achieving both flexible customization of poster images and high efficiency and availability, significantly improving the stability of poster generation.

[0103] For example, after taking a screenshot of the target page in step S317 to obtain the target poster image, the method may further include: releasing the invoked headless browser instance so that the instance resource library determines that the headless browser instance is in an idle state.

[0104] In specific implementation, a preset method can be added to the instance repository. This preset method accepts a function as a parameter. The preset method is used to obtain a headless browser instance from the instance repository, then pass the headless browser instance to the function. After the function finishes execution, regardless of whether the execution result is successful or not, the headless browser instance will be returned to the instance repository, thereby releasing the called headless browser instance. This allows the instance repository to determine that the headless browser instance is in an idle state, realizing the reuse of headless browser instances in the instance repository.

[0105] S209, Return the target poster image to the target object.

[0106] Specifically, the server can either directly return the target poster image to the target object after generating it, or it can first store the target poster image and obtain its access address, and then return the access address of the target poster image to the target object, so that the target object can obtain the target poster image based on the access address.

[0107] As can be seen from the above technical solutions of the embodiments of this application, the embodiments of this application realize user-defined poster templates and can automatically generate personalized target poster images containing user-input text based on the user-defined poster templates. This improves the flexibility and efficiency of generating poster images, meets users' personalized needs for information sharing, and helps to increase users' willingness to share based on poster images, thereby increasing the information dissemination rate.

[0108] In some exemplary embodiments, to further improve the flexibility of personalized poster image generation and increase information dissemination rate, after the aforementioned step S209, the method may further include:

[0109] In response to the adjustment instruction for the target poster template, the poster template configuration data is displayed on the poster template configuration page;

[0110] Obtain the adjusted poster template configuration data based on the poster template configuration page;

[0111] The target poster template stored in the poster template library is updated based on the adjusted poster template configuration data.

[0112] When a target audience perceives that the target poster image displayed on a terminal does not meet expectations regarding the target poster template, they can adjust the target poster template. Specifically, the poster template configuration page can provide template adjustment entry points (such as corresponding controls) for the target poster template. When these entry points are triggered, an adjustment command for the corresponding target poster template can be sent. In response to this command, the server can retrieve the poster template configuration data for the target poster template from the poster template library and display this data on the poster template configuration page. This allows for adjustments to the displayed poster template configuration data. After the adjustment is complete, the server obtains the adjusted poster template configuration data based on the poster template configuration page and then updates the target poster templates stored in the poster template library based on this adjusted data.

[0113] Updating the target poster template stored in the poster template library based on the adjusted poster template configuration data can include updating the target image and / or updating the text and regional information. Then, when the server receives a poster generation request for the target poster template from the target object again, it can generate an updated target poster image based on the updated target poster template, further improving the flexibility of personalized poster image generation.

[0114] Corresponding to the poster image generation methods provided in the above embodiments, this application also provides a poster image generation device. Since the poster image generation device provided in this application corresponds to the poster image generation methods provided in the above embodiments, the implementation methods of the aforementioned poster image generation methods are also applicable to the poster image generation device provided in this embodiment, and will not be described in detail in this embodiment.

[0115] Please see Figure 4 The diagram shows a structural schematic of a poster image generation device provided in an embodiment of this application. This device has the function of implementing the poster image generation method described in the above method embodiments. This function can be implemented by hardware or by hardware executing corresponding software. Figure 4 As shown, the poster image generating device 400 may include:

[0116] The template configuration data acquisition module 410 is used to acquire the poster template configuration data of the target object based on the poster template configuration page. The poster template configuration data includes the target image and text regional information. The text regional information indicates the layout of the poster text in the target image.

[0117] The target poster template storage module 420 is used to store the target poster template in the poster template library based on the poster template configuration data;

[0118] The request-response module 430 is used to respond to the poster generation request sent by the target object for the target poster template, and to obtain the target image and the text region information; the poster generation request includes poster text information to be displayed on the target poster image to be generated;

[0119] The poster image rendering module 440 is used to call a rendering program instance to generate a target poster image with the target image as the background and including the poster text information, based on the target image, the text region information, and the poster text information; the layout of the poster text information in the target poster image matches the text region information.

[0120] The poster image return module 450 is used to return the target poster image to the target object.

[0121] In one exemplary embodiment, the target poster template storage module 420 includes:

[0122] The storage address determination module is used to store the target image in the poster template configuration data to a specified storage space and determine the storage address of the target image in the specified storage space.

[0123] The template identifier determination module is used to determine the target template identifier corresponding to the target poster template;

[0124] The mapping relationship establishment module is used to establish the mapping relationship between the target template identifier, the storage address, and the text regional information in the poster template library.

[0125] In one exemplary embodiment, the request-response generation module 430 includes:

[0126] The request generation module is used to obtain the poster generation request sent by the target object for the target poster template, and the poster generation request includes the target template identifier;

[0127] The target correspondence determination module is used to determine the target correspondence in the poster template library that matches the target template identifier.

[0128] The information acquisition module is used to acquire the textual geographic information in the target correspondence and the storage address in the target correspondence.

[0129] In one exemplary embodiment, the device 400 further includes:

[0130] The adjustment instruction response module is used to respond to adjustment instructions for the target poster template and display the poster template configuration data based on the poster template configuration page;

[0131] Adjust the data acquisition module to obtain the adjusted poster template configuration data based on the poster template configuration page;

[0132] The poster template update module is used to update the target poster template stored in the poster template library based on the adjusted poster template configuration data.

[0133] In one exemplary embodiment, the poster image rendering module 440 includes:

[0134] The browser instance invocation module is used to invoke a headless browser instance to access the storage address and create a first page based on the target image in the storage address; the size of the first page matches the size of the target image, and the first page uses the target image as its background;

[0135] The block-level element addition module is used to add target block-level elements to the first page based on the text's regional information and the poster's text information, thus obtaining the target page.

[0136] The screenshot module is used to take a screenshot of the target page and obtain the target poster image.

[0137] In one exemplary embodiment, the browser instance invocation module is specifically configured to: send a headless browser instance retrieval request to the instance resource library, so that the instance resource library, in response to the headless browser instance retrieval request, searches for an idle headless browser instance in the instance resource library and returns a response result based on the search result; upon receiving the first response result returned by the instance resource library, add the headless browser instance retrieval request to a waiting queue, so that when the instance resource library determines that an idle headless browser instance exists, it returns a second response result based on the idle headless browser instance and in the order of the headless browser instance retrieval requests in the waiting queue; the first response result indicates that no idle headless browser instance was found, and the second response result includes any idle headless browser instance; upon receiving the second response result returned by the instance resource library, invoke the idle headless browser instance in the second response result to access the storage address.

[0138] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0139] This application provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction or at least one program, which is loaded and executed by the processor to implement any of the poster image generation methods provided in the above method embodiments.

[0140] Memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for the functions, etc.; the data storage area can store data created based on the use of the device, etc. Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory can also include a memory controller to provide the processor with access to the memory.

[0141] The methods and embodiments provided in this application can be executed in a computer terminal, server, or similar computing device; that is, the aforementioned electronic device may include a computer terminal, server, or similar computing device. Taking running on a server as an example... Figure 5 This is a hardware structure block diagram of an electronic device that runs a poster image generation method according to an embodiment of the present invention, such as... Figure 5 As shown, the server 500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 510 (CPUs 510 may include, but are not limited to, microprocessors such as MCUs or programmable logic devices such as FPGAs), a memory 530 for storing data, and one or more storage media 520 (e.g., one or more mass storage devices) for storing application programs 523 or data 522. The memory 530 and storage media 520 may be temporary or persistent storage. The program stored in the storage media 520 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 510 may be configured to communicate with the storage media 520 and execute the series of instruction operations stored in the storage media 520 on the server 500. Server 500 may also include one or more power supplies 560, one or more wired or wireless network interfaces 550, one or more input / output interfaces 540, and / or one or more operating systems 521, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0142] The input / output interface 540 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 500. In one example, the input / output interface 540 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 540 may be a radio frequency (RF) module for wireless communication with the Internet.

[0143] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 500 may also include... Figure 5 The more or fewer components shown, or having the same Figure 5 The different configurations shown.

[0144] Embodiments of this application also provide a computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a poster image generation method. The at least one instruction or the at least one program is loaded and executed by the processor to implement any of the poster image generation methods provided in the above-described method embodiments.

[0145] Embodiments of this application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform any of the poster image generation methods provided in the above-described method embodiments.

[0146] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0147] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0148] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0149] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0150] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A method for generating poster images, characterized in that, The method includes: Obtain the poster template configuration data of the target object based on the poster template configuration page. The poster template configuration data includes the target image and text regional information. The text regional information indicates the layout of the poster text in the target image. Based on the poster template configuration data, the target poster template is stored in the poster template library; In response to a poster generation request sent by the target object for the target poster template, the target image and the text region information are obtained; the poster generation request includes poster text information for displaying on the target poster image to be generated; A rendering program instance is invoked to generate a target poster image with the target image as the background and including the poster text information, based on the target image, the text region information, and the poster text information; the layout of the poster text information in the target poster image matches the text region information. Return the target poster image to the target object.

2. The method according to claim 1, characterized in that, The step of storing the target poster template in the poster template library based on the poster template configuration data includes: Store the target image in the poster template configuration data to a specified storage space, and determine the storage address of the target image in the specified storage space; Determine the target template identifier corresponding to the target poster template; Establish a correspondence between the target template identifier, the storage address, and the text geographic information in the poster template library.

3. The method according to claim 2, characterized in that, The step of responding to the poster generation request sent by the target object for the target poster template, and obtaining the target image and the textual geographic information, includes: Obtain a poster generation request sent by the target object for the target poster template, wherein the poster generation request includes the target template identifier; Determine the target correspondence in the poster template library that matches the target template identifier; Obtain the textual geographic information in the target correspondence and the storage address in the target correspondence.

4. The method according to claim 1, characterized in that, After returning the target poster image to the target object, the method further includes: In response to the adjustment instruction for the target poster template, the poster template configuration data is displayed on the poster template configuration page; Obtain the adjusted poster template configuration data based on the poster template configuration page; The target poster template stored in the poster template library is updated based on the adjusted poster template configuration data.

5. The method according to claim 3, characterized in that, The invocation of the rendering program instance generates a target poster image with the target image as the background and including the poster text information, based on the target image, the text region information, and the poster text information, including: A headless browser instance is invoked to access the storage address, and a first page is created based on the target image in the storage address; the size of the first page matches the size of the target image, and the first page uses the target image as its background; Based on the textual geographic information and the poster text information, a target block-level element is added to the first page to obtain the target page; Take a screenshot of the target page to obtain the target poster image.

6. The method according to claim 5, characterized in that, The process of accessing the storage address by calling a headless browser instance includes: Send a request to the instance repository to obtain a headless browser instance, so that the instance repository responds to the request, searches for an idle headless browser instance in the instance repository, and returns a response result based on the search result; Upon receiving the first response result returned by the instance repository, the request to acquire the headless browser instance is added to the waiting queue, so that when the instance repository determines that there is an idle headless browser instance, it returns a second response result based on the idle headless browser instance and in the order of the headless browser instance acquisition requests in the waiting queue; the first response result indicates that no idle headless browser instance was found, and the second response result includes any idle headless browser instance; Upon receiving the second response result returned by the instance resource library, the idle headless browser instance in the second response result is invoked to access the storage address.

7. The method according to claim 6, characterized in that, After taking a screenshot of the target page to obtain the target poster image, the method further includes: Release the invoked headless browser instance so that the instance repository determines that the headless browser instance is in an idle state.

8. A poster image generating device, characterized in that, The device includes: The template configuration data acquisition module is used to acquire the poster template configuration data of the target object based on the poster template configuration page. The poster template configuration data includes the target image and text regional information, and the text regional information indicates the layout of the poster text in the target image. The target poster template storage module is used to store target poster templates in the poster template library based on the poster template configuration data; A request-response module is used to respond to a poster generation request sent by the target object for the target poster template, and to obtain the target image and the text region information; the poster generation request includes poster text information for displaying on the target poster image to be generated; The poster image rendering module is used to call a rendering program instance to generate a target poster image with the target image as the background and including the poster text information, based on the target image, the text region information, and the poster text information; the layout of the poster text information in the target poster image matches the text region information. The poster image return module is used to return the target poster image to the target object.

9. An electronic device, characterized in that, The method includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the poster image generation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the poster image generation method as described in any one of claims 1 to 7.

11. A computer program, characterized in that, When the computer program is executed by the processor, it implements the poster image generation method according to any one of claims 1 to 7.