Front-end interface style updating method and device
The semantic matching of user styles and template styles and color theme corrections are solved through a large language model, which solves the problem that front-end interface design does not meet user needs in the existing technology, and improves design efficiency and consistency.
Patent Information
- Application Number
- CN202411207880.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-12
AI Technical Summary
In the prior art, although the front-end interface design generated based on template ideas is fast, the generated content does not meet the design requirements of the user team, resulting in designers needing manual adjustments, which is time-consuming and labor-consuming.
Through a large language model, the user style name is semantically matched with the template style name, replace the template style in the front-end interface with the user style, and correct the parameters according to the color theme of the design drawing to generate a style that is more in line with user needs.
It reduces designers' time and energy in style adjustment, improves design efficiency, and makes the front-end interface more in line with user's design needs.
Smart Images

Figure CN118939263A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of front-end design, and in particular to a method and device for updating the style of a front-end interface. Background Art
[0002] In design tools, there is already a method for generating UI (User Interface) design content based on template ideas. The core idea is to search and recall the information provided by the user (design drawings or input text descriptions) in the template library to find matching content, helping users to quickly generate design content to improve the work efficiency of designers.
[0003] In actual work scenarios, the design team that the user belongs to will develop a style library of its own team (including colors and rounded corners), and use these styles when drawing designs. However, since the existing method is a template-based generation idea, the generated content itself is a fixed template and does not meet the design requirements of the user team. Although the rapid generation of design templates can help designers save time, after the generation is completed, the user needs to manually adjust the content and apply the style defined by his or her team. This process still takes a lot of time and effort. Summary of the invention
[0004] The present application provides a method and device for updating the style of a front-end interface, the purpose of which is to update the style on the front-end interface.
[0005] In order to achieve the above objectives, this application provides the following technical solutions:
[0006] A method for updating the style of a front-end interface, comprising:
[0007] Determine a corresponding user style library based on the user style used in the user's design drawing;
[0008] Read the user style names of all user styles in the user style library;
[0009] Inputting the multiple user style names obtained by reading and the template style names of all template styles in the template style library into a preset large language model in a unified data format to obtain a first semantic matching result output by the large language model; the first semantic matching result includes a first matching relationship between the user style name and the template style name;
[0010] According to the first matching relationship, the first template style used in the front-end interface is replaced with the first user style; the user style name of the first user style matches the template style name of the first template style.
[0011] Optionally, based on the user style used in the user's design drawing, a corresponding user style library is determined, including:
[0012] Obtain data sources of multiple user styles used in the user's design drawing;
[0013] Count the usage times corresponding to various data sources; various data sources include local style libraries and team style libraries; the usage times represent the total number of user styles belonging to the data source in the design drawing;
[0014] If the number of times the local style library is used is greater than the number of times the team style library is used, the local style library is determined to be the corresponding user style library;
[0015] If the number of times the local style library is used is not greater than the number of times the team style library is used, the user style library is determined based on the team style library.
[0016] Optionally, the method further includes:
[0017] If the individual template style name does not match the user style name, and the type of the template style to which the individual template style name belongs is a color style, based on the color theme of the design drawing, modify the parameters of the individual template style to obtain a corresponding modified template style;
[0018] The individual template styles in the front-end interface are replaced with the revised template styles.
[0019] Optionally, based on the color theme of the design drawing, modifying the parameters of the individual template style to obtain a corresponding modified template style includes:
[0020] Obtaining the fill color of each drawing object in the design drawing;
[0021] Analyze the fill color of each of the drawing objects to obtain a first value and a second value; the first value represents the number of drawing objects whose saturation of the fill color meets the first threshold and whose brightness meets the second threshold; the second value represents the number of drawing objects whose saturation of the fill color meets the third threshold and whose brightness meets the fourth threshold;
[0022] Determining a color theme of the design drawing based on a comparison result of the first value and the second value;
[0023] Based on the color theme of the design drawing, the parameters of the individual template styles are modified to obtain the corresponding modified template styles.
[0024] Optionally, determining a color theme of the design drawing based on a comparison result of the first value and the second value includes:
[0025] If the first value is greater than or equal to the second value, determining that the color theme of the design drawing is a bright color;
[0026] If the first value is less than the second value, it is determined that the color theme of the design drawing is dark.
[0027] Optionally, based on the color theme of the design drawing, modifying the parameters of the individual template style to obtain a corresponding modified template style includes:
[0028] Based on a preset color value mapping relationship table, a target color value parameter corresponding to the color theme of the design drawing and the individual template style name is determined; the color value mapping relationship table includes a plurality of color value parameters, and a template style name and a color theme corresponding to each of the color value parameters;
[0029] The color value parameters in the individual template pattern are replaced with the target color value parameters to obtain the corresponding modified template pattern.
[0030] Optionally, the method further includes:
[0031] If the user style is not used in the design drawing, generating a design style set based on a preset style specification;
[0032] Read the design style names of all design styles in the design style set;
[0033] Inputting the read multiple design style names and multiple template style names into the large language model in a unified data format to obtain a second semantic matching result output by the large language model; the second semantic matching result includes a second matching relationship between the design style name and the template style name;
[0034] According to the second matching relationship, the second template style used in the front-end interface is replaced with a second user style; the user style name of the second user style matches the template style name of the second template style.
[0035] A front-end interface style updating device, comprising:
[0036] A style library determination unit, used to determine a corresponding user style library based on a user style used in a user's design drawing;
[0037] A name reading unit, used for reading the user style names of all user styles in the user style library;
[0038] a name matching unit, configured to input the plurality of user style names obtained by reading and the template style names of all template styles in the template style library into a preset large language model in a unified data format, so as to obtain a first semantic matching result output by the large language model; the first semantic matching result includes a first matching relationship between the user style name and the template style name;
[0039] A style replacement unit is used to replace the first template style used in the front-end interface with a first user style according to the first matching relationship; the user style name of the first user style matches the template style name of the first template style.
[0040] Optionally, the style library determining unit is specifically used to:
[0041] Obtain data sources of multiple user styles used in the user's design drawing;
[0042] Count the usage times corresponding to various data sources; various data sources include local style libraries and team style libraries; the usage times represent the total number of user styles belonging to the data source in the design drawing;
[0043] If the number of times the local style library is used is greater than the number of times the team style library is used, the local style library is determined to be the corresponding user style library;
[0044] If the number of times the local style library is used is not greater than the number of times the team style library is used, the user style library is determined based on the team style library.
[0045] Optionally, the device further comprises:
[0046] A style correction unit is used to: if an individual template style name does not match a user style name, and the type of the template style to which the individual template style name belongs is a color style, perform parameter correction on the individual template style based on the color theme of the design drawing to obtain a corresponding corrected template style; and replace the individual template style in the front-end interface with the corrected template style.
[0047] Optionally, the style correction unit is specifically used to:
[0048] Obtaining the fill color of each drawing object in the design drawing;
[0049] Analyze the fill color of each of the drawing objects to obtain a first value and a second value; the first value represents the number of drawing objects whose saturation of the fill color meets the first threshold and whose brightness meets the second threshold; the second value represents the number of drawing objects whose saturation of the fill color meets the third threshold and whose brightness meets the fourth threshold;
[0050] Determining a color theme of the design drawing based on a comparison result of the first value and the second value;
[0051] Based on the color theme of the design drawing, the parameters of the individual template styles are modified to obtain the corresponding modified template styles.
[0052] Optionally, the style correction unit is specifically used to:
[0053] If the first value is greater than or equal to the second value, determining that the color theme of the design drawing is a bright color;
[0054] If the first value is less than the second value, it is determined that the color theme of the design drawing is dark.
[0055] Optionally, the style correction unit is specifically used to:
[0056] Based on a preset color value mapping relationship table, a target color value parameter corresponding to the color theme of the design drawing and the individual template style name is determined; the color value mapping relationship table includes a plurality of color value parameters, and a template style name and a color theme corresponding to each of the color value parameters;
[0057] The color value parameters in the individual template pattern are replaced with the target color value parameters to obtain the corresponding modified template pattern.
[0058] Optionally, the device further comprises:
[0059] A style generation unit, used to: if the user style is not used in the design drawing, generate a design style set based on a preset style specification; read the design style names of all design styles in the design style set; input the multiple design style names and multiple template style names read into the large language model in a unified data format to obtain a second semantic matching result output by the large language model; the second semantic matching result includes a second matching relationship between the design style name and the template style name; according to the second matching relationship, replace the second template style used in the front-end interface with a second user style; the user style name of the second user style matches the template style name of the second template style.
[0060] A storage medium includes a stored program, wherein the program executes the front-end interface style updating method when executed by a processor.
[0061] An electronic device, comprising: a processor, a memory and a bus; the processor and the memory are connected via the bus;
[0062] The memory is used to store programs, and the processor is used to run programs, wherein the program executes the front-end interface style updating method when the program is run by the processor.
[0063] The technical solution provided by the present application determines the corresponding user style library based on the user style used in the user's design drawing. Read the user style names of all user styles in the user style library. Input the multiple user style names read and the template style names of all template styles in the template style library into a preset large language model in a unified data format to obtain a first semantic matching result output by the large language model. According to the first matching relationship, the first template style used in the front-end interface is replaced with the first user style. The present application obtains the first matching relationship between the user style name and the template style name through the large language model, and uses the first matching relationship to replace the first template style used in the front-end interface with the first user style, so that the style of the front-end interface is updated, and the updated front-end interface is more in line with the user's design requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the embodiments of the present application 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0065] Figure 1 A schematic diagram of a flow chart of a method for updating a style of a front-end interface provided in an embodiment of the present application;
[0066] Figure 2 A schematic diagram of a flow chart of another method for updating the style of a front-end interface provided in an embodiment of the present application;
[0067] Figure 3 A schematic diagram of a flow chart of another method for updating the style of a front-end interface provided in an embodiment of the present application;
[0068] Figure 4 A schematic diagram of a flow chart of another method for updating the style of a front-end interface provided in an embodiment of the present application;
[0069] Figure 5A schematic diagram of a flow chart of another method for updating the style of a front-end interface provided in an embodiment of the present application;
[0070] Figure 6 A schematic diagram of the architecture of a style updating device for a front-end interface provided in an embodiment of the present application. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0072] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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 more restrictions, the elements defined by the sentence "comprise one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0073] like Figure 1 As shown, it is a flow chart of a method for updating the style of a front-end interface provided in an embodiment of the present application, including the units shown below.
[0074] S101: Determine a corresponding user style library based on the user style used in the user's design drawing.
[0075] Among them, the user can complete the drawing of the design drawing on the front-end interface, or use the front-end interface to open the drawn design drawing. The front-end interface will display the corresponding style while displaying the design drawing.
[0076] The so-called user styles can be understood as UI drawing elements such as fonts, colors, and rounded corners. Correspondingly, a user style library refers to a set of predefined user styles (such as fonts, colors, rounded corners, etc.) that can be consistently applied throughout an application or website. All user styles in a user style library are usually created by designers or developers to ensure design consistency and maintainability.
[0077] Generally speaking, the main purpose of a user style library is to help teams maintain visual and experience consistency across different pages and components. By using a user style library, developers and designers can quickly apply predefined styles without having to design from scratch every time.
[0078] Optionally, based on the user style used in the user's design, determine the implementation process of the corresponding user style library, which can be seen in Figure 2 Steps shown and explanations of the steps.
[0079] S102: Read the user style names of all user styles in the user style library.
[0080] The types of user style names include first-layer style names, second-layer style names, and third-layer style names.
[0081] In a possible implementation, for the same user style, the first-layer style name may be Blue, the second-layer style name may be System Colors / Blue, and the third-layer style name may be IOS14Dark / System Colors / Blue.
[0082] In some examples, it may be set to read the first-layer style names or the second-layer style names of all user styles in the user style library.
[0083] S103: Input the read multiple user style names and the template style names of all template styles in the template style library into a preset large language model in a unified data format to obtain a first semantic matching result output by the large language model.
[0084] The first semantic matching result includes a first matching relationship between the user style name and the template style name.
[0085] It should be noted that the template style library is the data source of the template styles displayed on the front-end interface, and the template style library provides users with various template styles for assisting image drawing.
[0086] In some examples, the unified data format may be in JSON format.
[0087] In a possible implementation, the JSON code of multiple user style names may be: "Color":{"UserColor1":"","UserColor2":"","UserColor3":""},"CornerRadius":{"UserRadius1":"","UserRadius2":""}. Specifically, Color represents a user style of color style type, and CornerRadius represents a user style of rounded corner style type.
[0088] In a possible implementation, the JSON code of multiple template style names may be: “ColorStyle”:{“Brand / Primary”:“”,“Brand / PrimarySubtle”:“”,“Brand / Secondary”:“”,“Brand / SecondarySubtle”:“”,“Brand / Tertiary”:“”,“Brand / TertiarySubtle”:“”“Functional / Success”:“”,“Functional / Information”:“”,“Functional / Warning”:“”},”RadiusStyle”{“Small”:“”,“Mid”:“”,“Large”:“”,“Mid”:“ExtraLarge”}. Specifically, ColorStyle represents a template style of color style type, and RadiusStyle represents a template style of rounded corner style type.
[0089] In some examples, the preset large language model may be a LLM (Large Language Model).
[0090] In a possible implementation manner, a plurality of user style names and a plurality of template style names are semantically matched using LLM to obtain a first matching relationship between the user style names and the template style names.
[0091] In a possible implementation, the first semantic matching result may be expressed in the form of: “Color”:{“Brand / Primary”:“UserColor1”,“Brand / PrimarySubtle”:“UserColor2”}, “Corner Radius”:{“Small-4px”:“UserRadius1”,“Mid-8px”:“UserRadius2”}.
[0092] S104: According to the first matching relationship, the first template style used in the front-end interface is replaced with the first user style.
[0093] The user style name of the first user style matches the template style name of the first template style.
[0094] The process shown in S101-S104 above obtains the first matching relationship between the user style name and the template style name through the large language model, and uses the first matching relationship to replace the first template style used in the front-end interface with the first user style, so that the style of the front-end interface is updated. The updated front-end interface can better meet the user's design requirements, which can effectively help designers save a lot of time on secondary editing and style replacement.
[0095] like Figure 2 As shown, it is a flow chart of another method for updating the style of the front-end interface provided in an embodiment of the present application, including the following steps.
[0096] S201: Obtain data sources of multiple user styles used in the user's design drawing.
[0097] The data source of the user style bound to each image can be determined by traversing each layer in the design drawing.
[0098] It should be noted that the data source of the user style can be understood as the source of the user style, that is, the style library from which the user style is derived.
[0099] S202: Count the usage times corresponding to each type of data source.
[0100] Among them, various data sources include local style libraries and team style libraries, and the number of uses represents the total number of user styles belonging to the data source in the design drawing.
[0101] S203: If the number of times the local style library is used is greater than the number of times the team style library is used, the local style library is determined to be the corresponding user style library.
[0102] Among them, the number of times the local style library is used is greater than the number of times the team style library is used. It can be determined that the design drawing is drawn by the user based on the local style library. Therefore, the corresponding user style library can be determined based on the local style library.
[0103] S204: If the number of times the local style library is used is not greater than the number of times the team style library is used, the team style library is determined to be the user style library.
[0104] Among them, the number of uses corresponding to the local style library is not greater than the number of uses corresponding to the team style library. It can be determined that the design drawing is drawn by the user based on the team style library. For this reason, it can be determined as the corresponding user style library based on the team style library.
[0105] The process shown in S201-S204 above determines the user style library used by the user's design drawing by counting the usage times corresponding to various data sources, so as to facilitate the subsequent use of the user style library to update the template style on the front-end interface.
[0106] like Figure 3 As shown, it is a flow chart of another method for updating the style of the front-end interface provided in an embodiment of the present application, including the following steps.
[0107] S301: If the individual template style name does not match the user style name, and the type of the template style to which the individual template style name belongs is a color style, based on the color theme of the design drawing, modify the parameters of the individual template style to obtain a corresponding modified template style.
[0108] Among them, if the result output by the large language model for individual template style names is a null value, taking Brand / Primary as an example, the output result corresponding to Brand / Primary is "Brand / Primary":"", it can be determined that Brand / Primary does not match the user style name.
[0109] Optionally, based on the color theme of the design drawing, modify the parameters of individual template styles to obtain the corresponding modified template style implementation process, which can be seen in Figure 4 Steps shown and explanations of the steps.
[0110] S302: Replace individual template styles in the front-end interface with revised template styles.
[0111] Among them, individual template styles in the front-end interface are replaced with revised template styles, and the style of the front-end interface is updated, so that the front-end interface can better meet the design needs of users.
[0112] In the process shown in the above S301-S302, when the name of an individual template style does not match the user style name, the parameters of the individual template style are modified based on the color theme of the design drawing to obtain the corresponding modified template style, and the individual template style in the front-end interface is replaced with the modified template style, so that the style of the front-end interface is updated. The updated front-end interface can better meet the user's design requirements, which can effectively help designers save a lot of time on secondary editing and style replacement.
[0113] like Figure 4As shown, it is a flow chart of another method for updating the style of the front-end interface provided in an embodiment of the present application, including the following steps.
[0114] S401: Obtain the fill color of each drawing object in the design drawing.
[0115] The drawing objects included in the design drawing include but are not limited to containers, layers, etc.
[0116] In some examples, containers whose sizes meet preset requirements and rectangular layers can be considered as drawing objects.
[0117] It should be noted that if the fill color of a container or rectangle layer is a gradient color and the number of gradient anchor points exceeds three, the container or rectangle layer is not considered a drawing object.
[0118] S402: Analyze the fill color of each drawing object to obtain a first value and a second value.
[0119] The first value represents the number of drawing objects whose saturation of the filling color meets the first threshold and whose brightness meets the second threshold, and the second value represents the number of drawing objects whose saturation of the filling color meets the third threshold and whose brightness meets the fourth threshold.
[0120] In some examples, the HSB model may be used to analyze the fill color of each drawing object to obtain a first value and a second value. Specifically, the hue, saturation, and lightness of each drawing object may be analyzed using the HSB model.
[0121] In a possible implementation, the total number of drawing objects with a fill color saturation of less than 20 and a lightness greater than 70 may be regarded as a first value, and the total number of drawing objects with a fill color saturation of less than 60 and a lightness less than 30 may be regarded as a second value.
[0122] S403: Determine a color theme of the design drawing based on a comparison result of the first value and the second value.
[0123] Optionally, if the first value is greater than or equal to the second value, the color theme of the design drawing is determined to be a light color; if the first value is less than the second value, the color theme of the design drawing is determined to be a dark color.
[0124] S404: Based on the color theme of the design drawing, modify parameters of individual template styles to obtain corresponding modified template styles.
[0125] Among them, based on the color theme of the design drawing, the color value parameters of individual template styles can be modified to obtain the corresponding modified template style.
[0126] Optionally, based on the color theme of the design drawing, the implementation process of modifying the parameters of individual template styles to obtain the corresponding modified template style can be as follows: based on a preset color value mapping relationship table, determining the target color value parameters corresponding to the color theme of the design drawing and the name of the individual template style; the color value mapping relationship table includes multiple color value parameters, and the template style name and color theme corresponding to each color value parameter; replacing the color value parameters in the individual template style with the target color value parameters to obtain the corresponding modified template style.
[0127] In some examples, the preset color value mapping relationship table can be shown in Table 1.
[0128] Table 1
[0129]
[0130]
[0131] It can be understood that the content shown in Table 1 above is only for illustration.
[0132] In a possible implementation, taking Table 1 as an example, if Brand / Primary does not match the user style name and the color theme of the design drawing is bright color, the color value parameter of Brand / Primary is modified to obtain Brand / Primary with a bright color value of #3578FF.
[0133] The process shown in S401-S404 above utilizes the color theme of the design drawing to modify individual template styles to obtain a modified template style, and replaces individual template styles in the front-end interface with the modified template style, so that the style of the front-end interface is updated. The updated front-end interface can better meet the user's design requirements and can effectively help designers save a lot of time on secondary editing and style replacement.
[0134] like Figure 5 As shown, it is a flow chart of another method for updating the style of the front-end interface provided in an embodiment of the present application, including the following steps.
[0135] S501: If the user style is not used in the design drawing, generate a design style set based on a preset style specification.
[0136] Among them, if the user style is not used in the design drawing, the corresponding user style library cannot be determined using the user style. For this reason, a design style set can be generated based on the preset style specifications, so that the template style of the front-end interface can be updated using the design style set.
[0137] It should be noted that the preset style specification can be set by technical personnel according to actual conditions. Based on the preset style specification, the generated design style set includes multiple design styles.
[0138] S502: Read the design style names of all design styles in the design style set.
[0139] The types of design style names include first-layer style names, second-layer style names, and third-layer style names.
[0140] In some examples, the first-level style names or the second-level style names of all design styles in the design style set may be read.
[0141] S503: Input the read multiple design style names and multiple template style names into the large language model in a unified data format to obtain a second semantic matching result output by the large language model.
[0142] The second semantic matching result includes a second matching relationship between the design style name and the template style name.
[0143] In some examples, the types of design styles include a rounded corner style and a color style, and the color style may be subdivided into a light color style and a dark color style.
[0144] In a possible implementation manner, the second matching relationship between the design style name of the color style and the template style name can be seen in Table 2.
[0145] Table 2
[0146]
[0147]
[0148]
[0149]
[0150] It can be understood that the contents shown in Table 2 above are only for illustration.
[0151] In a possible implementation manner, the second matching relationship between the design style name of the rounded corner style and the template style name can be seen in Table 3.
[0152] Table 3
[0153]
[0154] It can be understood that the contents shown in Table 3 above are only for illustration.
[0155] Optionally, for some template styles of color style type, the color value parameters of some template styles may be modified to obtain corresponding design styles, where the design styles include light color design styles and dark color design styles. Specifically, the second matching relationship between some template style names and the corresponding light color design style names and dark color design style names may be shown in Table 4.
[0156] Table 4
[0157]
[0158]
[0159] It can be understood that the contents shown in Table 4 above are only for illustration.
[0160] S504: According to the second matching relationship, the second template style used in the front-end interface is replaced with the second user style.
[0161] The user style name of the second user style matches the template style name of the second template style.
[0162] In the process shown in the above S501-S504, when the user has no user style to use, the user's design drawing can be used to generate a design style set, and the design style set can be used to generate a design style that is more in line with the user's design style. The design style is used to update the template style in the front-end interface, thereby reducing the time cost of the user manually replacing the template style and reducing the time cost of manually establishing a style library.
[0163] like Figure 6 As shown, it is a schematic diagram of the architecture of a style updating device for a front-end interface provided in an embodiment of the present application, including the units shown below.
[0164] The style library determining unit 100 is used to determine a corresponding user style library based on the user style used in the user's design drawing.
[0165] The name reading unit 200 is used to read the user style names of all user styles in the user style library.
[0166] The name matching unit 300 is used to input the multiple user style names read and the template style names of all template styles in the template style library into a preset large language model in a unified data format to obtain a first semantic matching result output by the large language model; the first semantic matching result includes a first matching relationship between the user style name and the template style name.
[0167] The style replacement unit 400 is used to replace the first template style used in the front-end interface with the first user style according to the first matching relationship; the user style name of the first user style matches the template style name of the first template style.
[0168] Optionally, the style library determination unit 100 is specifically used to: obtain data sources of multiple user styles used in the user's design drawing; count the usage times corresponding to each type of data source; each type of data source includes a local style library and a team style library; the usage times represent the total number of user styles belonging to the data source in the design drawing; if the usage times corresponding to the local style library is greater than the usage times corresponding to the team style library, based on the local style library, it is determined to be the corresponding user style library; if the usage times corresponding to the local style library is not greater than the usage times corresponding to the team style library, it is determined to be the user style library based on the team style library.
[0169] The style correction unit 500 is used for: if the individual template style name does not match the user style name, and the type of the template style to which the individual template style name belongs is a color style, based on the color theme of the design drawing, performing parameter correction on the individual template style to obtain the corresponding corrected template style; replacing the individual template style in the front-end interface with the corrected template style.
[0170] Optionally, the style correction unit 500 is specifically used to: obtain the fill color of each drawing object in the design drawing; analyze the fill color of each drawing object to obtain a first value and a second value; the first value represents the number of drawing objects whose saturation of the fill color meets the first threshold and whose brightness meets the second threshold; the second value represents the number of drawing objects whose saturation of the fill color meets the third threshold and whose brightness meets the fourth threshold; determine the color theme of the design drawing based on the comparison result of the first value and the second value; and perform parameter correction on individual template styles based on the color theme of the design drawing to obtain a corresponding corrected template style.
[0171] Optionally, the style correction unit 500 is specifically used to: if the first value is greater than or equal to the second value, determine that the color theme of the design drawing is a light color; if the first value is less than the second value, determine that the color theme of the design drawing is a dark color.
[0172] Optionally, the style correction unit 500 is specifically used to: determine the target color value parameters corresponding to the color theme and individual template style names of the design drawing based on a preset color value mapping relationship table; the color value mapping relationship table includes multiple color value parameters, and the template style name and color theme corresponding to each color value parameter; replace the color value parameters in the individual template style with the target color value parameters to obtain the corresponding corrected template style.
[0173] The style generation unit 600 is used to: if the user style is not used in the design drawing, generate a design style set based on a preset style specification; read the design style names of all design styles in the design style set; input the multiple design style names and multiple template style names read into the large language model in a unified data format to obtain a second semantic matching result output by the large language model; the second semantic matching result includes a second matching relationship between the design style name and the template style name; according to the second matching relationship, replace the second template style used in the front-end interface with a second user style; the user style name of the second user style is matched with the template style name of the second template style.
[0174] Each of the above-mentioned units obtains a first matching relationship between a user style name and a template style name through a large language model, and utilizes the first matching relationship to replace a first template style used in the front-end interface with a first user style, so that the style of the front-end interface is updated. The updated front-end interface can better meet the user's design requirements, and can effectively help designers save a lot of time on secondary editing and style replacement.
[0175] The present application also provides a computer-readable storage medium, which includes a stored program, wherein the program executes the style updating method of the front-end interface provided by the present application.
[0176] The present application also provides an electronic device, including: a processor, a memory and a bus. The processor and the memory are connected via a bus, the memory is used to store programs, and the processor is used to run programs, wherein the front-end interface style update method provided by the present application is executed when the program is running.
[0177] In addition, the functions described above in the embodiments of the present application may be at least partially performed by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0178] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
[0179] Although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present application. Certain features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination.
[0180] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
Claims
1. A method for updating the style of a front-end interface, characterized in that: include: Determine a corresponding user style library based on the user style used in the user's design drawing; Read the user style names of all user styles in the user style library; Inputting the multiple user style names obtained by reading and the template style names of all template styles in the template style library into a preset large language model in a unified data format to obtain a first semantic matching result output by the large language model; the first semantic matching result includes a first matching relationship between the user style name and the template style name; According to the first matching relationship, the first template style used in the front-end interface is replaced with the first user style; the user style name of the first user style matches the template style name of the first template style.
2. The method according to claim 1, characterized in that Based on the user style used in the user's design drawing, determine the corresponding user style library, including: Obtain data sources of multiple user styles used in the user's design drawing; Count the usage times corresponding to various data sources; various data sources include local style libraries and team style libraries; the usage times represent the total number of user styles belonging to the data source in the design drawing; If the number of times the local style library is used is greater than the number of times the team style library is used, the local style library is determined to be the corresponding user style library; If the number of times the local style library is used is not greater than the number of times the team style library is used, the user style library is determined based on the team style library.
3. The method according to claim 1, characterized in that The method further comprises: If the individual template style name does not match the user style name, and the type of the template style to which the individual template style name belongs is a color style, based on the color theme of the design drawing, modify the parameters of the individual template style to obtain a corresponding modified template style; The individual template styles in the front-end interface are replaced with the revised template styles.
4. The method according to claim 3, characterized in that Based on the color theme of the design drawing, the parameters of the individual template styles are modified to obtain corresponding modified template styles, including: Obtaining the fill color of each drawing object in the design drawing; Analyze the fill color of each of the drawing objects to obtain a first value and a second value; the first value represents the number of drawing objects whose saturation of the fill color meets the first threshold and whose brightness meets the second threshold; the second value represents the number of drawing objects whose saturation of the fill color meets the third threshold and whose brightness meets the fourth threshold; Determining a color theme of the design drawing based on a comparison result of the first value and the second value; Based on the color theme of the design drawing, the parameters of the individual template styles are modified to obtain the corresponding modified template styles.
5. The method according to claim 4, characterized in that Determining a color theme of the design drawing based on a comparison result of the first value and the second value includes: If the first value is greater than or equal to the second value, determining that the color theme of the design drawing is a bright color; If the first value is less than the second value, it is determined that the color theme of the design drawing is dark.
6. The method according to claim 5, characterized in that Based on the color theme of the design drawing, the parameters of the individual template styles are modified to obtain corresponding modified template styles, including: Based on a preset color value mapping relationship table, a target color value parameter corresponding to the color theme of the design drawing and the individual template style name is determined; the color value mapping relationship table includes a plurality of color value parameters, and a template style name and a color theme corresponding to each of the color value parameters; The color value parameters in the individual template pattern are replaced with the target color value parameters to obtain the corresponding modified template pattern.
7. The method according to claim 1, characterized in that The method further comprises: If the user style is not used in the design drawing, generating a design style set based on a preset style specification; Read the design style names of all design styles in the design style set; Inputting the read multiple design style names and multiple template style names into the large language model in a unified data format to obtain a second semantic matching result output by the large language model; the second semantic matching result includes a second matching relationship between the design style name and the template style name; According to the second matching relationship, the second template style used in the front-end interface is replaced with a second user style; the user style name of the second user style matches the template style name of the second template style.
8. A front-end interface style updating device, characterized in that: include: A style library determination unit, used to determine a corresponding user style library based on a user style used in a user's design drawing; A name reading unit, used for reading the user style names of all user styles in the user style library; a name matching unit, configured to input the plurality of user style names obtained by reading and the template style names of all template styles in the template style library into a preset large language model in a unified data format, so as to obtain a first semantic matching result output by the large language model; the first semantic matching result includes a first matching relationship between the user style name and the template style name; A style replacement unit is used to replace the first template style used in the front-end interface with a first user style according to the first matching relationship; the user style name of the first user style matches the template style name of the first template style.
9. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program, when executed by a processor, executes the method for updating the style of the front-end interface according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: processor, memory, and bus; The processor is connected to the memory via the bus; The memory is used to store programs, and the processor is used to run programs, wherein the program, when run by the processor, executes the front-end interface style updating method described in any one of claims 1-7.
Citation Information
Cited By
AI-based business card style one-key replacement method and apparatus, and electronic device
CN120216776A
Training data generation method based on flow chart, training data generation equipment and medium
CN120745582A
