Multi-layer atomization visual design method and device based on style reference

Through the multi-level token style reference mechanism and dynamic style update mode, the limitations of a single-level structure and cross-platform consistency issues in the traditional design delivery process are solved, achieving more efficient design collaboration and product quality.

CN118733012APending Publication Date: 2024-10-01BEIJING CHUANGZUOMEIHAO TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410513877.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-26
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The traditional design transfer process is difficult to meet the needs of rapid iteration and efficient collaboration. It has the limitations of a single-level structure, the difficulty of updating and maintaining, and the challenge of cross-platform consistency.

Method used

A multi-level token style reference mechanism is adopted to divide the visual design into the global level, scene level and component level. Through the token dynamic style reference mode and dependent data link analysis, the dynamic update and management of atomic style attribute tokens are realized. .

Benefits of technology

It improves the maintainability, flexibility and collaboration efficiency of the design system, ensuring cross-platform consistency and product quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733012A_ABST
    Figure CN118733012A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-layer atomization visual design method and device based on style quotation, and the method comprises the steps: dividing visual design into multiple atomization hierarchies including a global hierarchy, a scene hierarchy and a component hierarchy, and the multiple atomization hierarchies comprise a group of atomization style attribute tokens; creating at least one target component in the design end page, wherein the pattern attribute of the target component references the atomized pattern attribute token through a token dynamic pattern reference mode; performing dependency data link analysis on the atomization style attribute tokens referenced by the target components to obtain decision data states, so that designers can adjust reference tokens of the target components according to the decision data states; in response to the update of the atomized pattern attribute token, a target component referencing the atomized pattern attribute token is updated through a token dynamic pattern update mode. According to the method, a multi-level token structure and a dynamic style reference mechanism are introduced, so that the maintainability, flexibility and cooperation efficiency of a design system are 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 software design, and in particular to a multi-layer atomic visual design method and device based on style reference. Background Art

[0002] As the complexity of digital product design and development increases, collaboration between designers and developers becomes more critical. Traditional design delivery processes, such as manually coding design specifications and relying on visual reviews to ensure consistency, can no longer meet the needs of rapid iteration and efficient collaboration. The traditional design delivery process is not only time-consuming and error-prone, but also greatly reduces the team's work efficiency and the product's market responsiveness.

[0003] Although existing design software or systems have a certain degree of standardization and automation functions such as color, font, spacing, etc. (can be used across platforms), they still face many challenges: First, the limitations of a single-level structure. Most existing systems have a single-level structure, which limits their flexibility and scalability when dealing with complex design systems. For example, when a color needs to be used in different ways in different contexts (such as button background color and text color), a single-level structure is difficult to manage effectively; second, the difficulty of updating and maintenance. In traditional design systems, when design decisions change, a large number of files need to be manually modified, which is not only inefficient but also easy to miss, resulting in inconsistencies between implementation and design; third, the challenge of cross-platform consistency. With the popularity of multi-platform applications, how to maintain consistency between different platforms has become a challenge. Existing design methods often lack an effective cross-platform support mechanism, which increases the cost of maintaining consistency.

[0004] Therefore, a new software design method and device are urgently needed to solve the above problems, so as to achieve flexible management of multi-layer atomic visual design and improve the collaboration efficiency and product quality in the process from design to development. Summary of the invention

[0005] In view of the above problems, the present invention is proposed to provide a multi-level atomic visual design method and device based on style reference with a multi-level token style reference mechanism.

[0006] According to one aspect of the present invention, a multi-layer atomic visual design method based on style reference is provided, comprising:

[0007] Dividing the visual design into multiple atomic levels of a global level, a scene level, and a component level, wherein the component level includes a base component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens;

[0008] At least one target component is created in the design-side page, and the style attribute of the target component references the atomic style attribute token through a token dynamic style reference mode;

[0009] Performing dependency data link analysis on the atomic style attribute tokens referenced by each of the target components to obtain a decision data state so that the designer can adjust the reference tokens of the target components according to the decision data state;

[0010] In response to the update of the atomic style attribute token, the target component that references the atomic style attribute token is updated through a token dynamic style update mode.

[0011] In an optional manner, the method further includes:

[0012] The atomized style attribute token is converted into style code, wherein the style code includes CSS variables, Swift code, and XML resources.

[0013] In an optional manner, the global level, scene level, and component level include but are not limited to the following style attributes: brand color, font, basic spacing, background color, border style, text style, hover state, click state, and disabled state.

[0014] In an optional manner, the atomized style attribute token includes a name, an alias, and a variable attribute set;

[0015] The name adopts a naming convention consisting of a multi-layer atomic-level style attribute set of the global level, the scene level, and the component level;

[0016] The style attribute sets of the multiple layers of atomic levels are spliced ​​by a first preset specific symbol, and the style attributes of the multiple layers of atomic levels are spliced ​​by a second preset specific symbol;

[0017] The name and the variable attribute set form a key-value pair structure.

[0018] In an optional manner, the style attribute of the target component references the atomic style attribute token through the token dynamic style reference mode, further comprising:

[0019] After the target component determines to reference the atomic style attribute token, the style attribute alias of the target component is the name of the referenced atomic style attribute token;

[0020] The style attribute of the target component only refers to the atomic style attribute token with the same attribute style, and the name of the atomic style attribute token is unique in the design library.

[0021] In an optional manner, the performing dependency data link analysis on the atomic style attribute tokens referenced by each target component further includes:

[0022] According to each of the target components and the atomic style attribute tokens referenced by them, a token reference directed graph is constructed, wherein the vertices of the token reference directed graph are the target components and the paths are the token reference relationships;

[0023] Determine whether there is a circular dependency loop in the token reference directed graph; if so, update the dependent data link of the circular dependency loop to eliminate the loop; wherein only the self-loop in the circular dependency loop and the attribute style of the token referenced by each of the target components are retained, and the token referenced by the self-loop is deleted;

[0024] The updated dependent data link is used as the decision data state.

[0025] In an optional manner, updating the target component that references the atomic style attribute token through the token dynamic style update mode further includes:

[0026] Determine whether the variable attribute and name of the atomic style attribute token have changed. When the variable attribute changes, the style value of the target component that references the token changes synchronously; when the name changes, the style value of the target component that references the token remains unchanged;

[0027] Determine whether the atomic style attribute token of the target component is released, and if so, assign the style value of the atomic style attribute token when it is released.

[0028] In an optional manner, the method further includes:

[0029] Determine whether the first atomic style attribute token referenced by the target component is modified to a second atomic style attribute token. If so, the style attribute of the target component continues to reference the first atomic style attribute token, and the update of the second atomic style attribute token no longer affects the style attribute of the target component.

[0030] If the first atomic style attribute token is recreated, a token reference relationship is automatically established between the style attribute of the target component and the first atomic style attribute token; and the style attribute of the target component and the first atomic style attribute token are synchronously updated.

[0031] In an optional manner, the method further includes:

[0032] When multiple designers collaboratively reference multiple atomic style attribute tokens, the dependency data links of the multiple atomic style attribute tokens are merged to obtain a merged dependency data link;

[0033] It is determined whether there is a circular dependency loop in the merged dependency data link. If so, a modal pop-up window is used to remind the designer to perform a loop-breaking operation.

[0034] According to another aspect of the present invention, a multi-layer atomic visual design device based on style reference is provided, comprising:

[0035] A token definition module, configured to divide the visual design into multiple atomic levels of a global level, a scene level, and a component level, wherein the component level includes a base component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens;

[0036] A token reference module, used to create at least one target component in a design-side page, wherein the style attribute of the target component references the atomic style attribute token through a token dynamic style reference mode;

[0037] A token analysis module, used for performing dependency data link analysis on the atomic style attribute tokens referenced by each target component to obtain a decision data state, so that the designer can adjust the reference token of the target component according to the decision data state;

[0038] The token updating module is used to update the target component that references the atomic style attribute token through a token dynamic style updating mode in response to the update of the atomic style attribute token.

[0039] The solution provided by the above embodiment of the present invention divides the visual design into multiple atomic levels of global level, scene level and component level, wherein the component level includes a basic component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens; at least one target component is created in the design end page, and the style attributes of the target component reference the atomic style attribute token through a token dynamic style reference mode; the atomic style attribute tokens referenced by each target component are subjected to dependency data link analysis to obtain a decision data state so that the designer can adjust the reference token of the target component according to the decision data state; in response to the update of the atomic style attribute token, the target component that references the atomic style attribute token is updated through a token dynamic style update mode. The present invention improves the maintainability, flexibility and collaboration efficiency of the design system by introducing a multi-level token structure and a dynamic style reference mechanism.

[0040] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above description and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0042] Figure 1 A schematic diagram showing a flow chart of a multi-layer atomic visual design method based on style reference according to an embodiment of the present invention;

[0043] Figure 2 A schematic diagram showing the relationship between multiple atomization levels in an embodiment of the present invention is shown;

[0044] Figure 3 A schematic diagram of atomic style attribute token reference according to an embodiment of the present invention is shown;

[0045] Figure 4 The schematic diagram of the atomic style attribute token structure of an embodiment of the present invention is shown Figure 1 ;

[0046] Figure 5 The schematic diagram of the atomic style attribute token structure of an embodiment of the present invention is shown Figure 2 ;

[0047] Figure 6 An example diagram of atomic style attribute token reference according to an embodiment of the present invention is shown;

[0048] Figure 7 A schematic diagram of de-looping an atomized style attribute token according to an embodiment of the present invention is shown;

[0049] Figure 8 A schematic diagram of a style reference loop removal operation according to an embodiment of the present invention is shown;

[0050] Fig. 9 A schematic diagram of the update process of the atomic style attribute token according to an embodiment of the present invention is shown;

[0051] Fig.10 A schematic diagram of a code of an atomized style attribute token according to an embodiment of the present invention is shown;

[0052] Fig.11 A schematic diagram of importing an atomized style attribute token according to an embodiment of the present invention is shown;

[0053] Fig.12 A schematic structural diagram of a multi-layer atomic visual design device based on style reference according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0054] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.

[0055] Before implementing the embodiments of the present invention, the technical terms or custom terms involved below are uniformly explained here:

[0056] Components: They allow the UI to be divided into independent, reusable parts. In practical applications, components are often organized into a nested tree structure.

[0057] Container: Formerly known as "drawing board", it is an important design component of design software, such as iPhone container and A4 paper container.

[0058] Instance: An instance is a specific reference to a component. What the user drags from the component list or copies and pastes from a component is an "instance" rather than the component itself.

[0059] Component attributes: Component attributes originated in the R&D and production process, such as Button attributes and form-input attributes in Element VUE 2.0. They are divided into parameters, types, and optional values ​​in the code. Component attributes prepend the attributes in the code to the canvas editor, allowing the editor to add parameters, types, and values ​​in the property panel.

[0060] Variable component: A component placed in a component set container that is assigned multiple attributes (defining the properties and relationships of the variable component) and values ​​(defining specific characteristics or parameters of the attributes).

[0061] Mutable instance: An instance of a mutable component.

[0062] Token: In computer terminology, a token refers to a string of characters generated by the server. The present invention uses the concept of "token" to define complex design elements (regarded as an atomic visual design language). That is, the visual mode and interface attributes are reorganized and summarized for semantic naming, replacing the hard-coded constants in the front-end code (such as hexadecimal color codes), which facilitates designers to carry out unified management and expansion, ensure product consistency, and improve the efficiency of design and development. For example: color is used to define the color values ​​used in the product, such as primary color, secondary color, background color, etc.; font is used to define the font, font size, line height and other attributes used in the product, as well as the corresponding class name or variable name; border is used to define the border color, width, style and other attributes used in the product, as well as the corresponding class name or variable name; spacing is used to define the spacing, inner margin, outer margin and other attributes used in the product, as well as the corresponding class name or variable name; icon is used to define the icon used in the product, such as icon name, color, size and other attributes, as well as the corresponding class name or variable name; layout is used to define the layout method used in the product, such as grid, typesetting method, etc., as well as the corresponding class name or variable name.

[0063] This application aims to build a comprehensive and highly available design system, deeply understand the real needs of users, combine product requirements with actual usage scenarios, and propose an innovative method for implementing multi-layer atomic visual design management based on style reference capabilities to meet the challenges encountered in the current design and development process, especially in improving the maintainability, flexibility and cross-platform consistency of styles. The specific contents of the present invention are described in detail below through specific embodiments.

[0064] Embodiment 1:

[0065] Figure 1 FIG. 1 is a flow chart showing a multi-layer atomic visual design method based on style reference according to an embodiment of the present invention. Specifically, Figure 1 As shown, the following steps are included:

[0066] Step S101, divide the visual design into multiple atomic levels of global level, scene level and component level, wherein the component level includes a basic component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens.

[0067] In this embodiment, the visual design is divided into multiple atomic levels of global level, scene level and component level, wherein the component level includes the basic component level and the variant component level, and a set of atomic style attribute tokens is set for each level. Through the division of multiple atomic levels, designers can clearly and quickly build style elements. Among them, the global level contains style attribute tokens such as fonts, brand colors, border background colors, rounded corners, layout rules, etc. to ensure the uniformity of visual style. Different scene levels are divided according to different application scenarios or functional requirements. Different scenes require different design elements and styles. For example, the brand color of the global level of a certain brand of coffee is green. For some pages (such as product details pages, shopping pages and other multiple page scenes) or radio and check states, gray colors may be required. It is difficult to make differentiated designs using global level tokens. If the colors of some pages, or radio buttons and check boxes are manually changed, engineers will spend a lot of work. Therefore, on the basis of the global-level token, the scene-level token is added (such as adding "second-level" and "third-level" "aliases" to distinguish each component), and the color of the page or check box and radio button can be modified again to solve the risk problem that may need to be modified at any time in subsequent products. The component level is further subdivided and expanded on the basis of the global level and the scene level (that is, the intensity or fineness of control is different). For example, it is divided into multiple independent components (such as buttons, input boxes, etc.) according to the scene. Each component is customized and expanded according to specific needs based on the styles and rules of the global level and the scene level to form component-specific styles and rules. In this embodiment, the component level includes a basic component level and a variant component level. The basic component level sets the basic component style, including style attribute tokens of components such as buttons and input boxes, which can be adjusted on the basis of the global level and the scene level (that is, referencing the tokens of the global level and the scene level), or a preset component style can be created separately to meet the specific needs of the component. The variant component level is a further subdivision of the component level. It fine-tunes or expands the variants of the basic components according to specific needs or scenarios. For example, to handle component styles in different states, a button can have normal state, hover state, click state, shadow effect and other variants. Each variant has its own specific style attribute token, which makes the component present different visual effects in different states. Atomic style attribute tokens split style attributes into the smallest, reusable units, and each token corresponds to a specific style attribute. During the design process, by selecting and applying these atomic style attribute tokens, you can quickly build visual elements of various levels that meet the specifications to improve the efficiency of style attribute setting.

[0068] For example, $ui-controls-color-text-error=$color-feedback-error

[0069] (=$color-red-36)

[0070] (=#B90000)

[0071] The global level token is color-feedback-error (the error color under feedback conditions), which is one level lower than the color-red-36 (the red color named for color 36). The scene level token (second level alias) is ui-controls-color-text-error (the error color of text in UI controls), which is one level lower than the global level. The naming conventions followed by tokens at different levels are usually different. Generally speaking, satisfying design management with fewer levels is an important goal of token naming conventions. Table 1 gives a reference to a naming convention.

[0072] Table 1

[0073]

[0074]

[0075] Specifically, Figure 2 As shown in Figure 1, the atomic style attribute tokens defined at the global level are usually the most basic and widely used style attributes in the entire design system, such as brand colors (such as primary colors, secondary colors, neutral colors, etc.), primary fonts, basic spacing (such as margins, padding, line height, etc.), etc. These global tokens provide a unified visual and feel foundation for the entire design system.

[0076] The scene level creates a "second layer" of scene level tokens based on different demand scenarios, and can also modify the global level tokens to form scene level tokens.

[0077] Tokens at the component level define the style properties of specific UI components, and can inherit (reference) tokens at the global level. By adding or overriding specific style properties to meet the needs of specific components, you can quickly customize UI components that meet specific scenarios or needs while maintaining overall design consistency. For example, the background color, border style (border width, color, solid line, dashed line, etc.) and text style (such as font size, color, alignment, etc.) tokens of button components. Although these tokens are based on the definition of the global level, they allow customization for specific components.

[0078] Variant level tokens inherit component level tokens (variant level 1, variant level n can inherit component level n at the same time, variant level 1 can inherit component level 1 and component level n at the same time), allowing you to define styles for different states or variants of a component, such as hover, active, or disabled. These tokens keep components visually consistent in different interactive states while increasing the flexibility of style definition.

[0079] In an optional manner, the atomized style attribute token includes a name, an alias, and a variable attribute set;

[0080] The name adopts a naming convention consisting of a multi-layer atomic-level style attribute set of the global level, the scene level, and the component level;

[0081] The style attribute sets of the multiple layers of atomic levels are spliced ​​by a first preset specific symbol, and the style attributes of the multiple layers of atomic levels are spliced ​​by a second preset specific symbol;

[0082] The name and the variable attribute set form a key-value pair structure.

[0083] In this embodiment, Figure 4 , Figure 5As shown, the atomic style attribute token includes a name, an alias, a reference, and a variable attribute set. Among them, the name follows a specific naming convention and is used to uniquely identify a style attribute set. The naming convention consists of multiple atomic levels, including a global level, a scene level, and a component level. The multiple atomic levels are spliced ​​by a first preset specific symbol (such as a hyphen "-" or an underscore "_"). At the same time, the style attributes of the multiple atomic levels are spliced ​​by a second preset specific symbol (such as a dot "."). This naming method improves the readability, maintainability, and search efficiency of the style. Aliases allow short names to be defined for commonly used style attribute sets. These aliases can be used as shortcuts to replace lengthy style attribute names. Aliases can be defined according to the specific needs of the project and the usage habits of the team. They can be a short name for a specific style attribute or a general name for a group of related style attributes. References are used to display the name of the specific token being referenced. For example, a button component references a token named button-primary-background-color to set the background color. The reference name is button-primary-background-color, which can track the source of the style attribute reference. The variable attribute collection describes the style value in the atomic style attribute token, which contains a series of specific style attribute values ​​(such as color, font size, margin, padding, and other style attributes). The variable attribute collection and the name are stored in the variable attribute collection as a key-value pair.

[0084] Step S102, at least one target component is created in the design end page, and the style attribute of the target component references the atomic style attribute token through the token dynamic style reference mode.

[0085] Register and introduce the target component in the parent component or page on the design side, and use the token dynamic style reference mode to reference the atomic style attribute token to change the component's style attributes to adapt to different design requirements. That is, you only need to adjust the value of the atomic style attribute token to achieve rapid style updates.

[0086] When using a token, such as Figure 3As shown, the global level, scene level, and component level include tokens such as brand color ({brand-color}), basic spacing, rounded button {button-primary-corner}, text style, hover {hover}, and disabled. A default button is created in the canvas. The default button references the brand color token in the global level, the rounded button token in the component level, and the hover token in the variant level. The reference token of the default button is {brand-color.button-primary-corner.hover}. After re-rendering, its style is adjusted to a rounded button. The rounded button protects the brand color, rounded corners, and hover state at the same time. Again, as Figure 6 As shown in the figure, the corner properties of the standard rounded corners can be changed by setting the reference style token (--corner-tiny 2,2,2,2). This shows that the style can be quickly updated by simply adjusting the value of the atomic style property token.

[0087] In an optional manner, the style attribute of the target component references the atomic style attribute token through the token dynamic style reference mode, further comprising:

[0088] After the target component determines to reference the atomic style attribute token, the style attribute alias of the target component is the name of the referenced atomic style attribute token;

[0089] The style attribute of the target component only refers to the atomic style attribute token with the same attribute style, and the name of the atomic style attribute token is unique in the design library.

[0090] In this embodiment, when the target component determines to reference a certain atomic style attribute token, the style attribute alias of the component is set to the name of the referenced atomic style attribute token. The alias is used to describe the source of the style attribute referenced by the target component, which enhances the readability and maintainability of the style attribute. The style attribute of the target component only references atomic style attribute tokens with the same attribute style. If the target component has a style attribute about font color, it can only reference atomic style attribute tokens related to font color in the design library to avoid style conflicts and override issues. Since each token describes a specific set of style attributes, the name of the atomic style attribute token is unique in the design library, which can avoid confusion and incorrect references to style attributes.

[0091] Step S103, performing dependency data link analysis on the atomic style attribute tokens referenced by each target component to obtain a decision data state so that the designer can adjust the reference tokens of the target component according to the decision data state.

[0092] In this embodiment, the decision data state reflects the dependency between the tokens referenced by the component style attributes. Based on the decision data state, the designer can identify which components depend on specific style tokens, and can track the reference sources and changes of style attributes. And which components share the same style token, thereby achieving style reuse. At the same time, potential style conflicts or inconsistencies can also be discovered, and adjustments can be made in a timely manner to ensure the style consistency of the entire design draft.

[0093] Specifically, all target components in the design project are traversed, the atomic style attribute tokens referenced by each component are retrieved, and a dependency data link diagram between the target components and the style tokens is constructed based on the token information referenced by each target component. The dependency data link diagram can be a visual diagram or a data structure such as a graph or adjacency list to represent the dependency relationship between components and tokens. Based on the dependency data link diagram, the decision data status of each target component is analyzed, including checking whether the component references a deleted token and whether the referenced token conflicts with other components. Based on the analysis results of the decision data status, suggestions are provided to the designer for adjusting the reference tokens of the target components so that the designer can adjust the reference tokens of the target components according to the decision data status.

[0094] In an optional manner, the performing dependency data link analysis on the atomic style attribute tokens referenced by each target component further includes:

[0095] According to each of the target components and the atomic style attribute tokens referenced by them, a token reference directed graph is constructed, wherein the vertices of the token reference directed graph are the target components and the paths are the token reference relationships;

[0096] Determine whether there is a circular dependency loop in the token reference directed graph; if so, update the dependent data link of the circular dependency loop to eliminate the loop; wherein only the self-loop in the circular dependency loop and the attribute style of the token referenced by each of the target components are retained, and the token referenced by the self-loop is deleted;

[0097] The updated dependent data link is used as the decision data state.

[0098] In this embodiment, a token reference directed graph is constructed to display the reference relationship between the target component and the atomic style attribute token, so as to determine whether there is a circular dependency loop in the token reference directed graph, and timely discover potential style reference problems, such as circular references that cause the style to be unable to be correctly applied. By updating the dependency data link of the circular dependency loop, the circular dependency is eliminated, the necessary attribute styles are retained, and the correctness of the style reference is ensured. The updated dependency data link is used as the decision data state, and the designer can make decisions quickly based on this information and adjust the reference token of the component.

[0099] Specifically, traverse all target components and record the atomic style attribute tokens referenced by each component. Construct a token reference directed graph with the target components as vertices and the token reference relationship as the path. Use a depth-first search or breadth-first search algorithm to traverse the token reference directed graph. If a vertex is visited repeatedly and the path forms a closed loop, it means that there is a circular dependency loop. Only the self-loops in the circular dependency loop and the attribute styles of the tokens referenced by each target component are retained, and the tokens referenced by the self-loops are deleted. Convert the updated token reference directed graph into a decision data state and present it to the designer in a visual form to adjust the reference tokens of the components.

[0100] like Figure 7 The token reference relationship shown is: A->B->C->B->D, then only the self-loop in the circular dependency loop and the attribute styles of the tokens referenced by each target component are retained, and the tokens referenced by the self-loop are deleted, that is, A->B, B->B, C->B.

[0101] Step S104 , in response to the update of the atomic style attribute token, the target component referencing the atomic style attribute token is updated through the token dynamic style update mode.

[0102] When the atomic style property token is updated, the style update of the target component is triggered. Due to the token dynamic style update mode, designers can easily adjust the atomic style property token without manually modifying the style property value of each target component. Managing style properties through atomic style property tokens makes style modification and maintenance more centralized and efficient.

[0103] Specifically, an event listener is set to listen to the update of the atomic style attribute token. When the atomic style attribute token is updated, the target components that reference the token are determined by analyzing the token reference relationship or querying the token reference record. The style attributes and values ​​in the token are parsed and converted into style codes that can be recognized by the target component, and the target component is re-rendered according to the generated new style code.

[0104] In an optional manner, updating the target component that references the atomic style attribute token through the token dynamic style update mode further includes:

[0105] Determine whether the variable attribute and name of the atomic style attribute token have changed. When the variable attribute changes, the style value of the target component that references the token changes synchronously; when the name changes, the style value of the target component that references the token remains unchanged;

[0106] Determine whether the atomic style attribute token of the target component is released, and if so, assign the style value of the atomic style attribute token when it is released.

[0107] In this embodiment, when a change in the variable attribute of an atomic style attribute token is detected, all target components that reference the token are traversed and the style values ​​of these components are synchronously updated. Fig. 9 As shown in the figure, if the name of the atomic style attribute token changes, the token reference record is updated to ensure that the new name matches the component reference. For the target component that has already referenced the token, its style value remains unchanged to avoid unnecessary style updates. When the atomic style attribute token of the target component is released, the style value at the time of release is recorded and assigned to the target component. After the token is released, the component style remains consistent, and there will be no style loss or confusion.

[0108] In an optional manner, the method further includes:

[0109] Determine whether the first atomic style attribute token referenced by the target component is modified to a second atomic style attribute token. If so, the style attribute of the target component continues to reference the first atomic style attribute token, and the update of the second atomic style attribute token no longer affects the style attribute of the target component.

[0110] If the first atomic style attribute token is recreated, a token reference relationship is automatically established between the style attribute of the target component and the first atomic style attribute token; and the style attribute of the target component and the first atomic style attribute token are synchronously updated.

[0111] In this embodiment, when the first atomic style attribute token is replaced by the second atomic style attribute token, the target component's reference to the first atomic style attribute token remains unchanged. In other words, the style attribute of the target component is disconnected from the influence of the new token and will continue to use the style definition of the first atomic style attribute token instead of the new second atomic style attribute token. Fig. 9 As shown, if the first atomic style attribute token is recreated, a token reference relationship is established between the style attribute of the target component and the recreated first atomic style attribute token. Once a new token reference relationship is established, the style attribute of the target component will be updated synchronously with the first atomic style attribute token. For example: component A references token B, and after token B is changed to token C, A still references token B, and A is displayed as token B. The update of token C no longer affects A; if a new token B is created at this time, A and token B are automatically associated, and A is updated with token B. In addition, when the reference relationship is released, the style value referenced at the time of release is directly assigned, and the content of the alias field is deleted. The modification of the style reference relationship triggers an update of the team library.

[0112] In an optional manner, the method further includes:

[0113] When multiple designers collaboratively reference multiple atomic style attribute tokens, the dependency data links of the multiple atomic style attribute tokens are merged to obtain a merged dependency data link;

[0114] It is determined whether there is a circular dependency loop in the merged dependency data link. If so, a modal pop-up window is used to remind the designer to perform a loop-breaking operation.

[0115] When multiple designers work together, merging the dependency data links of multiple atomic style attribute tokens and reminding designers through modal pop-ups when circular dependency loops are found is an important strategy to improve team collaboration efficiency and reduce potential errors. The following is a detailed explanation and advantage analysis of this process.

[0116] In this embodiment, when multiple designers work together and each references different atomic style attribute tokens, the token reference data of each designer is collected, including the dependency relationship between tokens. Then, these scattered dependency data links are merged to form an overall merged dependency data link. After merging the dependency data links, a graph theory algorithm is used to detect whether there is a circular dependency loop. A circular dependency loop refers to a closed loop formed in the token reference relationship, thereby discovering potential circular dependency problems. If there is a circular dependency loop, such as Figure 8 As shown, a modal pop-up window is used to remind the designer to perform the loop unwinding operation (there is a closed loop between corner-normal and corner-tiny, and since the two are in a parallel relationship, the loop needs to be unwound). A modal pop-up window is a pop-up interface that can block other user operations. The pop-up window displays the specific information of the circular dependency loop, including the tokens and dependencies involved, so that the designer can quickly locate the problem, such as modifying the token reference relationship or deleting unnecessary dependencies. By merging the dependency data links of multiple designers, the circular dependency reference operations caused by information asynchrony between designers are reduced, thereby improving the designer's work efficiency and reducing potential errors.

[0117] In an optional manner, the method further includes:

[0118] The atomized style attribute token is converted into style code, wherein the style code includes CSS variables, Swift code, and XML resources.

[0119] like Fig.10 As shown in the figure, when editing the rounded corner style, the code of the style is automatically generated, including position, width, height, rounded corners (border-radius:--corner-normal), etc. The style code includes CSS variables, Swift code, and XML resources.

[0120] For CSS variables, set each style attribute in the token as a CSS variable, and use the var() function in the CSS file to reference the CSS variable to replace the hard-coded style value. For example:

[0121]

[0122] In iOS development, use Swift code to define the styles of views and components, and encapsulate atomic style attribute tokens according to the defined Swift structure or class. For example:

[0123] / / Button reference token

[0124] let button=UIButton()

[0125] button.backgroundColor=(brand-color.button-primary-corner.hover)

[0126] In Android development, XML files are used to define the styles of views and layouts. Use the @style / prefix to reference tokens in the directory of the Android project. For example:

[0127]

[0128]

[0129] In addition, it also supports CSS variables, Swift code, and XML resource import functions, such as Fig.11 As shown in the figure, the CSS code is imported into the corresponding control, and these imported variables are directly applied to the corresponding control. The style of the control is updated by extracting the variables and matching and binding them with the properties of the control. Importing ensures that the same style and logic are applied on different platforms, thereby achieving cross-platform consistency and reducing the workload of manual code writing, so that the design draft can be quickly built and modified.

[0130] The solution provided by the above embodiment of the present invention divides the visual design into multiple atomic levels of global level, scene level and component level, wherein the component level includes a basic component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens; at least one target component is created in the design end page, and the style attributes of the target component reference the atomic style attribute token through a token dynamic style reference mode; the atomic style attribute tokens referenced by each target component are subjected to dependency data link analysis to obtain a decision data state so that the designer can adjust the reference token of the target component according to the decision data state; in response to the update of the atomic style attribute token, the target component that references the atomic style attribute token is updated through a token dynamic style update mode. The present invention improves the maintainability, flexibility and collaboration efficiency of the design system by introducing a multi-level token structure and a dynamic style reference mechanism.

[0131] Embodiment 2:

[0132] Fig.12 The schematic diagram of the structure of the multi-layer atomic visual design device based on style reference according to the embodiment of the present invention is shown. The multi-layer atomic visual design device based on style reference 12 comprises: a token definition module 1201 , a token reference module 1202 , a token analysis module 1203 and a token update module 1204 .

[0133] The token definition module 1201 is used to divide the visual design into multiple atomic levels of a global level, a scene level and a component level, wherein the component level includes a basic component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens;

[0134] The token reference module 1202 is used to create at least one target component in the design end page, and the style attribute of the target component references the atomic style attribute token through the token dynamic style reference mode;

[0135] The token analysis module 1203 is used to perform dependency data link analysis on the atomic style attribute tokens referenced by each target component to obtain a decision data state so that the designer can adjust the reference token of the target component according to the decision data state;

[0136] The token updating module 1204 is configured to update the target component that references the atomic style attribute token through a token dynamic style update mode in response to the update of the atomic style attribute token.

[0137] In an optional manner, the method further includes:

[0138] The atomized style attribute token is converted into style code, wherein the style code includes CSS variables, Swift code, and XML resources.

[0139] In an optional manner, the global level, scene level and component level include but are not limited to the following style attributes: brand color, font, basic spacing, background color, border style, text style, hover state, click state and disabled state.

[0140] In an optional manner, the atomized style attribute token includes a name, an alias, and a variable attribute set;

[0141] The name adopts a naming convention consisting of a multi-layer atomic-level style attribute set of the global level, the scene level, and the component level;

[0142] The style attribute sets of the multiple layers of atomic levels are spliced ​​by a first preset specific symbol, and the style attributes of the multiple layers of atomic levels are spliced ​​by a second preset specific symbol;

[0143] The name and the variable attribute set form a key-value pair structure.

[0144] In an optional manner, the style attribute of the target component references the atomic style attribute token through the token dynamic style reference mode, further comprising:

[0145] After the target component determines to reference the atomic style attribute token, the style attribute alias of the target component is the name of the referenced atomic style attribute token;

[0146] The style attribute of the target component only refers to the atomic style attribute token with the same attribute style, and the name of the atomic style attribute token is unique in the design library.

[0147] In an optional manner, the performing dependency data link analysis on the atomic style attribute tokens referenced by each target component further includes:

[0148] According to each of the target components and the atomic style attribute tokens referenced by them, a token reference directed graph is constructed, wherein the vertices of the token reference directed graph are the target components and the paths are the token reference relationships;

[0149] Determine whether there is a circular dependency loop in the token reference directed graph; if so, update the dependent data link of the circular dependency loop to eliminate the loop; wherein only the self-loop in the circular dependency loop and the attribute style of the token referenced by each of the target components are retained, and the token referenced by the self-loop is deleted;

[0150] The updated dependent data link is used as the decision data state.

[0151] In an optional manner, updating the target component that references the atomic style attribute token through the token dynamic style update mode further includes:

[0152] Determine whether the variable attribute and name of the atomic style attribute token have changed. When the variable attribute changes, the style value of the target component that references the token changes synchronously; when the name changes, the style value of the target component that references the token remains unchanged;

[0153] Determine whether the atomic style attribute token of the target component is released, and if so, assign the style value of the atomic style attribute token when it is released.

[0154] In an optional manner, the method further includes:

[0155] Determine whether the first atomic style attribute token referenced by the target component is modified to a second atomic style attribute token. If so, the style attribute of the target component continues to reference the first atomic style attribute token, and the update of the second atomic style attribute token no longer affects the style attribute of the target component.

[0156] If the first atomic style attribute token is recreated, a token reference relationship is automatically established between the style attribute of the target component and the first atomic style attribute token; and the style attribute of the target component and the first atomic style attribute token are synchronously updated.

[0157] In an optional manner, the method further includes:

[0158] When multiple designers collaboratively reference multiple atomic style attribute tokens, the dependency data links of the multiple atomic style attribute tokens are merged to obtain a merged dependency data link;

[0159] It is determined whether there is a circular dependency loop in the merged dependency data link. If so, a modal pop-up window is used to remind the designer to perform a loop-breaking operation.

[0160] The solution provided by the above embodiment of the present invention divides the visual design into multiple atomic levels of global level, scene level and component level, wherein the component level includes a basic component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens; at least one target component is created in the design end page, and the style attributes of the target component reference the atomic style attribute token through a token dynamic style reference mode; the atomic style attribute tokens referenced by each target component are subjected to dependency data link analysis to obtain a decision data state so that the designer can adjust the reference token of the target component according to the decision data state; in response to the update of the atomic style attribute token, the target component that references the atomic style attribute token is updated through a token dynamic style update mode. The present invention improves the maintainability, flexibility and collaboration efficiency of the design system by introducing a multi-level token structure and a dynamic style reference mechanism.

[0161] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description made to specific languages ​​above is for disclosing the best mode of the present invention.

[0162] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0163] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0164] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0165] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0166] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0167] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A multi-layer atomic visual design method based on style reference, characterized in that: include: Dividing the visual design into multiple atomic levels of a global level, a scene level, and a component level, wherein the component level includes a base component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens; At least one target component is created in the design-side page, and the style attribute of the target component references the atomic style attribute token through a token dynamic style reference mode; Performing dependency data link analysis on the atomic style attribute tokens referenced by each of the target components to obtain a decision data state so that the designer can adjust the reference tokens of the target components according to the decision data state; In response to the update of the atomic style attribute token, the target component that references the atomic style attribute token is updated through a token dynamic style update mode.

2. The method according to claim 1, characterized in that The method further comprises: The atomized style attribute token is converted into style code, wherein the style code includes CSS variables, Swift code, and XML resources.

3. The method according to claim 1 or 2, characterized in that: The global level, scene level, and component level include, but are not limited to, the following style attributes: brand color, font, basic spacing, background color, border style, text style, hover state, click state, and disabled state.

4. The method according to claim 3, characterized in that The atomized style attribute token includes a name, an alias, and a variable attribute set; The name adopts a naming convention consisting of a multi-layer atomic-level style attribute set of the global level, the scene level, and the component level; The style attribute sets of the multiple layers of atomic levels are spliced ​​by a first preset specific symbol, and the style attributes of the multiple layers of atomic levels are spliced ​​by a second preset specific symbol; The name and the variable attribute set form a key-value pair structure.

5. The method according to claim 1, characterized in that The style attribute of the target component references the atomized style attribute token through the token dynamic style reference mode, further comprising: After the target component determines to reference the atomic style attribute token, the style attribute alias of the target component is the name of the referenced atomic style attribute token; The style attribute of the target component only refers to the atomic style attribute token with the same attribute style, and the name of the atomic style attribute token is unique in the design library.

6. The method according to claim 1, characterized in that The performing dependency data link analysis on the atomic style attribute tokens referenced by each target component further comprises: According to each of the target components and the atomic style attribute tokens referenced by them, a token reference directed graph is constructed, wherein the vertices of the token reference directed graph are the target components and the paths are the token reference relationships; Determine whether there is a circular dependency loop in the token reference directed graph; if so, update the dependent data link of the circular dependency loop to eliminate the loop; wherein only the self-loop in the circular dependency loop and the attribute style of the token referenced by each of the target components are retained, and the token referenced by the self-loop is deleted; The updated dependent data link is used as the decision data state.

7. The method according to claim 1, characterized in that The updating of the target component referencing the atomic style attribute token through the token dynamic style update mode further comprises: Determine whether the variable attribute and name of the atomic style attribute token have changed. When the variable attribute changes, the style value of the target component that references the token changes synchronously; when the name changes, the style value of the target component that references the token remains unchanged; Determine whether the atomic style attribute token of the target component is released, and if so, assign the style value of the atomic style attribute token when it is released.

8. The method according to claim 7, characterized in that The method further comprises: Determine whether the first atomic style attribute token referenced by the target component is modified to a second atomic style attribute token. If so, the style attribute of the target component continues to reference the first atomic style attribute token, and the update of the second atomic style attribute token no longer affects the style attribute of the target component. If the first atomic style attribute token is recreated, a token reference relationship is automatically established between the style attribute of the target component and the first atomic style attribute token; and the style attribute of the target component and the first atomic style attribute token are synchronously updated.

9. The method according to claim 1 or 5, characterized in that: The method further comprises: When multiple designers collaboratively reference multiple atomic style attribute tokens, the dependency data links of the multiple atomic style attribute tokens are merged to obtain a merged dependency data link; It is determined whether there is a circular dependency loop in the merged dependency data link. If so, a modal pop-up window is used to remind the designer to perform a loop-breaking operation.

10. A multi-layer atomic visual design device based on style reference, characterized in that: include: A token definition module, configured to divide the visual design into multiple atomic levels of a global level, a scene level, and a component level, wherein the component level includes a base component level and a variant component level; the multiple atomic levels of each level include a set of atomic style attribute tokens; A token reference module, used to create at least one target component in a design-side page, wherein the style attribute of the target component references the atomic style attribute token through a token dynamic style reference mode; A token analysis module, used for performing dependency data link analysis on the atomic style attribute tokens referenced by each target component to obtain a decision data state, so that the designer can adjust the reference token of the target component according to the decision data state; The token updating module is used to update the target component that references the atomic style attribute token through a token dynamic style updating mode in response to the update of the atomic style attribute token.

Citation Information

Cited By

  • UI component data processing method and system based on design token

    CN119088393A

  • CSS atom class rule merging method and device, storage medium and computer equipment

    CN121211076A

  • Cross-platform multi-source heterogeneous data scenarized digital identification method, system and device

    CN121278014A