Component clustering method and apparatus

By employing a multi-dimensional component clustering method, including clustering of structure, layout, outline, and style information, the problem of low accuracy and efficiency of manual component annotation in existing technologies is solved, achieving efficient and accurate component classification and facilitating component reuse.

CN116738256BActive Publication Date: 2025-12-16BEIJING KANYUN SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310699943.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-13
Publication Date
2025-12-16
Estimated Expiration
2043-06-13

AI Technical Summary

Technical Problem

In existing technologies, the accuracy and efficiency of manual labeling and classification of components are low, making it difficult to achieve efficient and accurate component classification and reuse.

Method used

By clustering components from multiple dimensions, including structure, layout, outline, and style information, the element structure, layout, outline, and style information of the initial components are determined respectively, and the target component set is formed by progressively clustering based on this information.

Benefits of technology

This improves the accuracy and efficiency of component clustering, ensuring that downstream businesses can use more accurate component sets and facilitate component reuse.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116738256B_ABST
    Figure CN116738256B_ABST
Patent Text Reader

Abstract

The specification provides a component clustering method and device, wherein the component clustering method comprises: determining element structure information of initial components in an initial component set, and performing structure clustering on the initial components in the initial component set according to the element structure information to obtain a structure component set; determining element layout information of structure components in the structure component set, and performing layout clustering on the structure components in the structure component set according to the element layout information to obtain a layout component set; determining component contour information of layout components in the layout component set, and performing contour clustering on the layout components in the layout component set according to the component contour information to obtain a contour component set; determining element style information of contour components in the contour component set, and performing style clustering on the contour components in the contour component set according to the element style information to obtain a target component set.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of data processing, and particularly relates to a component clustering method and device. BACKGROUND

[0002] With the development of computer technology, design software emerges as the times require. With various design software, designers can support the drawing of different pages, provide more standardized and clearer pages for users, and store a large number of different page components to facilitate the reuse of components when other users draw. In the prior art, in order to facilitate users to reuse the designed components, most of the components to be stored are classified, but this operation generally needs to be completed by using a manual labeling method, that is, the type of each component is manually labeled, and then the labeled results are written in different positions to realize the classification of the components, which is more convenient for reuse, but the manual classification has low accuracy and efficiency. Therefore, an effective scheme is needed to solve the above problems. SUMMARY

[0003] Therefore, the embodiment of the present specification provides a component clustering method. The present specification also relates to a component clustering device, a computing device, and a computer readable storage medium to solve the technical defects in the prior art.

[0004] According to a first aspect of the embodiment of the present specification, a component clustering method is provided, comprising:

[0005] determining element structure information of an initial component in an initial component set, and performing structure clustering on the initial component in the initial component set according to the element structure information, to obtain a structure component set;

[0006] determining element layout information of a structure component in the structure component set, and performing layout clustering on the structure component in the structure component set according to the element layout information, to obtain a layout component set;

[0007] determining component contour information of a layout component in the layout component set, and performing contour clustering on the layout component in the layout component set according to the component contour information, to obtain a contour component set;

[0008] determining element style information of a contour component in the contour component set, and performing style clustering on the contour component in the contour component set according to the element style information, to obtain a target component set.

[0009] According to a second aspect of the embodiment of the present specification, a component clustering device is provided, comprising:

[0010] The structure clustering module is configured to determine element structure information of the initial components in the initial component set, and perform structure clustering on the initial components in the initial component set according to the element structure information, to obtain a structure component set.

[0011] The layout clustering module is configured to determine element layout information of the structure components in the structure component set, and perform layout clustering on the structure components in the structure component set according to the element layout information, to obtain a layout component set.

[0012] The contour clustering module is configured to determine component contour information of the layout components in the layout component set, and perform contour clustering on the layout components in the layout component set according to the component contour information, to obtain a contour component set.

[0013] The style clustering module is configured to determine element style information of the contour components in the contour component set, and perform style clustering on the contour components in the contour component set according to the element style information, to obtain a target component set.

[0014] According to a third aspect of an embodiment of the present specification, a computing device is provided, comprising:

[0015] a memory and a processor;

[0016] The memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions to implement the steps of the component clustering method.

[0017] According to a fourth aspect of an embodiment of the present specification, a computer readable storage medium is provided, which stores computer executable instructions, and the instructions are executed by a processor to implement the steps of the component clustering method.

[0018] The component clustering method provided in this embodiment, in order to improve clustering efficiency while ensuring clustering accuracy, can perform clustering processing from multiple dimensions. Specifically, it can first determine the element structure information of the initial components in the initial component set, and then perform structural clustering of the initial components in the initial component set based on the element structure information of each initial component, thus completing the clustering processing at the component structure dimension and obtaining a set of structural components. Secondly, it can determine the element layout information of the structural components in the set of structural components, and then perform layout clustering of the structural components in the set based on the element layout information of each structural component, thus completing further clustering at the component layout dimension and obtaining a set of layout components. Thirdly, it can determine the layout... The component outline information of the layout components in the component set is used to perform outline clustering on the layout components in the layout component set based on the outline information of each layout component. This achieves further clustering processing at the component outline dimension, thereby obtaining an outline component set. Finally, the element style information of the outline components in the outline component set can be determined, and the outline components in the outline component set can be clustered based on the element style information of each outline component. This achieves the final clustering processing at the component style dimension, thereby obtaining the target component set by performing clustering processing according to multiple dimensions. This can ensure the accuracy of component clustering while improving clustering efficiency, so that downstream businesses can use a more accurate target component set. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of a component clustering method provided in one embodiment of this specification;

[0020] Figure 2 This is a flowchart of a component clustering method provided in one embodiment of this specification;

[0021] Figure 3 This is a schematic diagram of components in a component clustering method provided in one embodiment of this specification;

[0022] Figure 4 This is a flowchart illustrating a component clustering method provided in one embodiment of this specification.

[0023] Figure 5 This is a schematic diagram of the structure of a component clustering device provided in one embodiment of this specification;

[0024] Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0025] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. However, the present description can be practiced without the specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to obscure the present description. The present description can be practiced with the specific details presented.

[0026] The terminology used in one or more embodiments of the present description is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the present description. As used in one or more embodiments of the present description and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in one or more embodiments of the present description, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0027] It will be understood that, although the terms first, second, etc. can be used herein to describe various information, these terms are not intended to denote a temporal sequence, but are used only to distinguish one piece of information from another. For example, without departing from the scope of one or more embodiments of the present description, first can be termed second; likewise, second can be termed first. Depending on the context, the word "if' as used herein can be interpreted to mean "when" or "in response to determining." In the present description, a component clustering method is provided, and the present description relates to a component clustering apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0028] In the present description, a component clustering method is provided, and the present description relates to a component clustering apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0029] Referring to Figure 1As shown in the schematic diagram, the component clustering method provided in this embodiment can realize clustering processing from multiple dimensions to improve clustering efficiency while ensuring clustering accuracy. That is, the element structure information of the initial components in the initial component set can be determined first, and the initial components in the initial component set are clustered according to the element structure information of each initial component to complete clustering processing in the component structure dimension, thereby obtaining a structure component set. Secondly, the element layout information of the structure components in the structure component set can be determined, and the structure components in the structure component set are clustered according to the element layout information of each structure component to complete further clustering in the component layout dimension, thereby obtaining a layout component set. Thirdly, the component contour information of the layout components in the layout component set can be determined, and the layout components in the layout component set are clustered according to the component contour information of each layout component to complete further clustering processing in the component contour dimension, thereby obtaining a contour component set. Finally, the element style information of the contour components in the contour component set can be determined, and the contour components in the contour component set are clustered according to the element style information of each contour component to complete final clustering processing in the component style dimension, thereby realizing the mode of sequentially clustering processing according to multiple dimensions to obtain a target component set. The component clustering accuracy can be ensured while improving the clustering efficiency, so that the downstream business can use a more accurate target component set.

[0030] Figure 2 A flowchart of a component clustering method according to an embodiment of the present specification is shown, which specifically includes the following steps:

[0031] In step S202, the element structure information of the initial components in the initial component set is determined, and the initial components in the initial component set are clustered according to the element structure information to obtain a structure component set.

[0032] The component clustering method provided in this embodiment is used to realize clustering processing on the components to be classified, so that the components meeting the classification requirements can be obtained according to the clustering results, to facilitate the downstream business to use, such as warehousing processing of components according to the classification results, to facilitate the selection of associated components according to the type in the reuse stage.

[0033] Specifically, the initial component set specifically refers to a set composed of multiple initial components that have not been classified, wherein the initial component specifically refers to a component composed of at least one component element having a cooperative use relationship, and the component element includes but is not limited to a text box, a rectangular box, a set shape box, etc. The component composed of at least one component element can be a planar figure such as a rectangle, a triangle, a circle, a trapezoid, a rounded rectangle, etc., which is not limited in this embodiment.

[0034] Further, the element structure information specifically refers to information composed of structure information corresponding to component elements included in the initial component. Since the initial component is composed of component elements, the structure similarity between components and components can be reflected through the element structure information, and clustering in the component structure dimension is realized. Correspondingly, the structure component set specifically refers to a component set obtained after clustering in the component structure dimension of the initial component included in the initial component set. The component structure included in the set is similar or identical.

[0035] Based on this, in order to realize clustering of components included in the initial component set from multiple dimensions, the clustering processing can be realized from the component structure dimension first. On this basis, the element structure information of the initial component in the initial component set can be determined first, the structure clustering of the initial component in the initial component set is realized according to the element structure information, the clustering processing is realized according to the structure relationship in the component, and the structure component set is obtained, so as to facilitate subsequent clustering processing in other dimensions.

[0036] Further, in order to accurately cluster the initial component included in the initial component set through the element structure information, the determination of the element structure information can be realized in the following manner; in this embodiment, the determination of the element structure information of any initial component in the initial component set includes:

[0037] extracting the initial component element included in the initial component and determining the element type of the initial component element; in the case where the element type is a text box type, selecting the word unit structure information and the text box structure information corresponding to the initial component element as the first element structure information; in the case where the element type is a rectangular box type, selecting the display structure information and the rectangular box structure information corresponding to the initial component element as the second element structure information; generating the element structure information of the initial component according to the first element structure information and / or the second element structure information corresponding to the initial component element.

[0038] Specifically, the initial component element specifically refers to a component element contained in the initial component, which includes but is not limited to a text box, a rectangular box, or a set shape box, etc. Correspondingly, the element type is the type corresponding to the initial component element, and different types will generate element structure information combined with different information; correspondingly, the word unit structure information specifically refers to the structure description information corresponding to the word unit in the text box component element, such as word unit font size, stroke thickness, etc.; correspondingly, the text box structure information specifically refers to the structure description information corresponding to the text box component element, such as the length and width dimensions of the text box, etc. Correspondingly, the display structure information specifically refers to the display dimension structure description information corresponding to the rectangular box component element, such as the background color of the rectangular box, etc. Correspondingly, the rectangular box structure information specifically refers to the structure dimension structure description information corresponding to the rectangular box component element, such as the size and shape of the rectangular box.

[0039] Based on this, in order to improve the clustering accuracy of the component structure dimension, it is necessary to accurately determine the element structure information of each initial component. In this process, the initial component elements contained in the initial component can be extracted first, and the element type of the initial component element can be determined. In the case of text box type, the initial component element is a text box component element, and the word unit structure information and the text box structure information corresponding to the initial component element can be selected as the first element structure information. In the case of rectangular box type, the initial component element is a rectangular box component element, and the display structure information and the rectangular box structure information corresponding to the initial component element can be selected as the second element structure information. On this basis, considering that the initial component may contain multiple initial component elements, and each initial component element may belong to different types, the element structure information of the initial component can be generated according to the first element structure information and / or the second element structure information corresponding to the initial component element, so that the clustering can be completed by comprehensively considering the structure information of multiple elements during clustering, and the clustering accuracy of the component structure dimension is ensured.

[0040] In summary, by constructing the element structure information of the initial component according to the element structure information of different types of initial component elements, it can be ensured that the determined element structure information can fully reflect the structure of the initial component, so that the structure clustering processing of the component can be accurately performed in the component structure dimension.

[0041] Further, when the initial component is clustered in the structure by using the element structure information, the initial components with high similarity are actually selected as a class by calculating the structure similarity, so that the structure clustering processing is completed in the component structure dimension. In this embodiment, the specific implementation is as follows:

[0042] According to the element structure information, structure similarity between initial components in the initial component set is calculated, and the initial components in the initial component set are structurally clustered according to the structure similarity calculation result, to obtain a structure component set.

[0043] Specifically, the structure similarity specifically refers to a score of calculating the structure similarity degree between any two initial components according to the element structure information. The higher the structure similarity is, the higher the similarity degree between the initial components is. When structure clustering is performed according to the structure similarity, it can be understood that the structure similarity is compared with a threshold value, and the initial components greater than the threshold value are considered as structurally similar components, thereby forming the structure component set.

[0044] Based on this, after the element structure information corresponding to the initial component is determined, the structure similarity between the initial components in the initial component set can be calculated according to the element structure information, the initial components in the initial component set are structurally clustered according to the structure similarity calculation result, and the structure component set is obtained.

[0045] Further, when the structure similarity is calculated, in order to improve the similarity calculation accuracy in the component structure dimension, the structure information of the component elements in the component can be combined to complete the calculation. In this embodiment, the calculation of the structure similarity between any two initial components in the initial component set includes:

[0046] determining a target initial component and target element structure information of the target initial component, and an associated initial component and associated element structure information of the associated initial component; extracting a target initial component element in the target initial component and an associated initial component element in the associated initial component; calculating element structure similarity between the target initial component element and the associated initial component element according to the target element structure information and the associated element structure information; weighting the element structure similarity according to area information corresponding to the target initial component element and the associated initial component element, to obtain target element structure similarity; and determining structure similarity between the target initial component and the associated initial component according to the target element structure similarity.

[0047] Specifically, the element structure similarity specifically refers to a score of the similarity degree between the target initial component element and the associated initial component element in the component structure dimension. It should be noted that, considering that different components may include different numbers of component elements, when calculating the element structure similarity, similarity calculation needs to be performed for any two component elements, so as to ensure the accuracy of the structure similarity. Correspondingly, the area information specifically refers to information of the area of the component occupied by the component element, which is used to weight the element structure similarity to obtain the target element structure similarity.

[0048] Based on this, when calculating the structural similarity between the initial components, the target initial component and the target element structure information of the target initial component, and the associated initial component and the associated element structure information of the associated initial component can be determined first. In order to ensure the calculation accuracy, the target initial component element can be extracted in the target initial component, and the associated initial component element can be extracted in the associated initial component. Then, the element structure similarity between the target initial component element and the associated initial component element can be calculated according to the target element structure information and the associated element structure information. In order to calculate the structural similarity in the component structure dimension more accurately, the element structure similarity can be weighted according to the area information corresponding to the target initial component element and the associated initial component element respectively to obtain the target element structure similarity. Finally, the structural similarity between the target initial component and the associated initial component can be determined according to the target element structure similarity.

[0049] In practical applications, when the structural similarity is determined according to the target element structure similarity, a similarity matrix can be constructed according to the target element structure similarity, and then the maximum matching of the bipartite graph is performed on the similarity matrix, so that the structural similarity between the target initial component and the associated initial component is generated according to the matching score after normalization, and the subsequent structural clustering can be completed according to the structural similarity between the initial components.

[0050] For example, the initial component set contains a (a is a positive integer greater than 1) initial component, such as Figure 3 As shown in (a), it is determined that the initial component a1 contains the image frame 1, the text box 1 and the text box 2; the initial component a2 contains the image frame 2, the text box 3……; At this time, it can be determined that the image frame 1 size of the initial component a1, the text box 1 contains the font size, the thickness, the text box 2 contains the font size, the thickness; the image frame 2 size of the initial component a2, the text box 3 contains the font size, the thickness……; Further, the similarity between the component elements in the two initial components can be calculated in combination with the above information, and after the similarity between the component elements in the two initial components is calculated, the area of the element can be used to weight the similarity, and the target similarity between the component elements in the two initial components can be obtained according to the weighted structure, such as the similarity between the component elements in the initial component a1 and the initial component a2. After the similarity calculation is completed, the following table (1) of the similarity matrix will be obtained: (1)

[0052] similarity matrix image frame 2 text frame 3 image frame 1 1 0 text frame 1 0 0.3 text frame 2 0 0.5

[0053] Further, after obtaining the similarity matrix between the component elements in any two initial components, bipartite graph maximum matching can be performed on the similarity matrix to realize normalization of the matching score as the structural similarity between any two initial components; thereafter, by comparing the structural similarity between any two initial components with a threshold, initial components greater than the threshold can be screened out to form a structural component set for subsequent clustering processing.

[0054] In summary, by calculating the structural similarity from the component elements, the accuracy of the structural similarity calculation can be ensured, and the structural similarity between components can be reflected by the structural similarity of all elements. Therefore, accurate structural clustering processing can be realized in the component structure dimension.

[0055] In step S204, the element layout information of the structural components in the structural component set is determined, and the structural components in the structural component set are layout clustered according to the element layout information to obtain a layout component set.

[0056] Specifically, after the above clustering processing in the component structure dimension, further secondary clustering processing can be performed in the component layout dimension. In the layout clustering processing, in order to cluster components with similar layouts together, the element layout information of the structural components in the structural component set can be determined first, and then the structural components in the structural component set are layout clustered according to the element layout information of each structural component to obtain a layout component set.

[0057] The element layout information specifically refers to information composed of the layout information corresponding to the component elements included in the structural component. Since the structural component is composed of component elements, the layout similarity between components can be reflected by the element layout information, and clustering in the component layout dimension can be realized. Correspondingly, the layout component set specifically refers to a component set obtained by clustering the structural components included in the structural component set in the component layout dimension. The components included in the set are similar or identical in structure and layout.

[0058] Further, in order to accurately layout cluster the structural components included in the structural component set by the element layout information, the determination of the element layout information can be realized in the following manner: in this embodiment, the determination of the element layout information of any one of the structural components in the structural component set includes:

[0059] The structural component elements included in the structural component are extracted, and the structural component attribute information of the structural component and the structural component element attribute information of the structural component elements are determined; the relative position information of the structural component elements relative to the structural component is determined according to the structural component element attribute information and the structural component attribute information; and the relative position information is taken as the element layout information of the structural component.

[0060] Specifically, the structural component element specifically refers to the component element included in the structural component, and correspondingly, the structural component attribute information specifically refers to the description information of the corresponding attribute of the structural component, including but not limited to the length, width, etc. of the structural component. Correspondingly, the structural component element attribute information specifically refers to the description information of the attribute of the structural component element, including but not limited to the length, width, etc. of the structural component element. Correspondingly, the relative position information specifically refers to the relative position of the structural component element relative to the structural component calculated according to the structural component attribute and the structural component element attribute information.

[0061] Based on this, in order to improve the clustering accuracy of the component layout dimension, it is necessary to accurately determine the element layout information of each structural component. In this process, the structural component elements included in the structural component can be extracted first, and the structural component attribute information of the structural component and the structural component element attribute information of the structural component elements are determined. On this basis, the relative position information of the structural component elements relative to the structural component can be determined according to the structural component element attribute information and the structural component attribute information. The relative position information is taken as the element layout information of the structural component, and the clustering accuracy of the component layout dimension is ensured.

[0062] In summary, by using the relative position information to determine the element layout information, it can be ensured that the determined element layout information can fully reflect the layout of the structural component, so as to realize the layout clustering processing of the component in the component layout dimension.

[0063] Further, when the structural component is clustered by using the element layout information, the structural components with high similarity are actually selected as a class by calculating the layout similarity, so as to realize the layout clustering processing from the component layout dimension. In this embodiment, the specific implementation is as follows:

[0064] According to the element layout information, the layout similarity between the structural components in the structural component set is calculated, the structural components in the structural component set are clustered according to the layout similarity calculation result, and a layout component set is obtained.

[0065] Specifically, the layout similarity specifically refers to a score of calculating the layout similarity degree between any two structural components according to the element layout information. The higher the layout similarity is, the higher the similarity degree between the structural components is. When performing layout clustering according to the layout similarity, it can be understood that the layout similarity is compared with a threshold value, and the structural components greater than the threshold value are considered as layout similar components, thereby forming a layout component set.

[0066] Based on this, after determining the element layout information corresponding to the structural components, the layout similarity between the structural components in the structural component set can be calculated according to the element layout information, the structural components in the structural component set are layout clustered according to the layout similarity calculation result, and thereby the layout component set is obtained.

[0067] Further, when performing layout similarity calculation, in order to improve the similarity calculation accuracy in the component layout dimension, the layout information of the component elements in the component can be combined to complete the calculation. In this embodiment, the calculation of the layout similarity between any two structural components in the structural component set includes:

[0068] determining a target structural component and target element layout information of the target structural component, and an associated structural component and associated element layout information of the associated structural component; extracting a target structural component element in the target structural component and an associated structural component element in the associated structural component; calculating the element layout similarity between the target structural component element and the associated structural component element according to the target element layout information and the associated element layout information; and determining the layout similarity between the target structural component and the associated structural component according to the element layout similarity.

[0069] Specifically, the element layout similarity specifically refers to a score of the similarity degree in the component layout dimension between the target structural component element and the associated structural component element. It should be noted that, considering that different components may contain different numbers of component elements, therefore, when calculating the element layout similarity, similarity calculation needs to be performed for any two component elements, thereby ensuring the accuracy of the layout similarity.

[0070] Based on this, when calculating the layout similarity, the target structure component and the target element layout information of the target structure component, and the associated structure component and the associated element layout information of the associated structure component can be determined. Then, the target structure component element can be extracted in the target structure component, and the associated structure component element can be extracted in the associated structure component. On this basis, the element layout similarity between the target structure component element and the associated structure component element can be calculated according to the target element layout information and the associated element layout information. After obtaining the element layout similarity, element mapping can be realized from the element to the component, so as to determine the layout similarity between the target structure component and the associated structure component according to the element layout similarity.

[0071] In actual application, when the layout similarity is determined according to the element layout similarity, a similarity matrix can be constructed according to the element layout similarity, and then the maximum matching of the bipartite graph is performed on the similarity matrix, so as to generate the layout similarity between the target structure component and the associated structure component according to the matching score after normalization, and the layout clustering can be completed according to the layout similarity between the structure components.

[0072] In the above example, after obtaining the structure component set composed of structure components with the same structure, the relative position similarity of each element in the component can be calculated, such as that the b11 component element is at 20% in the b1 component, 20% up, 40% high and 30% wide of the component. The b22 component element is at 18% in the b2 component, 20% up, 40% high and 28% wide of the component. At this time, the similarity between the b11 component element and the b22 component element can be calculated according to the relative position, and in the calculation process, the similarity can be set to 0 when the number of elements of each two components is different, and the maximum matching of the bipartite graph is performed on the similarity calculation result when the number of elements is the same, so as to obtain the layout similarity between any two structure components. Then, by comparing the layout similarity between any two structure components with a threshold value, the structure component set composed of the structure components greater than the threshold value can be screened out for subsequent clustering processing.

[0073] In step S206, the component contour information of the layout components in the layout component set is determined, and the layout components in the layout component set are clustered according to the component contour information to obtain a contour component set.

[0074] Specifically, after the clustering processing of the component layout dimension is completed, further clustering can be performed from the component contour dimension. In the contour clustering processing, in order to cluster the components with similar contours together, the component contour information of the layout components in the layout component set can be determined first, and then the layout components in the layout component set are clustered according to the component contour information corresponding to each layout component to obtain a contour component set.

[0075] The component contour information specifically refers to information corresponding to the outer contour of the layout component. Correspondingly, the contour component set specifically refers to a component set obtained after clustering the layout components contained in the layout component set in the component contour dimension. The components contained in the set are similar or identical in component structure, component layout, and component contour.

[0076] Further, in order to accurately cluster the layout components contained in the layout component set through the component contour information, the determination of the component contour information can be implemented in the following manner: In this embodiment, the determination of the component contour information of any one of the layout components in the layout component set comprises:

[0077] determining the layout component size information and the layout component border information of the layout component; and generating the component contour information of the layout component according to the layout component size information and the layout component border information.

[0078] Specifically, the layout component size information specifically refers to information such as the length, width, and the like of the layout component. Correspondingly, the layout component border information specifically refers to related information such as the border type and the corner radius of the layout component border. Based on this, in order to improve the clustering accuracy of the component contour dimension, the component contour information needs to be accurately determined. Therefore, the layout component size information and the layout component border information of the layout component can be determined; and the component contour information of the layout component can be generated according to the layout component size information and the layout component border information.

[0079] In summary, the determination of the contour information is completed by combining the component size and the component border, which can ensure that the determined component contour information can fully reflect the contour of the layout component, thereby realizing accurate contour clustering of the components in the component contour dimension.

[0080] Further, when the layout components are clustered in the contour dimension by using the component contour information, the layout components with high similarity are actually selected as a class by calculating the contour similarity, thereby realizing the contour clustering in the component contour dimension. In this embodiment, the specific implementation manner is as follows:

[0081] calculating the contour similarity between the layout components in the layout component set according to the component contour information; clustering the layout components in the layout component set in the contour dimension according to the contour similarity calculation result; and obtaining a contour component set.

[0082] Specifically, the contour similarity specifically refers to a score of calculating the contour similarity between any two layout components according to the component contour information. The higher the contour similarity is, the higher the similarity between the layout components is. When performing contour clustering according to the contour similarity, it can be understood that the contour similarity is compared with a threshold value, and the layout components greater than the threshold value are considered as contour similar components, thereby forming a contour component set.

[0083] Based on this, when constructing the contour component set, the contour similarity between the layout components in the layout component set can be calculated according to the component contour information, so as to realize contour clustering of the layout components in the layout component set according to the contour similarity calculation result, thereby obtaining the contour component set.

[0084] Further, when performing contour similarity calculation, in order to improve the similarity calculation accuracy in the component contour dimension, the contour information of the components can be combined. In this embodiment, the calculation of the contour similarity between any two layout components in the layout component set includes:

[0085] determining the target component contour information of the target layout component and the associated component contour information of the associated layout component; calculating the component size similarity and the component frame similarity between the target layout component and the associated layout component according to the target component contour information and the associated component contour information; and determining the component contour similarity by comparing the component size similarity and the component frame similarity, and taking the component contour similarity as the contour similarity between the target layout component and the associated layout component.

[0086] Specifically, the component size similarity specifically refers to a score of the frame size similarity between the target layout component and the associated layout component. Correspondingly, the component frame similarity specifically refers to a score of the frame type similarity between the target layout component and the associated layout component.

[0087] Based on this, when performing contour similarity calculation, the target component contour information of the target layout component and the associated component contour information of the associated layout component can be determined. On this basis, the component size similarity and the component frame similarity between the target layout component and the associated layout component can be calculated according to the target component contour information and the associated component contour information. Different types of similarity will reflect the contour similarity between the components, and a smaller value can reflect the real similarity. Therefore, the component contour similarity can be determined by comparing the component size similarity and the component frame similarity, and taken as the contour similarity between the target layout component and the associated layout component.

[0088] As used in the above example, after obtaining the layout component set composed of layout components with the same structure and layout, the width similarity and the corner similarity of two components can be calculated, such as the width of the layout component c1 is w1, the width of the layout component c2 is w2, and the corners of the two layout components are as shown in Figure 3 As shown in (b), the width similarity between the layout component c1 and the layout component c2 can be calculated first, and then the corner similarity between the two is calculated. Thereafter, the width similarity and the corner similarity are compared, and the smaller value is selected as the contour similarity of the layout component c1 and the layout component c2. Thereafter, by comparing the contour similarity between any two structural components with the threshold value, the layout components greater than the threshold value are screened out to form a contour component set for subsequent clustering processing.

[0089] In step S208, the element style information of the contour components in the contour component set is determined, and the contour components in the contour component set are style-clustered according to the element style information, to obtain a target component set.

[0090] Specifically, after the clustering processing of the component contour dimension is completed, further four times of clustering can be performed in the component style dimension. In the style clustering processing, in order to be able to cluster the components with similar styles together, the element style information of the contour components in the contour component set can be determined first, and then the contour components in the contour component set are style-clustered according to the element style information corresponding to each contour component, to obtain a target component set.

[0091] The element style information specifically refers to the information composed of the style information corresponding to the component elements included in the contour component. Since the contour component is composed of component elements, the style similarity between components can be reflected through the element style information, so that the clustering in the component style dimension can be realized. Correspondingly, the target component set specifically refers to the component set obtained after the contour components included in the contour component set are clustered in the component style dimension. The component structure, component layout, component contour, and component style included in the set are similar or identical.

[0092] Further, in order to be able to accurately style-cluster the contour components included in the contour component set through the element style information, the determination of the element style information can be realized in the following manner: in this embodiment, the determination of the element style information of any one contour component in the contour component set includes:

[0093] The extraction contour component element includes a contour component element, and the element type of the contour component element is determined; in the case that the element type is a text box type, the word unit style information and the text box style information corresponding to the contour component element are selected as the first element style information; in the case that the element type is a rectangular box type, the background style information corresponding to the contour component element is selected as the second element style information; and the element style information of the contour component is generated according to the first element style information and / or the second element style information corresponding to the contour component element.

[0094] Specifically, the word unit style information specifically refers to the font type information corresponding to the subunit recorded in the contour component element, such as Kai Ti, Song Ti, etc., and correspondingly, the text box style information specifically refers to the style information corresponding to the text box component element. The background style information specifically refers to the style information corresponding to the background of the rectangular box component element.

[0095] Therefore, in order to improve the clustering accuracy of the component style dimension, it is necessary to accurately determine the element style information of each contour component. In this process, the contour component element included in the contour component can be extracted first, and the element type of the contour component element is determined; in the case that the element type is a text box type, it is indicated that the contour component element is a text box component element, and then the word unit style information and the text box style information corresponding to the contour component element can be selected as the first element style information; in the case that the element type is a rectangular box type, it is indicated that the contour component element is a rectangular box component element, and then the background style information corresponding to the contour component element can be selected as the second element style information; on this basis, considering that the contour component may include multiple contour component elements, and each contour component element may belong to different types, the element style information of the contour component can be generated according to the first element style information and / or the second element style information corresponding to the contour component element. Therefore, the clustering can be completed by comprehensively considering the style information of multiple elements.

[0096] In summary, by constructing the element style information of the contour component according to the element style information of the contour component element of different types, it can be ensured that the determined element style information can fully reflect the style of the contour component, so as to realize the style clustering processing of the component from the component style dimension.

[0097] Further, when the contour component is clustered by using the element style information, the contour components with high similarity are selected as a class by calculating the style similarity, so as to realize the style clustering processing from the component style dimension. In this embodiment, the specific implementation manner is as follows:

[0098] According to the element style information, style similarity between the contour components in the contour component set is calculated, and the contour components in the contour component set are clustered according to the calculation result of the style similarity, to obtain the target component set.

[0099] Specifically, the style similarity specifically refers to a score of calculating the style similarity between any two contour components according to the element style information, and the higher the style similarity is, the higher the similarity between the contour components is. When clustering the style according to the style similarity, it can be understood that the style similarity is compared with a threshold value, and the contour components greater than the threshold value are considered as the similar components, so as to form the target component set.

[0100] Based on this, after determining the element style information corresponding to the contour components, the style similarity between the contour components in the contour component set can be calculated according to the element style information, the contour components in the contour component set are clustered according to the calculation result of the style similarity, and the target component set is obtained.

[0101] Furthermore, when calculating the style similarity, in order to improve the similarity calculation accuracy in the component style dimension, the style information of the component elements in the component can be combined; in the embodiment, the calculation of the style similarity between any two contour components in the contour component set includes:

[0102] determining target contour component and target element style information of the target contour component, and associated contour component and associated element style information of the associated contour component; extracting target contour component elements in the target contour component, and extracting associated contour component elements in the associated contour component; calculating at least two element style similarities between the target contour component elements and the associated contour component elements according to the target element style information and the associated element style information; selecting a target element style similarity in the at least two element style similarities, and determining the style similarity between the target contour component and the associated contour component according to the target element style similarity.

[0103] Specifically, the element style similarity specifically refers to a score of the similarity between the target contour component elements and the associated contour component elements in the component style dimension. It should be noted that, considering that different components may contain different numbers of component elements, when calculating the element style similarity, similarity calculation needs to be performed for any two component elements, so as to ensure the accuracy of the style similarity. Correspondingly, the target element style similarity specifically refers to the element style similarity selected from the at least two element style similarities.

[0104] Based on this, when calculating the style similarity, the target element style information of the target contour component and the target contour component, and the associated element style information of the associated contour component and the associated contour component can be determined; the target contour component element is extracted in the target contour component, and the associated contour component element is extracted in the associated contour component; on this basis, at least two element style similarities between the target contour component element and the associated contour component element can be calculated according to the target element style information and the associated element style information; then considering that the smaller element style similarity can better reflect the similarity between components, the target element style similarity can be selected from the at least two element style similarities, and the style similarity between the target contour component and the associated contour component is determined according to the target element style similarity.

[0105] In the above example, after obtaining the contour component set composed of contour components with the same structure, the same layout and the same contour, the style similarity of each element in the two components can be calculated, such as the background color of the component element d11 (rectangular frame) in the contour component d1 is black, the font of the component element d12 (text box) is Kai Ti, and the size is five; the background color of the component element d21 (rectangular frame) in the contour component d2 is white, the font of the component element d22 (text box) is Kai Ti, and the size is six; at this time, the background similarity between the component elements can be calculated first, then the font style similarity is calculated, and then the font size similarity is calculated; then the smaller value of the similarity is selected as the style similarity between the contour component d1 and the contour component d2, and thereafter, by comparing the style similarity between any two contour components with the threshold value, the contour components greater than the threshold value can be screened out to form a target component set, so as to facilitate the target component set to process related tasks in the downstream business.

[0106] The component clustering method provided by the embodiment can realize clustering processing from multiple dimensions to improve clustering efficiency while ensuring clustering accuracy. That is, the element structure information of the initial components in the initial component set can be determined first, and the initial components in the initial component set are clustered according to the element structure information of each initial component to complete clustering processing in the component structure dimension, thereby obtaining a structure component set. Secondly, the element layout information of the structure components in the structure component set can be determined, and the structure components in the structure component set are clustered according to the element layout information of each structure component to complete further clustering in the component layout dimension, thereby obtaining a layout component set. Thirdly, the component contour information of the layout components in the layout component set can be determined, and the layout components in the layout component set are clustered according to the component contour information of each layout component to complete more clustering processing in the component contour dimension, thereby obtaining a contour component set. Finally, the element style information of the contour components in the contour component set can be determined, and the contour components in the contour component set are clustered according to the element style information of each contour component to complete final clustering processing in the component style dimension, thereby realizing the mode of sequentially clustering processing according to multiple dimensions to obtain a target component set. The component clustering accuracy can be ensured while the clustering efficiency is improved, so that the downstream business can use a more accurate target component set.

[0107] The following description is made in conjunction with the accompanying drawings Figure 4 The component clustering method is further described by taking the application of the component clustering method provided by the present specification in the component clustering scene in the component design draft as an example. Among them, Figure 4 A processing flowchart of a component clustering method provided by an embodiment of the present specification is shown, which specifically includes the following steps:

[0108] In step S402, the element structure information of the initial components in the initial component set is determined, and the structure similarity between the initial components in the initial component set is calculated according to the element structure information.

[0109] In step S404, the initial components in the initial component set are clustered according to the structure similarity calculation result to obtain a structure component set.

[0110] Specifically, the determination of the element structure information of any one initial component in the initial component set comprises: extracting an initial component element contained in the initial component, and determining an element type of the initial component element; in a case where the element type is a text box type, selecting word unit structure information and text box structure information corresponding to the initial component element as first element structure information; in a case where the element type is a rectangular box type, selecting display structure information and rectangular box structure information corresponding to the initial component element as second element structure information; and generating the element structure information of the initial component according to the first element structure information and / or the second element structure information corresponding to the initial component element.

[0111] Further, the calculation of the structure similarity between any two initial components in the initial component set comprises: determining a target initial component and target element structure information of the target initial component, and an associated initial component and associated element structure information of the associated initial component; extracting a target initial component element in the target initial component and an associated initial component element in the associated initial component; calculating element structure similarity between the target initial component element and the associated initial component element according to the target element structure information and the associated element structure information; weighting the element structure similarity according to area information corresponding to the target initial component element and the associated initial component element respectively to obtain target element structure similarity; and determining the structure similarity between the target initial component and the associated initial component according to the target element structure similarity.

[0112] In step S406, element layout information of the structure components in the structure component set is determined, and layout similarity between the structure components in the structure component set is calculated according to the element layout information.

[0113] In step S408, the structure components in the structure component set are layout clustered according to the layout similarity calculation result, and a layout component set is obtained.

[0114] Specifically, the determination of the element layout information of any one structure component in the structure component set comprises: extracting a structure component element contained in the structure component, and determining structure component attribute information of the structure component and structure component element attribute information of the structure component element; determining relative position information of the structure component element relative to the structure component according to the structure component element attribute information and the structure component attribute information; and taking the relative position information as the element layout information of the structure component.

[0115] Further, the calculation of the layout similarity between any two structure components in the structure component set comprises: determining a target structure component and target element layout information of the target structure component, and an associated structure component and associated element layout information of the associated structure component; extracting a target structure component element from the target structure component and an associated structure component element from the associated structure component; calculating element layout similarity between the target structure component element and the associated structure component element according to the target element layout information and the associated element layout information; and determining the layout similarity between the target structure component and the associated structure component according to the element layout similarity.

[0116] In step S410, component contour information of the layout components in the layout component set is determined, and contour similarity between the layout components in the layout component set is calculated according to the component contour information.

[0117] In step S412, the layout components in the layout component set are clustered according to the contour similarity calculation result, to obtain a contour component set.

[0118] Specifically, the determination of the component contour information of any one of the layout components in the layout component set comprises: determining layout component size information and layout component border information of the layout component; and generating component contour information of the layout component according to the layout component size information and the layout component border information.

[0119] Further, the calculation of the contour similarity between any two layout components in the layout component set comprises: determining a target layout component and target component contour information of the target layout component, and an associated layout component and associated component contour information of the associated layout component; calculating component size similarity and component border similarity between the target layout component and the associated layout component according to the target component contour information and the associated component contour information; and determining component contour similarity by comparing the component size similarity and the component border similarity, and taking the component contour similarity as the contour similarity between the target layout component and the associated layout component.

[0120] In step S414, element style information of the contour components in the contour component set is determined, and style similarity between the contour components in the contour component set is calculated according to the element style information.

[0121] In step S416, the contour components in the contour component set are clustered according to the style similarity calculation result, to obtain a target component set.

[0122] Specifically, the determination of the element style information of any one of the profile components in the profile component set comprises: extracting a profile component element contained in the profile component, and determining an element type of the profile component element; in a case where the element type is a text box type, selecting word unit style information and text box style information corresponding to the profile component element as first element style information; in a case where the element type is a rectangular box type, selecting background style information corresponding to the profile component element as second element style information; and generating the element style information of the profile component according to the first element style information and / or the second element style information corresponding to the profile component element.

[0123] Further, the calculation of the style similarity between any two of the profile components in the profile component set comprises: determining target profile component and target element style information of the target profile component, and associated profile component and associated element style information of the associated profile component; extracting a target profile component element in the target profile component, and extracting an associated profile component element in the associated profile component; calculating at least two element style similarities between the target profile component element and the associated profile component element according to the target element style information and the associated element style information; selecting a target element style similarity in the at least two element style similarities, and determining the style similarity between the target profile component and the associated profile component according to the target element style similarity.

[0124] The component clustering method provided by the embodiment can realize clustering processing from multiple dimensions to improve clustering efficiency while ensuring clustering accuracy. That is, the element structure information of the initial components in the initial component set can be determined first, and the initial components in the initial component set are clustered according to the element structure information of each initial component to complete clustering processing in the component structure dimension, thereby obtaining a structure component set. Secondly, the element layout information of the structure components in the structure component set can be determined, and the structure components in the structure component set are clustered according to the element layout information of each structure component to complete further clustering in the component layout dimension, thereby obtaining a layout component set. Thirdly, the component contour information of the layout components in the layout component set can be determined, and the layout components in the layout component set are clustered according to the component contour information of each layout component to complete more further clustering processing in the component contour dimension, thereby obtaining a contour component set. Finally, the element style information of the contour components in the contour component set can be determined, and the contour components in the contour component set are clustered according to the element style information of each contour component to complete final clustering processing in the component style dimension, thereby realizing the mode of sequentially clustering processing according to multiple dimensions to obtain a target component set. The component clustering accuracy can be ensured while improving the clustering efficiency, so that the downstream business can use a more accurate target component set.

[0125] Corresponding to the method embodiments, the specification also provides component clustering device embodiments, Figure 5 A structural diagram of a component clustering device is shown. As shown in the figure, Figure 5 The device comprises:

[0126] The structure clustering module 502 is configured to determine the element structure information of the initial components in the initial component set, and cluster the initial components in the initial component set according to the element structure information to obtain a structure component set.

[0127] The layout clustering module 504 is configured to determine the element layout information of the structure components in the structure component set, and cluster the structure components in the structure component set according to the element layout information to obtain a layout component set.

[0128] The contour clustering module 506 is configured to determine the component contour information of the layout components in the layout component set, and cluster the layout components in the layout component set according to the component contour information to obtain a contour component set.

[0129] The style clustering module 508 is configured to determine element style information of the contour components in the contour component set, and perform style clustering on the contour components in the contour component set according to the element style information, to obtain a target component set.

[0130] In an optional embodiment, the determination of the element structure information of any initial component in the initial component set includes: extracting an initial component element contained in the initial component, and determining an element type of the initial component element; in a case where the element type is a text box type, selecting word unit structure information and text box structure information corresponding to the initial component element as first element structure information; in a case where the element type is a rectangular box type, selecting display structure information and rectangular box structure information corresponding to the initial component element as second element structure information; and generating the element structure information of the initial component according to the first element structure information and / or the second element structure information corresponding to the initial component element.

[0131] In an optional embodiment, the determination of the element layout information of any structure component in the structure component set includes: extracting a structure component element contained in the structure component, and determining structure component attribute information of the structure component and structure component element attribute information of the structure component element; determining relative position information of the structure component element relative to the structure component according to the structure component element attribute information and the structure component attribute information; and taking the relative position information as the element layout information of the structure component.

[0132] In an optional embodiment, the determination of the component contour information of any layout component in the layout component set includes: determining layout component size information and layout component border information of the layout component; and generating the component contour information of the layout component according to the layout component size information and the layout component border information.

[0133] In an optional embodiment, the determination of the element style information of any contour component in the contour component set includes: extracting a contour component element contained in the contour component, and determining an element type of the contour component element; in a case where the element type is a text box type, selecting word unit style information and text box style information corresponding to the contour component element as first element style information; in a case where the element type is a rectangular box type, selecting background style information corresponding to the contour component element as second element style information; and generating the element style information of the contour component according to the first element style information and / or the second element style information corresponding to the contour component element.

[0134] In an optional embodiment, the structure clustering module 502 is further configured to calculate structure similarity between initial components in the initial component set according to the element structure information, perform structure clustering on the initial components in the initial component set according to a result of the structure similarity calculation, and obtain a structure component set.

[0135] The layout clustering module 504 is further configured to calculate layout similarity between structure components in the structure component set according to the element layout information, perform layout clustering on the structure components in the structure component set according to a result of the layout similarity calculation, and obtain a layout component set.

[0136] The contour clustering module 506 is further configured to calculate contour similarity between layout components in the layout component set according to the component contour information, perform contour clustering on the layout components in the layout component set according to a result of the contour similarity calculation, and obtain a contour component set.

[0137] The style clustering module 508 is further configured to calculate style similarity between contour components in the contour component set according to the element style information, perform style clustering on the contour components in the contour component set according to a result of the style similarity calculation, and obtain a target component set.

[0138] In an optional embodiment, the calculation of the structure similarity between any two initial components in the initial component set includes: determining a target initial component and target element structure information of the target initial component, and an associated initial component and associated element structure information of the associated initial component; extracting a target initial component element from the target initial component and an associated initial component element from the associated initial component; calculating element structure similarity between the target initial component element and the associated initial component element according to the target element structure information and the associated element structure information; weighting the element structure similarity according to area information corresponding to the target initial component element and the associated initial component element respectively to obtain target element structure similarity; and determining the structure similarity between the target initial component and the associated initial component according to the target element structure similarity.

[0139] In an optional embodiment, the calculation of the layout similarity between any two structural components in the structural component set comprises: determining a target structural component and target element layout information of the target structural component, and an associated structural component and associated element layout information of the associated structural component; extracting target structural component elements in the target structural component and associated structural component elements in the associated structural component; calculating element layout similarity between the target structural component elements and the associated structural component elements according to the target element layout information and the associated element layout information; and determining the layout similarity between the target structural component and the associated structural component according to the element layout similarity.

[0140] In an optional embodiment, the calculation of the outline similarity between any two layout components in the layout component set comprises: determining a target layout component and target component outline information of the target layout component, and an associated layout component and associated component outline information of the associated layout component; calculating component size similarity and component frame similarity between the target layout component and the associated layout component according to the target component outline information and the associated component outline information; determining component outline similarity by comparing the component size similarity and the component frame similarity, and taking the component outline similarity as the outline similarity between the target layout component and the associated layout component.

[0141] In an optional embodiment, the calculation of the style similarity between any two outline components in the outline component set comprises:

[0142] determining a target outline component and target element style information of the target outline component, and an associated outline component and associated element style information of the associated outline component; extracting target outline component elements in the target outline component and associated outline component elements in the associated outline component; calculating at least two element style similarities between the target outline component elements and the associated outline component elements according to the target element style information and the associated element style information; selecting a target element style similarity in the at least two element style similarities, and determining the style similarity between the target outline component and the associated outline component according to the target element style similarity.

[0143] The component clustering device provided by the embodiment can realize clustering processing from multiple dimensions to improve clustering efficiency while ensuring clustering accuracy. That is, the element structure information of the initial components in the initial component set can be determined first, and the initial components in the initial component set are clustered according to the element structure information of each initial component to complete clustering processing in the component structure dimension, thereby obtaining a structure component set. Secondly, the element layout information of the structure components in the structure component set can be determined, and the structure components in the structure component set are clustered according to the element layout information of each structure component to complete further clustering in the component layout dimension, thereby obtaining a layout component set. Thirdly, the component contour information of the layout components in the layout component set can be determined, and the layout components in the layout component set are clustered according to the component contour information of each layout component to complete more clustering processing in the component contour dimension, thereby obtaining a contour component set. Finally, the element style information of the contour components in the contour component set can be determined, and the contour components in the contour component set are clustered according to the element style information of each contour component to complete final clustering processing in the component style dimension, thereby realizing the mode of sequentially clustering processing according to multiple dimensions to obtain a target component set. The component clustering precision can be ensured while the clustering efficiency is improved, so that the downstream business can use a more accurate target component set.

[0144] The above is a schematic scheme of the component clustering device of the embodiment. It should be noted that the technical scheme of the component clustering device belongs to the same concept as the technical scheme of the component clustering method described above, and the details of the technical scheme of the component clustering device that are not described in detail can be referred to the description of the technical scheme of the component clustering method.

[0145] Figure 6 A structural block diagram of a computing device 600 according to an embodiment of the present specification is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 through a bus 630, and a database 650 is used to save data.

[0146] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or combinations of such networks, such as the Internet. The access device 640 can include one or more of any type of network interface (for example, a network interface card (NIC)), such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, or the like.

[0147] In one embodiment of the present application, the above-described components of the computing device 600, as well as other components not shown in FIG. 6, can be connected to one another through the bus. As will be appreciated by one skilled in the art, the Figure 6 above-described components of the computing device 600, as well as other components not shown in FIG. 6, can be connected to one another through the bus. As will be appreciated by one skilled in the art, the Figure 6 structure of the computing device shown in FIG. 6 is merely an example, and that other configurations can be used to implement the present application. For example, other components not shown in FIG. 6 can be included, or some of the components shown in FIG. 6 can be omitted. For example, a keyboard, a mouse, or other input / output devices (not shown) can be included in the computing device 600.

[0148] The computing device 600 can be any type of stationary or mobile computing device including a mobile computer or mobile computing device (for example, a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, or the like), a mobile phone (for example, a smartphone), a wearable computing device (for example, a smart watch, smart glasses, or the like), or other type of mobile device, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 600 can also be a mobile or stationary server.

[0149] The processor 620 is configured to implement components clustering methods when executing the computer-executable instructions.

[0150] The above is a schematic scheme of the computing device of the embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the component clustering method described above belong to the same concept, and details of the technical scheme of the computing device that are not described in detail can be referred to the description of the technical scheme of the component clustering method.

[0151] An embodiment of the present specification also provides a computer readable storage medium storing computer instructions, which are executed by a processor to implement the component clustering method.

[0152] The above is a schematic scheme of the computer readable storage medium of the embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the component clustering method described above belong to the same concept, and details of the technical scheme of the storage medium that are not described in detail can be referred to the description of the technical scheme of the component clustering method.

[0153] The above describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which they are recited in the embodiments and still achieve desirable results. In addition, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order to achieve the desired results. In certain implementations, multitasking and parallel processing can be advantageous.

[0154] The computer instructions include computer program code, which can be in the form of source code, object code, executable code, or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer readable medium can be appropriately increased or decreased according to the requirements of patent practice, for example, in some regions, according to the patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.

[0155] It should be noted that for each of the above method embodiments, in order to facilitate description, they are all expressed as a combination of a series of acts, but those skilled in the art should know that the present specification is not limited by the order of the described acts, because according to the present specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the acts and modules involved are not necessarily all required by the present specification.

[0156] In the above-described embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0157] The preferred embodiments of the present specification disclosed above are only used to help explain the present specification. The alternative embodiments do not describe all the details and do not limit the present application to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the present specification. The present specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present specification, so that those skilled in the art can well understand and utilize the present specification. The present specification is limited only by the claims and their full scope and equivalents.

Claims

1. A component clustering method, characterized in that, include: Determine the element structure information of the initial components in the initial component set, and perform structural clustering on the initial components in the initial component set based on the element structure information to obtain a structural component set. The element structure information refers to the information composed of the structural information corresponding to the component elements contained in the initial component. The element structure information reflects the structural similarity between components, and clustering is performed in the component structure dimension. Determine the element layout information of the structural components in the set of structural components, and perform layout clustering on the structural components in the set of structural components based on the element layout information to obtain a set of layout components; Determine the component outline information of the layout components in the layout component set, and perform outline clustering on the layout components in the layout component set based on the component outline information to obtain an outline component set; Determine the element style information of the contour components in the contour component set, and perform style clustering on the contour components in the contour component set based on the element style information to obtain the target component set.

2. The method according to claim 1, characterized in that, Determining the element structure information of any initial component in the initial component set includes: Extract the initial component elements contained in the initial component, and determine the element type of the initial component elements; When the element type is a text box, select the character unit structure information and text box structure information corresponding to the initial component element as the first element structure information; When the element type is a rectangle, select the display structure information and rectangle structure information corresponding to the initial component element as the second element structure information; The element structure information of the initial component is generated based on the first element structure information and / or the second element structure information corresponding to the initial component element.

3. The method according to claim 1, characterized in that, Determining the element layout information of any structural component in the set of structural components includes: Extract the structural component elements contained in the structural component, and determine the structural component attribute information of the structural component and the structural component element attribute information of the structural component element; Based on the structural component element attribute information and the structural component attribute information, determine the relative position information of the structural component element relative to the structural component; The relative position information is used as the element layout information of the structural component.

4. The method according to claim 1, characterized in that, Determining the component outline information of any layout component in the set of layout components includes: Determine the layout component size information and layout component border information; Based on the layout component size information and the layout component border information, the component outline information of the layout component is generated.

5. The method according to claim 1, characterized in that, Determining the element style information of any contour component in the contour component set includes: Extract the contour component elements contained in the contour component, and determine the element type of the contour component elements; When the element type is a text box, select the character unit style information and text box style information corresponding to the outline component element as the first element style information; When the element type is a rectangle, the background style information corresponding to the outline component element is selected as the second element style information; The element style information of the contour component is generated based on the first element style information and / or the second element style information corresponding to the contour component element.

6. The method according to claim 1, characterized in that, The step of performing structural clustering on the initial components in the initial component set based on the element structural information to obtain a structural component set includes: Calculate the structural similarity between the initial components in the initial component set based on the element structural information, and perform structural clustering on the initial components in the initial component set based on the structural similarity calculation results to obtain a structural component set; The step of clustering the structural components in the structural component set according to the element layout information to obtain a layout component set includes: Calculate the layout similarity between structural components in the structural component set based on the element layout information, and perform layout clustering on the structural components in the structural component set based on the layout similarity calculation results to obtain a layout component set; The step of clustering layout components in the layout component set according to the component outline information to obtain an outline component set includes: The contour similarity between layout components in the layout component set is calculated based on the component contour information. Based on the contour similarity calculation results, the layout components in the layout component set are clustered to obtain a contour component set. The step of clustering the contour components in the contour component set according to the element style information to obtain the target component set includes: Calculate the style similarity between contour components in the contour component set based on the element style information, and perform style clustering on the contour components in the contour component set based on the style similarity calculation results to obtain the target component set.

7. The method according to claim 6, characterized in that, The calculation of the structural similarity between any two initial components in the initial component set includes: Determine the target initial component and the target element structure information of the target initial component, as well as the associated element structure information of the associated initial component and the associated initial component; Extract the target initial component element from the target initial component, and extract the associated initial component element from the associated initial component; Based on the target element structure information and the associated element structure information, calculate the element structure similarity between the target initial component element and the associated initial component element; Based on the area information corresponding to the target initial component element and the associated initial component element, the element structure similarity is weighted to obtain the target element structure similarity; Based on the structural similarity of the target elements, the structural similarity between the target initial component and the associated initial component is determined.

8. The method according to claim 6, characterized in that, The calculation of the layout similarity between any two structural components in the set of structural components includes: Determine the target structural component and the target element layout information of the target structural component, as well as the associated structural component and the associated element layout information of the associated structural component; Extract target structural component elements from the target structural component, and extract associated structural component elements from the associated structural component; Based on the target element layout information and the associated element layout information, calculate the element layout similarity between the target structural component element and the associated structural component element; Based on the element layout similarity, the layout similarity between the target structural component and the associated structural component is determined.

9. The method according to claim 6, characterized in that, The calculation of the contour similarity between any two layout components in the set of layout components includes: Determine the target layout component and the target component outline information of the target layout component, as well as the associated layout component and the associated component outline information of the associated layout component; Based on the outline information of the target component and the outline information of the associated component, calculate the component size similarity and component border similarity between the target layout component and the associated layout component; The component outline similarity is determined by comparing the component size similarity and the component border similarity, and is used as the outline similarity between the target layout component and the associated layout component.

10. The method according to claim 6, characterized in that, The calculation of style similarity between any two contour components in the contour component set includes: Determine the target contour component and the target element style information of the target contour component, as well as the associated element style information of the associated contour component and the associated contour component; Extract target contour component elements from the target contour component, and extract associated contour component elements from the associated contour component; Based on the target element style information and the associated element style information, calculate at least two element style similarities between the target contour component element and the associated contour component element; Select a target element style similarity from the at least two element style similarities, and determine the style similarity between the target contour component and the associated contour component based on the target element style similarity.

11. A component clustering device, characterized in that, include: The structural clustering module is configured to determine the element structural information of the initial components in the initial component set, and perform structural clustering on the initial components in the initial component set according to the element structural information to obtain a structural component set. The element structural information refers to the information composed of the structural information corresponding to the component elements contained in the initial component. The element structural information reflects the degree of structural similarity between components, and clustering is performed in the component structure dimension. The layout clustering module is configured to determine the element layout information of the structural components in the structural component set, and perform layout clustering on the structural components in the structural component set according to the element layout information to obtain a layout component set. The outline clustering module is configured to determine the component outline information of the layout components in the layout component set, and perform outline clustering on the layout components in the layout component set based on the component outline information to obtain an outline component set. The style clustering module is configured to determine the element style information of the contour components in the contour component set, and perform style clustering on the contour components in the contour component set according to the element style information to obtain the target component set.

12. A computing device, characterized in that, It includes a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the method according to any one of claims 1 to 10.

13. A computer-readable storage medium storing computer instructions, characterized in that, When executed by a processor, this instruction implements the steps of the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Portrait clustering method and device, electronic equipment and readable storage medium

    CN110084267A

  • Graphical interface processing method and device

    CN115033945A