Method and device for automatically extracting style

By automatically extracting the target attribute values ​​​​in the design drawing and filling in the style template, it solves the problem of low efficiency of designers when creating styles, achieves fast and accurate style generation, and improves work efficiency.

CN118642801APending Publication Date: 2024-09-13BEIJING CHUANGZUOMEIHAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410701055.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

When designers create styles, they need to abstract and separate layer attributes from the design drawings many times, resulting in low work efficiency and prone to errors.

Method used

By reading the target attribute values ​​in the design drawing, filter out the attribute values ​​that meet the design specifications, and fill them into the preset style template, automatically extracting the target style and reducing manual operations.

Benefits of technology

It improves the designer's work efficiency, reduces the time and error rate of style creation, and realizes the automated style extraction process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118642801A
    Figure CN118642801A
Patent Text Reader

Abstract

The invention provides a method and device for automatically extracting a style, and the method comprises the steps: reading a plurality of first attribute values of a target attribute in a design drawing, the target attribute being any layer attribute in the design drawing; screening out at least one second attribute value from the plurality of first attribute values; and filling the second attribute value into a preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute. According to the scheme, the styles are automatically extracted by utilizing the attribute values in the design drawing, a designer does not need to abstractly separate layer attributes from the design drawing and then create the styles one by one, and the working efficiency of the designer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of design software and graphic design, and in particular to a method and device for automatically extracting a style. Background Art

[0002] When designers draw designs, they usually start by drawing them based on their visual perception and experience. After determining the visual effect, they create various layer attributes in the design as styles one by one (i.e., create style specifications).

[0003] However, when creating a style, the designer needs to re-examine the entire design drawing, abstract and separate the layer attributes that should be standardized from the design drawing, and then create these layer attributes that should be standardized as styles one by one; the aforementioned style creation operation needs to be repeated dozens or hundreds of times and is prone to errors, which seriously affects the designer's work efficiency. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a method and device for automatically extracting styles to solve the problems existing in the current way of creating styles, such as affecting the work efficiency of designers.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] A first aspect of an embodiment of the present invention discloses a method for automatically extracting a style, the method comprising:

[0007] Reading a plurality of first attribute values ​​of a target attribute in a design drawing, wherein the target attribute is an attribute of any layer in the design drawing;

[0008] Filtering at least one second attribute value from the plurality of first attribute values;

[0009] The second attribute value is filled into a preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute.

[0010] Preferably, selecting at least one second attribute value from the plurality of first attribute values ​​comprises:

[0011] determining a range of attribute values ​​corresponding to the target attribute from the design specification;

[0012] At least one of the first attribute values ​​within the attribute value range is screened out to obtain at least one second attribute value.

[0013] Preferably, filling the second attribute value into a preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute includes:

[0014] Counting the number of times the second attribute value is used in the design drawing;

[0015] sorting the second attribute values ​​in descending order according to the number of times used;

[0016] In descending order of attribute values, the first n second attribute values ​​sorted in descending order are sequentially filled into the preset style template corresponding to the target attribute to obtain the target style corresponding to the target attribute, where n is greater than or equal to 1.

[0017] Preferably, in descending order of attribute values, the first n second attribute values ​​sorted in descending order are sequentially filled into the preset style template corresponding to the target attribute to obtain the target style corresponding to the target attribute, including:

[0018] In descending order of attribute values, the first n second attribute values ​​sorted in descending order are sequentially filled into the preset style template corresponding to the target attribute;

[0019] A target style corresponding to the target attribute is created based on the style template filled with the second attribute value.

[0020] Preferably, after obtaining the target style corresponding to the target attribute, the method further includes:

[0021] Generate a specification diagram corresponding to the target style.

[0022] A second aspect of an embodiment of the present invention discloses a device for automatically extracting a pattern, the device comprising:

[0023] A reading unit, used for reading a plurality of first attribute values ​​of a target attribute in a design drawing, wherein the target attribute is an attribute of any layer in the design drawing;

[0024] a screening unit, configured to screen out at least one second attribute value from the plurality of first attribute values;

[0025] The processing unit is used to fill the second attribute value into the preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute.

[0026] Preferably, the screening unit comprises:

[0027] A determination module, used to determine a property value range corresponding to the target property from a design specification;

[0028] The screening module is used to screen out at least one of the first attribute values ​​within the attribute value range to obtain at least one second attribute value.

[0029] Preferably, the processing unit comprises:

[0030] A statistics module, used for counting the number of times the second attribute value is used in the design diagram;

[0031] A sorting module, used for sorting the second attribute values ​​according to the number of times of use;

[0032] The processing module is used to fill the first n second attribute values ​​sorted in descending order into the preset style template corresponding to the target attribute in order to obtain the target style corresponding to the target attribute, where n is greater than or equal to 1.

[0033] Preferably, the processing module is specifically used to: fill the first n second attribute values ​​sorted in descending order into the preset style template corresponding to the target attribute in order according to the attribute value order from large to small; and create a target style corresponding to the target attribute based on the style template filled with the second attribute values.

[0034] Preferably, the processing unit is further used to: generate a standard description diagram corresponding to the target style.

[0035] Based on the above-mentioned embodiment of the present invention, a method and device for automatically extracting styles are provided. The method is as follows: read multiple first attribute values ​​of a target attribute in a design drawing, where the target attribute is any layer attribute in the design drawing; filter out at least one second attribute value from the multiple first attribute values; fill the second attribute value into a preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute. In this solution, multiple first attribute values ​​of the target attribute are read from the design drawing, and at least one second attribute value is filtered out from the multiple first attribute values. Fill the filtered second attribute value into the style template corresponding to the target attribute to obtain a target style corresponding to the target attribute. The attribute values ​​in the design drawing are used to automatically extract the style. There is no need for the designer to abstractly separate the layer attributes from the design drawing and then create styles one by one, thereby improving the designer's work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0037] Figure 1 A flowchart of a method for automatically extracting a style provided by an embodiment of the present invention;

[0038] Figure 2 A flow chart of generating a target style provided by an embodiment of the present invention;

[0039] Figure 3 An example diagram of a rounded corner style provided by an embodiment of the present invention;

[0040] Figure 4 An example diagram of a rounded corner specification diagram provided in an embodiment of the present invention;

[0041] Figure 5 A structural block diagram of a device for automatically extracting patterns provided by an embodiment of the present invention;

[0042] Figure 6 Another structural block diagram of an apparatus for automatically extracting patterns provided by an embodiment of the present invention;

[0043] Figure 7 Another structural block diagram of an apparatus for automatically extracting patterns provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0046] In a designer's work scenario, when a designer starts to draw a design, he usually does not formulate a complete design specification before drawing the design. Instead, he draws the design based on visual feelings and experience. After determining the visual effect, he creates various layer attributes in the design as styles one by one (that is, creates style specifications).

[0047] In the above situation, the subsequent process of establishing design specifications will be very complicated and time-consuming. Specifically, the designer needs to re-examine the entire design drawing, abstract and separate the layer attributes that should be standardized from the design drawing, and then create these layer attributes that should be standardized as styles one by one; the above-mentioned style creation operation needs to be repeated dozens or hundreds of times and is prone to errors, which seriously affects the designer's work efficiency.

[0048] Therefore, this solution proposes a method and device for automatically extracting styles, which reads multiple first attribute values ​​of a target attribute from a design drawing, and selects at least one second attribute value from the multiple first attribute values. The selected second attribute value is filled into a style template corresponding to the target attribute to obtain a target style corresponding to the target attribute, and the attribute values ​​in the design drawing are used to automatically extract the style, without the need for designers to abstractly separate layer attributes from the design drawing and then create styles one by one, thereby improving the work efficiency of designers.

[0049] In practical applications, this solution can be applied in design software. By identifying the layer data of the design drawing, and then analyzing, extracting, calculating and processing the layer data, a set of styles that meet the design specifications is obtained, thereby helping designers to quickly establish design specifications and improve work efficiency. The following is a detailed description of this solution through various embodiments.

[0050] See also Figure 1 , shows a flow chart of a method for automatically extracting a style provided by an embodiment of the present invention, the method comprising the following steps:

[0051] Step S101: Read multiple first attribute values ​​of target attributes in the design drawing.

[0052] In the process of implementing step S101, the attribute value of the target attribute is read from the design drawing, thereby obtaining multiple first attribute values ​​of the target attribute. The first attribute value is the attribute value of the target attribute in the design drawing. The target attribute is any layer attribute (radius attribute, stroke attribute, etc.) in the design drawing.

[0053] For example, assuming that the target attribute is the rounded corner attribute, multiple first attribute values ​​of the rounded corner attribute are read from the design drawing as follows:

[0054] border-radius:1px(pixel);

[0055] border-radius:4px;

[0056] border-radius:6px;

[0057] border-radius:8px;

[0058] border-radius:12px;

[0059] border-radius:16px;

[0060] border-radius:20px;

[0061] border-radius:60px;

[0062] It should be noted that in the above example, a layer in the design drawing has only one rounded corner attribute.

[0063] Step S102: Filter out at least one second attribute value from the plurality of first attribute values.

[0064] It should be noted that the design specifications usually define the attribute value range (also called reasonable range) corresponding to each layer attribute.

[0065] In the specific implementation of step S102 , the attribute value range corresponding to the target attribute is determined from the design specification; at least one first attribute value within the attribute value range is screened out to obtain at least one second attribute value.

[0066] That is to say, after reading multiple first attribute values ​​of the target attribute from the design drawing, first determine the attribute value range corresponding to the target attribute from the design specification, and then filter out at least one first attribute value within the attribute value range corresponding to the target attribute to obtain at least one second attribute value, where the second attribute value is the first attribute value within the attribute value range corresponding to the target attribute; the above process is equivalent to eliminating first attribute values ​​that are too large and too small, and filtering out all first attribute values ​​that meet the design specification to obtain second attribute values.

[0067] For example: design specifications usually define that the rounded corner value will not exceed 50px and will not be less than 2px, so the attribute value range corresponding to the rounded corner attribute in the design specifications is "greater than or equal to 2px and less than or equal to 50px"; assuming that the target attribute is the rounded corner attribute, the multiple first attribute values ​​of the rounded corner attribute (in this case, the rounded corner value) are 1px, 4px, 6px, 8px, 12px, 16px, 20px, and 60px; discard the first attribute values ​​of 1px and 60px, and the remaining 4px, 6px, 8px, 12px, 16px, and 20px are the second attribute values.

[0068] Step S103: Fill the second attribute value into the preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute.

[0069] It should be noted that a corresponding style template is preset for each layer attribute, and the number of style templates corresponding to each layer attribute is n, where n is greater than or equal to 1.

[0070] In the specific implementation of step S103, after the second attribute value is obtained by screening, the second attribute value obtained by screening is filled into the style template corresponding to the target attribute to obtain the target style corresponding to the target attribute.

[0071] In some embodiments, after obtaining the target style corresponding to the target attribute, a specification diagram corresponding to the target style is generated; specifically, based on the target style, a specification diagram corresponding to the target style is drawn in a canvas of a design software.

[0072] For example: assuming that the target attribute is a rounded corner attribute, after obtaining the rounded corner style as the target style, a rounded corner specification diagram is drawn in the canvas of the design software based on the rounded corner style.

[0073] In some embodiments, after obtaining the target style and the standard description diagram corresponding to the drawing target style, the standard description diagram corresponding to the target style and the drawing target style is output and displayed.

[0074] Through the above steps S101 to S103, similar processing is performed on each layer attribute in the design drawing, thereby obtaining a style and specification description diagram corresponding to each layer attribute in the design drawing.

[0075] In an embodiment of the present invention, multiple first attribute values ​​of a target attribute are read from a design drawing, and at least one second attribute value is screened out from the multiple first attribute values. The screened second attribute value is filled into a style template corresponding to the target attribute to obtain a target style corresponding to the target attribute, and the attribute value in the design drawing is used to automatically extract the style, without the need for the designer to abstractly separate the layer attributes from the design drawing and then create styles one by one, thereby improving the designer's work efficiency.

[0076] For the above-mentioned embodiment of the present invention Figure 1 For the content of obtaining the target style corresponding to the target attribute involved in step S103, see Figure 2 , which shows a flow chart of generating a target style provided by an embodiment of the present invention, Figure 2 The following steps are involved:

[0077] Step S201: Count the number of times the second attribute value is used in the design drawing.

[0078] In the specific implementation of step S201, after selecting at least one second attribute value, the number of times each second attribute value is used in the design drawing is counted to obtain the number of times each second attribute value is used.

[0079] For example: suppose the target attribute is the rounded corner attribute; there are 10,000 layers in the design drawing, and 2,000 layers in the design drawing use the rounded corner attribute; further subdivided, among these 2,000 layers using the rounded corner attribute, 500 layers use the rounded corner attribute with an attribute value of 4px, and 1,500 layers use the rounded corner attribute with an attribute value of 8px; then, the attribute value 4px is used 500 times in the design drawing, and the attribute value 8px is used 1,500 times in the design drawing; the above method can be used to count the number of times each second attribute value is used in the design drawing

[0080] Step S202: sort the second attribute values ​​in descending order according to the number of times used.

[0081] In the specific implementation of step S202, after obtaining the usage count of each second attribute value, the second attribute values ​​are sorted in descending order according to the order of the usage count from most to least.

[0082] For example: assuming the target attribute is the rounded corner attribute, the second attribute values ​​are: 4px, 6px, 8px, 12px, 16px, 20px; the number of times each second attribute value is used is: 4px (5 times), 6px (2 times), 8px (11 times), 12px (8 times), 16px (3 times), 20px (1 time); the sorting result of sorting the second attribute values ​​in descending order according to the number of times used is: 8px (11 times), 12px (8 times), 4px (5 times), 16px (3 times), 6px (2 times), 20px (1 time).

[0083] It should be noted that the number of times an attribute value is used can be used to represent the importance of the attribute value to the designer. The more times it is used, the more important the attribute value is.

[0084] Step S203: in descending order of attribute values, the first n second attribute values ​​sorted in descending order are sequentially filled into the preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute.

[0085] In the specific implementation process of step S203, the first n second attribute values ​​sorted in descending order are sequentially filled into the preset style template corresponding to the target attribute in the order of attribute values ​​from large to small; based on the style template filled with the second attribute values, a target style corresponding to the target attribute is created.

[0086] Specifically, after sorting each second attribute value in descending order according to the number of times used, take the second attribute values ​​ranked first in terms of number of times used; sort these first n second attribute values ​​in order of attribute value from large to small; fill the second attribute values ​​ranked first in terms of number of times used into the n style templates corresponding to the target attribute in order from large to small (these style templates are also sorted in advance); based on these n style templates filled with the second attribute values, create a target style corresponding to the target attribute.

[0087] For example: Assume that the target attribute is the rounded corner attribute, and n is 4; after sorting the second attribute values ​​in descending order according to the number of times used, the second attribute values ​​with the top four times used are 8px (11 times), 12px (8 times), 4px (5 times), and 16px (3 times); sorting these four second attribute values ​​from large to small, the results are: 16px, 12px, 8px, 4px; fill the four second attribute values ​​16px, 12px, 8px, and 4px into the four style templates of Radius-extra-large (extra-large rounded corners), Radius-large (large rounded corners), Radius-mid (medium rounded corners), and Radius-small (small rounded corners) in sequence, and get the following content:

[0088] Radius-extra-large: 16px;

[0089] Radius-large: 12px;

[0090] Radius-mid: 8px;

[0091] Radius-small: 4px;

[0092] Based on the style template filled with the second attribute value, a target style (rounded corner style) corresponding to the target attribute (rounded corner attribute) is created in the design software.

[0093] It is worth mentioning that some of the design specifications are universal styles (that is, universal style specifications) applicable to any design team and any design product. These universal styles do not need to be extracted from the design drawings and can be generated directly.

[0094] In some embodiments, when an operation for generating a universal style template is detected, a universal style template corresponding to the target attribute is created, and the universal style template already carries a universal attribute value; accordingly, when creating a target template corresponding to the target attribute, a target style corresponding to the target attribute is created based on the style template filled with the second attribute value and the universal style template.

[0095] For example, when the target attribute is the rounded corner attribute, full rounded corners are a style often used on buttons during the design process. This style is applicable to any design scenario where a capsule button needs to be created. Therefore, a universal full rounded corner style template (i.e., universal style template) can be created in the design specification. The full rounded corner style template is "Radius-full: 9999px", where 9999px is the universal rounded corner attribute value.

[0096] above Figure 2 This is an explanation of how to generate the target style.

[0097] To better understand the above embodiments of the present invention Figure 1 and Figure 2 For example, the target attribute is the rounded corner attribute and the target style is the rounded corner style. Through process A1-A6 and combined Figure 3 , Figure 4 Give an example.

[0098] A1. Read multiple first attribute values ​​of the rounded corner attribute from the design drawing. The multiple first attribute values ​​are as follows:

[0099] border-radius:1px;

[0100] border-radius:4px;

[0101] border-radius:6px;

[0102] border-radius:8px;

[0103] border-radius:12px;

[0104] border-radius:16px;

[0105] border-radius:20px;

[0106] border-radius:60px.

[0107] A2. Remove the first attribute values ​​that are too large or too small, and filter out all the first attribute values ​​that meet the design specifications to obtain the second attribute values; among which, the attribute value range corresponding to the rounded corner attribute is "greater than or equal to 2px and less than or equal to 50px", and the second attribute values ​​obtained by filtering out are 4px, 6px, 8px, 12px, 16px, and 20px respectively.

[0108] A3. Count the number of times each second attribute value is used in the design drawing. The number of times each second attribute value is used is: 4px (5 times), 6px (2 times), 8px (11 times), 12px (8 times), 16px (3 times), 20px (1 time); take the second attribute values ​​with the top 4 usages: 8px (11 times), 12px (8 times), 4px (5 times), 16px (3 times).

[0109] A4. Sort the second attribute values ​​of the top four used times from largest to smallest, and the results are: 16px, 12px, 8px, 4px; fill the four second attribute values ​​16px, 12px, 8px, 4px into the four style templates of Radius-extra-large, Radius-large, Radius-mid, and Radius-small in order, and get the following content:

[0110] Radius-extra-large: 16px;

[0111] Radius-large: 12px;

[0112] Radius-mid: 8px;

[0113] Radius-small: 4px.

[0114] A5. Create a universal full-rounded corner style template. The full-rounded corner style template is "Radius-full: 9999px". 9999px is the universal rounded corner attribute value.

[0115] A6. Based on the style template filled with the second attribute value and the full-rounded corner style template carrying the common rounded corner attribute value, create a design file for executing the "style extraction" function in the design software. Figure 3 The rounded corner style shown; and draw the following in the canvas Figure 4 The following figure shows the corresponding rounded corner specifications for each rounded corner style.

[0116] The above processes A1-A6 are examples of this solution; this solution can automatically extract styles from design drawings, without the need for designers to manually create styles one by one, saving a lot of time and improving the work efficiency of designers; this solution can be applied to the generation of various styles such as rounded corner styles, stroke styles, projection styles, inner shadow styles, background blur styles, etc.

[0117] Corresponding to the method for automatically extracting a style provided by the above embodiment of the present invention, see Figure 5, the embodiment of the present invention also provides a structural block diagram of a device for automatically extracting a pattern, the device comprising: a reading unit 501, a screening unit 502 and a processing unit 503;

[0118] The reading unit 501 is used to read a plurality of first attribute values ​​of a target attribute in the design drawing, where the target attribute is an attribute of any layer in the design drawing.

[0119] The screening unit 502 is used to screen out at least one second attribute value from the multiple first attribute values.

[0120] The processing unit 503 is configured to fill the second attribute value into a preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute.

[0121] Preferably, the processing unit 503 is further used to: generate a standard description diagram corresponding to the target style.

[0122] In an embodiment of the present invention, multiple first attribute values ​​of a target attribute are read from a design drawing, and at least one second attribute value is screened out from the multiple first attribute values. The screened second attribute value is filled into a style template corresponding to the target attribute to obtain a target style corresponding to the target attribute, and the attribute value in the design drawing is used to automatically extract the style, without the need for the designer to abstractly separate the layer attributes from the design drawing and then create styles one by one, thereby improving the designer's work efficiency.

[0123] Preferably, combined Figure 5 , see Figure 6 , shows another structural block diagram of an apparatus for automatically extracting patterns provided by an embodiment of the present invention, wherein the screening unit 502 includes:

[0124] The determination module 5021 is used to determine the attribute value range corresponding to the target attribute from the design specification.

[0125] The screening module 5022 is used to screen out at least one first attribute value within the attribute value range to obtain at least one second attribute value.

[0126] Preferably, combined Figure 5 , see Figure 7 , shows another structural block diagram of an apparatus for automatically extracting a pattern provided by an embodiment of the present invention, wherein the processing unit 503 includes:

[0127] The statistical module 5031 is used to count the number of times the second attribute value is used in the design drawing.

[0128] The sorting module 5032 is used to sort the second attribute values ​​according to the number of times they are used.

[0129] The processing module 5033 is used to fill the first n second attribute values ​​sorted in descending order into the preset style template corresponding to the target attribute in order to obtain the target style corresponding to the target attribute, where n is greater than or equal to 1.

[0130] In a specific implementation, the processing module 5033 is specifically used to: fill the first n second attribute values ​​sorted in descending order into the preset style template corresponding to the target attribute in order according to the attribute value order from large to small; and create a target style corresponding to the target attribute based on the style template filled with the second attribute values.

[0131] In summary, the embodiments of the present invention provide a method and device for automatically extracting styles, which reads multiple first attribute values ​​of a target attribute from a design drawing, and selects at least one second attribute value from the multiple first attribute values. The second attribute value obtained by selection is filled into a style template corresponding to the target attribute to obtain a target style corresponding to the target attribute, and the attribute values ​​in the design drawing are used to automatically extract the style, without the need for the designer to abstractly separate the layer attributes from the design drawing and then create styles one by one, thereby improving the designer's work efficiency.

[0132] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0133] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0134] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for automatically extracting a style, characterized in that: The method comprises: Reading a plurality of first attribute values ​​of a target attribute in a design drawing, wherein the target attribute is an attribute of any layer in the design drawing; Filtering at least one second attribute value from the plurality of first attribute values; The second attribute value is filled into a preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute.

2. The method according to claim 1, characterized in that Filtering at least one second attribute value from the plurality of first attribute values ​​comprises: determining a range of attribute values ​​corresponding to the target attribute from the design specification; At least one of the first attribute values ​​within the attribute value range is screened out to obtain at least one second attribute value.

3. The method according to claim 1, characterized in that Filling the second attribute value into a preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute includes: Counting the number of times the second attribute value is used in the design drawing; sorting the second attribute values ​​in descending order according to the number of times used; In descending order of attribute values, the first n second attribute values ​​sorted in descending order are sequentially filled into the preset style template corresponding to the target attribute to obtain the target style corresponding to the target attribute, where n is greater than or equal to 1.

4. The method according to claim 3, characterized in that In descending order of attribute values, the first n second attribute values ​​sorted in descending order are sequentially filled into the preset style template corresponding to the target attribute to obtain the target style corresponding to the target attribute, including: In descending order of attribute values, the first n second attribute values ​​sorted in descending order are sequentially filled into the preset style template corresponding to the target attribute; A target style corresponding to the target attribute is created based on the style template filled with the second attribute value.

5. The method according to any one of claims 1 to 4, characterized in that: After obtaining the target style corresponding to the target attribute, the method further includes: Generate a specification diagram corresponding to the target style.

6. A device for automatically extracting a pattern, characterized in that: The device comprises: A reading unit, used for reading a plurality of first attribute values ​​of a target attribute in a design drawing, wherein the target attribute is an attribute of any layer in the design drawing; a screening unit, configured to screen out at least one second attribute value from the plurality of first attribute values; The processing unit is configured to fill the second attribute value into a preset style template corresponding to the target attribute to obtain a target style corresponding to the target attribute.

7. The device according to claim 6, characterized in that The screening unit comprises: A determination module, used to determine a property value range corresponding to the target property from a design specification; The screening module is used to screen out at least one of the first attribute values ​​within the attribute value range to obtain at least one second attribute value.

8. The device according to claim 6, characterized in that The processing unit comprises: A statistics module, used for counting the number of times the second attribute value is used in the design diagram; A sorting module, used for sorting the second attribute values ​​according to the number of times of use; The processing module is used to fill the first n second attribute values ​​sorted in descending order into the preset style template corresponding to the target attribute in order to obtain the target style corresponding to the target attribute, where n is greater than or equal to 1.

9. The device according to claim 8, characterized in that The processing module is specifically used to: fill the first n second attribute values ​​sorted in descending order into the preset style template corresponding to the target attribute in sequence according to the attribute value order from large to small; and create a target style corresponding to the target attribute based on the style template filled with the second attribute values.

10. The device according to any one of claims 6 to 9, characterized in that The processing unit is also used to generate a standard description diagram corresponding to the target style.