Feature Extraction Method, Device, Computer Device and Storage Medium for Design Draft

By integrating feature information of child blocks and parent blocks in the design draft, the problem of difficult model construction and inaccurate classification results in the prior art is solved, and more efficient and accurate block classification is achieved.

CN113963173BActive Publication Date: 2025-07-22DOUYIN VISION CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111204219.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-15
Publication Date
2025-07-22
Estimated Expiration
2041-10-15

AI Technical Summary

Technical Problem

In the prior art, when using pixel values in the design draft picture as block feature information for classification, the model requirements are high and the classification results are not accurate enough, resulting in difficult model construction and unstable classification results.

Method used

By fusing the block feature information of each child block in the block group in the design draft with the block feature information of the parent block, target fusion features are generated to improve the accuracy of the block classification results of the parent block.

Benefits of technology

By integrating the feature information of the child block and the parent block, the accuracy and rationality of the block classification results of the parent block are improved, and the computational complexity and computing power requirements of the model are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113963173B_ABST
    Figure CN113963173B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, an apparatus, a computer device, and a storage medium for feature extraction of a design draft. Among them, the method includes: obtaining a design draft to be processed corresponding to a page; identifying the design draft to determine at least one block group with a nesting relationship in the design draft and the block feature information of each block in the block group; a block corresponds to a page component in the page; selecting a target block group from at least one block group, and for the target block group, according to the nesting relationship between different blocks in the target block group, fusing the block feature information of the parent block and the block feature information of each child block in the target block group to obtain a target fusion feature corresponding to the parent block; wherein, the target fusion feature is used to classify the parent block to obtain a block classification result of the parent block. The embodiments of the present disclosure can improve the rationality and accuracy of the determined target fusion feature corresponding to the parent block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of converting design drafts into code, and in particular, to a method, an apparatus, a computer device, and a storage medium for extracting features of a design draft. Background Art

[0002] Front-end page development is a process of creating a front-end page such as a WEB page or an APP (Application) and presenting it to users. When presenting the front-end page to users, the terminal needs to obtain the program code corresponding to the front-end page from a remote service platform such as a server or a cloud platform, and then through processing the program code, such as encoding and running, rendering, etc., to obtain the front-end page and present it to users. For the specific process of front-end page development, usually, page designers first design the design draft corresponding to the front-end page, and then program developers convert the design draft into the program code corresponding to the front-end page, and then render the front-end page corresponding to the design draft on the terminal based on the program code.

[0003] In order to improve the development efficiency of the front-end page, a design draft conversion tool can be used to automatically convert the design draft designed by page designers into program code. In this way, the participation of program developers can be reduced, and the development efficiency of the front-end page can be improved. The design draft may include multiple different blocks, and each block may correspond to a page component with different functions in the front-end page. For example, a component with a search function, a component with a clear function, etc. In the process of using the design draft conversion tool to convert the design draft into program code, for each block corresponding to the design draft, it is necessary to classify the block based on the feature information of the block to obtain the classification result of the block. For example, it is determined that the block is a block with a search function, and then based on the block classification result, the conversion of the design draft into program code is realized.

[0004] In the prior art, for the method of classifying blocks, most of them directly use the pixel values of each pixel point in the design draft picture as the feature information of the block and input it into a pre-trained model, and use the model to analyze and process the pixel values to determine the classification result corresponding to each block. However, the method of using the pixel values of each pixel point as the feature information of the block for classification has high requirements for the model. For example, it requires a large amount of computing power and complex algorithms. Therefore, the difficulty of building the model is increased, and moreover, it cannot guarantee the accuracy of the classification result output by the trained model. Summary of the Invention

[0005] The embodiments of the present disclosure at least provide a method, an apparatus, a computer device, and a storage medium for extracting features of a design draft to improve the accuracy of the output block classification result.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for feature extraction of a design draft, including:

[0007] Obtain a design draft to be processed corresponding to a page;

[0008] Identify the design draft to determine at least one block group with a nested relationship in the design draft and block feature information of each block in the block group; the block corresponds to a page component in the page;

[0009] Select a target block group from the at least one block group. For the target block group, according to the nested relationship between different blocks in the target block group, fuse the block feature information of the parent block and the block feature information of each child block in the target block group to obtain a target fusion feature corresponding to the parent block; wherein, the target fusion feature is used to classify the parent block to obtain a block classification result of the parent block.

[0010] In a possible implementation manner, before determining at least one block group with a nested relationship in the design draft and block feature information of each block in the block group, it further includes:

[0011] Identify the design draft to determine and delete the transparent blocks in the design draft; the transparent blocks correspond to invisible page components in the page.

[0012] In a possible implementation manner, determining at least one block group with a nested relationship in the design draft includes:

[0013] Determine the position information and size information of each block in the design draft in the design draft;

[0014] Based on the position information and size information corresponding to each block, determine at least one block group with a nested relationship in the design draft.

[0015] In a possible implementation manner, fusing the block feature information of the parent block and the block feature information of each child block in the target block group according to the nested relationship between different blocks in the target block group to obtain a target fusion feature corresponding to the parent block includes:

[0016] According to the nested relationship between different blocks in the target block group, determine the parent block in the target block group and at least one child block corresponding to the parent block;

[0017] Determine a first eigenvalue corresponding to the parent block based on the block feature information of the parent block, and determine a second eigenvalue corresponding to each sub-block based on the block feature information of each sub-block corresponding to the parent block;

[0018] Determine a target fusion feature corresponding to the parent block based on the first eigenvalue and the feature mean values corresponding to each of the second eigenvalues.

[0019] In a possible implementation manner, the block feature information includes various types of sub-feature information;

[0020] Determining a first eigenvalue corresponding to the parent block based on the block feature information of the parent block includes:

[0021] For each sub-feature information in the block feature information of the parent block, determine a sub-eigenvalue corresponding to the sub-feature information based on the category of the sub-feature information and the sub-feature information;

[0022] Use the sub-eigenvalue corresponding to each sub-feature information as the first eigenvalue corresponding to the parent block.

[0023] In a possible implementation manner, the sub-eigenvalue includes a first sub-eigenvalue or a second sub-eigenvalue;

[0024] Determining a sub-eigenvalue corresponding to the sub-feature information based on the category of the sub-feature information and the sub-feature information includes:

[0025] When it is determined that the category corresponding to the sub-feature information indicates that the data feature corresponding to the sub-feature information matches the discrete data feature, determine a first sub-eigenvalue corresponding to the sub-feature information based on a preset eigenvalue and the sub-feature information; or,

[0026] When it is determined that the category corresponding to the sub-feature information indicates that the data feature corresponding to the sub-feature information matches the continuous data feature, determine a second sub-eigenvalue corresponding to the sub-feature information based on a feature value range and the sub-feature information.

[0027] In a possible implementation manner, the determining a target fusion feature corresponding to the parent block based on the first eigenvalue and the feature mean values corresponding to each of the second eigenvalues includes:

[0028] For the sub-feature information corresponding to each category of the parent block, determine a target sub-feature mean value corresponding to the sub-feature information of this category based on the sub-eigenvalue of the first eigenvalue corresponding to the sub-feature information and the sub-eigenvalues of the second eigenvalues of each sub-block corresponding to the sub-feature information;

[0029] Determine the target fusion feature corresponding to the parent block based on the target sub-feature mean corresponding to the sub-feature information of each category.

[0030] In a possible implementation manner, the fusing the block feature information of the parent block and the block feature information of each sub-block in the target block group according to the nesting relationship between different blocks in the target block group to obtain the target fusion feature corresponding to the parent block includes:

[0031] Determine the parent block in the target block group and at least one sub-block corresponding to the parent block according to the nesting relationship between different blocks in the target block group;

[0032] Based on the sub-feature information of each category corresponding to the parent block, determine the sub-feature value of the sub-feature information of each category corresponding to the parent block, and based on the sub-feature information of each category corresponding to each sub-block corresponding to the parent block, determine the sub-feature value of the sub-feature information of each category corresponding to each sub-block;

[0033] Generate a first feature sequence based on the sub-feature value of the sub-feature information of each category corresponding to the parent block; and generate a second feature sequence corresponding to each sub-block respectively based on the sub-feature value of the sub-feature information of each category corresponding to each sub-block;

[0034] Concatenate the first feature sequence and each of the second feature sequences to obtain a target feature sequence;

[0035] Determine the target fusion feature corresponding to the parent block in the target block group based on the target feature sequence.

[0036] In a possible implementation manner, the fusing the block feature information of the parent block and the block feature information of each sub-block in the target block group according to the nesting relationship between different blocks in the target block group to obtain the target fusion feature corresponding to the parent block includes:

[0037] Determine the parent block in the block group and at least one sub-block corresponding to the parent block according to the nesting relationship between different blocks in the block group;

[0038] Based on the sub-feature information of each category corresponding to the parent block, determine the sub-feature value of the sub-feature information of each category corresponding to the parent block, and based on the sub-feature information of each category corresponding to each sub-block corresponding to the parent block, determine the sub-feature value of the sub-feature information of each category corresponding to each sub-block;

[0039] Generate a first feature matrix based on the sub - feature values of the sub - feature information corresponding to each category for the parent block; and, generate a second feature matrix corresponding to each sub - block respectively based on the sub - feature values of the sub - feature information corresponding to each category for each sub - block.

[0040] Fuse the first feature matrix and each of the second feature matrices to obtain a target feature matrix.

[0041] Based on the target feature matrix, determine the target fusion feature corresponding to the parent block in the target block group.

[0042] In a possible implementation manner, after fusing the block feature information of the parent block in the target block group and the block feature information of each sub - block to obtain the target fusion feature corresponding to the parent block, it further includes:

[0043] Obtain the target fusion feature corresponding to each sibling block of the parent block.

[0044] Fuse the target fusion feature corresponding to the parent block and the target fusion features corresponding to each sibling block of the parent block to obtain a new target fusion feature corresponding to the parent block.

[0045] In a second aspect, an embodiment of the present disclosure further provides a feature extraction device for a design draft, including:

[0046] An acquisition module, configured to acquire a to - be - processed design draft corresponding to a page.

[0047] A determination module, configured to identify the design draft and determine at least one block group with a nested relationship in the design draft and the block feature information of each block in the block group; the block corresponds to a page component in the page.

[0048] A fusion module, configured to select a target block group from the at least one block group, and for the target block group, according to the nested relationship between different blocks in the target block group, fuse the block feature information of the parent block in the target block group and the block feature information of each sub - block to obtain the target fusion feature corresponding to the parent block; wherein, the target fusion feature is used to classify the parent block to obtain the block classification result of the parent block.

[0049] In a possible implementation manner, the device further includes:

[0050] A deletion module, configured to identify the design draft before determining at least one block group with a nested relationship in the design draft and block feature information of each block in the block group, and determine and delete the transparent blocks in the design draft; the transparent blocks correspond to invisible page components in the page.

[0051] In a possible implementation manner, the determination module is configured to determine the position information and size information of each block in the design draft in the design draft;

[0052] Based on the position information and size information corresponding to each block, determine at least one block group with a nested relationship in the design draft.

[0053] In a possible implementation manner, the fusion module is configured to determine a parent block in the target block group and at least one sub-block corresponding to the parent block according to the nested relationship between different blocks in the target block group;

[0054] Based on the block feature information of the parent block, determine a first feature value corresponding to the parent block, and based on the block feature information of each sub-block corresponding to the parent block, respectively determine a second feature value corresponding to each sub-block;

[0055] Based on the first feature value and the feature mean values corresponding to each second feature value, determine a target fusion feature corresponding to the parent block.

[0056] In a possible implementation manner, the block feature information includes various types of sub-feature information;

[0057] The fusion module is configured to, for each sub-feature information in the block feature information of the parent block, determine a sub-feature value corresponding to the sub-feature information based on the category of the sub-feature information and the sub-feature information;

[0058] Use the sub-feature value corresponding to each sub-feature information as the first feature value corresponding to the parent block.

[0059] In a possible implementation manner, the sub-feature value includes a first sub-feature value or a second sub-feature value;

[0060] The fusion module is configured to, when determining that the category corresponding to the sub-feature information indicates that the data feature corresponding to the sub-feature information matches the discrete data feature, determine a first sub-feature value corresponding to the sub-feature information based on a preset feature value and the sub-feature information; or,

[0061] When it is determined that the category corresponding to the sub - feature information indicates that the data feature corresponding to the sub - feature information matches the continuous data feature, based on the feature value range and the sub - feature information, determine the second sub - feature value corresponding to the sub - feature information.

[0062] In a possible implementation manner, the fusion module is configured to, for the sub - feature information corresponding to each category of the parent block, based on the sub - feature value corresponding to the first feature value for this sub - feature information and the sub - feature values corresponding to this sub - feature information for the second feature values of each sub - block, determine the target sub - feature mean corresponding to the sub - feature information of this category;

[0063] Based on the target sub - feature means corresponding to the sub - feature information of each category, determine the target fusion feature corresponding to the parent block.

[0064] In a possible implementation manner, the fusion module is configured to determine the parent block in the target block group and at least one sub - block corresponding to the parent block according to the nesting relationship between different blocks in the target block group;

[0065] Based on the sub - feature information corresponding to each category of the parent block, determine the sub - feature values corresponding to the sub - feature information of each category of the parent block, and based on the sub - feature information corresponding to each category of the parent block for each sub - block corresponding to the parent block, determine the sub - feature values corresponding to the sub - feature information of each category of each sub - block;

[0066] Based on the sub - feature values corresponding to the sub - feature information of each category of the parent block, generate a first feature sequence; and, based on the sub - feature values corresponding to the sub - feature information of each category of each sub - block, generate a second feature sequence corresponding to each sub - block respectively;

[0067] Concatenate the first feature sequence and each of the second feature sequences to obtain a target feature sequence;

[0068] Based on the target feature sequence, determine the target fusion feature corresponding to the parent block in the target block group.

[0069] In a possible implementation manner, the fusion module is configured to determine the parent block in the block group and at least one sub - block corresponding to the parent block according to the nesting relationship between different blocks in the block group;

[0070] Based on the sub - feature information corresponding to each category of the parent block, determine the sub - feature values corresponding to the sub - feature information of each category of the parent block, and based on the sub - feature information corresponding to each category of the parent block for each sub - block corresponding to the parent block, determine the sub - feature values corresponding to the sub - feature information of each category of each sub - block;

[0071] Generate a first feature matrix based on the sub - feature values of the sub - feature information corresponding to each category for the parent block; and, generate second feature matrices corresponding to each sub - block respectively based on the sub - feature values of the sub - feature information corresponding to each category for each sub - block.

[0072] Fuse the first feature matrix and each of the second feature matrices to obtain a target feature matrix.

[0073] Determine the target fusion feature corresponding to the parent block in the target block group based on the target feature matrix.

[0074] In a possible implementation, the fusion module is further configured to, after fusing the block feature information of the parent block in the target block group and the block feature information of each sub - block to obtain the target fusion feature corresponding to the parent block, obtain the target fusion feature corresponding to each sibling block of the parent block.

[0075] Fuse the target fusion feature corresponding to the parent block and the target fusion features corresponding to each sibling block of the parent block to obtain a new target fusion feature corresponding to the parent block.

[0076] In a third aspect, an optional implementation of the present disclosure further provides a computer device, including a processor and a memory. The memory stores machine - readable instructions executable by the processor. The processor is configured to execute the machine - readable instructions stored in the memory. When the machine - readable instructions are executed by the processor, the machine - readable instructions execute the steps in the first aspect, or any possible implementation manner in the first aspect.

[0077] In a fourth aspect, an optional implementation of the present disclosure further provides a computer - readable storage medium. A computer program is stored on the computer - readable storage medium. When the computer program is run, it executes the steps in the first aspect, or any possible implementation manner in the first aspect.

[0078] For the effect description of the above - mentioned feature extraction device, computer device, and computer - readable storage medium of the design draft, refer to the description of the feature extraction method of the above - mentioned design draft, which will not be elaborated here.

[0079] The feature extraction method, device, computer device, and storage medium for design drafts provided by the embodiments of the present disclosure fuse the block feature information of each sub-block in the block group with the block feature information of the parent block, and use the fused feature as the target fused feature corresponding to the parent block in the block group. Then, the target fused feature is used to classify the parent block to determine the block classification result of the parent block. In the above solution, there is no need to construct a dedicated model to process the pixel values and classify the blocks in the design draft picture. In the solution of the present disclosure, since the block feature information of the sub-blocks can affect the block classification result of the parent block, by fusing the block feature information of each sub-block in the block group with the block feature information of the parent block, the determined target fused feature corresponding to the parent block can carry the block feature information of each sub-block, improving the rationality and accuracy of the determined target fused feature corresponding to the parent block. Furthermore, using the target fused feature with higher rationality and accuracy to classify the parent block can effectively improve the accuracy of the determined block classification result of the parent block.

[0080] Furthermore, in the feature extraction method, device, computer device, and storage medium for design drafts provided by the embodiments of the present disclosure, since the target fused features corresponding to each sibling block of the parent block may also affect the block classification result of the parent block, after determining the target fused feature corresponding to the parent block, by further fusing the obtained target fused features corresponding to each sibling block of the parent block and the target fused feature corresponding to the parent block, the further fused feature not only carries the block features of each sub-block but also carries the target fused features corresponding to each sibling block, further improving the accuracy of the determined block classification result of the parent block.

[0081] To make the above objects, features, and advantages of the present disclosure more obvious and understandable, the following specific embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the accompanying drawings required for the embodiments will be briefly introduced below. The accompanying drawings are incorporated into the specification and form a part of this specification. These drawings show embodiments consistent with the present disclosure and, together with the specification, are used to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0083] Figure 1 Shows a flowchart of a feature extraction method for a design draft provided by an embodiment of the present disclosure;

[0084] Figure 2 Shows a schematic diagram of a design draft provided by an embodiment of the present disclosure;

[0085] Figure 3 Shows a schematic diagram of a feature extraction device for a design draft provided by an embodiment of the present disclosure;

[0086] Figure 4 Shows a schematic diagram of the structure of a computer device provided by an embodiment of the present disclosure. Detailed implementation manners

[0087] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only a part rather than all of the embodiments of the present disclosure. Usually, the components of the embodiments of the present disclosure described and illustrated here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed, but merely represents selected embodiments of the present disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative efforts shall fall within the scope of protection of the present disclosure.

[0088] In addition, the terms "first", "second", etc. in the description and claims of the embodiments of the present disclosure and the above accompanying drawings are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order different from that shown or described here.

[0089] As used herein, "a plurality of or several" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0090] It has been found through research that front-end page development is a process of creating front-end pages such as WEB pages or APPs (Applications) and presenting them to users. When presenting the front-end page to users, the terminal needs to obtain the program code corresponding to the front-end page from remote service platforms such as servers and cloud platforms, and then through the processing of the program code, such as encoding and running, rendering, etc., to obtain the front-end page and present it to users. For the specific process of front-end page development, usually, page designers first design the design draft corresponding to the front-end page, and then program developers convert the design draft into the program code corresponding to the front-end page, and then render the front-end page corresponding to the design draft on the terminal based on the program code.

[0091] In order to improve the development efficiency of front-end pages, a design draft conversion tool can be used to automatically convert the design draft designed by page designers into program code. In this way, the participation of program developers can be reduced, and the development efficiency of front-end pages can be improved. The design draft can include multiple different blocks, and each block can correspond to page components with different functions in the front-end page. For example, components with search functions, components with clear functions, and so on. In the process of using the design draft conversion tool to convert the design draft into program code, for each block corresponding to the design draft, it is necessary to classify the block based on the feature information of the block to obtain the classification result of the block. For example, it is determined that the block is a block with a search function, and then based on the block classification result, the conversion of the design draft into program code is realized.

[0092] In the prior art, for the method of classifying blocks, most often, the pixel values of each pixel point in the design draft picture are directly used as the feature information of the block and input into a pre-trained model, and the model is used to analyze and process the pixel values to determine the classification results corresponding to each block. However, the method of using the pixel values of each pixel point as the feature information of the block for classification has relatively high requirements for the model. For example, it requires a large amount of computing power and complex algorithms. Therefore, it increases the difficulty of building the model, and moreover, it cannot guarantee the accuracy of the classification results output by the trained model.

[0093] Based on the above research, the present disclosure provides a method, an apparatus, a computer device, and a storage medium for extracting features of a design draft. By fusing the block feature information of each sub-block in a block group with the block feature information of the parent block, and taking the fused feature as the target fused feature corresponding to the parent block in the block group, and then classifying the parent block using the target fused feature to determine the block classification result of the parent block. Since the block feature information of the sub-blocks can affect the block classification result of the parent block, by fusing the block feature information of each sub-block in the block group with the block feature information of the parent block, it is possible to make the determined target fused feature corresponding to the parent block carry the block feature information of each sub-block, improving the rationality and accuracy of the determined target fused feature corresponding to the parent block. Furthermore, using the target fused feature with higher rationality and accuracy to classify the parent block can effectively improve the accuracy of the determined block classification result of the parent block.

[0094] Regarding the defects existing in the above solutions, they are all the results obtained by the inventors through practice and careful research. Therefore, the process of discovering the above problems and the solutions proposed by the present disclosure for the above problems in the following text should be the contributions made by the inventors to the present disclosure during the process of the present disclosure.

[0095] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0096] It should be noted that the specific terms mentioned in the embodiments of the present disclosure include:

[0097] Design draft: Refers to the design draft of the user interface, usually drawn by UI (User Interface) designers through tools such as Figma, Sketch, Photoshop, etc.

[0098] Inline block: A type of block that does not occupy an independent area. Specifically, it is a block that does not occupy a single line alone and has the characteristic that it is located on the same line as the adjacent other inline blocks in total.

[0099] Block-level block: A type of block that independently occupies one or more lines.

[0100] Parent-child relationship of blocks: If block A contains block B on the page, it can be considered that there is a parent-child relationship between block A and block B, that is, block A is the parent block and block B is the sub-block.

[0101] For the convenience of understanding this embodiment, first, a method for feature extraction of a design draft disclosed in an embodiment of the present disclosure will be introduced in detail. The execution subject of the method for feature extraction of the design draft provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities. In some possible implementation manners, the method for feature extraction of the design draft can be implemented by a processor calling computer-readable instructions stored in a memory.

[0102] Next, taking the execution subject as a computer device as an example, the method for feature extraction of the design draft provided in the embodiment of the present disclosure will be described.

[0103] As Figure 1 shown, it is a flowchart of a method for feature extraction of a design draft provided in an embodiment of the present disclosure, which may include the following steps:

[0104] S101: Obtain the design draft to be processed corresponding to the page.

[0105] Here, the page may include a UI page. Specifically, it may be a rendered UI page displayed on the client. The design draft to be processed may be a design draft drawn by a UI designer corresponding to the UI page. As Figure 2 shown, it is a schematic diagram of a design draft provided in an embodiment of the present disclosure.

[0106] S102: Identify the design draft to determine at least one block group with a nested relationship and the block feature information of each block in the block group; a block corresponds to a page component in the page.

[0107] Here, the design draft to be processed may include at least one block group. One block group may include at least one block, and one block corresponds to a page component in the page.

[0108] Specifically, in Figure 2 , block A, block B, and block C form a block group. Block A corresponds to the search box component in the page, block B corresponds to the search button component in the page, the search button component is a sub-component of the search box component, block C corresponds to the combination key indication component in the page, and the search function can be directly triggered by the combination key corresponding to the combination key indication component. The combination key indication component is also a sub-component of the search box component.

[0109] The nested relationship is used to reflect the parent-child relationship between each block in the design draft. A block group with a nested relationship may include multiple blocks. Specifically, a block group with a nested relationship may include a parent block and each corresponding sub-block of the parent block. A block in the design draft may appear in different block groups, that is, a block may be a parent block in the current block group or a sub-block in another block group.

[0110] In another embodiment, a block group may include not only a parent block and each corresponding sub-block of the parent block, but also each corresponding grandchild block of the parent block. The specific division method of the block group can be determined according to the needs of feature extraction and will not be limited here. For example, if the sub-blocks corresponding to a parent block, the grandchild blocks corresponding to the parent block, and the sub-blocks of the grandchild blocks corresponding to the parent block all affect the determination of the block classification result of the parent block, then a block group may include the parent block, the sub-blocks corresponding to the parent block, the grandchild blocks corresponding to the parent block, the sub-blocks of the grandchild blocks corresponding to the parent block, and so on.

[0111] The block feature information is used to characterize the features of the block in the design draft. For example, position features, size features, etc. In specific implementation, the block feature information may include various types of sub-feature information. Specifically, the sub-feature information may be the category information of the block, the width information and height information of the block, the position information of the block relative to the parent block, the font information in the block, etc. Among them, the category information of the block is used to characterize the category of the block. Specifically, the block category may include two types: block-level blocks and inline blocks; the position information of the block relative to the parent block may include the horizontal distance x from the block to its corresponding parent block and the vertical distance y from the block to its corresponding parent block; the font information in the block may include the type of the font, such as Song typeface, Kai typeface, Fangsong typeface, etc., the size of the font, such as 5th size font, 3rd size font, etc., and the color of the font, such as black, red, etc.

[0112] In specific implementation, after obtaining the design draft to be processed, the design draft can be recognized to determine each block included in the design draft and the corresponding block feature information of each block, and to determine each parent block in the blocks included in the design draft and each sub-block corresponding to each parent block. Furthermore, each parent block and its corresponding sub-blocks can be used as a block group with a nested relationship, and the parent-child relationship between the blocks in the block group can be used as the corresponding nested relationship of the block group. Thus, at least one block group with a nested relationship in the design draft can be obtained.

[0113] In addition, if a block has no sub-blocks and parent blocks, the block can be used as a block group, or the block can be left ungrouped.

[0114] S103: Select a target block group from at least one block group. For the target block group, according to the nested relationship between different blocks in the target block group, fuse the block feature information of the parent block and the block feature information of each sub-block in the target block group to obtain the target fusion feature corresponding to the parent block; wherein, the target fusion feature is used to classify the parent block to obtain the block classification result of the parent block.

[0115] Here, the target fusion feature is used to represent the fused block feature corresponding to the parent block in the block group. Since the model for determining the block classification result of the parent block can only accept single-line sample data, it is necessary to fuse the block feature information of the parent block and the block feature information of each sub-block to obtain a single-line target fusion feature for the model to process.

[0116] Specifically, in implementation, a target block group can be selected from at least one block group first, and then the selected target block group can be processed to determine the target fusion feature corresponding to the parent block. Here, when selecting the target block group, each block group can be used as the target block group for processing in sequence, or some block groups can be selected as the target block group for processing. For example, in the case where a block group only includes one block, the block feature information of the block in this block group does not need to be fused, and the block feature information of this block can be directly used as the target fusion feature of this block. In this way, this block group does not need to be selected as the target block group.

[0117] Specifically, for the selected target block group, according to the nesting relationship between different blocks in the target block group, the parent block in the target block group and each sub-block corresponding to this parent block can be determined. Then, the block feature information of each sub-block and the block feature information of this parent block can be feature-fused to obtain the target fusion feature corresponding to this parent block. For example, when the block feature information is specific feature values, the feature mean of the feature values corresponding to each sub-block and the feature value corresponding to this parent block can be used as the target fusion feature corresponding to this parent block. Or, the mean values of the feature values corresponding to each sub-block and the feature value corresponding to this parent block can be weighted and summed using preset weight values to determine the target fusion feature corresponding to this parent block. Or, based on the feature values corresponding to each sub-block, the feature value corresponding to this parent block, and the feature mean, the standard deviation (variance) can be determined. Furthermore, the determined standard deviation (variance) can be used as the target fusion feature corresponding to this parent block.

[0118] Furthermore, based on the above steps, the target fusion feature corresponding to the parent block in each selected target block group can be determined, that is, the target fusion feature corresponding to each parent block in the design draft can be determined. Further, the target fusion feature corresponding to each parent block can be used to classify each parent block to determine the block classification result corresponding to each parent block.

[0119] Here, the block classification result is used to represent the function corresponding to each block. For example, if the block classification result is a search block, this result can represent that the block is a block with a search function.

[0120] During specific implementation, the obtained target fusion feature can be a specific feature vector, or after obtaining the target fusion feature corresponding to the parent block, it can be converted into a feature vector, and then the target fusion feature (feature vector) can be input into a pre-trained model, and the model is used to process the target fusion feature, so as to output the block classification result corresponding to the parent block.

[0121] In another implementation manner, after obtaining the feature vectors corresponding to each parent block, similarity analysis can also be performed on each parent block based on the feature vectors corresponding to each parent block. For example, the similarity between each parent block can be determined based on the similarity between the feature vectors corresponding to each parent block.

[0122] In this way, by fusing the block feature information of each sub-block in the block group with the block feature information of the parent block, and using the fused feature as the target fusion feature corresponding to the parent block in the block group, and then classifying the parent block using the target fusion feature to determine the block classification result of the parent block. Since the block feature information of the sub-block can affect the block classification result of the parent block, by fusing the block feature information of each sub-block in the block group with the block feature information of the parent block, it can make the determined target fusion feature corresponding to the parent block carry the block feature information of each sub-block, improving the comprehensiveness and accuracy of the determined target fusion feature corresponding to the parent block; furthermore, using the target fusion feature with higher comprehensiveness and accuracy to classify the parent block can effectively improve the accuracy of the determined block classification result of the parent block.

[0123] In one embodiment, before determining at least one block group with a nested relationship in the design draft and the block feature information of each block in the block group, since different designers may have different design habits, therefore, even when painting the design drafts corresponding to the same page, there may be differences between the design drafts painted by different designers. So after obtaining the design draft, the design draft can be preprocessed first to standardize the design draft.

[0124] During specific implementation, the design draft can be identified to determine and delete the transparent blocks in the design draft. Among them, the transparent blocks correspond to invisible page components in the page.

[0125] Here, although the transparent blocks are invisible blocks in the page, there is a problem of affecting the block feature information of the blocks. Therefore, it is necessary to identify the transparent blocks in the design draft, and then delete the transparent blocks to standardize the design draft. In this way, the accuracy of the block feature information of each determined block can be improved.

[0126] In one embodiment, the step of determining at least one block group with a nested relationship in the design draft can be implemented according to the following steps:

[0127] Step 1: Determine the position information and size information of each block in the design draft in the design draft.

[0128] Here, the position information is used to represent the position of the block in the design draft. For example, the position information can be the position coordinates of each block in the design draft, such as the coordinates of the center of the block and the coordinates of each edge point of the block, etc. The size information is used to represent the size of each block. Specifically, the size information can include the width information, height information, area information of the block, etc.

[0129] Specifically in implementation, after deleting the transparent blocks in the design draft, for each block other than the transparent blocks in the design draft, based on the recognition of the design draft, the position information and size information of each block in the design draft can be determined.

[0130] Step 2: Based on the position information and size information corresponding to each block, determine at least one block group with a nested relationship in the design draft.

[0131] Specifically in implementation, based on the position information of each block, the blocks with overlapping positions can be determined. Then, for the blocks with overlapping positions, according to the size information of each block, the smaller-sized blocks included in the larger-sized block corresponding to the size information can be determined. The larger-sized block is used as the parent block, and the included smaller-sized block is used as the child block. Furthermore, based on the position information and size information corresponding to each block, each parent block and the child blocks corresponding to each parent block can be determined. Then, the parent block and its corresponding child blocks can be used as a block group with a nested relationship, and the parent-child relationship corresponding to each block in the block group is used as the nested relationship corresponding to each block in the block group. Thus, the block groups with a nested relationship in the design draft can be determined.

[0132] Specifically, in the design draft, the coordinate of a child block on the horizontal axis must be less than the coordinate of its parent block on the horizontal axis, and its coordinate on the vertical axis must be less than the coordinate of its parent block on the vertical axis.

[0133] For example, in Figure 2 , block A, block B, and block C form a block group. Block A contains block B and block C. Then, block A can be used as the parent block, and block B and block C can be used as the child blocks.

[0134] In one embodiment, for S103, it can be implemented according to the following steps:

[0135] S103-1: Determine the parent block in the target block group and at least one child block corresponding to the parent block according to the nesting relationship between different blocks in the target block group.

[0136] Here, the parent block in the target block group and each child block corresponding to the parent block can be determined. In the case where there are multiple child blocks, at least one child block can be selected for subsequent determination of the target fusion feature corresponding to the parent block.

[0137] S103-2: Based on the block feature information of the parent block, determine the first feature value corresponding to the parent block, and based on the block feature information of each child block corresponding to the parent block, determine the second feature value corresponding to each child block respectively.

[0138] Here, the feature value is a value obtained by converting the block feature information and can represent the block feature corresponding to the block.

[0139] In one embodiment, the block feature information may include various types of sub-feature information. For specific sub-feature information, reference can be made to the above embodiments and will not be elaborated here. For S103-2, it can be implemented according to the following steps:

[0140] S103-2-1: For each sub-feature information in the block feature information of the parent block, determine the sub-feature value corresponding to the sub-feature information based on the category and the sub-feature information of the sub-feature information.

[0141] Here, different types of sub-feature information have different data characteristics. Among them, the data characteristics can include discrete data characteristics and continuous data characteristics. The discrete data characteristics are used to represent that there is no continuous data in mathematics for the data. For example, the category of the font, either Song typeface or Kai typeface, etc., is a discontinuous feature. The continuous data characteristics are used to represent that there is continuous data in mathematics for the data. For example, height information, width information, etc.

[0142] Specifically in implementation, for each sub-feature information in the block feature information of the parent block, the data characteristic corresponding to the sub-feature information can be determined based on the category of the sub-feature information. Then, based on the data characteristic corresponding to the sub-feature information, the sub-feature information can be converted to obtain the sub-feature value corresponding to the sub-feature information. Furthermore, the sub-feature values corresponding to each sub-feature information in the block feature information of the parent block can be determined respectively.

[0143] S103-2-2: Use the sub-feature value corresponding to each sub-feature information as the first feature value corresponding to the parent block.

[0144] Here, the sub-feature value corresponding to each sub-feature information in the block feature information of the parent block can be used as the first feature value corresponding to the parent block.

[0145] Similarly, for each sub-block corresponding to the parent block, the eigenvalue corresponding to each sub-feature information of the sub-block can be determined according to the category of each sub-feature information corresponding to the sub-block and each sub-feature information corresponding to the sub-block, and the eigenvalue corresponding to each sub-feature information of the sub-block is used as the second eigenvalue corresponding to the sub-block. Based on this, the second eigenvalue of each sub-block corresponding to the parent block can be determined.

[0146] S103-3: Determine the target fusion feature corresponding to the parent block based on the first eigenvalue and the feature mean values corresponding to the respective second eigenvalues.

[0147] Here, after determining the first eigenvalue corresponding to the parent block and the second eigenvalues corresponding to each sub-block, the feature mean values corresponding to the first eigenvalue and the respective second eigenvalues can be determined, and then the feature mean value is used as the target fusion feature corresponding to the parent block.

[0148] In one embodiment, the sub-eigenvalue may include a first sub-eigenvalue or a second sub-eigenvalue, and the first sub-eigenvalue and the second sub-eigenvalue respectively correspond to sub-feature information with different data characteristics. Specifically, the sub-feature information with discrete data characteristics may correspond to the first sub-eigenvalue, and the sub-feature information with continuous data characteristics may correspond to the second sub-eigenvalue.

[0149] In S103-2-1, for each sub-feature information, when it is determined that the category indicating the sub-feature information corresponds to the data characteristic matching the discrete data characteristic, the first eigenvalue corresponding to the sub-feature information can be determined according to the preset eigenvalue corresponding to the discrete data characteristic and the sub-feature information.

[0150] Here, the preset eigenvalue may include 0 and 1, that is, when it is determined that the category indicating the sub-feature information corresponds to the data characteristic matching the discrete data characteristic, the sub-feature information can be converted into a binary feature. For example, if the font category feature in the sub-feature information corresponding to the parent block is Song typeface, then the sub-feature information can be converted into a binary feature: whether it is Song typeface or Kai typeface. Furthermore, the binary feature can be identified by 0, that is, Song typeface is identified by 0, and then 0 is used as the first eigenvalue corresponding to the sub-feature information. On the contrary, if the font category feature is Kai typeface, then the binary feature can be identified by 1, that is, Kai typeface is identified by 1, and then 1 is used as the first eigenvalue corresponding to the sub-feature information.

[0151] In addition, when it is determined that the category indicating the sub-feature information corresponds to the data characteristic matching the continuous data characteristic, the second sub-eigenvalue corresponding to the sub-feature information is determined based on the feature value range corresponding to the continuous data characteristic and the sub-feature information.

[0152] Here, the range of the feature value can be (0, 1), which is a preset range. That is, when it is determined that the class indicating the sub - feature information corresponding to the sub - feature information matches the continuous data feature of the data, the sub - feature information can be normalized between 0 and 1. For example, for the sub - feature information corresponding to the parent block: the width of the block is 3 cm, then this sub - feature information can be normalized between 0 and 1. For example, it can be normalized to 0.3 cm, 0.03 cm, etc. The specific normalization method can be set according to the development needs and is not limited here. Furthermore, the normalized feature value can be used as the second feature value corresponding to the sub - feature information.

[0153] As shown in Table 1 below, it is a schematic diagram of each sub - feature information corresponding to a parent block and its sub - blocks provided by an embodiment of the present disclosure:

[0154]

[0155] Table 1

[0156] Among them, Null means empty, that is, the value of the block feature information corresponding to the block is empty.

[0157] For the data in Table 1, the block category, the category of the font, and the size of the font all belong to the data with discrete data features, and can be converted into binary features. Specifically, the block category can be converted into a binary feature: whether it is a block - within - block or an in - line block; the category of the font can be converted into multiple binary features: whether it is Song typeface or FangSong typeface, whether it is Song typeface or Kai typeface, whether it is FangSong typeface or Kai typeface, and the size of the font can also be converted into multiple binary features: whether it is size 4 or size 5, whether it is size 4 or small size 5, whether it is size 5 or small size 5. And the width information of the block, the height information of the block, x, and y are all data with continuous data features, and can be normalized between 0 and 1.

[0158] In specific implementation, for the parent block in Table 1, the sub - feature values corresponding to each sub - feature information can be: the first sub - feature value corresponding to the block category: 0; the second sub - feature value corresponding to the width information of the block: 0.5 cm, the second sub - feature value corresponding to the height information of the block: 0.4 cm; the second sub - feature value corresponding to x: null; the second sub - feature value corresponding to y: null; the first sub - feature value corresponding to the category of the font: the value corresponding to whether it is Song typeface or FangSong typeface can be 0; the value corresponding to whether it is Song typeface or Kai typeface can also be 0, the value corresponding to whether it is FangSong typeface or Kai typeface can be null; the first sub - feature value corresponding to the size of the font: the value corresponding to whether it is size 4 or size 5 is 0, the value corresponding to whether it is size 4 or small size 5 is 0, the value corresponding to whether it is size 5 or small size 5 is null. In this way, each sub - feature value corresponding to the parent block can be obtained, that is, the first feature value corresponding to the parent block can be obtained.

[0159] Among them, when the sub-feature information of a category is converted into multiple binary features, only one binary feature that can represent the block feature information corresponding to the block can be selected for identification. For example, for the category of the font corresponding to the parent block, the binary feature of whether it is Song typeface or FangSong typeface can be selected for identification, or the binary feature of whether it is Song typeface or Kai typeface can be selected for identification, or each binary feature can be used for identification respectively. However, when a binary feature does not contain the block feature information corresponding to the block, for example, for the category of the font corresponding to the parent block, the binary feature of whether it is FangSong typeface or Kai typeface cannot identify the Song typeface corresponding to the parent block, then the value corresponding to the binary feature can be set to a default value, such as null, or this binary feature can be ignored.

[0160] Similarly, the respective sub-feature values corresponding to sub-block 1 and the respective sub-feature values corresponding to sub-block 2 can be determined, which will not be exemplified here.

[0161] In one embodiment, for S103-3, it can be implemented according to the following steps:

[0162] S103-3-1: For the sub-feature information of each category corresponding to the parent block, based on the sub-feature value corresponding to the sub-feature information of the first feature value and the sub-feature value corresponding to the sub-feature information of the second feature value of each sub-block, determine the target sub-feature mean corresponding to the sub-feature information of this category.

[0163] Here, as can be seen from the above embodiments, the first feature value corresponding to the parent block may include the sub-feature values respectively corresponding to the sub-feature information of each category, and the second feature value corresponding to each sub-block may include the sub-feature values respectively corresponding to the sub-feature information of each category. In the process of determining the feature means corresponding to the first feature value and each second feature value, the target sub-feature means of the sub-feature values corresponding to each block for each category can be determined first.

[0164] Specifically in implementation, for the sub-feature information of each category corresponding to the parent block, the sub-feature value of the sub-feature information of this category can be determined from the first feature value, and for the sub-feature information of this category, the sub-feature value of the sub-feature information of this category corresponding to each sub-block can be determined respectively from the second feature value corresponding to each sub-block, and then, the target sub-feature mean corresponding to the sub-feature value of the sub-feature information of this category corresponding to the parent block and the sub-feature value of the sub-feature information of this category corresponding to each sub-block can be obtained.

[0165] S103-3-2: Based on the target sub-feature means corresponding to the sub-feature information of each category, determine the target fusion feature corresponding to the parent block.

[0166] Here, the target sub-feature mean corresponding to the sub-feature information of each category can be directly used as the feature mean of the sub-feature information of the parent block corresponding to this category. Furthermore, the feature means of the sub-feature information of the parent block corresponding to each category can be used as the target fusion feature corresponding to the parent block.

[0167] In one embodiment, since the model for determining the block classification result of the parent block can only accept single-row sample data, for S103, after determining the sub-feature values of the sub-feature information of the parent block corresponding to each category, and the sub-feature values of the sub-feature information of each sub-block corresponding to each category, a first feature sequence corresponding to the parent block can also be generated based on the sub-feature values of the sub-feature information of the parent block corresponding to each category. For example, the first feature sequence corresponding to the parent block can be generated based on the sub-feature values of the sub-feature information of each category in the order of the column positions of the sub-feature information of each category in Table 1.

[0168] For each sub-block corresponding to the parent block, a second feature sequence corresponding to the sub-block can be generated based on the sub-feature values of the sub-feature information of the sub-block corresponding to each category. Furthermore, the second feature sequences corresponding to each sub-block can be generated, that is, the block feature information corresponding to each block is used as a feature sequence. Then, the first feature sequence and each second feature sequence can be concatenated to obtain a single-row target feature sequence.

[0169] After that, based on the target feature sequence, the target fusion feature corresponding to the parent block in the target block group can be determined.

[0170] Exemplarily, the generated target feature sequence can be directly used as the target fusion feature corresponding to the parent block; or, sequence modeling can be performed on the target feature sequence, and the result of the modeling can be used as the target fusion feature.

[0171] In another embodiment, for S103, after determining the sub-feature values of the sub-feature information of the parent block corresponding to each category, and the sub-feature values of the sub-feature information of each sub-block corresponding to each category, a first feature matrix can also be generated based on the sub-feature values of the sub-feature information of the parent block corresponding to each category. For example, according to the preset number of matrix rows and columns, the first feature matrix corresponding to the parent block can be generated based on the sub-feature values of the sub-feature information of each category in the order of the column positions of the sub-feature information of each category in Table 1. Similarly, for each sub-block corresponding to the parent block, a second feature matrix corresponding to the sub-block can be generated based on the sub-feature values of the sub-feature information of the sub-block corresponding to each category. Furthermore, the second feature matrices corresponding to each sub-block can be generated, that is, the block feature information corresponding to each block is used as a feature matrix.

[0172] Then, the first feature matrix and each second feature matrix can be fused to obtain a target feature matrix that can be used as single-row sample data.

[0173] After that, based on the target feature matrix, the target fusion feature corresponding to the parent block in the target block group can be determined.

[0174] Exemplarily, a model such as CNN (Convolutional Neural Networks) that can learn feature matrices can be used to model the target feature matrix, and based on the result obtained from the modeling, the target fusion feature corresponding to the parent block in the target block group can be determined.

[0175] In this way, based on any of the above ways of determining the target fusion feature, a feature vector with a dimension within 30 can ultimately be obtained. Compared with the pixel value features corresponding to the design draft pictures in the prior art (such as 224*224), the amount of data that the model needs to process is greatly reduced. This can not only reduce the difficulty of model inference, save computing power costs, but also improve the speed of model inference. Additionally, since the information contained in the target fusion feature is richer and more comprehensive, the accuracy of the block classification result output by the model is further improved.

[0176] In one embodiment, after obtaining the target fusion feature corresponding to the parent block in the target block group, the sibling blocks of the parent block in other block groups that have a sibling relationship with the parent block can also be determined. Among them, the blocks with a sibling relationship are the blocks corresponding to the same parent block.

[0177] Furthermore, in the case where the sibling blocks of the parent block have child blocks, the target fusion features corresponding to each sibling block can be obtained respectively, or alternatively, the block feature information corresponding to each sibling block can be directly obtained.

[0178] Taking the example of obtaining the target fusion features corresponding to each sibling block, the target fusion feature corresponding to the parent block and the target fusion features corresponding to each sibling block of the parent block can be fused to obtain a new target fusion feature corresponding to the parent block. Thus, the update of the target fusion feature corresponding to the parent block is realized, and a new target fusion feature that not only carries the block feature information of each child block but also carries the target fusion features corresponding to each sibling block is obtained, further improving the comprehensiveness and accuracy of the determined target fusion feature corresponding to the parent block.

[0179] Exemplarily, for the target fusion feature corresponding to the parent block and the target fusion features corresponding to each sibling block of the parent block, the target fusion features corresponding to the sub-feature information of the same category in the target fusion feature of the parent block and the target fusion features of each sibling block can be fused to obtain the fusion feature corresponding to the sub-feature information of each category. After that, the fusion feature corresponding to the sub-feature information of each category can be used as the new target fusion feature corresponding to the parent block.

[0180] In addition, in the case where there are no sub-blocks in each sibling block of the parent block, the block feature information corresponding to each sibling block can be obtained respectively, and in the same way as fusing the block feature information of the parent block and the block feature information of each sub-block corresponding to the parent block, the target fusion feature of the parent block and the block feature information corresponding to each sibling block can be fused to obtain the new target fusion feature corresponding to the parent block.

[0181] Based on this, the update of the target fusion feature of each parent block with sibling blocks can be realized, and the new target fusion feature corresponding to each of the above parent blocks can be obtained.

[0182] Furthermore, the model can be used to classify the parent block based on the determined new target fusion feature corresponding to the parent block, and determine the block classification result corresponding to the parent block.

[0183] Those skilled in the art can understand that in the above method of the specific implementation manner, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined according to its function and possible internal logic.

[0184] Based on the same inventive concept, an apparatus for extracting features of a design draft corresponding to the method for extracting features of a design draft is further provided in the embodiments of the present disclosure. Since the principle of solving problems by the apparatus in the embodiments of the present disclosure is similar to the above method for extracting features of a design draft in the embodiments of the present disclosure, the implementation of the apparatus can refer to the implementation of the method, and the repeated parts will not be described again.

[0185] As Figure 3 shown, it is a schematic diagram of an apparatus for extracting features of a design draft provided by an embodiment of the present disclosure, including:

[0186] An obtaining module 301, configured to obtain a to-be-processed design draft corresponding to a page;

[0187] A determining module 302, configured to identify the design draft, and determine at least one block group with a nesting relationship in the design draft and the block feature information of each block in the block group; the block corresponds to a page component in the page;

[0188] The fusion module 303 is configured to select a target block group from the at least one block group. For the target block group, according to the nesting relationship between different blocks in the target block group, fuse the block feature information of the parent block and the block feature information of each child block in the target block group to obtain the target fusion feature corresponding to the parent block; wherein, the target fusion feature is used to classify the parent block to obtain the block classification result of the parent block.

[0189] In a possible implementation manner, the apparatus further includes:

[0190] The deletion module 304 is configured to identify the design draft, determine and delete the transparent blocks in the design draft before determining the at least one block group with a nesting relationship in the design draft and the block feature information of each block in the block group; the transparent blocks correspond to invisible page components in the page.

[0191] In a possible implementation manner, the determination module 302 is configured to determine the position information and size information of each block in the design draft in the design draft;

[0192] Based on the position information and size information corresponding to each block, determine at least one block group with a nesting relationship in the design draft.

[0193] In a possible implementation manner, the fusion module 303 is configured to determine the parent block in the target block group and at least one child block corresponding to the parent block according to the nesting relationship between different blocks in the target block group;

[0194] Based on the block feature information of the parent block, determine the first feature value corresponding to the parent block, and based on the block feature information of each child block corresponding to the parent block, respectively determine the second feature value corresponding to each child block;

[0195] Based on the first feature value and the feature mean values corresponding to each of the second feature values, determine the target fusion feature corresponding to the parent block.

[0196] In a possible implementation manner, the block feature information includes multiple categories of sub-feature information;

[0197] The fusion module 303 is configured to, for each sub-feature information in the block feature information of the parent block, determine the sub-feature value corresponding to the sub-feature information based on the category and the sub-feature information of the sub-feature information;

[0198] Use the sub-feature value corresponding to each sub-feature information as the first feature value corresponding to the parent block.

[0199] In a possible implementation, the sub-feature value includes a first sub-feature value or a second sub-feature value;

[0200] The fusion module 303 is configured to, when it is determined that the category corresponding to the sub-feature information indicates that the data feature corresponding to the sub-feature information matches the discrete data feature, determine the first sub-feature value corresponding to the sub-feature information based on a preset feature value and the sub-feature information; or,

[0201] When it is determined that the category corresponding to the sub-feature information indicates that the data feature corresponding to the sub-feature information matches the continuous data feature, determine the second sub-feature value corresponding to the sub-feature information based on a feature value range and the sub-feature information.

[0202] In a possible implementation, the fusion module 303 is configured to, for the sub-feature information corresponding to each category of the parent block, determine the target sub-feature mean value corresponding to the sub-feature information of this category based on the sub-feature value corresponding to the first feature value for this sub-feature information and the sub-feature values corresponding to the second feature values of each sub-block for this sub-feature information;

[0203] Determine the target fusion feature corresponding to the parent block based on the target sub-feature mean values corresponding to the sub-feature information of each category.

[0204] In a possible implementation, the fusion module 303 is configured to determine the parent block in the target block group and at least one sub-block corresponding to the parent block according to the nesting relationship between different blocks in the target block group;

[0205] Based on the sub-feature information corresponding to each category of the parent block, determine the sub-feature value corresponding to the sub-feature information corresponding to each category of the parent block, and based on the sub-feature information corresponding to each category of the sub-feature information respectively corresponding to each sub-block of the parent block, determine the sub-feature value corresponding to the sub-feature information corresponding to each category of each sub-block;

[0206] Generate a first feature sequence based on the sub-feature values corresponding to the sub-feature information corresponding to each category of the parent block; and, generate second feature sequences corresponding to each sub-block respectively based on the sub-feature values corresponding to the sub-feature information corresponding to each category of each sub-block;

[0207] Concatenate the first feature sequence and each of the second feature sequences to obtain a target feature sequence;

[0208] Determine the target fusion feature corresponding to the parent block in the target block group based on the target feature sequence.

[0209] In a possible implementation, the fusion module 303 is configured to determine a parent block in the block group and at least one sub-block corresponding to the parent block according to the nesting relationship between different blocks in the block group;

[0210] Based on the sub-feature information of each category corresponding to the parent block, determine the sub-feature value of the sub-feature information of each category corresponding to the parent block, and based on the sub-feature information of each category corresponding to each sub-block corresponding to the parent block, determine the sub-feature value of the sub-feature information of each category corresponding to each sub-block;

[0211] Generate a first feature matrix based on the sub-feature value of the sub-feature information of each category corresponding to the parent block; and generate a second feature matrix corresponding to each sub-block based on the sub-feature value of the sub-feature information of each category corresponding to each sub-block;

[0212] Fuse the first feature matrix and each of the second feature matrices to obtain a target feature matrix;

[0213] Based on the target feature matrix, determine the target fusion feature corresponding to the parent block in the target block group.

[0214] In a possible implementation, the fusion module 303 is further configured to, after fusing the block feature information of the parent block in the target block group and the block feature information of each sub-block to obtain the target fusion feature corresponding to the parent block, obtain the target fusion feature corresponding to each sibling block of the parent block;

[0215] Fuse the target fusion feature corresponding to the parent block and the target fusion features corresponding to each sibling block of the parent block to obtain a new target fusion feature corresponding to the parent block.

[0216] The description of the processing flow of each module in the device and the interaction flow between the modules can refer to the relevant descriptions in the above method embodiments, which will not be elaborated here.

[0217] This disclosure embodiment also provides a computer device, as Figure 4 shown, which is a schematic structural diagram of a computer device provided by this disclosure embodiment, including:

[0218] A processor 41 and a memory 42; the memory 42 stores machine-readable instructions executable by the processor 41, and the processor 41 is configured to execute the machine-readable instructions stored in the memory 42. When the machine-readable instructions are executed by the processor 41, the processor 41 performs the following steps: S101: Obtain a design draft to be processed corresponding to a page; S102: Identify the design draft to determine at least one block group having a nested relationship in the design draft and block feature information of each block in the block group; a block corresponds to a page component in the page; and S103: Select a target block group from the at least one block group. For the target block group, according to the nested relationship between different blocks in the target block group, fuse the block feature information of the parent block and the block feature information of each child block in the target block group to obtain a target fusion feature corresponding to the parent block; wherein the target fusion feature is used to classify the parent block to obtain a block classification result of the parent block.

[0219] The above-mentioned memory 42 includes a memory 421 and an external memory 422; the memory 421 here is also called an internal memory, which is used to temporarily store the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk. The processor 41 exchanges data with the external memory 422 through the memory 421.

[0220] For the specific execution process of the above instructions, reference can be made to the steps of the method for extracting features of the design draft described in the embodiments of the present disclosure, which will not be elaborated here.

[0221] The embodiments of the present disclosure further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the method for extracting features of the design draft described in the above method embodiments. Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.

[0222] A computer program product for the method for extracting features of a design draft provided by the embodiments of the present disclosure includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the steps of the method for extracting features of the design draft described in the above method embodiments. Specifically, reference can be made to the above method embodiments, which will not be elaborated here.

[0223] The computer program product can be specifically implemented in a manner of hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.

[0224] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the devices described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein. In several embodiments provided by the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined, or some features can be ignored, or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

[0225] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0226] In addition, in each embodiment of the present disclosure, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0227] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present disclosure. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs that can store program codes.

[0228] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present disclosure, used to illustrate the technical solutions of the present disclosure, rather than limiting it. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present disclosure can still modify the technical solutions described in the foregoing embodiments or can easily think of changes, or perform equivalent replacements for some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should all be covered within the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.

Claims

1. A method for feature extraction of a design draft, characterized in that Including: Obtain the design draft to be processed corresponding to the page; Identify the design draft, and determine at least one block group with a nested relationship in the design draft and the block feature information of each block in the block group; The block corresponds to a page component in the page; Select a target block group from the at least one block group with a nested relationship. For the target block group, according to the nested relationship between different blocks in the target block group, fuse the block feature information of the parent block and the block feature information of each child block in the target block group to obtain the target fusion feature corresponding to the parent block; Wherein, the target fusion feature is used for a pre-trained model, and the pre-trained model processes the target fusion feature and outputs the block classification result of the parent block; Wherein, the step of fusing the block feature information of the parent block and the block feature information of each child block in the target block group according to the nested relationship between different blocks in the target block group to obtain the target fusion feature corresponding to the parent block includes: According to the nested relationship between different blocks in the target block group, determine the parent block in the target block group and at least one child block corresponding to the parent block; Based on the sub-feature information of each category corresponding to the parent block, determine the sub-feature value of the sub-feature information of each category corresponding to the parent block, and based on each child block corresponding to the parent block corresponding to the sub-feature information of each category, determine the sub-feature value of the sub-feature information of each category corresponding to each child block; Generate a first feature sequence based on the sub-feature value of the sub-feature information of each category corresponding to the parent block; and generate a second feature sequence corresponding to each child block based on the sub-feature value of the sub-feature information of each category corresponding to each child block; Concatenate the first feature sequence and each of the second feature sequences to obtain a target feature sequence; Based on the target feature sequence, determine the target fusion feature corresponding to the parent block in the target block group.

2. The method according to claim 1, characterized in that, Before determining at least one block group with a nested relationship in the design draft and the block feature information of each block in the block group, it further includes: Identify the design draft, and determine and delete the transparent blocks in the design draft; the transparent blocks correspond to invisible page components in the page.

3. The method according to claim 2, wherein The step of determining at least one block group with a nested relationship in the design draft includes: Determine the position information and size information of each block in the design draft; Based on the position information and size information corresponding to each block, determine at least one block group with a nested relationship in the design draft.

4. The method according to claim 1, wherein The step of fusing the block feature information of the parent block and the block feature information of each child block in the target block group according to the nested relationship between different blocks in the target block group to obtain the target fusion feature corresponding to the parent block includes: Determine the parent block in the target block group and at least one sub-block corresponding to the parent block according to the nesting relationship between different blocks in the target block group; Based on the block feature information of the parent block, determine the first feature value corresponding to the parent block, and based on the block feature information of each sub-block corresponding to the parent block, determine the second feature value corresponding to each sub-block respectively; Based on the first feature value and the feature mean values corresponding to each of the second feature values, determine the target fusion feature corresponding to the parent block.

5. The method according to claim 4, characterized in that The block feature information includes multiple categories of sub-feature information; Based on the block feature information of the parent block, determining the first feature value corresponding to the parent block includes: For each sub-feature information in the block feature information of the parent block, determine the sub-feature value corresponding to the sub-feature information based on the category of the sub-feature information and the sub-feature information; Use the sub-feature value corresponding to each sub-feature information as the first feature value corresponding to the parent block.

6. The method according to claim 5, characterized in that The sub-feature value includes a first sub-feature value or a second sub-feature value; Based on the category of the sub-feature information and the sub-feature information, determining the sub-feature value corresponding to the sub-feature information includes: When it is determined that the category corresponding to the sub-feature information indicates that the data feature corresponding to the sub-feature information matches the discrete data feature, determine the first sub-feature value corresponding to the sub-feature information based on a preset feature value and the sub-feature information; Or, When it is determined that the category corresponding to the sub-feature information indicates that the data feature corresponding to the sub-feature information matches the continuous data feature, determine the second sub-feature value corresponding to the sub-feature information based on the feature value range and the sub-feature information.

7. The method according to claim 6, characterized in that, The determining the target fusion feature corresponding to the parent block based on the first feature value and the feature mean values corresponding to each of the second feature values includes: For each category of sub-feature information corresponding to the parent block, determine the target sub-feature mean value corresponding to the category of sub-feature information based on the sub-feature value corresponding to the sub-feature information of the first feature value and the sub-feature values corresponding to the sub-feature information of the second feature values of each sub-block; Based on the target sub-feature mean values corresponding to each category of sub-feature information, determine the target fusion feature corresponding to the parent block.

8. The method according to claim 1, wherein The fusing the block feature information of the parent block in the target block group and the block feature information of each sub-block to obtain the target fusion feature corresponding to the parent block according to the nesting relationship between different blocks in the target block group includes: Determine the parent block in the block group and at least one sub-block corresponding to the parent block according to the nesting relationship between different blocks in the block group; Based on each category of sub-feature information corresponding to the parent block, determine the sub-feature value corresponding to each category of sub-feature information of the parent block, and based on each category of sub-feature information corresponding to each sub-block corresponding to the parent block, determine the sub-feature value corresponding to each category of sub-feature information of each sub-block respectively; Generate a first feature matrix based on the sub-feature values of the sub-feature information corresponding to each category for the parent block; and, generate a second feature matrix corresponding to each sub-block based on the sub-feature values of the sub-feature information corresponding to each category for each sub-block. Fuse the first feature matrix and each of the second feature matrices to obtain a target feature matrix. Based on the target feature matrix, determine the target fusion feature corresponding to the parent block in the target block group.

9. The method according to claim 1, characterized in that, After fusing the block feature information of the parent block and the block feature information of each sub-block in the target block group to obtain the target fusion feature corresponding to the parent block, it further includes: Obtain the target fusion feature corresponding to each sibling block of the parent block. Fuse the target fusion feature corresponding to the parent block and the target fusion features corresponding to each sibling block of the parent block to obtain a new target fusion feature corresponding to the parent block.

10. A feature extraction device for a design draft, characterized in that, Include: An acquisition module for acquiring the design draft to be processed corresponding to the page. A determination module for identifying the design draft to determine at least one block group with a nested relationship in the design draft and the block feature information of each block in the block group. The block corresponds to a page component in the page. A fusion module for selecting a target block group from the at least one block group with a nested relationship, and for the target block group, according to the nested relationship between different blocks in the target block group, fuse the block feature information of the parent block and the block feature information of each sub-block in the target block group to obtain the target fusion feature corresponding to the parent block. Wherein, the target fusion feature is used for a pre-trained model, and the pre-trained model processes the target fusion feature and outputs the block classification result of the parent block. Wherein, the fusion module is further used for: According to the nested relationship between different blocks in the target block group, determine the parent block in the target block group and at least one sub-block corresponding to the parent block. Based on the sub-feature information corresponding to each category for the parent block, determine the sub-feature values of the sub-feature information corresponding to each category for the parent block, and based on the sub-feature information corresponding to each category for each sub-block corresponding to the parent block, determine the sub-feature values of the sub-feature information corresponding to each category for each sub-block. Generate a first feature sequence based on the sub-feature values of the sub-feature information corresponding to each category for the parent block; and, generate a second feature sequence corresponding to each sub-block based on the sub-feature values of the sub-feature information corresponding to each category for each sub-block. Concatenate the first feature sequence and each of the second feature sequences to obtain a target feature sequence. Based on the target feature sequence, determine the target fusion feature corresponding to the parent block in the target block group.

11. A computer device, characterized in that, Include: A processor and a memory, the memory stores machine-readable instructions executable by the processor, the processor is configured to execute the machine-readable instructions stored in the memory, and when the machine-readable instructions are executed by the processor, the processor executes the steps of the feature extraction method of the design draft according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is run by a computer device, the computer device executes the steps of the feature extraction method of the design draft according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Feature extraction method and apparatus, computer program, storage medium and electronic device

    CN108229302A

  • Method and device for identifying attribute of target object, electronic equipment and storage medium

    CN111598164A

  • Data processing method and system, visual manuscript processing method and system and electronic equipment

    CN113296769A