Graph typesetting method and device

By inputting target layout elements and prompt information into a large language model for graphic layout, the problems of low efficiency and difficulty in rapid adjustment in the existing technology are solved, and efficient and flexible layout design and intelligent interaction are achieved.

CN119399325APending Publication Date: 2025-02-07SHANGHAI HODE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411575062.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art is less efficient in graphic layout design and is difficult to quickly adjust or adapt to changing needs, especially in large-scale design tasks.

Method used

By obtaining target typesetting elements and target typesetting prompt information, element identification is performed, and this information is input into the target large language model, and graphic types are used for large language models.

Benefits of technology

It improves the adaptability and flexibility of typesetting, can quickly adjust and adapt to changing needs, improves efficiency in large-scale design tasks, and realizes intelligent interaction with users, improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399325A_ABST
    Figure CN119399325A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a graphic typesetting method which comprises the steps that target typesetting elements and target typesetting prompt information are obtained, and the target typesetting elements comprise information of at least one mode; identifying the target typesetting element to obtain element identification information; and inputting the target typesetting prompt information and the element identification information into a target large language model, and performing graphic typesetting by utilizing the target large language model according to the typesetting prompt information and the element identification information. According to the technical scheme, the adaptability and flexibility of typesetting can be improved, rapid adjustment and adaptation can be achieved in the face of constantly changing requirements, and the efficiency in large-scale design tasks is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular, to a graphic typesetting method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] When laying out graphics, pre-designed templates are usually used to assist. However, the production and selection of templates require manual participation, and inappropriate template layout will lead to poor graphic layout design. Therefore, although using templates to assist graphic layout can improve efficiency to a certain extent, it is less efficient in large-scale design tasks and is difficult to quickly adjust or adapt when faced with changing needs.

[0003] Subsequently, some studies have attempted to use heuristic algorithms such as genetic algorithms and simulated annealing to solve the layout problem. However, these methods require careful design of energy functions, rely heavily on design experience and expertise, lack versatility when facing different applications, and often require redesigning the energy function when encountering new design elements or applying to layouts of different styles.

[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the invention

[0005] The embodiments of the present application provide a graphic typesetting method, apparatus, computer equipment, computer-readable storage medium, and computer program product to solve or alleviate one or more of the technical problems raised above.

[0006] One aspect of an embodiment of the present application provides a graphic typesetting method, the method comprising: Acquire a target layout element and target layout prompt information, wherein the target layout element includes information of at least one mode; Identify the target layout element to obtain element identification information; The target layout prompt information and the element identification information are input into a target large language model, and the target large language model is used to perform graphic layout according to the layout prompt information and the element identification information.

[0007] Optionally, the identifying the target layout element to obtain element identification information includes: A target convolutional neural network based on an attention mechanism is used to identify the target typesetting element to obtain element identification information.

[0008] Optionally, the element identification information includes at least part of the information of the element's category, shape, size, position, font, font size, color, level and text content, and the element identification information is stored in JSON format.

[0009] Optionally, the method further comprises: The constructed convolutional neural network is trained using a first training data set to obtain the target convolutional neural network, wherein the first preset training data set includes N training images, and the training images include single elements or combinations of elements in images of multiple colors, images of multiple textures, texts in multiple fonts, texts in multiple font sizes, logos of multiple designs, and multiple text background colors.

[0010] Optionally, the method further comprises: A second training data set is used to fine-tune the large language model to obtain the target large language model, wherein the second training data set includes a plurality of paired combinations of training element identification information and training typesetting prompt information, the training element identification information includes element identification information of pictures, texts or logos of various styles, and the training typesetting prompt information includes at least part of the information of element position, size, color, font, font size, level, spacing, layout mode, image style and image processing.

[0011] Optionally, after performing graphic typeset according to the typesetting prompt information and the element identification information using the target large language model, the method further includes: Obtaining graphic layout information of the target large language model; In the case where there are elements with layout conflicts in the graphic layout information, the elements with layout conflicts are adjusted using a preset adjustment method to obtain an adjustment result, wherein the preset adjustment method at least includes moving, scaling and rotating; A layout image is generated according to the adjustment result.

[0012] Another aspect of an embodiment of the present application provides a graphic typesetting device, the device comprising: An acquisition module, used to acquire a target layout element and target layout prompt information, wherein the target layout element includes information of at least one mode; An identification module, used to identify the target layout element to obtain element identification information; The typesetting module is used to input the target typesetting prompt information and the element identification information into a target large language model, and use the target large language model to perform graphic typesetting according to the typesetting prompt information and the element identification information.

[0013] Another aspect of an embodiment of the present application provides a computer device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein: the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described above.

[0014] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method described above is implemented.

[0015] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the method described above when executed by a processor.

[0016] The above technical solution adopted in the embodiment of the present application may have the following advantages: By acquiring the target typesetting element and the target typesetting hint information, the target typesetting element includes information of at least one modality, identifying the target typesetting element to obtain the element identification information, inputting the target typesetting hint information and the element identification information into the target large language model, and using the target large language model to perform graphic typesetting according to the typesetting hint information and the element identification information, information of multiple modalities can be applied to typesetting, thereby enriching the typesetting input and improving the typesetting effect; and, typesetting through the large language model and the target typesetting hint information can improve the adaptability and flexibility of typesetting, can quickly adjust and adapt in the face of changing needs, improve efficiency in large-scale design tasks, and at the same time can achieve intelligent interaction with users and improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0018] Figure 1 The operating environment diagram of the graphic typesetting method according to the first embodiment of the present application is schematically shown; Figure 2 A flowchart of a graphic typesetting method according to Embodiment 1 of the present application is schematically shown; Figure 3 This is an example diagram of a target typesetting element in the graphic typesetting method according to the first embodiment of the present application; Figure 4 This is an example diagram of the typesetting process in the graphic typesetting method according to the first embodiment of the present application; Figure 5 This is a final typesetting example diagram in the graphic typesetting method according to the first embodiment of the present application; Figure 6 The newly added process of the graphic typesetting method according to the first embodiment of the present application is schematically shown; Figure 7 A block diagram schematically shows a graphic typesetting device according to the second embodiment of the present application; and Figure 8 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0020] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0021] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.

[0022] First, the following terms are explained: Large Language Model: A model with billions of parameters that has been pre-trained to obtain extensive knowledge from a large unlabeled text corpus. It can understand and generate natural language and has achieved remarkable success in various natural language processing tasks. In addition, through methods such as multimodal instruction fine-tuning, the large language model can also incorporate information from other modalities such as vision to handle more complex multimodal tasks.

[0023] Layout Generation: Layout generation refers to arranging the positions and sizes of various multimodal design elements in a graphic design in a way that is visually pleasing and follows constraints. It plays a key role in all types of graphic designs, such as commercial posters, mobile app UIs, web pages, video thumbnails, etc.

[0024] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the relevant technologies are described below: In related technologies, pre-designed models are used to assist in graphic layout, which is inefficient in large-scale design tasks and difficult to quickly adjust or adapt to changing needs. Heuristic algorithms such as genetic algorithms and simulated annealing are used to solve layout problems, but lack versatility when faced with different applications.

[0025] To this end, the embodiment of the present application provides a graphic typesetting technical solution. In this technical solution, the adaptability and flexibility of typesetting can be improved, and rapid adjustment and adaptation can be made in the face of changing needs, thereby improving the efficiency in large-scale design tasks. See below for details.

[0026] Finally, for ease of understanding, an exemplary operating environment is provided below.

[0027] like Figure 1 As shown, the environment diagram includes a service platform 2, a network 4, and a client 6, wherein: The service platform 2 may be composed of a single or multiple computing devices. The multiple computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc. The computing device may load a virtual machine based on a virtual image and / or other data defining specific software (e.g., operating system, dedicated application, server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices. A hypervisor may be implemented to manage the use of different virtual machines on the same computing device.

[0028] The service platform 2 may be configured to communicate with the client 6 or the like via a network 4. The network 4 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network 4 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, and the like, or wireless links, such as cellular links, satellite links, Wi-Fi links, and the like.

[0029] The service platform 2 can provide storage, reading, writing, querying, deleting and other services, such as providing graphic typesetting services for clients.

[0030] The client 6 may be an electronic device running an operating system such as Windows, Android™ or iOS, such as a smart phone, a tablet device, a laptop computer, a virtual reality device, a gaming device, a set-top box, a vehicle terminal, or a smart TV. Based on the above operating system, various application programs may be run, such as an application program that assists in performing graphic typesetting operations.

[0031] The client 6 can provide / configure a user access page for manipulating the service platform 2 or uploading objects, etc. For example, graphic layout elements and layout prompt information required for typesetting can be uploaded to the service platform 2.

[0032] It should be noted that the above devices are exemplary, and the number and type of devices are adjustable in different scenarios or according to different needs.

[0033] The following uses the service platform 2 as the execution subject and introduces the technical solution of the present application through multiple embodiments. It should be noted that these embodiments can be implemented in a variety of different forms and should not be interpreted as being limited to the embodiments described here. In addition, if the computing power of the client 6 is sufficient, the client 6 can also serve as the execution subject.

[0034] Embodiment 1 Figure 2 The flowchart of the graphic typesetting method according to the first embodiment of the present application is schematically shown.

[0035] like Figure 2 As shown, the graphic typesetting method may include steps S200 to S204, wherein: Step S200, obtaining a target layout element and target layout prompt information, wherein the target layout element includes information of at least one mode.

[0036] Step S202: Identify the target layout element to obtain element identification information.

[0037] Step S204: input the target layout prompt information and element identification information into the target large language model, and use the target large language model to perform graphic layout according to the layout prompt information and element identification information.

[0038] The graphic typesetting method provided in the present embodiment obtains a target typesetting element and a target typesetting prompt information, wherein the target typesetting element includes information of at least one modality, identifies the target typesetting element to obtain element identification information, inputs the target typesetting prompt information and the element identification information into a target large language model, and uses the target large language model to perform graphic typesetting according to the typesetting prompt information and the element identification information. Information of multiple modalities can be applied to typesetting, thereby enriching the input of typesetting and improving the typesetting effect. Moreover, typesetting through the large language model and the target typesetting prompt information can improve the adaptability and flexibility of typesetting, can quickly adjust and adapt in the face of ever-changing needs, improve efficiency in large-scale design tasks, and at the same time can achieve intelligent interaction with users and improve user experience.

[0039] The following combination Figure 2 , each step in steps S200~S204 and other optional steps are described in detail.

[0040] Step S200 , obtain target layout elements and target layout prompt information, wherein the target layout element includes information of at least one mode.

[0041] The target layout element can be uploaded to the service platform by the user logging into the client. After being uploaded to the service platform, it can be stored in a specified location, and the service platform can then obtain the target layout element from the specified location. The target layout prompt information can be input by the user logging into the client. After the user completes the input, the client sends the target layout prompt information to the service platform, so that the service platform can obtain the target layout prompt information.

[0042] The target layout element may include one or more modal elements such as text, image, logo, etc. Optionally, the target layout element may be included in an input image, such as Figure 3 As shown, an input image can include elements of multiple modalities such as text, graphics, and logos.

[0043] The target typesetting prompt information is the user's typesetting requirement information, which may include typesetting layout, alignment, line spacing, font, character spacing, color and other requirement information, for example, it may be: 1. The logo is placed in the upper left corner of the page, the text is left-aligned, the line spacing is 1.5 times, the character spacing is 2 pixels, and the text color is dark blue; 2. The logo is placed at the top of the page, the text is centered, the line spacing is set to 1, the character spacing remains the default, and the text color is black; 3. The logo is placed at the left 1 / 3 of the page, the text is aligned, the line spacing is 1.2 times, the character spacing is 0.5 pixels, and the text color is gray.

[0044] The client or service platform can set default layout prompt information. When the user does not limit a certain layout option, the default layout prompt information is used, so that the user can focus on the layout prompt information that needs to be specially designed without entering all the layout elements. For example, the line spacing can be set to 1 by default. If the layout prompt information entered by the user does not include the line spacing, the default line spacing is used. Finally, the layout prompt information entered by the user and the default layout prompt information are used as the target layout prompt information.

[0045] Step S202 , identify the target typesetting element to obtain element identification information.

[0046] The service platform can use a pre-trained artificial intelligence model to identify the target layout elements to obtain element identification information, wherein the artificial intelligence model is a model that can use a deep learning algorithm, for example, a model trained by a convolutional neural network.

[0047] In an optional embodiment, step S202 may specifically be: using a target convolutional neural network based on an attention mechanism to identify the target layout element to obtain element identification information.

[0048] Among them, the attention mechanism can be used to focus on important areas or important information in the typesetting elements, which may include the space, color, texture, edge, shape and other information of the elements. For example, the edge or outline of the element, these areas usually contain the key visual features of the element, which helps to more accurately identify the position or size of the element.

[0049] By using a convolutional neural network based on the attention mechanism to identify the target typesetting elements to obtain element identification information, the accuracy of element identification can be effectively improved, which facilitates subsequent precise typesetting and improves the typesetting effect.

[0050] In order to further improve the recognition effect of target typesetting elements, massive amounts of data can be used to train the artificial intelligence model in advance, so that the obtained artificial intelligence model can adapt to various complex element combinations.

[0051] In an optional embodiment, the graphic typesetting method may further include: using a first training data set to train the constructed convolutional neural network to obtain a target convolutional neural network, wherein the first preset training data set includes N training images, and the training images include images of multiple colors, images of multiple textures, text in multiple fonts, text in multiple font sizes, logos of multiple designs, and single elements or combinations of elements in multiple text background colors.

[0052] Wherein, N can be a positive integer. In order to adapt the target convolutional neural network to various complex elements or element combinations, N can be, for example, tens of thousands or hundreds of thousands. A single training image can be an image of one or more colors, an image of one or more textures, text of one or more fonts, text of one or more font sizes, one or more designed logos, one or more text background colors, or a combination of various images, texts, logos, and text background colors.

[0053] During the training process, stochastic gradient descent (SGD) or its variants can be used to continuously adjust the parameters of the network to minimize the error between the predicted results and the true labels. Of course, other gradient descent algorithms can also be used. In addition, appropriate regularization measures can be set, such as L1 and L2 regularization, to prevent overfitting.

[0054] The constructed convolutional neural network is trained by using the first training data set to obtain a target convolutional neural network. The training images in the first preset training data set include single elements or combinations of elements in images of multiple colors, images of multiple textures, texts in multiple fonts, texts in multiple font sizes, logos of multiple designs, and multiple text backgrounds. The trained target convolutional neural network can be adapted to various complex element combinations and improve the accuracy of element recognition.

[0055] In an exemplary embodiment, the element identification information may include at least part of the information of the category, shape, size, position, font, color, level, and text content of the element, and the element identification information is stored in a JSON format.

[0056] Among them, the category of elements may include images, texts, etc.; shape may refer to the shape of an image, for example, a rectangle, a square, a circle, etc.; size may refer to the size of an image, for example, the length and width of an image; position may refer to the absolute position or relative position of an image or text, for example, it may be represented by coordinates. In practical applications, if the position of an element is represented by coordinates, a boundary value check may be performed to ensure that the coordinates are within a reasonable range; level may refer to the typesetting level of an image or text, which may be marked in advance so that the level information may be obtained based on the marking identification.

[0057] Since JSON supports nested structures, storing element identification information in JSON format can easily represent complex hierarchical relationships. New fields can also be added as needed, making it easy to expand while occupying little storage space. It is also convenient for subsequent large language models to process data.

[0058] In this embodiment, the element identification information includes at least part of the information on the element's category, shape, size, position, font, font size, color, level, and text content. The element identification information is stored in JSON format, and information on multiple dimensions of the element can be obtained as needed, thereby facilitating the subsequent large language model to use this information for accurate graphic typesetting, and also facilitating the subsequent expansion of the information dimension as needed.

[0059] Step S204 , input the target typesetting prompt information and element identification information into the target large language model, and use the target large language model to perform graphic typeset according to the typesetting prompt information and element identification information.

[0060] The target typesetting prompt information is used as the prompt input of the target large language model. The target large language model can integrate advanced natural language processing technology and deep learning algorithms, and will perform lexical analysis, syntactic analysis and semantic understanding on the target typesetting prompt information, accurately extract the key information for typesetting layout contained in the target typesetting prompt information, and accurately understand the user's typesetting requirements. At the same time, the target large language model parses the input element recognition information to determine all typesetting elements; then, all typesetting elements are graphically typeset according to the understood typesetting requirements.

[0061] Optionally, the large language model can be expanded into a multimodal model so that the model can directly output the final result of the graphic layout. The large language model can also output graphic layout information, and then render the graphic layout information to obtain a visualization result. For example, the large language model can output graphic layout information in JSON format, and then use a programming language or a graphics library to render the graphic layout information into a visualization result. Among them, the graphic layout information output by the large language model can include detailed information such as the position, size, rotation angle, etc. of the final layout of the element, as well as various attributes of the text, such as font, font size, color, spacing, etc., so that it can be accurately read and executed by the subsequent visualization processing algorithm, thereby achieving the typesetting effect expected by the user.

[0062] Please refer to Figure 4 and Figure 5 ,in, Figure 4 Schematic diagram of the graphic layout process. Figure 5 The final typesetting image is schematically shown.

[0063] In order to make the large language model more adaptable to the needs of typesetting, a large amount of training data can be used to fine-tune the large language model. In an optional embodiment, the graphic typesetting method can further include: fine-tuning the large language model using a second training data set to obtain a target large language model, wherein the second training data set includes a pairing combination of multiple training element identification information and training typesetting prompt information, the training element identification information includes element identification information of pictures, texts or logos of various styles, and the training typesetting prompt information includes at least part of the information in the position, size, color, font, font size, level, spacing, layout mode, image style and image processing of the element.

[0064] Among them, the layout method includes, for example, floating layout, positioning layout or adaptive layout; the image style includes, for example, filter effect, transparency or border shadow; the image processing includes, for example, cropping, scaling or rotating.

[0065] The target large language model is obtained by fine-tuning the large language model using a pairing combination of multiple training element recognition information and training typesetting prompt information. The training element recognition information includes element recognition information of pictures, texts or logos in various styles. The training typesetting prompt information includes at least part of the information on the position, size, color, font, font size, level, spacing, layout method, image style and image processing of the elements. The fine-tuned target large language model can better adapt to the needs of typesetting tasks and improve the accuracy and typesetting effect of the final typesetting.

[0066] In the graphic layout information output by the target large language model, if there is no conflict in the final layout positions of various layout elements, or the degree of conflict is within an acceptable range, the visual layout result can be directly generated by rendering according to the output graphic layout information.

[0067] In an optional embodiment, if Figure 6 As shown, after step S204, the graphic typesetting method may further include steps S300 to S304: Step S300, obtaining graphic layout information of the target large language model.

[0068] Step S302, when there are elements with layout conflicts in the graphic layout information, the elements with layout conflicts are adjusted using a preset adjustment method to obtain an adjustment result, wherein the preset adjustment method at least includes moving, scaling and rotating.

[0069] Step S304, generating a layout image according to the adjustment result.

[0070] Specifically, the service platform obtains the graphic typesetting information output by the target large language model, checks the graphic typesetting information, and determines whether there are elements with typesetting conflicts in the graphic typesetting information, such as checking whether there are overlapping parts between every two elements, and determining that there is a typesetting conflict if there is an overlapping part; if there are no elements with typesetting conflicts, a typesetting image can be directly generated according to the graphic typesetting information; if there are elements with typesetting conflicts, the elements with typesetting conflicts are adjusted using a preset adjustment method, such as moving, scaling or rotating at least one element with typesetting conflicts, so that the typesetting conflicts disappear or are within an acceptable range, and the adjustment results are obtained; then a typesetting image is generated according to the adjustment results, so that the elements in the final typesetting image are coordinated and matched, in accordance with aesthetic principles and design specifications, and the overall visual effect is guaranteed. Among them, the movement, scaling or rotation can be performed according to certain rules (for example, according to a certain ratio).

[0071] In this optional embodiment, by obtaining the graphic typesetting information of the target large language model, when there is a typesetting conflict in the graphic typesetting information, the elements of the typesetting conflict are adjusted using a preset adjustment method to obtain an adjustment result, and a typesetting image is generated according to the adjustment result. The output result of the target large language model can be optimized to generate a typesetting image with coordinated elements, thereby improving the accuracy of the typesetting and the final effect.

[0072] Embodiment 2 Figure 7 The block diagram of the graphic typesetting device 400 according to the second embodiment of the present application is schematically shown. The device 400 can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Figure 7 As shown, the apparatus 400 may include an acquisition module 410, an identification module 420 and a layout module 430, wherein: The acquisition module 410 is used to acquire a target layout element and target layout prompt information, wherein the target layout element includes information of at least one mode; The identification module 420 is used to identify the target layout element to obtain element identification information; The typesetting module 430 is used to input the target typesetting prompt information and the element identification information into a target large language model, and use the target large language model to perform graphic typesetting according to the typesetting prompt information and the element identification information.

[0073] In an optional embodiment, the identification module 420 is further configured to: A target convolutional neural network based on an attention mechanism is used to identify the target typesetting element to obtain element identification information.

[0074] In an optional embodiment, the element identification information includes at least part of the information of the element's category, shape, size, position, font, font size, color, level, and text content, and the element identification information is stored in JSON format.

[0075] In an optional embodiment, the device 400 is further used for: The constructed convolutional neural network is trained using a first training data set to obtain the target convolutional neural network, wherein the first preset training data set includes N training images, and the training images include single elements or combinations of elements in images of multiple colors, images of multiple textures, texts in multiple fonts, texts in multiple font sizes, logos of multiple designs, and multiple text background colors.

[0076] In an optional embodiment, the device 400 is further used for: A second training data set is used to fine-tune the large language model to obtain the target large language model, wherein the second training data set includes a plurality of paired combinations of training element identification information and training typesetting prompt information, the training element identification information includes element identification information of pictures, texts or logos of various styles, and the training typesetting prompt information includes at least part of the information of element position, size, color, font, font size, level, spacing, layout mode, image style and image processing.

[0077] In an optional embodiment, the device 400 is further used for: Obtaining graphic layout information of the target large language model; In the case where there are elements with layout conflicts in the graphic layout information, the elements with layout conflicts are adjusted using a preset adjustment method to obtain an adjustment result, wherein the preset adjustment method at least includes moving, scaling and rotating; A layout image is generated according to the adjustment result.

[0078] Embodiment 3 Figure 8The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing a graphic typesetting method according to the third embodiment of the present application is shown. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Figure 8 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them: The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 can be an internal storage module of the computer device 10000, such as a hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 can also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 can also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed in the computer device 10000, such as program codes of the graphic typesetting method, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or are to be output.

[0079] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.

[0080] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0081] It should be pointed out that Figure 8 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0082] In this embodiment, the graphic typesetting method stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.

[0083] Embodiment 4 An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the graphic typesetting method in the embodiment are implemented.

[0084] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the program code of the graphic typesetting method in the embodiment, etc. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.

[0085] Embodiment 5 An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.

[0086] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.

[0087] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A graphic typesetting method, characterized in that: The method comprises: Acquire a target layout element and target layout prompt information, wherein the target layout element includes information of at least one mode; Identify the target layout element to obtain element identification information; The target layout prompt information and the element identification information are input into a target large language model, and the target large language model is used to perform graphic layout according to the layout prompt information and the element identification information.

2. The method according to claim 1, characterized in that The identifying the target layout element to obtain element identification information includes: A target convolutional neural network based on an attention mechanism is used to identify the target typesetting element to obtain element identification information.

3. The method according to claim 2, characterized in that The element identification information includes at least part of the information of the element's category, shape, size, position, font, font size, color, level, and text content, and the element identification information is stored in JSON format.

4. The method according to claim 2, characterized in that: The method further comprises: The constructed convolutional neural network is trained using a first training data set to obtain the target convolutional neural network, wherein the first preset training data set includes N training images, and the training images include single elements or combinations of elements in images of multiple colors, images of multiple textures, texts in multiple fonts, texts in multiple font sizes, logos of multiple designs, and multiple text background colors.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: A second training data set is used to fine-tune the large language model to obtain the target large language model, wherein the second training data set includes a plurality of paired combinations of training element identification information and training typesetting prompt information, the training element identification information includes element identification information of pictures, texts or logos of various styles, and the training typesetting prompt information includes at least part of the information of element position, size, color, font, font size, level, spacing, layout mode, image style and image processing.

6. The method according to any one of claims 1 to 4, characterized in that: After performing graphic typeset using the target large language model according to the typeset prompt information and the element identification information, the method further includes: Obtaining graphic layout information of the target large language model; In the case where there are elements with layout conflicts in the graphic layout information, the elements with layout conflicts are adjusted using a preset adjustment method to obtain an adjustment result, wherein the preset adjustment method at least includes moving, scaling and rotating; A layout image is generated according to the adjustment result.

7. A graphic typesetting device, characterized in that: The device comprises: An acquisition module, used to acquire a target layout element and target layout prompt information, wherein the target layout element includes information of at least one mode; An identification module, used to identify the target layout element to obtain element identification information; The typesetting module is used to input the target typesetting prompt information and the element identification information into a target large language model, and use the target large language model to perform graphic typesetting according to the typesetting prompt information and the element identification information.

8. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.