CN118733012A - A multi-layer atomic visual design method and device based on style reference - Google Patents

A multi-layer atomic visual design method and device based on style reference Download PDF

Info

Publication number
CN118733012A
CN118733012A CN202410513877.4A CN202410513877A CN118733012A CN 118733012 A CN118733012 A CN 118733012A CN 202410513877 A CN202410513877 A CN 202410513877A CN 118733012 A CN118733012 A CN 118733012A
Authority
CN
China
Prior art keywords
style
token
style attribute
attribute
atomization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410513877.4A
Other languages
Chinese (zh)
Inventor
罗琨
刘伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Creative Beautiful Technology Co ltd
Original Assignee
Beijing Creative Beautiful Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Creative Beautiful Technology Co ltd filed Critical Beijing Creative Beautiful Technology Co ltd
Priority to CN202410513877.4A priority Critical patent/CN118733012A/en
Publication of CN118733012A publication Critical patent/CN118733012A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/34Graphical or visual programming
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a multi-layer atomization visual design method and device based on style reference, wherein the method comprises the following steps: dividing the visual design into a global hierarchy, a scene hierarchy, and a multi-layered atomization hierarchy of a component hierarchy, the multi-layered atomization hierarchy comprising a set of atomization style attribute tokens; creating at least one target component in the design end page, wherein the style attribute of the target component refers to an atomized style attribute token through a token dynamic style reference mode; performing dependency data link analysis on the atomization style attribute tokens referenced by each target component to obtain decision data states, so that a designer can adjust the reference tokens of the target components according to the decision data states; in response to the updating of the atomized style attribute token, updating the target component referencing the atomized style attribute token through the token dynamic style update schema. The invention improves maintainability, flexibility and cooperation efficiency of a design system by introducing a multi-level token structure and a dynamic style quotation mechanism.

Description

一种基于样式引用的多层原子化视觉设计方法和装置A multi-layer atomic visual design method and device based on style reference

技术领域Technical Field

本发明涉及软件设计技术领域,具体涉及一种基于样式引用的多层原子化视觉设计方法和装置。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

随着数字产品设计和开发的复杂度日益增加,设计师与开发者之间的协作变得尤为关键。传统的设计传递流程,如手动编码设计规范和靠视觉审查确保实现的一致性,已经难以满足快速迭代和高效协作的需求。改传统的设计传递流程不仅耗时且容易出错,大幅降低了团队的工作效率和产品的市场响应速度。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.

现有的设计软件或系统虽然具有如颜色、字体、间距等一定程度的标准化和自动化功能(可以跨平台使用),但仍面临诸多方面的挑战:一是单层次结构的局限性。大多数现有系统为单一层次结构,限制了其在处理复杂设计系统时的灵活性和扩展性。例如,当一个颜色需要在不同的上下文中以不同的方式使用时(如按钮背景色与文本颜色),单层次结构就难以有效管理;二是更新与维护的困难性。在传统的设计系统中,当设计决策发生变化时,需要手动修改大量文件,不仅效率低下而且容易遗漏,导致实现与设计的不一致性;三是跨平台一致性的挑战。随着多平台应用的普及,如何保持不同平台间设计的一致性成为一个挑战,现有的设计方法往往缺乏有效的跨平台支持机制,使得维护一致性的成本增加。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.

因此,急需一种新的软件设计方法和装置解决上述问题,以实现对多层原子化视觉设计的灵活管理,并提高从设计到开发流程中的协作效率和产品质量。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

鉴于上述问题,提出了本发明以便提供一种多层次令牌样式引用机制的基于样式引用的多层原子化视觉设计方法和装置。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.

根据本发明的一个方面,提供了一种基于样式引用的多层原子化视觉设计方法,包括:According to one aspect of the present invention, a multi-layer atomic visual design method based on style reference is provided, comprising:

将所述视觉设计划分为全局层级、场景层级以及组件层级的多层原子化层级,其中,所述组件层级包括基础组件层级以及变体组件层级;各层级的所述多层原子化层级包含一组原子化样式属性令牌;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, a target component that references the atomic style attribute token is updated through a token dynamic style update mode.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

将所述原子化样式属性令牌转换为样式代码,所述样式代码包括CSS变量、Swift代码以及XML资源。The atomized style attribute token is converted into style code, wherein the style code includes CSS variables, Swift code, and XML resources.

在一种可选的方式中,所述全局层级、场景层级以及组件层级包括但不限于以下样式属性:品牌颜色、字体、基础间距、背景色、边框样式、文本样式、悬停状态、点击状态以及禁用状态。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.

在一种可选的方式中,所述原子化样式属性令牌包括名称、别名以及变量属性集合;In an optional manner, 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.

在一种可选的方式中,所述目标组件的样式属性通过令牌动态样式引用模式引用所述原子化样式属性令牌进一步包括: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:

所述目标组件确定引用原子化样式属性令牌之后,所述目标组件的样式属性别名为被引用原子化样式属性令牌的名称;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.

在一种可选的方式中,所述对各个所述目标组件引用的原子化样式属性令牌进行依赖数据链路分析进一步包括:In an optional manner, the performing dependency data link analysis on the atomic style attribute tokens referenced by each target component further includes:

根据各个所述目标组件及其引用的原子化样式属性令牌,构建令牌引用有向图,其中,所述令牌引用有向图的顶点为各个目标组件,路径为令牌引用关系;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.

在一种可选的方式中,所述通过令牌动态样式更新模式更新引用所述原子化样式属性令牌的目标组件进一步包括:In an optional manner, updating the target component that references the atomic style attribute token through the token dynamic style update mode further includes:

判断所述原子化样式属性令牌的变量属性和名称是否改变,当所述变量属性改变时,引用该令牌的目标组件的样式值同步发生变化;当所述名称发生改变时,引用该令牌的目标组件的样式值保持不变;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.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

判断所述目标组件所引用的第一原子化样式属性令牌是否被修改为第二原子化样式属性令牌,若是,所述目标组件的样式属性继续引用所述第一原子化样式属性令牌,所述第二原子化样式属性令牌的更新不再影响所述目标组件的样式属性;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.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

当多个设计师协同引用多个原子化样式属性令牌时,将所述多个原子化样式属性令牌的依赖数据链路进行合并得到合并依赖数据链路;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.

根据本发明的另一方面,提供了一种基于样式引用的多层原子化视觉设计装置,包括:According to another aspect of the present invention, a multi-layer atomic visual design device based on style reference is provided, comprising:

令牌定义模块,用于将所述视觉设计划分为全局层级、场景层级以及组件层级的多层原子化层级,其中,所述组件层级包括基础组件层级以及变体组件层级;各层级的所述多层原子化层级包含一组原子化样式属性令牌;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 for creating 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.

本发明上述实施例提供的方案,将所述视觉设计划分为全局层级、场景层级以及组件层级的多层原子化层级,其中,所述组件层级包括基础组件层级以及变体组件层级;各层级的所述多层原子化层级包含一组原子化样式属性令牌;在设计端页面中创建至少一个目标组件,所述目标组件的样式属性通过令牌动态样式引用模式引用所述原子化样式属性令牌;对各个所述目标组件引用的原子化样式属性令牌进行依赖数据链路分析,得到决策数据状态,以便设计师根据所述决策数据状态调整所述目标组件的引用令牌;响应于所述原子化样式属性令牌的更新,通过令牌动态样式更新模式更新引用所述原子化样式属性令牌的目标组件。本发明通过引入多层次令牌结构以及动态样式引用机制,提高了设计系统的可维护性、灵活性和协作效率。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.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述说明和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。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

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中: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. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

图1示出了本发明实施例的基于样式引用的多层原子化视觉设计方法的流程示意图;FIG1 is 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;

图2示出了本发明实施例的多层原子化层级的关系示意图;FIG2 is a schematic diagram showing the relationship between multiple atomization levels according to an embodiment of the present invention;

图3示出了本发明实施例的原子化样式属性令牌引用示意图;FIG3 shows a schematic diagram of atomic style attribute token reference according to an embodiment of the present invention;

图4示出了本发明实施例的原子化样式属性令牌结构示意图一;FIG4 shows a schematic diagram of the structure of an atomic style attribute token according to an embodiment of the present invention;

图5示出了本发明实施例的原子化样式属性令牌结构示意图二;FIG5 shows a second schematic diagram of the structure of an atomic style attribute token according to an embodiment of the present invention;

图6示出了本发明实施例的原子化样式属性令牌引用示例图;FIG. 6 shows an example diagram of an atomic style attribute token reference according to an embodiment of the present invention;

图7示出了本发明实施例的原子化样式属性令牌解环示意图;FIG7 shows a schematic diagram of de-looping of an atomic style attribute token according to an embodiment of the present invention;

图8示出了本发明实施例的样式引用成环解除操作示意图;FIG8 is a schematic diagram showing a style reference loop removal operation according to an embodiment of the present invention;

图9示出了本发明实施例的原子化样式属性令牌的更新流程示意图;FIG9 is a schematic diagram showing an update process of an atomic style attribute token according to an embodiment of the present invention;

图10示出了本发明实施例的原子化样式属性令牌的代码示意图;FIG10 shows a schematic diagram of a code of an atomized style attribute token according to an embodiment of the present invention;

图11示出了本发明实施例的原子化样式属性令牌的导入示意图;FIG11 is a schematic diagram showing the import of an atomic style attribute token according to an embodiment of the present invention;

图12示出了本发明实施例的基于样式引用的多层原子化视觉设计装置的结构示意图。FIG. 12 shows a schematic structural diagram of a multi-layer atomic visual design device based on style reference according to an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将参照附图更详细地描述本发明的示例性实施例。虽然附图中显示了本发明的示例性实施例,然而应当理解,可以以各种形式实现本发明而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本发明,并且能够将本发明的范围完整的传达给本领域的技术人员。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.

在实施本发明实施例之前,对下文中涉及的技术术语或自定义术语在此进行统一解释:Before implementing the embodiments of the present invention, the technical terms or custom terms involved below are uniformly explained here:

组件:其允许将UI划分为独立的、可重用的部分,在实际应用中,组件常被组织成层层嵌套的树状结构。Components: They allow the UI to be divided into independent, reusable parts. In practical applications, components are often organized into a nested tree structure.

容器:旧称“画板”,是设计软件的重要设计组成,例如iPhone容器、A4纸容器。Container: Formerly known as "drawing board", it is an important design component of design software, such as iPhone container and A4 paper container.

实例:实例是指对组件的具体引用,用户从组件列表里拖出的、或是从组件复制粘贴出来的,均是一个“实例”,而非组件的本体。Instance: An instance refers to 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.

组件属性:组件属性最早起源于研发生产过程中,例如Element VUE 2.0中的Button attributes和form-input attributes。在代码中分为参数、类型和可选值。组件属性将代码中的attributes前置给到画布编辑者,让编辑者能够在属性面板自主新增参数、类型和值。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.

可变组件:放置在组件集容器中的赋予多个属性(定义可变组件的性质与关系)和值(定义属性的特定特征或参数)的组件。Variable component: A component placed in a component set container and given multiple attributes (defining the properties and relationships of the variable component) and values (defining specific characteristics or parameters of the attributes).

可变实例:可变组件的实例。Mutable instance: An instance of a mutable component.

令牌:在计算机术语中,令牌(token)是指服务端生成的一串字符串。本发明利用“令牌”的概念定义复杂的设计元素(视为原子化视觉设计语言)。即,将视觉模式和界面属性重新梳理归纳进行语义化命名,代替前端代码中的硬编码常量(例如十六进制的颜色代码),方便设计师进行统一的管理和扩展,保证产品的一致性,提升设计与开发的效率。例如:颜色,用于定义产品中使用的颜色值,如主色、辅助色、背景色等;字体,用于定义产品中使用的字体、字号、行高等属性,以及对应的类名或变量名;边框,用于定义产品中使用的边框颜色、宽度、样式等属性,以及对应的类名或变量名;间距,用于定义产品中使用的间距、内边距、外边距等属性,以及对应的类名或变量名;图标,用于定义产品中使用的图标,如图标名称、颜色、大小等属性,以及对应的类名或变量名;布局,用于定义产品中使用的布局方式,如栅格、排版方式等,以及对应的类名或变量名。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.

本申请为构建一套全面高可用的设计系统,深入理解使用者的真实需求,结合产品需求与实际使用场景,提出一种创新的基于样式引用能力实现多层原子化视觉设计管理的方法,以应对当前设计与开发过程中遇到的挑战,特别是在提高样式的可维护性、灵活性和跨平台一致性方面。以下通过具体实施例对本发明的具体内容进行详细说明。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.

实施例一:Embodiment 1:

图1示出了本发明实施例的基于样式引用的多层原子化视觉设计方法的流程示意图。具体地,如图1所示,包括以下步骤:FIG1 shows a schematic flow chart of a multi-layer atomic visual design method based on style reference according to an embodiment of the present invention. Specifically, as shown in FIG1 , the method includes the following steps:

步骤S101,将视觉设计划分为全局层级、场景层级以及组件层级的多层原子化层级,其中,所述组件层级包括基础组件层级以及变体组件层级;各层级的多层原子化层级包含一组原子化样式属性令牌。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.

本实施例中,将视觉设计划分为全局层级、场景层级以及组件层级的多层原子化层级,其中,组件层级包括基础组件层级以及变体组件层级,并为每个层级设置一组原子化样式属性令牌。通过多层原子化层级的划分,设计师能够清晰、快速地构建样式元素。其中,全局层级包含如字体、品牌颜色、边框背景色、圆角、布局规则等样式属性令牌,以确保视觉风格的统一性。根据不同的应用场景或功能需求划分不同的场景层级,不同的场景需要不同的设计元素和样式,例如,某品牌咖啡的全局层级的品牌颜色为绿色,对于某些页面(如商品详情页、购物页等多个页面场景)或单选与复选状态,可能需要灰色的颜色。使用全局层级的令牌式就很难做差异化设计,如果手动更改某些页面、或者单选框与复选框的颜色,则工程师将花费很多的工作量。因此,在全局层级的令牌基础上,加入场景层级令牌(如加入“第二层”、“第三层”的“别名”区分每个组件),则可以分别再次修改页面或复选框与单选框的颜色,以解决在之后的产品中可能存在需要随时修改的风险问题。组件层级在全局层级、场景层级的基础上进一步细分和扩展(即控制的力度或细度不同)。例如,根据场景拆分成多个独立的组件(如按钮、输入框等),每个组件基于全局层级和场景层级的样式和规则,根据特定需求进行定制和扩展,形成组件特有的样式和规则。本实施例中,组件层级包括基础组件层级以及变体组件层级。基础组件层级设置基础的组件样式,包括如按钮、输入框等组件的样式属性令牌,可以在全局层级、场景层级的基础上进行调整(即引用全局层级、场景层级的令牌),也可以单独创建预设的组件样式,以满足组件的特定需求。变体组件层级是对组件层级的进一步细分,根据具体的需求或场景基于基础组件的变体进行微调或扩展,例如,处理不同状态下的组件样式,一个按钮可以有正常状态、悬停状态、点击状态、阴影效果等变体,每个变体都有其特定的样式属性令牌,使组件在不同状态下呈现不同的视觉效果。原子化样式属性令牌将样式属性拆分为最小的、可复用的单元,每个令牌都对应一个具体的样式属性。在设计过程中,通过选择并应用这些原子化样式属性令牌,可以快速地构建符合规范的各个层级的视觉元素,以提高样式属性设置的效率。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.

例如,$ui-controls-color-text-error=$color-feedback-errorFor example, $ui-controls-color-text-error=$color-feedback-error

(=$color-red-36)(=$color-red-36)

(=#B90000)(=#B90000)

全局层级的令牌为color-feedback-error(即反馈状况下的报错颜色),在color-red-36(即为命名为36号色的红色)令牌名称下细化了一层。场景层级(第二层别名)的令牌为ui-controls-color-text-error(即UI控件中文字的报错颜色),在全局层级的前提下又细化了一层。各层级的令牌所遵循的命名规范通常都不一样,通常而言,通过更少的层数满足设计管理是令牌命名规范的一个重要目标,表1给出了一种命名规范的参考。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.

表1Table 1

具体地,如图2所示,在全局层级(Global Level)定义的原子化样式属性令牌通常是整个设计系统中最基础、最广泛使用的样式属性,如品牌颜色(如主色调、辅助色、中性色等)、主要字体、基础间距(如边距、内边距、行高等)等。这些全局令牌为整个设计系统提供了统一的视觉和感觉基础。Specifically, as shown in Figure 2, 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.

场景层级根据不同的需求场景,创建“第二层”的场景层级令牌,也可以在全局层级令牌的基础上修改形成场景层级令牌。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.

基础组件层级(Component Level)的令牌定义特定UI组件的样式属性,可以继承(引用)全局层级的令牌,通过添加或覆盖特定的样式属性,以满足特定组件的需求,可以在保持整体设计一致性的同时,能够快速定制符合特定场景或需求的UI组件。例如,按钮组件的背景色、边框样式(边框的宽度、颜色、实线、虚线等)和文本样式(如字体大小、颜色、对齐方式等)令牌。这些令牌虽然基于全局层级的定义,但允许针对特定组件进行自定义。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 global level definition, they allow customization for specific components.

变体组件层级(Variant Level)的令牌继承组件层级的令牌(变体层级1、变体层级n可以同时继承组件层级n,变体层级1可以同时继承组件层级1以及组件层级n),允许为组件定义不同状态或变体的样式,如悬停(hover)、点击(active)或禁用(disabled)状态。这些令牌使组件在不同交互状态下保持视觉一致性,同时增加了样式定义的灵活性。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.

在一种可选的方式中,所述原子化样式属性令牌包括名称、别名以及变量属性集合;In an optional manner, 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.

本实施例中,如图4、图5所示,原子化样式属性令牌包括名称(name)、别名(alias)、引用(reference)以及变量属性集合等。其中,名称遵循特定的命名规范,用于唯一标识一个样式属性集合。该命名规范由多层原子化层级构成,包括全局层级、场景层级和组件层级。多层原子化层级通过第一预设特定符(如连字符“-”或下划线“_”)进行拼接。同时,多层原子化层级的样式属性之间通过第二预设特定符(如点号“.”)进行拼接。该命名方式提高了样式的可读性、可维护性以及查找效率。别名允许为常用的样式属性集合定义简短的名称。这些别名可以作为快捷方式替代冗长的样式属性名称。可以根据项目的具体需求和团队的使用习惯定义别名,可以是对某个特定样式属性的简称,也可以是对一组相关样式属性的概括性命名。引用用于显示所引用的特定令牌的名称,例如,按钮组件引用名为button-primary-background-color的令牌设置背景色,引用名称则为button-primary-background-color,可以追踪样式属性的引用来源。变量属性集合描述原子化样式属性令牌中的样式值,包含一系列具体的样式属性值(如颜色、字体大小、边距、填充等样式属性),该变量属性集合与名称以键值对的形式存储在变量属性集合中。In this embodiment, as shown in Figures 4 and 5, 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.

步骤S102,在设计端页面中创建至少一个目标组件,目标组件的样式属性通过令牌动态样式引用模式引用原子化样式属性令牌。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.

在设计端的父组件或页面中注册并引入目标组件,通过令牌动态样式引用模式引用原子化样式属性令牌改变组件的样式属性,以适应不同的设计需求。即,只需调整原子化样式属性令牌的值,即可实现样式的快速更新。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 update of the style.

使用令牌时,如图3所示,全局层级、场景层级及组件层级包括品牌颜色({brand-color})、基础间距、圆角按钮{button-primary-corner}、文本样式等令牌、悬停{hover}、禁用等令牌。在画布中创建默认按钮,该默认按钮分别引用全局层级中的品牌颜色令牌、组件层级中的圆角按钮令牌以及变体层级中的悬停令牌之后,该默认按钮的引用令牌为{brand-color.button-primary-corner.hover},通过重新渲染后其样式调整为圆角按钮,该圆角按钮同时保护了品牌颜色、圆角以及悬停状态。又,如图6所示,通过设置引用样式令牌(--corner-tiny 2,2,2,2)即可改变标准圆角的圆角属性。由此可见,只需调整原子化样式属性令牌的值,即可实现样式的快速更新。When using tokens, as shown in Figure 3, 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. After 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. As shown in Figure 6, the rounded corner properties of the standard rounded corners can be changed by setting the reference style token (--corner-tiny 2,2,2,2). It can be seen that the style can be quickly updated by simply adjusting the value of the atomic style attribute token.

在一种可选的方式中,所述目标组件的样式属性通过令牌动态样式引用模式引用所述原子化样式属性令牌进一步包括: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:

所述目标组件确定引用原子化样式属性令牌之后,所述目标组件的样式属性别名为被引用原子化样式属性令牌的名称;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.

本实施例中,当目标组件确定引用某个原子化样式属性令牌后,该组件的样式属性别名被设置为被引用原子化样式属性令牌的名称。别名用于描述目标组件所引用的样式属性来源,增强了样式属性的可读性和可维护性。目标组件的样式属性仅引用与其同属性样式的原子化样式属性令牌。如果目标组件有一个关于字体颜色的样式属性,其只能引用设计库中与字体颜色相关的原子化样式属性令牌,以避免样式冲突和覆盖的问题。由于每个令牌描述特定的样式属性集合,在设计库中,原子化样式属性令牌的名称是唯一的,可以避免样式属性的混淆和错误引用。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.

步骤S103,对各个目标组件引用的原子化样式属性令牌进行依赖数据链路分析,得到决策数据状态,以便设计师根据决策数据状态调整目标组件的引用令牌。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.

本实施例中,决策数据状态反映组件样式属性所引用令牌之间的依赖关系,设计师根据决策数据状态可以识别出哪些组件依赖于特定的样式令牌,可以追踪样式属性的引用来源和变化。以及哪些组件共享相同的样式令牌,从而实现样式的复用。同时,还可以发现潜在的样式冲突或不一致性,并及时进行调整,以确保整个设计稿的样式一致性。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, so as to achieve style reuse. At the same time, potential style conflicts or inconsistencies can also be discovered, and adjustments can be made in time to ensure the style consistency of the entire design draft.

具体地,遍历设计项目中的所有目标组件,检索每个组件所引用的原子化样式属性令牌,根据各个目标组件所引用的令牌信息,构建目标组件与样式令牌之间的依赖数据链路图。该依赖数据链路图可以是可视化图表,也可以是图或邻接表等数据结构,以表示组件与令牌之间的依赖关系。基于依赖数据链路图,分析各个目标组件的决策数据状态,包括检查组件是否引用了已删除令牌以及引用的令牌是否与其他组件存在冲突等。根据决策数据状态的分析结果,为设计师提供调整目标组件引用令牌的建议,以便设计师根据决策数据状态调整目标组件的引用令牌。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 to adjust 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.

在一种可选的方式中,所述对各个所述目标组件引用的原子化样式属性令牌进行依赖数据链路分析进一步包括:In an optional manner, the performing dependency data link analysis on the atomic style attribute tokens referenced by each target component further includes:

根据各个所述目标组件及其引用的原子化样式属性令牌,构建令牌引用有向图,其中,所述令牌引用有向图的顶点为各个目标组件,路径为令牌引用关系;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.

本实施例中,通过构建令牌引用有向图展示目标组件与原子化样式属性令牌之间的引用关系,以判断令牌引用有向图中是否存在循环依赖环,及时发现潜在的样式引用问题,如循环引用导致样式无法被正确应用等。通过更新循环依赖环的依赖数据链路消除循环依赖,保留必要的属性样式,确保样式引用的正确性。将更新后的依赖数据链路作为决策数据状态,设计师可以基于这些信息快速做出决策,调整组件的引用令牌。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.

具体地,遍历所有目标组件,记录每个组件引用的原子化样式属性令牌。以目标组件作为顶点,令牌引用关系作为路径,构建令牌引用有向图。使用深度优先搜索或广度优先搜索算法遍历令牌引用有向图。如果某个顶点被重复访问且路径形成闭环,则说明存在循环依赖环。仅保留循环依赖环中的自环以及各个目标组件所引用令牌的属性样式,并删除自环所引用的令牌。将更新后的令牌引用有向图转换为决策数据状态,以可视化的形式展示给设计师,以调整组件的引用令牌。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.

如图7所示的令牌引用关系为:A->B->C->B->D,则仅保留循环依赖环中的自环以及各个目标组件所引用令牌的属性样式,并删除自环所引用的令牌,即A->B,B->B,C->B。As shown in Figure 7, the token reference relationship is: A->B->C->B->D. 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.

步骤S104,响应于原子化样式属性令牌的更新,通过令牌动态样式更新模式更新引用原子化样式属性令牌的目标组件。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.

当原子化样式属性令牌更新时,触发目标组件的样式更新。由于采用了令牌动态样式更新模式,设计师可以轻松地调整原子化样式属性令牌,而无需手动修改每个目标组件的样式属性值。通过原子化样式属性令牌管理样式属性,使样式的修改和维护变得更加集中和高效。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.

具体地,设置事件监听器监听原子化样式属性令牌的更新,当检测到原子化样式属性令牌更新时,通过分析令牌引用关系或查询令牌引用记录确定哪些目标组件引用了该令牌。解析令牌中的样式属性和值,并将其转换为目标组件可识别的样式代码,根据生成的新样式代码重新渲染目标组件。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.

在一种可选的方式中,所述通过令牌动态样式更新模式更新引用所述原子化样式属性令牌的目标组件进一步包括:In an optional manner, updating the target component that references the atomic style attribute token through the token dynamic style update mode further includes:

判断所述原子化样式属性令牌的变量属性和名称是否改变,当所述变量属性改变时,引用该令牌的目标组件的样式值同步发生变化;当所述名称发生改变时,引用该令牌的目标组件的样式值保持不变;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.

本实施例中,当检测到原子化样式属性令牌的变量属性发生变化时,遍历所有引用该令牌的目标组件,并同步更新这些组件的样式值。如图9所示,如果原子化样式属性令牌的名称发生改变,更新令牌引用记录以确保新的名称与组件的引用保持匹配,对于已经引用该令牌的目标组件,其样式值保持不变以避免不必要的样式更新。当目标组件的原子化样式属性令牌被解除时,记录解除时的样式值并将该值赋给目标组件,令牌解除后组件的样式仍然保持一致,不会出现样式丢失或错乱的情况。In this embodiment, when it is detected that the variable attribute of the atomic style attribute token has changed, all target components that reference the token are traversed, and the style values of these components are synchronously updated. As shown in Figure 9, if the name of the atomic style attribute token changes, the token reference record is updated to ensure that the new name matches the reference of the component. For the target components that have already referenced the token, their style values remain 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 style of the component remains consistent, and there will be no style loss or confusion.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

判断所述目标组件所引用的第一原子化样式属性令牌是否被修改为第二原子化样式属性令牌,若是,所述目标组件的样式属性继续引用所述第一原子化样式属性令牌,所述第二原子化样式属性令牌的更新不再影响所述目标组件的样式属性;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所示,如果第一原子化样式属性令牌被重新创建,为目标组件的样式属性与重新创建的第一原子化样式属性令牌建立令牌引用关系。一旦建立新的令牌引用关系,目标组件的样式属性将与第一原子化样式属性令牌同步更新。例如:组件A引用令牌B,令牌B被修改为令牌C之后,A仍引用令牌B,A显示为令牌B,令牌C的更新不再影响A;如此时另外新建令牌B,A和令牌B自动关联,A随令牌B更新。此外,当解除引用关系时,按解除时被引用的样式值直接赋值,删除别名alias字段的内容,样式引用关系的修改触发团队库更新。In this embodiment, when the first atomic style attribute token is replaced by the second atomic style attribute token, the reference of the target component to the first atomic style attribute token remains unchanged. That is, the style attribute of the target component is disconnected from the influence of the new token, and the style definition of the first atomic style attribute token will continue to be used instead of the new second atomic style attribute token. As shown in Figure 9, 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 modified 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 the update of the team library.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

当多个设计师协同引用多个原子化样式属性令牌时,将所述多个原子化样式属性令牌的依赖数据链路进行合并得到合并依赖数据链路;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.

在多个设计师协同工作时,合并多个原子化样式属性令牌的依赖数据链路,并在发现循环依赖环时通过模态弹窗提醒设计师,是提升团队协作效率和减少潜在错误的重要策略。以下是对这一过程的详细解释和优势分析。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.

本实施例中,当多个设计师协同工作并各自引用不同的原子化样式属性令牌时,收集每个设计师的令牌引用数据,包括令牌之间的依赖关系。然后,将这些分散的依赖数据链路进行合并,形成整体的合并依赖数据链路。在合并依赖数据链路后,使用图论算法检测其中是否存在循环依赖环。循环依赖环指的是在令牌引用关系中形成的闭环,从而发现潜在的循环依赖问题。如果存在循环依赖环,如图8所示,则通过模态弹窗的方式提醒设计师行解环操作(corner-normal与corner-tiny之间存在闭环,由于二者是并列关系,因此需要解环)。模态弹窗是一种弹出式界面,可以阻断用户的其他操作。弹窗中显示循环依赖环的具体信息,包括涉及的令牌和依赖关系,以便设计师能够迅速定位问题所在,例如修改令牌引用关系或删除不必要的依赖。通过合并多个设计师的依赖数据链路,减少了设计师之间因信息不同步导致的循环依赖引用操作,以提高设计师的工作效率、减少潜在错误。In this embodiment, when multiple designers work together and each references a different atomic style attribute token, 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 link, 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 a token reference relationship, thereby discovering potential circular dependency problems. If there is a circular dependency loop, as shown in Figure 8, a modal pop-up window is used to remind the designer to perform a loop-breaking 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 broken). The modal pop-up window is a pop-up interface that can block other user operations. The pop-up window displays specific information about 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, so as to improve the work efficiency of designers and reduce potential errors.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

将所述原子化样式属性令牌转换为样式代码,所述样式代码包括CSS变量、Swift代码以及XML资源。The atomized style attribute token is converted into style code, wherein the style code includes CSS variables, Swift code, and XML resources.

如图10所示,当编辑圆角样式时,自动生成该样式的代码,包括位置(position)、宽度(width)、高度(height)、圆角(border-radius:--corner-normal)等。该样式代码包括CSS变量、Swift代码以及XML资源等。As shown in Figure 10, 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.

其中,针对CSS变量,将令牌中发每个样式属性设定CSS变量,在CSS文件中使用var()函数引用该CSS变量,以替代硬编码的样式值。例如: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:

在iOS开发中,使用Swift代码定义视图和组件的样式,根据所定义的Swift结构体或类封装原子化样式属性令牌。例如: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:

//按钮引用令牌//Button reference token

let button=UIButton()let button = UIButton()

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

在Android开发中,使用XML文件定义视图和布局的样式。在Android项目的目录下使用@style/前缀引用令牌。例如: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:

此外,还支持CSS变量、Swift代码以及XML资源导入功能,如图11所示,将CSS代码导入对应的控件中,这些导入的变量被直接应用到对应的控件上。通过提取出变量并将其与控件的属性进行匹配和绑定以更新控件的样式。通过导入确保在不同平台上应用相同的样式和逻辑,从而实现跨平台的一致性,同时减少了手动编写代码的工作量,能够快速构建和修改设计稿。In addition, it also supports CSS variables, Swift code, and XML resource import functions. As shown in Figure 11, 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. By importing, the same style and logic are applied on different platforms, thereby achieving cross-platform consistency, while reducing the workload of manual code writing, and being able to quickly build and modify design drafts.

本发明上述实施例提供的方案,将所述视觉设计划分为全局层级、场景层级以及组件层级的多层原子化层级,其中,所述组件层级包括基础组件层级以及变体组件层级;各层级的所述多层原子化层级包含一组原子化样式属性令牌;在设计端页面中创建至少一个目标组件,所述目标组件的样式属性通过令牌动态样式引用模式引用所述原子化样式属性令牌;对各个所述目标组件引用的原子化样式属性令牌进行依赖数据链路分析,得到决策数据状态,以便设计师根据所述决策数据状态调整所述目标组件的引用令牌;响应于所述原子化样式属性令牌的更新,通过令牌动态样式更新模式更新引用所述原子化样式属性令牌的目标组件。本发明通过引入多层次令牌结构以及动态样式引用机制,提高了设计系统的可维护性、灵活性和协作效率。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.

实施例二:Embodiment 2:

图12示出了本发明实施例的基于样式引用的多层原子化视觉设计装置的结构示意图。基于样式引用的多层原子化视觉设计装置12包括:令牌定义模块1201、令牌引用模块1202、令牌分析模块1203和令牌更新模块1204。12 shows a schematic diagram of the structure of a multi-layer atomic visual design device based on style reference according to an embodiment of the present invention. 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 .

所述令牌定义模块1201,用于将所述视觉设计划分为全局层级、场景层级以及组件层级的多层原子化层级,其中,所述组件层级包括基础组件层级以及变体组件层级;各层级的所述多层原子化层级包含一组原子化样式属性令牌;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;

所述令牌引用模块1202,用于在设计端页面中创建至少一个目标组件,所述目标组件的样式属性通过令牌动态样式引用模式引用所述原子化样式属性令牌;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;

所述令牌分析模块1203,用于对各个所述目标组件引用的原子化样式属性令牌进行依赖数据链路分析,得到决策数据状态,以便设计师根据所述决策数据状态调整所述目标组件的引用令牌;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;

所述令牌更新模块1204,用于响应于所述原子化样式属性令牌的更新,通过令牌动态样式更新模式更新引用所述原子化样式属性令牌的目标组件。The token updating module 1204 is configured 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.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

将所述原子化样式属性令牌转换为样式代码,所述样式代码包括CSS变量、Swift代码以及XML资源。The atomized style attribute token is converted into style code, wherein the style code includes CSS variables, Swift code, and XML resources.

在一种可选的方式中,所述全局层级、场景层级以及组件层级包括但不限于以下样式属性:品牌颜色、字体以、基础间距、背景色、边框样式、文本样式、悬停状态、点击状态以及禁用状态。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.

在一种可选的方式中,所述原子化样式属性令牌包括名称、别名以及变量属性集合;In an optional manner, 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.

在一种可选的方式中,所述目标组件的样式属性通过令牌动态样式引用模式引用所述原子化样式属性令牌进一步包括: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:

所述目标组件确定引用原子化样式属性令牌之后,所述目标组件的样式属性别名为被引用原子化样式属性令牌的名称;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.

在一种可选的方式中,所述对各个所述目标组件引用的原子化样式属性令牌进行依赖数据链路分析进一步包括:In an optional manner, the performing dependency data link analysis on the atomic style attribute tokens referenced by each target component further includes:

根据各个所述目标组件及其引用的原子化样式属性令牌,构建令牌引用有向图,其中,所述令牌引用有向图的顶点为各个目标组件,路径为令牌引用关系;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.

在一种可选的方式中,所述通过令牌动态样式更新模式更新引用所述原子化样式属性令牌的目标组件进一步包括:In an optional manner, updating the target component that references the atomic style attribute token through the token dynamic style update mode further includes:

判断所述原子化样式属性令牌的变量属性和名称是否改变,当所述变量属性改变时,引用该令牌的目标组件的样式值同步发生变化;当所述名称发生改变时,引用该令牌的目标组件的样式值保持不变;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.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

判断所述目标组件所引用的第一原子化样式属性令牌是否被修改为第二原子化样式属性令牌,若是,所述目标组件的样式属性继续引用所述第一原子化样式属性令牌,所述第二原子化样式属性令牌的更新不再影响所述目标组件的样式属性;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.

在一种可选的方式中,所述方法还包括:In an optional manner, the method further includes:

当多个设计师协同引用多个原子化样式属性令牌时,将所述多个原子化样式属性令牌的依赖数据链路进行合并得到合并依赖数据链路;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.

本发明上述实施例提供的方案,将所述视觉设计划分为全局层级、场景层级以及组件层级的多层原子化层级,其中,所述组件层级包括基础组件层级以及变体组件层级;各层级的所述多层原子化层级包含一组原子化样式属性令牌;在设计端页面中创建至少一个目标组件,所述目标组件的样式属性通过令牌动态样式引用模式引用所述原子化样式属性令牌;对各个所述目标组件引用的原子化样式属性令牌进行依赖数据链路分析,得到决策数据状态,以便设计师根据所述决策数据状态调整所述目标组件的引用令牌;响应于所述原子化样式属性令牌的更新,通过令牌动态样式更新模式更新引用所述原子化样式属性令牌的目标组件。本发明通过引入多层次令牌结构以及动态样式引用机制,提高了设计系统的可维护性、灵活性和协作效率。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.

在此提供的算法或显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明实施例也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。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.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。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.

类似地,应当理解,为了精简本发明并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明实施例的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。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.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。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.

此外,本领域的技术人员能够理解,尽管在此的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。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 following claims, any one of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。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 of the functions of some or all of the components according to an embodiment 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.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。上述实施例中的步骤,除有特殊说明外,不应理解为对执行顺序的限定。It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may design 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 that lists 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 (10)

1. A style-referencing-based multi-layered atomized visual design method, comprising:
dividing the visual design into a global hierarchy, a scene hierarchy, and a multi-layered atomization hierarchy of component hierarchies, wherein the component hierarchies include a base component hierarchy and a variant component hierarchy; the multi-layered atomization hierarchy of each hierarchy comprises a set of atomization style attribute tokens;
Creating at least one target component in a design end page, wherein the style attribute of the target component refers to the atomization style attribute token through a token dynamic style reference mode;
Performing dependency data link analysis on the atomization style attribute tokens referenced by each target component to obtain a decision data state, so that a designer adjusts the reference tokens of the target components according to the decision data state;
in response to the updating of the atomized style attribute token, updating a target component referencing the atomized style attribute token through a token dynamic style update schema.
2. The method according to claim 1, wherein the method further comprises:
the atomized style attribute token is converted into style codes, wherein the style codes comprise CSS variables, swift codes and XML resources.
3. The method of claim 1 or 2, wherein the global hierarchy, scene hierarchy, and component hierarchy include, but are not limited to, the following style attributes: brand color, font, base spacing, background color, border style, text style, hover state, click state, and disable state.
4. The method of claim 3, wherein the atomized style attribute token includes a name, an alias, and a set of variable attributes;
the name adopts a naming specification formed by a style attribute set of a multi-layered atomization level of a global level, a scene level and a component level;
A first preset specific Fu Pinjie is adopted among the style attribute sets of the multi-layer atomization hierarchy, and a second preset specific Fu Pinjie is adopted among the style attributes of the multi-layer atomization hierarchy;
And the name and the variable attribute set form a key value pair structure.
5. The method of claim 1, wherein the style properties of the target component reference the atomized style property token through a token dynamic style reference schema further comprises:
After the target component determines the reference atomization style attribute token, the style attribute gender name of the target component is the name of the referenced atomization style attribute token;
Wherein, the style attribute of the target component only refers to an atomization style attribute token of the same attribute style, and the name of the atomization style attribute token is unique in a design library.
6. The method of claim 1, wherein said relying data link analysis of the atomized style attribute tokens referenced by each of said target components further comprises:
constructing a token reference directed graph according to each target component and the atomization style attribute token referenced by the target component, wherein the vertex of the token reference directed graph is each target component, and the path is a token reference relation;
Judging whether a circularly dependent ring exists in the token reference directed graph or not; if so, updating the dependent data link of the circularly dependent ring to eliminate the circle; wherein only the self-loop in the circularly dependent loop and the attribute style of the token referenced by each target component are reserved, and the token referenced by the self-loop is deleted;
the dependent data link after the update is taken as the decision data state.
7. The method of claim 1, wherein the updating the target component referencing the atomized style attribute token via a token dynamic style update schema further comprises:
Judging whether the variable attribute and the name of the atomization style attribute token are changed, and synchronously changing the style value of a target component referring to the token when the variable attribute is changed; when the name changes, the style value of the target component referencing the token remains unchanged;
Judging whether the atomization style attribute token of the target component is released, if so, assigning according to the style value of the atomization style attribute token when the atomization style attribute token is released.
8. The method of claim 7, wherein the method further comprises:
Judging whether a first atomization style attribute token referenced by the target component is modified into a second atomization style attribute token, if so, continuing to reference the first atomization style attribute token by the style attribute of the target component, wherein the updating of the second atomization style attribute token does not influence the style attribute of the target component;
If the first atomization style attribute token is re-created, automatically establishing a token reference relation between the style attribute of the target component and the first atomization style attribute token; the style attribute of the target component is updated synchronously with the first atomized style attribute token.
9. The method according to claim 1 or 5, characterized in that the method further comprises:
When a plurality of designers cooperatively quote a plurality of atomization style attribute tokens, merging the dependent data links of the atomization style attribute tokens to obtain a merged dependent data link;
judging whether a cyclic dependency ring exists in the merging dependency data link, and if so, reminding a designer of carrying out ring-opening operation in a mode of a modal popup window.
10. A style-referencing-based multi-layered atomized visual design apparatus, comprising:
A token definition module for partitioning the visual design into a global hierarchy, a scene hierarchy, and a multi-layered atomization hierarchy of component hierarchies, wherein the component hierarchies include a base component hierarchy and a variant component hierarchy; the multi-layered atomization hierarchy of each hierarchy comprises a set of atomization style attribute tokens;
The token quotation module is used for creating at least one target component in the design end page, and the style attribute of the target component quotes the atomized style attribute token through a token dynamic style quotation mode;
The token analysis module is used for carrying out dependency data link analysis on the atomization style attribute tokens referenced by each target component to obtain a decision data state so that a designer can adjust the reference tokens of the target components according to the decision data state;
And the token updating module is used for responding to the updating of the atomization style attribute token and updating a target component referencing the atomization style attribute token through a token dynamic style updating mode.
CN202410513877.4A 2024-04-26 2024-04-26 A multi-layer atomic visual design method and device based on style reference Pending CN118733012A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410513877.4A CN118733012A (en) 2024-04-26 2024-04-26 A multi-layer atomic visual design method and device based on style reference

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410513877.4A CN118733012A (en) 2024-04-26 2024-04-26 A multi-layer atomic visual design method and device based on style reference

Publications (1)

Publication Number Publication Date
CN118733012A true CN118733012A (en) 2024-10-01

Family

ID=92863024

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410513877.4A Pending CN118733012A (en) 2024-04-26 2024-04-26 A multi-layer atomic visual design method and device based on style reference

Country Status (1)

Country Link
CN (1) CN118733012A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119088393A (en) * 2024-11-01 2024-12-06 太极计算机股份有限公司 A UI component data processing method and system based on design token

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119088393A (en) * 2024-11-01 2024-12-06 太极计算机股份有限公司 A UI component data processing method and system based on design token

Similar Documents

Publication Publication Date Title
US11392393B2 (en) Application runtime configuration using design time artifacts
US9465590B2 (en) Code generation framework for application program interface for model
US8196099B2 (en) Updating application design
JP7373563B2 (en) Systems and methods for creating and processing configurable applications for website building systems
US10248386B2 (en) Generating a software complex using superordinate design input
US9817811B2 (en) Web server system, dictionary system, dictionary call method, screen control display method, and demonstration application generation method
JP2010534870A (en) Consistent method system and computer program for developing software asset based solutions
CN113535177A (en) Form generation method, device and device
US9141403B2 (en) Data-driven schema for describing and executing management tasks in a graphical user interface
US10708365B2 (en) Action flow fragment management
US12265949B2 (en) Dynamically controlling case model structure using case fragments
US20200394055A1 (en) System and method for providing a configurable user interface using a self-describing data system
CN119621034A (en) A business process construction method combining workflow engine and dynamic form
CN105404692A (en) Web page generation method and generation device
CN118860357A (en) A low-code property editor registration method
CN118733012A (en) A multi-layer atomic visual design method and device based on style reference
US20130080879A1 (en) Methods and apparatus providing document elements formatting
CN119203963A (en) Business report generation method, device and electronic equipment
US9405514B1 (en) Process fragment management
CN119025113B (en) Low-code data linkage setting method and system
US20250307482A1 (en) Generative filling of design content
US20250094142A1 (en) Model describing configuration field dependencies to drive user experience
CN120832140A (en) Graphical interface processing method, device, electronic device, computer-readable storage medium, and computer program product
CN119902763A (en) A form design application system and method thereof
Gündoğan Automation of Artwork Processes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination