Search

CN-120763987-B - Condition-based structured layout generation method, device, equipment and storage medium

CN120763987BCN 120763987 BCN120763987 BCN 120763987BCN-120763987-B

Abstract

The application discloses a method, a device, equipment and a storage medium for generating a structured layout based on conditions, wherein the method comprises the steps of obtaining element conditions and a structure code; inputting the condition constraint and the structural code into a structural layout generation model, generating a structural sequence through the structural layout generation model, and converting the structural sequence into a layout tree to obtain a generated structural layout. According to the application, the element conditions and the structural codes for reflecting the structural layout characteristics are used as the input information of the structural layout generation model, so that the structural layout with various structures or appointed structures can be generated by the structural layout generation model, the structural layout of the contents in the whole page can be generated by a user according to the contents which are required to be placed in the page by the user, and the layout structure is adjusted according to the user requirements, so that convenience is brought to the user.

Inventors

  • XU PENGFEI
  • HU XIN
  • ZHOU JIN
  • HUANG HUI

Assignees

  • 深圳大学

Dates

Publication Date
20260508
Application Date
20250526

Claims (8)

  1. 1. The condition-based structured layout generation method is characterized by specifically comprising the following steps of: acquiring element conditions and structure codes, wherein the element conditions comprise attribute conditions and organization conditions; Inputting the element conditions and the structural codes into a structural layout generation model, and generating a structural sequence through the structural layout generation model, wherein each node element in the structural sequence comprises node attribute information, node type and relationship between a node and a father node; Converting the structure sequence into a layout tree to obtain a generated structured layout; the structural sequence is generated by the structural layout generation model, specifically, the structural layout generation model sequentially generates node elements according to the sequence from a root node to a leaf node to obtain the structural sequence, wherein the generation process of the node elements specifically comprises the following steps: acquiring a generated preamble structure sequence, and encoding the preamble structure sequence to obtain a context code; Connecting the element condition, the structure code and the context code, and adding a condition ending mark between the element condition and the structure code to obtain a first input sequence; Generating a first feature according to the first input sequence, and determining a hierarchical tag identifier and an element condition identifier according to the first feature; if the hierarchy mark identifier is expressed as a hierarchy mark, ending the generation process of the node element; If the hierarchical label identifier indicates that the hierarchical label is not a hierarchical label, generating a second input sequence according to the first input sequence and the first characteristic, and determining a condition label according to the second input sequence and a condition characteristic corresponding to the element condition when the element condition identifier is an element condition item which is required to meet the element condition; Determining a third input sequence according to the second input sequence and the condition mark, generating a third feature according to the second input sequence, and determining node attribute information according to the third feature; and determining a fourth input sequence according to the third input sequence and the node attribute information, generating a fourth feature according to the fourth input sequence, and determining a node type and a relation between the node and a father node according to the fourth feature.
  2. 2. The method for generating a condition-based structured layout according to claim 1, wherein the structure code is obtained based on a priori structure tree, and the obtaining process of the structure code specifically comprises: Acquiring a priori layout tree, wherein each node in the priori layout tree comprises node attribute information and an ordered set of all leaf nodes of the node; Determining node types corresponding to all nodes in each subsequence and the relation between the nodes and father nodes according to the ordered set of all leaf nodes of the nodes, and dividing the nodes in the prior layout tree into a plurality of subsequences according to the hierarchy, wherein each subsequence comprises nodes of the same layer in the prior layout tree; connecting the subsequences according to a hierarchical sequence, and adding a hierarchical mark after each subsequence to obtain a priori structure sequence corresponding to the priori layout tree; inputting the prior structure sequence into a preset structure encoder, and acquiring the coding characteristics of the prior layout tree through the preset structure encoder.
  3. 3. The method for generating a condition-based structured layout according to claim 1, the method is characterized in that the structure code is obtained through a random sampling mode.
  4. 4. A method of generating a condition-based structured layout according to claim 1, wherein an attention mask is added to the process of generating node elements from the first input sequence for indicating an update of element conditions, wherein the attention mask is described as: The attribute condition in the element condition accepts information from itself and the condition end mark; the organization condition in the element condition receives the information from the self and the node element under the organization element condition and the condition end mark; the condition end mark accepts information from all element condition items in the element condition; the structure code receives information from the structure code; The context code accepts from itself, unsatisfied element condition items, condition end markers, and structure code information.
  5. 5. The condition-based structured layout generation method according to claim 1, wherein the attribute condition is used for constraining positional information of node elements, and the organization condition is used for constraining interrelationships between node elements.
  6. 6. The condition-based structured layout generation device is characterized by comprising the following specific components: The acquisition module is used for acquiring element conditions and structure codes, wherein the element conditions comprise attribute conditions and organization conditions; The generation module is used for inputting the element conditions and the structural codes into a structural layout generation model, and generating a structural sequence through the structural layout generation model, wherein each node element in the structural sequence comprises node attribute information, node type and relationship between a node and a father node; the conversion module is used for converting the structure sequence into a layout tree to obtain a generated structured layout; the structural sequence is generated by the structural layout generation model, specifically, the structural layout generation model sequentially generates node elements according to the sequence from a root node to a leaf node to obtain the structural sequence, wherein the generation process of the node elements specifically comprises the following steps: acquiring a generated preamble structure sequence, and encoding the preamble structure sequence to obtain a context code; Connecting the element condition, the structure code and the context code, and adding a condition ending mark between the element condition and the structure code to obtain a first input sequence; Generating a first feature according to the first input sequence, and determining a hierarchical tag identifier and an element condition identifier according to the first feature; if the hierarchy mark identifier is expressed as a hierarchy mark, ending the generation process of the node element; If the hierarchical label identifier indicates that the hierarchical label is not a hierarchical label, generating a second input sequence according to the first input sequence and the first characteristic, and determining a condition label according to the second input sequence and a condition characteristic corresponding to the element condition when the element condition identifier is an element condition item which is required to meet the element condition; Determining a third input sequence according to the second input sequence and the condition mark, generating a third feature according to the second input sequence, and determining node attribute information according to the third feature; and determining a fourth input sequence according to the third input sequence and the node attribute information, generating a fourth feature according to the fourth input sequence, and determining a node type and a relation between the node and a father node according to the fourth feature.
  7. 7. A computer-readable storage medium, characterized in that the computer-readable storage medium stores one or more programs, the one or more programs are executable by one or more processors to implement the steps in the condition-based structured layout generation method of any of claims 1-5.
  8. 8. A terminal device is characterized by comprising a processor and a memory; The memory has stored thereon a computer readable program executable by the processor; The processor, when executing the computer readable program, implements the steps in the condition based structured layout generation method of any of claims 1 to 5.

Description

Condition-based structured layout generation method, device, equipment and storage medium Technical Field The present application relates to the field of computer graphics, and in particular, to a method, apparatus, device, and storage medium for generating a structured layout based on conditions. Background Layout (Layout) generally refers to the set of positional information of a presentation element in a presentation context. The concept plays a vital role in a plurality of fields such as documents, posters, magazines, graphical User Interfaces (GUIs), furniture placement, indoor designs and the like. In the past decades, researchers have conducted a great deal of research on layout generation tasks, which are divided into two main categories, one category is to construct a layout based on a traditional geometric computational framework, and the other category is to automatically generate a layout using a data-driven method. Compared with the traditional method, the data driving method has higher layout generation efficiency, and a user does not need to have professional layout design experience. Currently, most data driven methods are only suitable for generating unstructured layouts. In the unstructured layout, the positions of the elements are fixed and are described in the form of bounding boxes, the elements are mutually independent, information describing the interrelationships of the elements is lacking, the layout structure cannot be adjusted according to the requirements of users, and inconvenience is brought to the users in use. There is thus a need for improvements and improvements in the art. Disclosure of Invention The application aims to solve the technical problem of providing a condition-based structured layout generation method, a device, equipment and a storage medium aiming at the defects of the prior art. In order to solve the above technical problem, a first aspect of the present application provides a condition-based structured layout generation method, where the condition-based structured layout generation method specifically includes: acquiring element conditions and structure codes, wherein the element conditions comprise attribute conditions and organization conditions; Inputting the condition constraint and the structural code into a structural layout generation model, and generating a structural sequence through the structural layout generation model, wherein each node element in the structural sequence comprises node attribute information, node type and relationship between a node and a father node; the structure sequence is converted into a layout tree to obtain a generated structured layout. The method for generating the structured layout based on the condition, wherein the structure code is obtained based on a priori structure tree, and the obtaining process of the structure code specifically comprises the following steps: Acquiring a priori layout tree, wherein each node in the priori layout tree comprises node attribute information and an ordered set of all leaf nodes of the node; Determining node types corresponding to all nodes in each subsequence and the relation between the nodes and father nodes according to the ordered set of all leaf nodes of the nodes, and dividing the nodes in the prior layout tree into a plurality of subsequences according to the hierarchy, wherein each subsequence comprises nodes of the same layer in the prior layout tree; connecting the subsequences according to a hierarchical sequence, and adding a hierarchical mark after each subsequence to obtain a priori structure sequence corresponding to the priori layout tree; inputting the prior structure sequence into a preset structure encoder, and acquiring the coding characteristics of the prior layout tree through the preset structure encoder. The method for generating the structured layout based on the condition, wherein, the structure code is obtained by a random sampling mode. The method for generating the structured layout based on the condition, wherein the method for generating the structured sequence by the structured layout generation model specifically comprises the steps that the structured layout generation model sequentially generates node elements according to the sequence from a root node to a leaf node to obtain the structured sequence, and the generation process of the node elements specifically comprises the following steps: acquiring a generated preamble structure sequence, and encoding the preamble structure sequence to obtain a context code; Connecting the element condition, the structure code and the context code, and adding a condition ending mark between the element condition and the structure code to obtain a first input sequence; generating node elements according to the first input sequence. The method for generating the structured layout based on the condition, wherein an attention mask is added in the process of generating node elements according to the first input seq