Layout information generation method and device, computer equipment and storage medium
By constructing the layout element relationship diagram, semantic representation vector extraction, and clustering analysis, the problem of insufficient layout information in the existing technology has been solved, and the generation and acquisition of high -quality layout information are realized.
Patent Information
- Application Number
- CN202411507303.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-01-21
AI Technical Summary
The prior art is difficult to generate high-quality layout information, especially when dealing with the correlation and dependencies between layout elements, resulting in insufficient correlation, logic and visual aesthetics of the generated layout information.
By obtaining layout element information, calculating similarity and distance, build a layout element relationship diagram, perform semantic representation vector extraction, cluster analysis to obtain layout function modules and theme areas, and the layout spread based on these modules and regions, generate effective layout information, Essence
Effectively generate high -quality layout information, improve the correlation, logical and visual aesthetics of layout information, and meet the complex and changeable creative needs.
Smart Images

Figure CN119336952A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, specifically to the field of financial technology, and in particular to a layout information generation method, device, computer equipment and storage medium. Background Art
[0002] Layout generation technology, as a shining pearl in the field of modern design, is increasingly becoming the core driving force of multiple industries such as advertising design, publishing and printing, and digital content creation. Based on the intuitive presentation of image information and the exquisite arrangement of visual text elements, this technology cleverly transforms creative ideas into works with strong visual impact. It is widely used in diversified creative scenes such as advertising posters, magazine layout, and web design. The subtlety of layout lies not only in the careful arrangement of spatial structure, but also in the harmonious coexistence of visual elements, which directly shapes the overall effect and aesthetic value of the work, profoundly affecting the audience's first impression and emotional resonance.
[0003] In the two major fields of finance and medicine, the application of layout generation technology is particularly significant. In drug label design, a clear and accurate layout is not only related to the efficiency of information transmission, but also the key to ensuring the safety of patients' medication. In insurance advertising, creative and attractive layout design has become an important means to attract the attention of target customers and enhance brand image. However, with the growing market demand for personalized and customized design, traditional predefined templates have been unable to meet the increasingly complex and changing creative needs due to their inherent limitations. These templates often lack the necessary flexibility and are difficult to adapt to the unique style requirements of specific projects or brands.
[0004] In order to break through this bottleneck, the current technology trend tends to adopt a more intelligent and dynamic layout generation method. Through the algorithm, the preset layout elements are intelligently diffused, and attempts are made to generate diverse layout display information. However, the challenges faced in this process should not be ignored. Due to the wide variety of layout elements and the different ways of representing the characteristics of each element, how to accurately capture and express the correlation and dependency between elements in the diffusion generation process has become the key to improving the layout quality. Existing technologies often find it difficult to achieve the ideal effect when dealing with this problem, resulting in deficiencies in the correlation, logic, and visual aesthetics of the generated layout information, which affects the effective generation and acquisition of high-quality layout information. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a layout information generation method, apparatus, computer equipment and storage medium to solve the problem of being unable to generate high-quality layout information.
[0006] In order to solve the above technical problems, the present application provides a layout information generation method, which adopts the following technical solution:
[0007] Acquire layout element information, perform similarity and distance calculation on the layout element information, and obtain layout element similarity and layout element distance;
[0008] Constructing a layout element relationship graph according to the layout element similarities and the layout element distances;
[0009] Extracting semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors;
[0010] Performing cluster analysis based on the layout representation vector to obtain layout function modules and layout theme areas;
[0011] Layout diffusion is performed based on the layout function module and the layout subject area to generate effective layout information.
[0012] Furthermore, the step of acquiring layout element information, calculating similarity and distance of the layout element information, and obtaining layout element similarity and layout element distance specifically includes:
[0013] Extracting the layout element information from a database;
[0014] Performing feature extraction and vectorization processing on the layout element information to obtain a layout element feature vector;
[0015] Calculating the cosine similarity of the layout element feature vectors to obtain the layout element similarity;
[0016] The element distance is calculated according to the central coordinates of the layout element information to obtain the layout element distance.
[0017] Furthermore, the step of constructing a layout element relationship graph according to the layout element similarities and the layout element distances specifically includes:
[0018] Establishing connection edges between layout elements according to the layout element similarity and the layout element distance;
[0019] Obtaining a preset weight calculation rule, and calculating the connection edge weight according to the weight calculation rule, the layout element similarity, and the layout element distance;
[0020] A graph is constructed according to the layout elements, the connection edges, and the connection edge weights to obtain the layout element relationship graph.
[0021] Furthermore, the step of extracting semantic representation vectors from the layout element relationship graph to obtain the layout element representation vectors specifically includes:
[0022] Inputting the layout element relationship graph into the graph convolution layer to perform graph convolution operation to obtain element representation features;
[0023] The graph convolutional layers are stacked to extract high-level semantic features from the element representation features to obtain the layout element representation vector.
[0024] Furthermore, the step of performing cluster analysis according to the layout element representation vector to obtain layout function modules and layout theme areas specifically includes:
[0025] Calculating the distance of the representation vectors of the layout elements to obtain the representation vector distance, and constructing a similarity matrix according to the representation vector distance;
[0026] Obtaining a preset density threshold and a minimum number of included points, clustering the similarity matrix according to a preset clustering algorithm, the preset density threshold, and the minimum number of included points, to obtain the layout function module;
[0027] Acquire the element position coordinates of the layout function module, and calculate the layout attributes corresponding to the layout function module according to the element position coordinates;
[0028] The spatial adjacency relationship between the layout function modules is determined according to the layout attributes, and the adjacent layout function modules are merged into the layout theme area.
[0029] Furthermore, the step of performing layout diffusion based on the layout function module and the layout theme area to generate effective layout information specifically includes:
[0030] Performing structural feature analysis on the layout function module and the layout theme area to obtain layout structural feature information;
[0031] Clustering layout elements according to the layout structure characteristic information to obtain a layout template;
[0032] The layout template is input into a preset discrete diffusion model for layout diffusion to obtain the effective layout information.
[0033] Furthermore, the step of inputting the layout template into a preset discrete diffusion model for layout diffusion to obtain the effective layout information specifically includes:
[0034] Obtaining category attribute information and geometric attribute information corresponding to the layout template;
[0035] Performing forward transfer destruction on the category attribute information and the geometric attribute information to obtain changed category attribute information and changed geometric attribute information;
[0036] adding uniformly distributed noise to the change category attribute information to obtain category diffusion information;
[0037] Adding discrete Gaussian noise to the changed geometric attribute information to obtain geometric diffusion information;
[0038] The category diffusion information and the geometric diffusion information are reversely generated to obtain the effective layout information.
[0039] In order to solve the above technical problems, the embodiment of the present application further provides a layout information generating device, which adopts the following technical solution:
[0040] An information calculation module, used to obtain layout element information, perform similarity and distance calculation on the layout element information, and obtain layout element similarity and layout element distance;
[0041] A relationship building module, used for building a layout element relationship graph according to the layout element similarity and the layout element distance;
[0042] A vector extraction module, used to extract semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors;
[0043] A cluster analysis module, used for performing cluster analysis according to the layout representation vector to obtain layout function modules and layout theme areas;
[0044] The layout diffusion module is used to perform layout diffusion based on the layout function module and the layout theme area to generate effective layout information.
[0045] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0046] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of any one of the above layout information generation methods when executing the computer-readable instructions.
[0047] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0048] A computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the layout information generating method as described in any one of the above items are implemented.
[0049] Compared with the prior art, the embodiment of the present application has the following beneficial effects: the embodiment obtains layout element information, calculates similarity and distance of the layout element information, and obtains layout element similarity and layout element distance; constructs a layout element relationship graph according to the layout element similarity and the layout element distance; extracts semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors; performs cluster analysis according to the layout representation vectors to obtain layout function modules and layout theme areas; performs layout diffusion based on the layout function modules and the layout theme areas to generate effective layout information. Thus, high-quality effective layout information is effectively generated according to the layout element information to achieve effective layout of information. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0051] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0052] Figure 2 A flow chart of an embodiment of a method for generating layout information according to the present application;
[0053] Figure 3 yes Figure 2 A flowchart of a specific implementation of step S10;
[0054] Figure 4 yes Figure 2 A flowchart of a specific implementation of step S20;
[0055] Figure 5 yes Figure 2 A flowchart of a specific implementation of step S30;
[0056] Figure 6 yes Figure 2 A flowchart of a specific implementation of step S40;
[0057] Figure 7 yes Figure 2 A flowchart of a specific implementation of step S50;
[0058] Figure 8 yes Figure 7 A flowchart of a specific implementation of step S503;
[0059] Fig. 9is a structural schematic diagram of an embodiment of a layout information generating device according to the present application;
[0060] Fig.10 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0062] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor does it refer to non-related or alternative embodiments that are mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0063] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0064] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables.
[0065] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0066] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to a laptop computer 1011, a tablet computer 1012 or a mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0067] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0068] It should be noted that the layout information generating method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the layout information generating device is generally arranged in the server / terminal device.
[0069] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0070] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for generating layout information according to the present application. The layout information generating method comprises the following steps:
[0071] Step S10, acquiring layout element information, performing similarity and distance calculation on the layout element information, and obtaining layout element similarity and layout element distance;
[0072] In this embodiment, the layout element information includes multiple layout elements used to determine the placement and presentation of each element in the interface design, and each layout element has position, size and shape attributes. Among them, the layout element is the basic unit that constitutes the interface layout, and can be any interface component such as a button, a text box, a picture, an icon, etc. The position attribute of the layout element is used to specify the specific position of the layout element on the interface, and the specific position can be expressed as a two-dimensional coordinate (x, y). The size attribute of the layout element is used to describe the size of the layout element, including width and height, and the height and width can be defined using specific values (such as pixels, percentages, etc.). The shape attribute of the layout element is used to define the appearance outline of the layout element, which can be a rectangle, a circle, a polygon, etc., and the appearance outline can include a border, a rounded corner, and a custom shape.
[0073] Step S20, constructing a layout element relationship graph according to the layout element similarities and the layout element distances;
[0074] In this embodiment, the layout element similarity is calculated based on the position, size and shape attributes of two different layout elements, and is information about the similarity between the layout elements. The layout element distance is the Euclidean distance between the center points of two different layout elements. The layout element relationship graph is a graphical representation used to show the relationship between the elements in the layout. In the graph, each layout element is represented as a node (or vertex), and the relationship between the elements is represented by the edges between the nodes. In this embodiment, the layout element relationship graph reflecting the relationship between the layout elements is effectively constructed based on the similarity and Euclidean distance between the layout elements.
[0075] Step S30, extracting semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors;
[0076] In this embodiment, the semantic representation vector extraction process is performed on the layout element relationship graph by using a graph neural network model. The graph neural network model can adopt a graph convolutional network (GCN) model, and the working steps of the graph convolutional network (GCN) model are as follows: Neighbor information aggregation: For each node in the graph, GCN aggregates the feature information of its neighbor nodes, usually by multiplying the feature vector of the neighbor node by the weight matrix, and may add a nonlinear activation function to achieve. Feature transformation: The aggregated neighbor information is combined with the original features of the current node (possibly through concatenation, addition, or more complex operations), and then transformed by a linear transformation (i.e., the product of the weight matrix and the feature vector) and a nonlinear activation function to generate a new node representation. Iterative update: The above process can be iterated multiple times to capture more distant neighbor information in the graph, and each iteration will generate new node representations, which gradually integrate more extensive information in the graph. Output layer: Finally, GCN adds an output layer for performing specific tasks, such as node classification, graph classification, or link prediction. The output layer is usually a linear transformation followed by a softmax function (for classification tasks) or other appropriate output functions.
[0077] Step S40, performing cluster analysis according to the layout representation vector to obtain layout function modules and layout theme areas;
[0078] In this embodiment, the clustering analysis of the layout representation vector includes two steps: clustering and merging. The clustering operation is performed on the similarity matrix constructed by the layout representation vector. The similarity matrix is clustered to effectively divide the layout elements of the corresponding category into the same layout function module. The merging is a module integration action based on the spatial adjacency relationship between the layout function modules. After the clustering operation, some layout function modules that are spatially adjacent but belong to different categories may be obtained. Therefore, in order to obtain a more reasonable and coherent layout structure, a merging operation is required. The layout function modules are merged to generate a layout theme area. The layout function modules in the layout theme area all have the same layout theme.
[0079] Step S50: Perform layout diffusion based on the layout function module and the layout subject area to generate effective layout information.
[0080] In this embodiment, layout diffusion is performed based on a discrete diffusion model, which is a mathematical model used to describe the propagation of matter or information in space. By dividing the space into several discrete small areas and defining the change law of matter or information in each small area, the process of the evolution of layout function modules and layout theme areas over time is described to obtain effective layout information.
[0081] This embodiment obtains layout element information, performs similarity and distance calculation on the layout element information, obtains layout element similarity and layout element distance; constructs a layout element relationship graph according to the layout element similarity and the layout element distance; extracts semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors; performs cluster analysis according to the layout representation vectors to obtain layout function modules and layout theme areas; performs layout diffusion based on the layout function modules and the layout theme areas to generate effective layout information. Thus, high-quality effective layout information is effectively generated according to the layout element information to achieve effective layout of information.
[0082] In this embodiment, the above-mentioned layout information generation method can be applied to the advertising page layout of financial advertisements. Financial advertisements can specifically refer to financial insurance advertisements. Financial insurance advertisements include life insurance advertisements, health insurance advertisements, property insurance advertisements, accidental injury insurance advertisements, etc. The effective layout information in this embodiment corresponds to the advertising page layout of any of the above financial insurance advertisements.
[0083] refer to Figure 3 In some optional implementations of this embodiment, step S10 includes the following steps:
[0084] Step S101, extracting the layout element information from a database;
[0085] In this embodiment, a matching query can be performed in the database through the layout element extraction identifier to effectively extract the layout element information from the database.
[0086] Step S102, performing feature extraction and vectorization processing on the layout element information to obtain a layout element feature vector;
[0087] In this embodiment, feature extraction is performed on the position, size and shape attributes of the layout element information to obtain corresponding feature information such as the layout element position, layout element size, layout element shape, etc. The obtained feature information is then vectorized to convert the feature information into a comparable numerical representation, thereby obtaining a layout element feature vector.
[0088] Step S103, calculating the cosine similarity of the layout element feature vectors to obtain the layout element similarity;
[0089] In this embodiment, the cosine similarity formula is used to calculate the cosine value of the angle between two layout element feature vectors. The closer the cosine value of the angle is to 1, the more similar the two vectors are; the closer it is to -1, the less similar they are; and the closer it is to 0, the two vectors are orthogonal (no correlation). The calculated cosine value of the angle is used as the layout element similarity.
[0090] Step S104: Calculate the element distance according to the center coordinates of the layout element information to obtain the layout element distance.
[0091] In this embodiment, the element distance calculation is performed using the Euclidean distance. For two layout elements, assuming that their coordinates are (x1, y1) and (x2, y2), the Euclidean distance d between them can be calculated using the following formula: This formula calculates the straight-line distance between two points, that is, their Euclidean distance in two-dimensional space. When the Euclidean distance calculation is completed, the obtained Euclidean distance value is the layout element distance.
[0092] This embodiment extracts the layout element information from the database; performs feature extraction and vectorization processing on the layout element information to obtain a layout element feature vector; calculates the cosine similarity of the layout element feature vector to obtain the layout element similarity; and performs element distance calculation according to the center coordinates of the layout element information to obtain the layout element distance. This effectively achieves obtaining the layout element similarity and layout element distance reflecting the similarity relationship of the layout elements according to the layout element information.
[0093] refer to Figure 4 In some optional implementations of this embodiment, step S20 includes the following steps:
[0094] Step S201: Establish a layout element based on the layout element similarity and the layout element distance.
[0095] The connecting edges between local elements;
[0096] · In this embodiment, a similarity threshold and a distance threshold are set corresponding to the layout element similarity and the layout element distance, wherein the similarity threshold and the distance threshold can be set and adjusted according to the specific application scenario and the characteristics of the interface layout. By comparing the layout element similarity and the layout element distance with the preset similarity threshold and the distance threshold, when the layout element similarity is higher than the similarity threshold and the layout element distance is lower than the distance threshold, a connection edge is established between them.
[0097] Step S202, obtaining a preset weight calculation rule, and calculating the connection edge weight according to the weight calculation rule, the layout element similarity, and the layout element distance;
[0098] In this embodiment, the preset weight calculation rule may be to define the weight w as the product of the layout element similarity s and the inverse of the layout element distance d (or a certain attenuation function of the distance), that is, w=s*1 / f(d), where f(d) is a monotonically increasing function of the layout element distance d (such as d, d2, ed, etc.), which is used to ensure that the weight gradually decreases as the layout element distance increases. The connection edge weight corresponding to the connection edge is calculated by the above weight calculation rule.
[0099] Step S203: constructing a graph according to the layout elements, the connection edges, and the connection edge weights to obtain the layout element relationship graph.
[0100] In this embodiment, by treating each layout element as a node of the graph and creating a set containing the nodes, for each pair of layout elements, it is checked whether there is a connection edge between them (i.e., whether the preset similarity and distance conditions are met), and for the element pair with a connection edge, an edge object is created, which contains references (or identifiers) of the two nodes and the weight of the edge. According to the selected adjacency list graph representation method, the edge object is added to the graph, and in the adjacency table, it is implemented by adding an edge object to the adjacency list of the corresponding node. A weight is assigned to the corresponding edge object according to the connection edge weight, which can be implemented by storing the calculated weight value in each edge object. When the connection edge weight is added to all edge objects, a complete layout element relationship graph is obtained.
[0101] This embodiment establishes connecting edges between layout elements according to the layout element similarity and the layout element distance; obtains a preset weight calculation rule, and calculates the connecting edge weight according to the weight calculation rule, the layout element similarity, and the layout element distance; and constructs a graph according to the layout elements, the connecting edges, and the connecting edge weights, thereby effectively obtaining a layout element relationship graph constructed based on the layout element similarity and the layout element distance, so as to facilitate the subsequent extraction of semantic representation vectors.
[0102] refer to Figure 5 In some optional implementations of this embodiment, step S30 includes the following steps:
[0103] Step S301, inputting the layout element relationship graph into a graph convolution layer to perform a graph convolution operation to obtain element representation features;
[0104] In this embodiment, the graph convolution layer refers to the convolution layer in the graph convolution network. By inputting the layout element relationship graph into the graph convolution layer, the graph convolution layer aggregates the neighbor information of each node and updates the node representation based on this information. In specific implementation, an appropriate aggregation function (such as mean aggregation, maximum pooling aggregation, etc.) can be selected to merge the features of neighbor nodes to obtain effective element representation features.
[0105] Step S302: stacking the graph convolutional layers to extract high-level semantic features from the element representation features to obtain the layout element representation vector.
[0106] In this embodiment, in order to extract high-level semantic features from element representation features, multiple graph convolutional layers can be stacked together to form a deep network structure. In each layer, the representation of the node is updated according to the update of its neighbors, thereby gradually capturing more global information. As the number of layers increases, the representation of the node becomes more abstract and high-level, capturing more complex structures and relationships in the graph. Then, by extracting the representation vector of the node from the last layer of the stacked graph convolutional layer, the representation vector is the layout element representation vector, which contains the high-level semantic features learned from the layout element relationship graph.
[0107] In this embodiment, the layout element relationship graph is input into a graph convolution layer to perform a graph convolution operation to obtain element representation features; the graph convolution layers are stacked to extract high-level semantic features from the element representation features, thereby effectively obtaining a layout element representation vector represented by the high-level semantic features of the layout element relationship graph to facilitate subsequent clustering analysis processing.
[0108] Continue to refer Figure 6 In some optional implementations of this embodiment, step S40 includes the following steps:
[0109] Step S401, calculating the distance of the representation vectors of the layout elements to obtain the representation vector distance, and constructing a similarity matrix according to the representation vector distance;
[0110] In this embodiment, the representation vector distance can be obtained by calculating the cosine similarity between the representation vectors of the layout elements, and then a square matrix with the same number of layout elements is created to store the representation vector distance. The rows and columns of the matrix correspond to different layout elements respectively. By filling the representation vector distance into the above matrix, a similarity matrix is obtained. In this embodiment, for the same layout elements (that is, the vectors are exactly the same), the corresponding elements in the similarity matrix should be set to the maximum value (such as 1).
[0111] Step S402, obtaining a preset density threshold and a minimum number of included points, clustering the similarity matrix according to a preset clustering algorithm, the preset density threshold and the minimum number of included points, and obtaining the layout function module;
[0112] In this embodiment, the density threshold is used to measure the density of the layout elements corresponding to the similarity matrix. If the density of the layout elements exceeds the density threshold, it is considered that these points belong to the same cluster. The minimum number of included points defines the minimum number of data points that constitute a valid cluster. If the number of layout elements in an area does not reach the threshold, these points will be marked as noise points. In this embodiment, the similarity matrix is clustered based on the DBSCAN algorithm. DBSCAN is a density-based clustering algorithm that does not require the number of clusters to be specified in advance, but discovers clusters of arbitrary shapes based on the density distribution of the data. By using the calculated similarity matrix as the input of the clustering algorithm, the clustering algorithm traverses the layout element data points, and marks the adjacent layout elements as the same cluster according to the density threshold, while considering the minimum number of included points to filter out noise points to obtain the clustered layout function module.
[0113] Step S403, obtaining the element position coordinates of the layout function module, and calculating the layout attributes corresponding to the layout function module according to the element position coordinates;
[0114] In this embodiment, the corresponding element position coordinates are obtained according to the position information corresponding to the layout element in the layout function module. In this embodiment, the layout function module (such as the navigation bar, main content area, sidebar, etc. in the web page) contains several layout elements. The page position corresponding to the layout function module is determined by the position information corresponding to the layout element, and the corresponding border range is determined. The position of the layout function module in the page is determined according to the border range to further determine the element position coordinates corresponding to the layout element in the page. The layout attributes include the center point, height size, and width size of the module.
[0115] Step S404: determining the spatial adjacency relationship between the layout function modules according to the layout attributes, and merging the adjacent layout function modules into the layout theme area.
[0116] In this embodiment, the module position of the layout function module is determined according to the center point coordinates, height size and width size of the layout function module, and then the spatial adjacency relationship of the layout function module in the page is determined according to the module position of each layout function module. The spatial adjacency relationship can be judged by the adjacency distance, which is the distance value between the module borders of the layout function module. By comparing the distance value with the preset distance threshold, it is determined whether there is spatial adjacency between the layout function modules, and the spatially adjacent layout function modules are merged into corresponding layout theme areas.
[0117] This embodiment calculates the distance of the representation vectors of the layout elements to obtain the representation vector distance, and constructs a similarity matrix based on the representation vector distance; obtains a preset density threshold and a minimum number of included points, clusters the similarity matrix based on a preset clustering algorithm, the preset density threshold, and the minimum number of included points to obtain the layout function module; obtains the element position coordinates of the layout function module, and calculates the layout attributes corresponding to the layout function module based on the element position coordinates; determines the spatial adjacency relationship between the layout function modules based on the layout attributes, and merges the adjacent layout function modules into the layout theme area. This effectively achieves the acquisition of the layout function modules and layout theme areas after clustering and merging based on the similarity relationship and spatial relationship of the representation vectors of the layout elements, so as to facilitate the subsequent layout diffusion processing.
[0118] Continue to refer Figure 7 In some optional implementations of this embodiment, step S50 includes the following steps:
[0119] Step S501, analyzing the structural characteristics of the layout function module and the layout theme area to obtain layout structural characteristic information;
[0120] In this embodiment, the layout structural feature information includes module size, module shape, module density, module spatial distribution, area size, area density, area shape, etc., and the structural feature analysis of the layout functional module and the layout theme area is performed through the geometric analysis method. The analysis steps of the geometric analysis method include: shape and contour analysis: identifying the geometric shapes of the layout functional module and the layout theme area, such as rectangle, circle, polygon, etc., analyzing the symmetry and regularity of the shape and their influence on the overall layout, checking the smoothness of the contour line, the combination of straight lines and curves and other characteristics. Proportion and scale analysis: measuring the size of each functional module and theme area, calculating the proportional relationship between them, analyzing whether these proportions are coordinated and whether they conform to the principles of visual aesthetics, and evaluating the distribution and balance of elements of different scales in the layout. Position and direction analysis: determining the specific position of the functional module and theme area in the layout, analyzing their directionality, such as horizontal, vertical or inclined, etc., and the influence of these directions on the overall smoothness of the layout.
[0121] Step S502, clustering layout elements according to the layout structure characteristic information to obtain a layout template;
[0122] In this embodiment, a clustering algorithm is used to cluster layout elements with similar layout structures according to layout structure characteristic information, and then a layout element closest to the cluster center point is selected from the clustering results as a layout template. The clustering algorithm may be a DBSCAN algorithm.
[0123] In this embodiment, after obtaining the layout template, the preset design specifications and aesthetic principles can be obtained, and the design specifications and aesthetic principles can be used as judgment conditions. For each of the layout templates, it is compared with the preset design specifications and aesthetic principles, and the matching degree of the two is calculated by a similarity algorithm; if the matching degree of the layout template with the design specifications and aesthetic principles is lower than a preset threshold, it is judged that the layout template does not meet the design specifications and aesthetic principles. The functional module or theme area containing the layout template that does not meet the design specifications and aesthetic principles is obtained, and it is marked as a layout area that needs to be optimized. All the layout areas that need to be optimized are output, the position and size attributes of the layout elements in the layout areas that need to be optimized are obtained, and a layout optimization objective function is constructed. The objective function is used to evaluate the alignment and spacing uniformity of the layout elements. The optimal position and size of the layout elements are obtained by solving the objective function, and a layout optimization suggestion is generated. Finally, the position and size attributes of the layout elements are automatically adjusted according to the layout optimization suggestion to obtain an optimized layout.
[0124] Step S503: input the layout template into a preset discrete diffusion model for layout diffusion to obtain the effective layout information.
[0125] In this embodiment, by inputting the layout template into a preset discrete diffusion model, diffusion is effectively performed according to the layout template to obtain high-quality effective layout information.
[0126] This embodiment obtains layout structural feature information by performing structural feature analysis on the layout function module and the layout subject area; clusters layout elements according to the layout structural feature information to obtain a layout template; and inputs the layout template into a preset discrete diffusion model for layout diffusion, thereby effectively obtaining effective layout information based on clustering and diffusion of the layout structural feature information, so as to effectively achieve high-quality layout information acquisition.
[0127] Continue to refer Figure 8 In some optional implementations of this embodiment, step S503 includes the following steps:
[0128] S5031, obtaining category attribute information and geometric attribute information corresponding to the layout template;
[0129] In this embodiment, the category attribute information refers to the category label corresponding to the layout element in the layout template, such as "button", "text box", "picture", etc., and the geometric attribute information refers to the geometric features such as the position, size, shape, etc. of each element in the layout template. The representation of the layout element in the layout template is l = (c, x, y, w, h), where c is the category attribute, x, y, w, h are geometric attributes, x, y represent the center coordinates of the layout element, and w, h represent the width and height of the layout element.
[0130] S5032, forward transfer destruction is performed on the category attribute information and the geometric attribute information to obtain changed category attribute information and changed geometric attribute information;
[0131] In this embodiment, a disjoint transfer matrix Q is applied to the vectors corresponding to c, x, y, w, and h. c t , Q x t , Q y t , Q w t , Q h t For Q c t , the size of each matrix is (C+2)×(C+2), where +2 represents [PAD] and [MASK]. In this way of transferring states, the layout l is gradually destroyed from the initial state l0 to l N , to obtain the change category attribute information and change geometry attribute information.
[0132] S5033, adding uniformly distributed noise to the change category attribute information to obtain category diffusion information;
[0133] In this embodiment, uniformly distributed noise is a kind of random noise whose values are uniformly distributed within a given range. By adding this noise to the changing category attribute information, the uncertainty or diversity of the category attributes can be further simulated to obtain the category diffusion information after effective diffusion, which represents a broader or more fuzzy set of category attributes.
[0134] S5034, adding discrete Gaussian noise to the changed geometric attribute information to obtain geometric diffusion information;
[0135] In this embodiment, Gaussian noise is a continuously distributed random noise, and discrete Gaussian noise retains the statistical characteristics of Gaussian noise, but its values are discrete. By adding this noise to the changing geometric attribute information, geometric diffusion information representing a broader or more fuzzy set of geometric attributes is obtained.
[0136] S5035: Reversely generate the category diffusion information and the geometric diffusion information to obtain the effective layout information.
[0137] In this embodiment, reverse generation is a process of recovering or generating effective layout information from diffusion information, which requires performing an inverse transformation corresponding to forward transfer destruction and noise addition on the category diffusion information and geometric diffusion information to obtain high-quality effective layout information. It should be understood that the forward transfer destruction, uniformly distributed noise addition, discrete Gaussian noise addition, and reverse generation are all implemented in a preset discrete diffusion model.
[0138] This embodiment obtains the category attribute information and geometric attribute information corresponding to the layout template; performs forward transfer destruction on the category attribute information and the geometric attribute information to obtain changed category attribute information and changed geometric attribute information; adds uniformly distributed noise to the changed category attribute information to obtain category diffusion information; adds discrete Gaussian noise to the changed geometric attribute information to obtain geometric diffusion information; and reversely generates the category diffusion information and the geometric diffusion information, thereby effectively obtaining effective layout information based on the category attribute information and the geometric attribute information corresponding to the layout template that are forward diffused and reversely generated, so as to achieve high-quality layout information generation.
[0139] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0140] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0141] Further references Fig. 9 , as a response to the above Figure 1 The present application provides an embodiment of a layout information generating device, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0142] like Fig. 9 As shown, the layout information generating device 600 described in this embodiment includes: a data acquisition module 601, a feature extraction module 602, a feature representation module 603, a feature fusion module 604, and a model prediction module 605. Among them:
[0143] The information calculation module 601 is used to obtain layout element information, perform similarity and distance calculation on the layout element information, and obtain layout element similarity and layout element distance;
[0144] A relationship building module 602, configured to build a layout element relationship graph according to the layout element similarities and the layout element distances;
[0145] A vector extraction module 603 is used to extract semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors;
[0146] A cluster analysis module 604, configured to perform cluster analysis based on the layout representation vector to obtain layout function modules and layout theme areas;
[0147] The layout diffusion module 605 is used to perform layout diffusion based on the layout function module and the layout theme area to generate effective layout information.
[0148] By adopting the above-mentioned layout information generation device, this embodiment can obtain financial information data, parse the financial information data to obtain financial time series data and financial text information data; extract features from the financial time series data and the financial text information data to obtain financial time features and financial sentiment features; perform feature representation transformation on the financial time features and the financial sentiment features based on the graph attention network to obtain fused feature representation; merge the financial time features and the financial sentiment features into the fused feature representation to obtain financial information features; normalize the financial information features to obtain financial effective features, and input the financial effective features into the pre-trained fraud probability prediction model to obtain fraud probability results. This effectively achieves accurate acquisition of fraud probability results of financial information data, so as to identify whether the financial information data is fraud information and improve the reliability of information acquisition.
[0149] To solve the above technical problems, the present application also provides a computer device. Fig.10 , Fig.10 This is a basic structural block diagram of the computer device in this embodiment.
[0150] The computer device 7 includes a memory 71, a processor 72, and a network interface 73 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 7 with components 71-73, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0151] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0152] The memory 71 includes at least one type of readable storage medium, and the 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 memory 71 can be an internal storage unit of the computer device 7, such as a hard disk or memory of the computer device 7. In other embodiments, the memory 71 can also be an external storage device of the computer device 7, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 7. Of course, the memory 71 can also include both the internal storage unit of the computer device 7 and its external storage device. In this embodiment, the memory 71 is generally used to store the operating system and various application software installed on the computer device 7, such as computer-readable instructions of the layout information generation method, etc. In addition, the memory 71 can also be used to temporarily store various types of data that have been output or are to be output.
[0153] The processor 72 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 72 is generally used to control the overall operation of the computer device 7. In this embodiment, the processor 72 is used to run computer-readable instructions stored in the memory 71 or process data, such as computer-readable instructions for running the layout information generation method.
[0154] The network interface 73 may include a wireless network interface or a wired network interface. The network interface 73 is generally used to establish a communication connection between the computer device 7 and other electronic devices.
[0155] By using the above-mentioned computer device, this embodiment can obtain financial information data, parse the financial information data to obtain financial time series data and financial text information data; extract features from the financial time series data and the financial text information data to obtain financial time features and financial sentiment features; perform feature representation transformation on the financial time features and the financial sentiment features based on the graph attention network to obtain fused feature representation; merge the financial time features and the financial sentiment features into the fused feature representation to obtain financial information features; normalize the financial information features to obtain financial effective features, and input the financial effective features into the pre-trained fraud probability prediction model to obtain fraud probability results. This effectively achieves accurate acquisition of fraud probability results of financial information data, so as to identify whether the financial information data is fraud information and improve the reliability of information acquisition.
[0156] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the layout information generation method as described above.
[0157] By adopting the above-mentioned computer-readable storage medium, this embodiment can obtain financial information data, parse the financial information data to obtain financial time series data and financial text information data; extract features from the financial time series data and the financial text information data to obtain financial time features and financial sentiment features; perform feature representation transformation on the financial time features and the financial sentiment features based on the graph attention network to obtain fused feature representation; merge the financial time features and the financial sentiment features into the fused feature representation to obtain financial information features; normalize the financial information features to obtain financial effective features, and input the financial effective features into the pre-trained fraud probability prediction model to obtain fraud probability results. This effectively achieves accurate acquisition of fraud probability results of financial information data, so as to identify whether the financial information data is fraud information and improve the reliability of information acquisition.
[0158] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0159] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
[0160] The non-Company software tools or components appearing in the embodiments of this application are merely examples and do not represent actual use.
Claims
1. A layout information generation method, characterized in that: The steps include: Acquire layout element information, perform similarity and distance calculation on the layout element information, and obtain layout element similarity and layout element distance; Constructing a layout element relationship graph according to the layout element similarities and the layout element distances; Extracting semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors; Performing cluster analysis based on the layout representation vector to obtain layout function modules and layout theme areas; Layout diffusion is performed based on the layout function module and the layout subject area to generate effective layout information.
2. The layout information generation method according to claim 1, characterized in that: The step of acquiring layout element information, calculating similarity and distance of the layout element information, and obtaining layout element similarity and layout element distance specifically includes: Extracting the layout element information from a database; Performing feature extraction and vectorization processing on the layout element information to obtain a layout element feature vector; Calculating the cosine similarity of the layout element feature vectors to obtain the layout element similarity; The element distance is calculated according to the central coordinates of the layout element information to obtain the layout element distance.
3. The layout information generating method according to claim 1, characterized in that: The step of constructing a layout element relationship graph according to the layout element similarities and the layout element distances specifically includes: Establishing connection edges between layout elements according to the layout element similarity and the layout element distance; Obtaining a preset weight calculation rule, and calculating the connection edge weight according to the weight calculation rule, the layout element similarity, and the layout element distance; A graph is constructed according to the layout elements, the connection edges, and the connection edge weights to obtain the layout element relationship graph.
4. The layout information generation method according to claim 1, characterized in that: The step of extracting semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors specifically includes: Inputting the layout element relationship graph into the graph convolution layer to perform graph convolution operation to obtain element representation features; The graph convolutional layers are stacked to extract high-level semantic features from the element representation features to obtain the layout element representation vector.
5. The layout information generation method according to claim 1, characterized in that: The step of performing cluster analysis according to the layout element representation vector to obtain the layout function module and the layout theme area specifically includes: Calculating the distance of the representation vectors of the layout elements to obtain the representation vector distance, and constructing a similarity matrix according to the representation vector distance; Obtaining a preset density threshold and a minimum number of included points, clustering the similarity matrix according to a preset clustering algorithm, the preset density threshold, and the minimum number of included points, to obtain the layout function module; Acquire the element position coordinates of the layout function module, and calculate the layout attributes corresponding to the layout function module according to the element position coordinates; The spatial adjacency relationship between the layout function modules is determined according to the layout attributes, and the adjacent layout function modules are merged into the layout theme area.
6. The layout information generation method according to claim 1, characterized in that: The step of performing layout diffusion based on the layout function module and the layout theme area to generate effective layout information specifically includes: Performing structural feature analysis on the layout function module and the layout theme area to obtain layout structural feature information; Clustering layout elements according to the layout structure characteristic information to obtain a layout template; The layout template is input into a preset discrete diffusion model for layout diffusion to obtain the effective layout information.
7. The layout information generation method according to claim 6, characterized in that: The step of inputting the layout template into a preset discrete diffusion model for layout diffusion to obtain the effective layout information specifically includes: Obtaining category attribute information and geometric attribute information corresponding to the layout template; Performing forward transfer destruction on the category attribute information and the geometric attribute information to obtain changed category attribute information and changed geometric attribute information; adding uniformly distributed noise to the change category attribute information to obtain category diffusion information; Adding discrete Gaussian noise to the changed geometric attribute information to obtain geometric diffusion information; The category diffusion information and the geometric diffusion information are reversely generated to obtain the effective layout information.
8. A layout information generating device, characterized in that: include: An information calculation module, used to obtain layout element information, perform similarity and distance calculation on the layout element information, and obtain layout element similarity and layout element distance; A relationship building module, used for building a layout element relationship graph according to the layout element similarity and the layout element distance; A vector extraction module, used to extract semantic representation vectors from the layout element relationship graph to obtain layout element representation vectors; A cluster analysis module, used for performing cluster analysis according to the layout representation vector to obtain layout function modules and layout theme areas; The layout diffusion module is used to perform layout diffusion based on the layout function module and the layout theme area to generate effective layout information.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the layout information generating method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the layout information generating method according to any one of claims 1 to 7 are implemented.