UI component data processing method and system based on design token

By extracting the features of the UI component library, building the Design Token library and integrating it with design tools, the problems of complexity of UI library development and difficulty in switching dynamic topics are solved, efficient UI component management and consistency are achieved, and maintenance costs are reduced.

CN119088393AInactive Publication Date: 2024-12-06TAIJI COMPUTER CORPORATION LIMITED

Patent Information

Application Number
CN202411547634.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2024-12-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The development process of existing UI libraries is complex. Faced with complex UI design requirements, the data processing consistency is poor in realizing dynamic theme switching and UI component management, and the maintenance cost is high.

Method used

By obtaining the features of the UI component library, extracting semantic component variables, building variable call relationships, forming Design Token library, and integrating it with design tools to achieve real-time data processing and automation synchronization, reducing manual configuration and adjustment workload.

Benefits of technology

It improves design efficiency and consistency, simplifies the UI library development process, realizes data processing consistency of dynamic theme switching and UI component management, reduces maintenance costs, and enhances system scalability and team collaboration efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088393A_ABST
    Figure CN119088393A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, provides a UI component data processing method and system based on a design token, and aims to solve the problems that in the prior art, a UI library development process is complex, dynamic theme switching is difficult, UI component management data processing is poor in consistency, maintenance cost is high and the like. A Design Token library is formed by abstracting design elements and continuously optimized and integrated into a design system and a development process, efficient management and consistent application of design variables are achieved, the development process of the UI library is simplified, the dynamic theme switching capacity is enhanced, UI component management is optimized, team cooperation efficiency is improved, and maintenance cost is reduced. According to the method, the design and development efficiency of the UI component is remarkably improved, and powerful support is provided for rapid construction and customization of a software product or an application interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a UI component data processing method and system based on design tokens. Background Art

[0002] A UI component library is a collection of various user interface elements designed to quickly build and customize the interface of a software product or application. It usually contains a series of pre-designed, reusable UI components, such as buttons, input boxes, navigation bars, etc. Developers can efficiently create beautiful and functional user interfaces by using components and combining and modifying them according to the specific needs of the project. The existence of a UI component library greatly improves development efficiency and ensures consistency of the interface and coherence of the user experience.

[0003] Design Token is an abstract, reusable design element that is used as a design variable in a design system. Design tokens use semantic naming to make design parameters easier to understand and expand, while also enabling visual consistency. Simply put, Design Token is like a "variable" in the field of design. Design tokens represent a series of design attribute values ​​with specific meanings and uses, such as color, font, spacing, etc. The attribute values ​​of design tokens can be uniformly managed and used throughout the design system.

[0004] In the actual use process of UI components based on design tokens, there are the following technical pain points: the existing UI library development process is complicated, and in the face of complex UI design requirements, the data processing consistency in realizing dynamic theme switching and UI component management is poor, and the maintenance cost is high. In order to solve this technical problem, the present invention provides a UI component data processing method and system based on design tokens. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a UI component data processing method and system based on design tokens to solve the problems of complex UI library development process, poor data processing consistency in realizing dynamic theme switching and UI component management, and high maintenance cost in the face of complex UI design requirements.

[0006] In order to solve the above technical problems, the specific technical solutions of the present invention are as follows: In a first aspect, the present invention provides a UI component data processing method based on a design token, comprising: Step S101, obtaining design data and UI component library requirement information, and extracting UI component library features from the design data according to the UI component library requirement information, wherein the UI component library features include rounded corner features, color features, text features, spacing features, and shadow features; Step S102, extracting semantic component variables according to the features of the UI component library, constructing a calling relationship between the variables, and obtaining a calling relationship between components and variables in the UI component library; Step S103, based on the variables extracted in steps S101 and S102, forming a design token library, the design token library including multiple groups of design tokens, the multiple groups of design tokens including color tokens, font tokens, spacing tokens and size tokens, receiving a design token library configuration, and loading the design token library configuration; Step S104, integrating the design token library with the design tool, encapsulating the design token into an object model, establishing a design token variable relationship between the design token library and the design tool according to the calling relationship between the components and variables in the UI component library, and encapsulating the design token variable relationship and the design token into an object model; Step S105: receiving real-time design variables, configuring the real-time design variables in the design token encapsulated into an object model, obtaining the real-time design token encapsulated into an object model, substituting the user operation requirements into the real-time design token encapsulated into the object model, and outputting the design results by encapsulating the real-time design token into the object model.

[0007] Furthermore, the present invention provides the UI component data processing method based on the design token, wherein step S102 comprises: The data processing unit receives the UI component library feature data sent from the front end or the design tool, and the server parses the UI component library feature data to extract information. The server extracts semantic component variables based on the parsed component library feature data. The data processing unit performs semantic definition detection on each variable, and generates variable information to be supplemented with semantic definition for variables without semantic definition; The data processing unit constructs a variable calling relationship based on the logical relationship between component variables; The data processing unit receives a request from a front end or design tool to query component variables and their calling relationships. When the front end or design tool needs to reference or modify component variables, the data processing unit obtains the latest variable information and calling relationships through the server interface.

[0008] Furthermore, the present invention provides the UI component data processing method based on the design token, wherein step S103 comprises: The server collects variable data extracted from steps S101 and S102, where the variable data includes semantic component variables of color, font, spacing, and size; The variable data is sorted, and the server constructs a design token library according to the sorted variable data. The design token library stores multiple groups of design tokens in a structured form. The multiple groups of design tokens include color tokens, font tokens, spacing tokens, and size tokens. The design token library construction unit receives the design token library configuration information from the front end or the configuration management tool, the design token library configuration information includes the version, update frequency and access rights of the token library; The object model generation unit parses the design token library configuration information, converts the design token library configuration information into an internally recognizable format, and stores it in a configuration file. The object model generation unit loads the design token library based on the parsed configuration information. Loading the design token library includes reading the token library data from a database or file system and building a corresponding data structure in memory.

[0009] Furthermore, the present invention provides the UI component data processing method based on the design token, wherein step S104 comprises: Receiving the design token library API interface information, the server matches the data interface for the design tool to access the design token library according to the design token library API interface information, and the API interface is used to provide query, acquisition and update of the design token; The object model generation unit encapsulates the design token into an object model, and the object model includes the attributes and calling relationships of the design token; The object model generation unit monitors the changes in the calling relationship between components and variables in the UI component library, and updates the information in the design token library in real time; When the design token library or UI component library is updated, the model generation unit automatically synchronizes the changes to the design tool. The model generation unit is also used to process user modification requests for design tokens in the design tool and synchronize user modifications to the design tokens back to the design token library.

[0010] Furthermore, the present invention provides the UI component data processing method based on the design token, wherein step S105 comprises: The server receives real-time design variables from the front end or design tool through an API interface. The real-time design variables include color codes, font sizes, and spacing values. The server configures the received real-time design variables in the object model encapsulated by the design token to update the corresponding attribute values ​​and call relationships in the object model; The server analyzes user operation requirements, which include modifying design elements, applying new themes, or adjusting layouts; The server processes the object model encapsulated by the real-time design token according to the user's operation requirements; The server converts the object model encapsulated by the processed real-time design token into a design result, and returns it to the front end or design tool through the API interface; The design results include updated design artwork, CSS code, and JSON configuration data.

[0011] In a second aspect, the present invention provides a UI component data processing system based on a design token, applying the UI component data processing method based on a design token, including: A data acquisition unit, which acquires design data and UI component library requirement information, and extracts UI component library features from the design data according to the UI component library requirement information. The UI component library features include rounded corner features, color features, text features, spacing features, and shadow features. The data processing unit extracts semantic component variables according to the characteristics of the UI component library, constructs the calling relationship between the variables, and obtains the calling relationship between the components and variables in the UI component library; A design token library construction unit, based on the variables extracted in steps S101 and S102, forms a design token library, the design token library includes multiple groups of design tokens, the multiple groups of design tokens include color tokens, font tokens, spacing tokens and size tokens, receives a design token library configuration, and the design token library loads the design token library configuration; The object model generation unit integrates the design token library with the design tool, encapsulates the design token into an object model, establishes a design token variable relationship between the design token library and the design tool according to the calling relationship between the components and variables in the UI component library, and encapsulates the design token variable relationship and the design token into an object model; Result output unit: receiving real-time design variables, configuring the real-time design variables in the design token encapsulated into an object model, obtaining the real-time design token encapsulated into an object model, substituting user operation requirements into the real-time design token encapsulated into the object model, and outputting the design results by encapsulating the real-time design token into the object model.

[0012] Furthermore, the present invention provides the UI component data processing system based on the design token, wherein the data processing unit is further used for: The data processing unit receives the UI component library feature data sent from the front end or the design tool, and the server parses the UI component library feature data to extract information. The server extracts semantic component variables based on the parsed component library feature data. The data processing unit performs semantic definition detection on each variable, and generates variable information to be supplemented with semantic definition for variables without semantic definition; The data processing unit constructs a variable calling relationship based on the logical relationship between component variables; The data processing unit receives a request from a front end or design tool to query component variables and their calling relationships. When the front end or design tool needs to reference or modify component variables, the data processing unit obtains the latest variable information and calling relationships through the server interface.

[0013] Furthermore, the present invention provides the UI component data processing system based on the design token, wherein the design token library construction unit is further used for: The design token library construction unit collects variable data extracted from the data acquisition unit and the data processing unit, and the variable data includes semantic component variables of color, font, spacing, and size; The variable data is sorted, and the server constructs a design token library according to the sorted variable data. The design token library stores multiple groups of design tokens in a structured form. The multiple groups of design tokens include color tokens, font tokens, spacing tokens, and size tokens. The design token library construction unit receives the design token library configuration information from the front end or the configuration management tool, the design token library configuration information includes the version, update frequency and access rights of the token library; The object model generation unit parses the design token library configuration information, converts the design token library configuration information into an internally recognizable format, and stores it in a configuration file. The object model generation unit loads the design token library based on the parsed configuration information. Loading the design token library includes reading the token library data from a database or file system and building a corresponding data structure in memory.

[0014] Furthermore, the present invention provides the UI component data processing system based on the design token, wherein the object model generation unit is further used for: Receiving the design token library API interface information, the server matches the data interface for the design tool to access the design token library according to the design token library API interface information, and the API interface is used to provide query, acquisition and update of the design token; The object model generation unit encapsulates the design token into an object model, and the object model includes the attributes and calling relationships of the design token; The object model generation unit monitors the changes in the calling relationship between components and variables in the UI component library, and updates the information in the design token library in real time; When the design token library or UI component library is updated, the model generation unit automatically synchronizes the changes to the design tool. The model generation unit is also used to process user modification requests for design tokens in the design tool and synchronize user modifications to the design tokens back to the design token library.

[0015] Furthermore, the present invention provides the UI component data processing system based on the design token, wherein the result output unit is further used for: The result output unit receives real-time design variables from the front end or design tool through an API interface. The real-time design variables include color codes, font sizes, and spacing values. The result output unit configures the received real-time design variables in the object model encapsulated by the design token to update the corresponding attribute values ​​and call relationships in the object model; The result output unit analyzes user operation requirements, which include modifying design elements, applying new themes, or adjusting layouts; The result output unit processes the object model encapsulated by the real-time design token according to the user's operation requirements; The result output unit converts the object model encapsulated by the processed real-time design token into a design result, and returns it to the front end or design tool through the API interface; The design results include updated design artwork, CSS code, and JSON configuration data.

[0016] Beneficial effects of the present invention: The present invention abstracts the design elements and forms a Design Token library, so that designers can more conveniently reference and manage design variables, thereby improving design efficiency. The use of the Design Token library improves the consistency of design parameters, so that different designers or design work at different stages can maintain a consistent interface style.

[0017] The present invention simplifies the development process of the UI library through a series of automated data processing processes, reduces the workload of manual configuration and adjustment, and makes the integration of design variables and components smoother, thereby improving the automation level of the entire development process.

[0018] The dynamic theme switching function is also implemented by publishing design variables as packages or modules that can be called by front-end developers and referencing variables during the development process of the UI component library. This enables the application interface to automatically adjust the theme according to user preferences or environmental changes, improving the user experience.

[0019] The present invention provides a complete UI component management solution, including variable extraction, call relationship construction, DesignToken library maintenance, etc. The data processing consistency of UI component management is improved and the maintenance cost is reduced.

[0020] The Design Token library can be shared and maintained within the team, improving the consistency and accuracy of design variables. Team members can work together more conveniently, reducing communication and rework costs caused by inconsistent design variables. By encapsulating design tokens as object models and clarifying the dependencies between variables, the present invention enhances the scalability of the system. When new design variables or components need to be added, they only need to be updated in the Design Token library without large-scale modifications to the entire system.

[0021] In summary, the present invention significantly improves the design efficiency, consistency, dynamic theme switching capability, management efficiency and team collaboration efficiency of UI components through a series of innovative technical means, while reducing maintenance costs, bringing significant beneficial effects to the development of software products or application interfaces. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solution of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, for ordinary technicians in this field, other drawings can be obtained based on the drawings without paying any creative labor.

[0023] Figure 1 A schematic diagram of a UI component data processing method based on a design token provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. The technical solutions provided by the embodiments of the present invention are described in detail below in conjunction with the drawings.

[0025] In order to better understand the purpose of the present invention, the present invention is described in further detail below.

[0026] In a first aspect, the present invention provides a UI component data processing method based on a design token, comprising: Step S101, obtaining design data and UI component library requirement information, and extracting UI component library features from the design data according to the UI component library requirement information, wherein the UI component library features include rounded corner features, color features, text features, spacing features, and shadow features; Obtaining design data: It is necessary to obtain relevant design data, which includes various attributes and information of design elements.

[0027] Obtain UI component library requirement information: Collect specific requirement information of the UI component library. The requirement information clarifies the specific requirements and specifications that need to be met when building the UI component library.

[0028] Extract UI component library features: Based on the collected UI component library requirement information, extract the features of the UI component library from the design data. The features include: Corner rounding feature: the degree of roundness of the corners of UI components.

[0029] Color characteristics: the colors used by the component and how they are combined.

[0030] Text features: font, size, style and other attributes of text.

[0031] Spacing feature: The space distance between elements within a component or between components.

[0032] Shadow feature: The shadow effect of the component is used to enhance the visual layering and three-dimensional effect.

[0033] The feature extraction work provides basic data support for the subsequent construction of UI component library and design token library, improving the consistency and maintainability of UI components.

[0034] Step S102, extracting semantic component variables according to the features of the UI component library, constructing a calling relationship between the variables, and obtaining a calling relationship between components and variables in the UI component library; Step S102 is a step in a UI component data processing method based on a design token proposed by the present invention, which specifically involves extracting semantic component variables from UI component library features and building a calling relationship between variables. The following is a detailed explanation of this step: In step S102, firstly, semantic component variables need to be extracted based on UI component library features (such as rounded corner features, color features, text features, spacing features, and shadow features) extracted from the design data. Semantic component variables refer to design parameters with clear meanings and uses, and the parameters are represented by naming methods that are easy to understand and expand.

[0035] Build calling relationships between variables. After extracting semantic component variables, you need to build calling relationships between variables. Calling relationships refer to how variables reference and depend on each other, which helps improve the consistency and maintainability of the design.

[0036] Obtaining the calling relationship between components and variables in the UI component library Through the above steps, the calling relationship between components and variables in the UI component library can be finally obtained. This calling relationship is crucial for the subsequent design token library construction, design tool integration, and real-time design variable processing.

[0037] In summary, step S102 is an important part of the method proposed in the present invention, which improves the ability of design elements to be abstracted and form meaningful variables. At the same time, the calling relationship between variables is also clearly constructed, providing a solid foundation for subsequent design work.

[0038] Step S103, based on the variables extracted in steps S101 and S102, forming a design token library, the design token library including multiple groups of design tokens, the multiple groups of design tokens including color tokens, font tokens, spacing tokens and size tokens, receiving a design token library configuration, and loading the design token library configuration; In step S103, based on the variables extracted in steps S101 and S102, a design token library is formed, and the design token library is configured and loaded. The following are the detailed steps: A design token library is formed, and a design token library is constructed according to the variables extracted in steps S101 and S102 (such as semantic component variables such as color, font, spacing, size, etc.). The design token library stores multiple groups of design tokens in a structured form, including color tokens, font tokens, spacing tokens, and size tokens.

[0039] Receiving the design token library configuration, the design token library construction unit receives the design token library configuration information from the front end or the configuration management tool. The configuration information includes the version, update frequency, and access rights of the token library.

[0040] Loading the design token library configuration, the object model generation unit parses the design token library configuration information, converts it into an internally recognizable format, and stores it in the configuration file. According to the parsed configuration information, the design token library is loaded. The loading process includes reading the token library data from the database or file system and building the corresponding data structure in the memory.

[0041] Through this series of steps, the design token library is established and configured, providing a basis for the subsequent use and management of design tokens.

[0042] Step S104, integrating the design token library with the design tool, encapsulating the design token into an object model, establishing a design token variable relationship between the design token library and the design tool according to the calling relationship between the components and variables in the UI component library, and encapsulating the design token variable relationship and the design token into an object model; In step S104, the design token library is first integrated with the design tool. The purpose of this integration is to allow designers to easily reference and manage design tokens in the design tool, thereby improving the efficiency of design work. After integration, the design tool will be able to directly access the data in the design token library and support designers to call and modify design tokens in real time during the design process.

[0043] Encapsulate the design token into an object model. An object model is a data structure that contains the properties of the design token and its calling relationships. By encapsulating it into an object model, the design token can be better managed and used in the design tool, while improving the consistency and maintainability of the design token.

[0044] In the process of encapsulating design tokens, it is also necessary to establish design token variable relationships for the design token library and design tools based on the calling relationship between components and variables in the UI component library. The purpose of this step is to improve the correct use of design tokens in the UI component library and maintain the consistency of the design. By establishing design token variable relationships, the automatic update and synchronization of design tokens in the UI component library can be achieved, thereby improving the efficiency of design work.

[0045] To summarize, step S104 integrates the design token library and design tools, encapsulates the design token into an object model, and establishes the design token variable relationship based on the calling relationship between components and variables in the UI component library, thereby achieving efficient management and use of design tokens and improving the efficiency and consistency of design work.

[0046] Step S105: receiving real-time design variables, configuring the real-time design variables in the design token encapsulated into an object model, obtaining the real-time design token encapsulated into an object model, substituting the user operation requirements into the real-time design token encapsulated into the object model, and outputting the design results by encapsulating the real-time design token into the object model.

[0047] Step S105 describes in detail a step in a UI component data processing method based on a design token. The following is a detailed explanation of this step: Receive real-time design variables. Real-time design variables are instant design information received from the front end or design tools. The information includes color codes, font sizes, spacing values, etc., which are used to update the design of UI components in real time.

[0048] Configure the real-time design variables and configure the received real-time design variables in the object model encapsulated by the design token. This step is to integrate the new design variables into the existing design token library to update the corresponding attribute values ​​and call relationships in the object model.

[0049] Substitute user operation requirements, and substitute the user's specific operation requirements (such as modifying design elements, applying new themes, or adjusting layouts) into the object model that has been configured with real-time design variables. This step is to ensure that user operations can be correctly reflected in the design results.

[0050] Output design results. After the above steps, the object model encapsulated by the real-time design token will output the design results. The design results include updated design drawings, CSS code, and JSON configuration data, etc., for use by the front-end or design tools.

[0051] This step achieves dynamic update and real-time feedback of UI component design by receiving and processing design variables in real time and substituting user operation requirements, thereby improving the flexibility and efficiency of the design.

[0052] Specifically, the present invention provides the UI component data processing method based on the design token, wherein step S102 comprises: The data processing unit receives the UI component library feature data sent from the front end or the design tool, and the server parses the UI component library feature data to extract information. The server extracts semantic component variables based on the parsed component library feature data. The data processing unit performs semantic definition detection on each variable, and generates variable information to be supplemented with semantic definition for variables without semantic definition; The data processing unit constructs a variable calling relationship based on the logical relationship between component variables; The data processing unit receives a request from a front end or design tool to query component variables and their calling relationships. When the front end or design tool needs to reference or modify component variables, the data processing unit obtains the latest variable information and calling relationships through the server interface.

[0053] The specific implementation of step S102 is as follows: Receiving UI component library feature data: The data processing unit receives UI component library feature data sent from the front end or design tool. The data includes various design features of the UI component library, such as rounded corners, colors, text, spacing, and shadows.

[0054] Parse the UI component library feature data. The server parses the received UI component library feature data and extracts the information. The information provides the basis for the subsequent extraction of semantic component variables.

[0055] Extract semantic component variables. Based on the parsed component library feature data, the server extracts semantic component variables. Variables are represented by easy-to-understand and expandable naming methods with clear meanings and uses, such as color, font, spacing, etc.

[0056] The data processing unit performs semantic definition detection on each extracted variable. For variables without semantic definition, the system generates variable information to be supplemented with semantic definition to ensure that all variables have clear meanings.

[0057] Construct variable call relationships. The data processing unit constructs variable call relationships based on the logical relationships between component variables. The call relationship represents how variables reference and depend on each other, which helps improve the consistency and maintainability of the design.

[0058] Processing requests from the front end or design tool, the data processing unit receives requests from the front end or design tool to query component variables and their calling relationships. When the front end or design tool needs to reference or modify component variables, it can obtain the latest variable information and calling relationships through the server interface, improving data synchronization and consistency between the design tool and the server.

[0059] In summary, step S102 provides a solid foundation for subsequent UI component library design and development by receiving and parsing UI component library feature data, extracting semantic component variables, building variable call relationships, and processing requests from the front end or design tools.

[0060] Specifically, the present invention provides the UI component data processing method based on the design token, wherein step S103 comprises: The server collects variable data extracted from steps S101 and S102, where the variable data includes semantic component variables of color, font, spacing, and size; The variable data is sorted, and the server constructs a design token library according to the sorted variable data. The design token library stores multiple groups of design tokens in a structured form. The multiple groups of design tokens include color tokens, font tokens, spacing tokens, and size tokens. The design token library construction unit receives the design token library configuration information from the front end or the configuration management tool, the design token library configuration information includes the version, update frequency and access rights of the token library; The object model generation unit parses the design token library configuration information, converts the design token library configuration information into an internally recognizable format, and stores it in a configuration file. The object model generation unit loads the design token library based on the parsed configuration information. Loading the design token library includes reading the token library data from a database or file system and building a corresponding data structure in memory.

[0061] The specific content of step S103 is as follows: Collect variable data: The server collects the variable data extracted from steps S101 and S102. The variable data includes semantic component variables such as color, font, spacing, size, etc.

[0062] The server organizes the collected variable data. The organization process includes operations such as deduplication, formatting, and classification to improve the accuracy and consistency of the variable data.

[0063] Constructing a design token library: Based on the sorted variable data, the server constructs a design token library. The design token library stores multiple groups of design tokens in a structured form, and the design tokens include color tokens, font tokens, spacing tokens, and size tokens.

[0064] The design token library configuration information is received. The design token library construction unit receives the design token library configuration information from the front end or the configuration management tool. The configuration information includes the version, update frequency, and access rights of the token library.

[0065] Parsing the design token library configuration information, the object model generation unit parses the design token library configuration information, converts it into an internally recognizable format, and stores it in the configuration file. This step improves the correctness and usability of the design token library configuration information.

[0066] Load the design token library. According to the parsed configuration information, the object model generation unit loads the design token library. The loading process includes reading the token library data from the database or file system and building the corresponding data structure in the memory. In this way, the design token library can be referenced and used in the design tool in real time.

[0067] Specifically, the present invention provides the UI component data processing method based on the design token, wherein step S104 comprises: Receiving the design token library API interface information, the server matches the data interface for the design tool to access the design token library according to the design token library API interface information, and the API interface is used to provide query, acquisition and update of the design token; The object model generation unit encapsulates the design token into an object model, and the object model includes the attributes and calling relationships of the design token; The object model generation unit monitors the changes in the calling relationship between components and variables in the UI component library, and updates the information in the design token library in real time; When the design token library or UI component library is updated, the model generation unit automatically synchronizes the changes to the design tool. The model generation unit is also used to process user modification requests for design tokens in the design tool and synchronize user modifications to the design tokens back to the design token library.

[0068] Receive the design token library API interface information. The server receives the API interface information of the design token library. The API interface is used to provide the functions of querying, obtaining and updating the design token.

[0069] The server performs data interface matching. The server matches the data interface of the design tool accessing the design token library based on the received design token library API interface information, thereby improving the design tool's ability to correctly access and operate the design token library.

[0070] The object model generation unit encapsulates the design token and encapsulates the design token into an object model. The object model includes the properties of the design token and its calling relationship, so that the design token can be more conveniently referenced and managed in the design tool.

[0071] The object model generation unit monitors the changes in the calling relationship between components and variables in the UI component library. This helps to improve the consistency of the design and respond to changes in the design in a timely manner.

[0072] Update the information in the design token library in real time. When the calling relationship between components and variables in the UI component library is monitored to change, the object model generation unit will update the information in the design token library in real time to maintain the consistency between the design token library and the UI component library.

[0073] Processing modification requests for design tokens from users in the design tool, when users in the design tool modify the design token, the object model generation unit receives the modification request and synchronizes the modification back to the design token library. This ensures that the information in the design token library is always up to date and reflects the user's latest design requirements.

[0074] To summarize, step S104 realizes the effective integration and efficient management of the design token library and design tools by receiving the design token library API interface information, performing data interface matching, encapsulating the design token into an object model, monitoring the changes in the calling relationship, updating the design token library information in real time, and processing user modification requests.

[0075] Specifically, the present invention provides the UI component data processing method based on the design token, wherein step S105 comprises: The server receives real-time design variables from the front end or design tool through an API interface. The real-time design variables include color codes, font sizes, and spacing values. The server configures the received real-time design variables in the object model encapsulated by the design token to update the corresponding attribute values ​​and call relationships in the object model; The server analyzes user operation requirements, which include modifying design elements, applying new themes, or adjusting layouts; The server processes the object model encapsulated by the real-time design token according to the user's operation requirements; The server converts the object model encapsulated by the processed real-time design token into a design result, and returns it to the front end or design tool through the API interface; The design results include updated design artwork, CSS code, and JSON configuration data.

[0076] The server receives real-time design variables from the front end or design tool through the API interface. The real-time design variables include color codes, font sizes, and spacing values, etc., which are used to dynamically update the design of UI components.

[0077] The server configures the received real-time design variables in the object model encapsulated by the design token. The purpose of this step is to update the corresponding attribute values ​​and call relationships in the object model to reflect the latest design changes.

[0078] Parse user operation requirements. The server parses user operation requirements. Requirements include modifying design elements, applying new themes, or adjusting layouts. Parsing user operation requirements is to improve the server's ability to correctly process requirements and generate corresponding design results.

[0079] Processing the object model encapsulated by the real-time design token: According to the parsed user operation requirements, the server processes the object model encapsulated by the real-time design token. This processing involves adjusting the attributes, call relationships and object model structure of the design token.

[0080] The processed object model is converted into a design result and returned. The server converts the object model encapsulated by the processed real-time design token into a design result. The design result includes the updated design artwork, CSS code, and JSON configuration data. The server returns the design result to the front end or design tool through the API interface for users to view and use.

[0081] Through this series of steps, step S105 realizes dynamic update and real-time feedback of UI component design, thereby improving the flexibility and efficiency of design.

[0082] In a second aspect, the present invention provides a UI component data processing system based on a design token, applying the UI component data processing method based on a design token, including: A data acquisition unit, which acquires design data and UI component library requirement information, and extracts UI component library features from the design data according to the UI component library requirement information. The UI component library features include rounded corner features, color features, text features, spacing features, and shadow features. The data processing unit extracts semantic component variables according to the characteristics of the UI component library, constructs the calling relationship between the variables, and obtains the calling relationship between the components and variables in the UI component library; A design token library construction unit, based on the variables extracted in steps S101 and S102, forms a design token library, the design token library includes multiple groups of design tokens, the multiple groups of design tokens include color tokens, font tokens, spacing tokens and size tokens, receives a design token library configuration, and the design token library loads the design token library configuration; The object model generation unit integrates the design token library with the design tool, encapsulates the design token into an object model, establishes a design token variable relationship between the design token library and the design tool according to the calling relationship between the components and variables in the UI component library, and encapsulates the design token variable relationship and the design token into an object model; Result output unit: receiving real-time design variables, configuring the real-time design variables in the design token encapsulated into an object model, obtaining the real-time design token encapsulated into an object model, substituting user operation requirements into the real-time design token encapsulated into the object model, and outputting the design results by encapsulating the real-time design token into the object model.

[0083] Specifically, the present invention provides the UI component data processing system based on the design token, wherein the data processing unit is further used for: The data processing unit receives the UI component library feature data sent from the front end or the design tool, and the server parses the UI component library feature data to extract information. The server extracts semantic component variables based on the parsed component library feature data. The data processing unit performs semantic definition detection on each variable, and generates variable information to be supplemented with semantic definition for variables without semantic definition; The data processing unit constructs a variable calling relationship based on the logical relationship between component variables; The data processing unit receives a request from a front end or design tool to query component variables and their calling relationships. When the front end or design tool needs to reference or modify component variables, the data processing unit obtains the latest variable information and calling relationships through the server interface.

[0084] Specifically, the present invention provides the UI component data processing system based on the design token, wherein the design token library construction unit is further used for: The design token library construction unit collects variable data extracted from the data acquisition unit and the data processing unit, and the variable data includes semantic component variables of color, font, spacing, and size; The variable data is sorted, and the server constructs a design token library according to the sorted variable data. The design token library stores multiple groups of design tokens in a structured form. The multiple groups of design tokens include color tokens, font tokens, spacing tokens, and size tokens. The design token library construction unit receives the design token library configuration information from the front end or the configuration management tool, the design token library configuration information includes the version, update frequency and access rights of the token library; The object model generation unit parses the design token library configuration information, converts the design token library configuration information into an internally recognizable format, and stores it in a configuration file. The object model generation unit loads the design token library based on the parsed configuration information. Loading the design token library includes reading the token library data from a database or file system and building a corresponding data structure in memory.

[0085] Specifically, the present invention provides the UI component data processing system based on the design token, wherein the object model generation unit is further used for: Receiving the design token library API interface information, the server matches the data interface for the design tool to access the design token library according to the design token library API interface information, and the API interface is used to provide query, acquisition and update of the design token; The object model generation unit encapsulates the design token into an object model, and the object model includes the attributes and calling relationships of the design token; The object model generation unit monitors the changes in the calling relationship between components and variables in the UI component library, and updates the information in the design token library in real time; When the design token library or UI component library is updated, the model generation unit automatically synchronizes the changes to the design tool. The model generation unit is also used to process user modification requests for design tokens in the design tool and synchronize user modifications to the design tokens back to the design token library.

[0086] Specifically, the present invention provides the UI component data processing system based on the design token, wherein the result output unit is further used for: The result output unit receives real-time design variables from the front end or design tool through an API interface. The real-time design variables include color codes, font sizes, and spacing values. The result output unit configures the received real-time design variables in the object model encapsulated by the design token to update the corresponding attribute values ​​and call relationships in the object model; The result output unit analyzes user operation requirements, which include modifying design elements, applying new themes, or adjusting layouts; The result output unit processes the object model encapsulated by the real-time design token according to the user's operation requirements; The result output unit converts the object model encapsulated by the processed real-time design token into a design result, and returns it to the front end or design tool through the API interface; The design results include updated design artwork, CSS code, and JSON configuration data.

[0087] The specific embodiments of the present invention are as follows: The present invention helps developers build consistent and beautiful application interfaces through a customizable component library system based on design tokens, while maintaining a high degree of flexibility to adapt to the design requirements of different software products or applications.

[0088] Abstract the features and elements of the UI component library from the design draft, extract the core elements from the major aspects of "shape, color, font, structure, and quality" to form basic variables. Shape refers to the shape and appearance, such as rounded corners. Color refers to the color, including basic color palette, functional color, brand color, etc. Font refers to the font, size, etc. Structure refers to the structure, such as spacing, etc. Quality refers to the texture, such as shadows, animations, etc.

[0089] Extract component variables based on the characteristics of the component. Based on the characteristics of the component, abstract and extract more semantic component variables. Component variables can reference basic variables and build calling relationships between variables.

[0090] Form the Design Token library and usage specifications. Through the previous step, form the Design Token library and form clear usage specifications. Establish the Design Token library. The global design token of the esign Token library mainly includes the following aspects: Color characteristics (Color): defines the color scheme of the entire application, including primary color, secondary color, warning color, background color, text color, etc. Color variables are the smallest part of UI design because they affect the user's visual experience and brand recognition.

[0091] Typography: including font family, weight, size, line height, etc. Variables improve the readability and consistency of text content on different devices and screens.

[0092] Spacing: defines the amount of space between elements in a layout, such as padding, margin, etc. Spacing systems help create a sense of visual hierarchy and organization.

[0093] Component Size: covers the basic sizes of UI components, such as button height, input box width, etc., to maintain the consistency and coordination of interface elements.

[0094] Borders: Including border width, style, and color. Variables are used to define the outline and border of components.

[0095] Shadow features: Defines the shadow effects of UI components, which are used to express the hierarchical relationship and three-dimensional sense of components.

[0096] Hierarchy feature (Z-Index): Manage the stacking order of different UI components to make visually correct overlapping and hierarchical relationships.

[0097] Icons: Define the size, color, and style of icons to improve the consistency and recognizability of icons in the interface.

[0098] Interaction States: Describes the visual feedback of a component in different interaction states, such as hover, focus, press, etc.

[0099] Animations: Including animation timing, speed curve, delay, etc., variables provide a dynamic interactive experience for the UI.

[0100] Grid System: defines the number of columns, gutter size, and margins for a layout, and is used for responsive design.

[0101] Breakpoints: Breakpoints defined for different screen sizes, used for media queries to achieve responsive design.

[0102] Themes: Includes light and dark themes, as well as other custom theme variables.

[0103] Shapes: Defines the shapes used in the UI, such as buttons, rounded corners of cards, etc.

[0104] Continuously iterate, update and maintain the Design Token library; Establish an update and maintenance mechanism and jointly maintain this set of design variables within the team.

[0105] Use design tokens in your design system; The Design Token library and specifications established require designers to follow the specifications and use design tokens during the design process. The Design Token library can be integrated with different design tools such as Figma and Sketch through plug-ins, allowing designers to easily reference the Design Token library.

[0106] Release design variants; Encapsulate the design tokens into an object model to reflect the dependencies between variables.

[0107] Publish design variables into packages or modules that can be called by front-end development.

[0108] Use design variables in the development of UI component libraries; In the development process of the UI component library, variables are used and referenced in the JS and CSS files of each UI component to achieve dynamic theme switching, personalized configuration and other functions. The UI framework (JUI for short) is a UI framework based on Svelte + TailwindCSS, which includes more than 60 commonly used UI components. The component design of JUI is based on the design concept of Design Token, extracts the design elements of commonly used UI components, and forms a design variable library. Through the definition of design variables, theme variables are formed, so that the UI of the component library has good consistency, coherence and maintainability.

[0109] The present invention uses innovative technical means to effectively solve the problems encountered in the actual use of existing UI components based on design tokens, such as complex UI library development process, difficulty in dynamic theme switching, poor consistency in UI component management data processing, and high maintenance costs. The specific solutions are as follows: Abstract design elements and form a Design Token library, abstract the features and elements of the UI component library from the design draft, extract the core elements from the five aspects of "shape, color, font, structure, and quality" to form basic variables. Basic variables include shape, color, font, structure, and texture.

[0110] According to the characteristics of the components, more semantic component variables are extracted. Variables can reference basic variables and build calling relationships between variables. Through the above steps, a Design Token library is formed, and the usage specifications are clarified to improve the consistency and maintainability of design parameters.

[0111] Continuously update and maintain the Design Token library, establish an update and maintenance mechanism, so that the Design Token library can adapt to the ever-changing design needs. Maintain this set of design variables together within the team to improve the accuracy and consistency of the variables.

[0112] Use design tokens in the design system. Designers follow the specifications during the design process and use the design tokens in the DesignToken library. The Design Token library is integrated with different design tools (such as Figma, Sketch, etc.) through plug-ins, making it convenient for designers to reference.

[0113] Publish design variables and integrate them into the development process, encapsulate design tokens into object models, and reflect the dependencies between variables. Publish design variables into packages or modules that can be called by front-end development to improve data consistency during the development process. In the development process of the UI component library, reference design variables to implement dynamic theme switching, personalized configuration and other functions.

[0114] Optimize the data processing flow, receive, parse and process the UI component library feature data through the server, extract semantic component variables, and build variable call relationships. The server monitors the changes in the call relationship between components and variables in the UI component library in real time, and automatically synchronizes the changes to the design tools and development environment. When the design token library or UI component library is updated, the server is responsible for processing the update to ensure that the data in the design tool and development environment are always consistent.

[0115] In real-time response to design needs, the server receives real-time design variables from the front end or design tools through the API interface and configures them in the object model encapsulated by the design token. According to user operation requirements (such as modifying design elements, applying new themes, or adjusting layouts), the server processes the object model encapsulated by the real-time design token and outputs the updated design results.

[0116] Through the above technical scheme, the present invention simplifies the development process of the UI library, improves the flexibility of dynamic theme switching and the data processing consistency of UI component management, while reducing maintenance costs, allowing developers to more efficiently build a consistent and beautiful application interface to meet the design requirements of different software products or applications.

[0117] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if the modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include the modifications and variations, and the above-described embodiments of the present invention do not constitute a limitation on the scope of protection of the present invention.

Claims

1. A UI component data processing method based on design tokens, characterized in that: include: Step S101, obtaining design data and UI component library requirement information, and extracting UI component library features from the design data according to the UI component library requirement information, wherein the UI component library features include rounded corner features, color features, text features, spacing features, and shadow features; Step S102, extracting semantic component variables according to the features of the UI component library, constructing a calling relationship between the variables, and obtaining a calling relationship between components and variables in the UI component library; Step S103, based on the variables extracted in steps S101 and S102, forming a design token library, the design token library including multiple groups of design tokens, the multiple groups of design tokens including color tokens, font tokens, spacing tokens and size tokens, receiving a design token library configuration, and loading the design token library configuration; Step S104, integrating the design token library with the design tool, encapsulating the design token into an object model, establishing a design token variable relationship between the design token library and the design tool according to the calling relationship between the components and variables in the UI component library, and encapsulating the design token variable relationship and the design token into an object model; Step S105, receiving real-time design variables, configuring the real-time design variables in the design token encapsulated into an object model, obtaining the real-time design token encapsulated into an object model, substituting the user operation requirements into the real-time design token encapsulated into the object model, and outputting the design results by encapsulating the real-time design token into the object model.

2. The UI component data processing method based on design tokens according to claim 1, characterized in that: The step S102 includes: The server receives the UI component library feature data sent from the front end or design tool, parses the UI component library feature data to extract information, and extracts semantic component variables based on the parsed component library feature data; Perform semantic definition detection on each variable, and generate variable information to be supplemented with semantic definition for variables without semantic definition; Construct variable calling relationships based on the logical relationships between component variables; Receive requests from the front end or design tool to query component variables and their calling relationships. When the front end or design tool needs to reference or modify component variables, the latest variable information and calling relationships are obtained through the server interface.

3. The UI component data processing method based on design tokens according to claim 1, characterized in that: The step S103 includes: Collect variable data extracted from steps S101 and S102, where the variable data includes semantic component variables of color, font, spacing, and size; The variable data is sorted, and the server constructs a design token library according to the sorted variable data. The design token library stores multiple groups of design tokens in a structured form. The multiple groups of design tokens include color tokens, font tokens, spacing tokens, and size tokens. Receiving design token library configuration information from a front end or a configuration management tool, the design token library configuration information including a version, update frequency, and access rights of the token library; Parse the design token library configuration information, convert the design token library configuration information into an internally recognizable format, and store it in a configuration file; load the design token library according to the parsed configuration information; loading the design token library includes reading the token library data from a database or file system and building a corresponding data structure in memory.

4. The UI component data processing method based on design tokens according to claim 1, characterized in that: The step S104 includes: Receiving the design token library API interface information, the server matches the data interface for the design tool to access the design token library according to the design token library API interface information, and the API interface is used to provide query, acquisition and update of the design token; Encapsulate the design token into an object model, which includes the properties and calling relationships of the design token; Monitor the changes in the calling relationship between components and variables in the UI component library, and update the information in the design token library in real time; When the design token library or UI component library is updated, the changes are automatically synchronized to the design tool. The model generation unit is also used to process user modification requests for design tokens in the design tool and synchronize user modifications to the design tokens back to the design token library.

5. The UI component data processing method based on design tokens according to claim 1, characterized in that: The step S105 includes: Receive real-time design variables from the front end or design tools through the API interface. Real-time design variables include color codes, font sizes, and spacing values; The received real-time design variables are configured in the object model encapsulated by the design token to update the corresponding attribute values ​​and call relationships in the object model; Analyze user operation requirements, which include modifying design elements, applying new themes, or adjusting layouts; According to user operation requirements, the object model encapsulated by the real-time design token is processed; Convert the object model encapsulated by the processed real-time design token into a design result and return it to the front end or design tool through the API interface; The design results include updated design artwork, CSS code, and JSON configuration data.

6. A UI component data processing system based on a design token, applying the UI component data processing method based on a design token as claimed in any one of claims 1 to 5, characterized in that: include: A data acquisition unit is used to acquire design data and UI component library requirement information, and extract UI component library features from the design data according to the UI component library requirement information. The UI component library features include rounded corner features, color features, text features, spacing features, and shadow features. The data processing unit is used to extract semantic component variables according to the characteristics of the UI component library, build the calling relationship between the variables, and obtain the calling relationship between the components and variables in the UI component library; A design token library construction unit is used to form a design token library based on the variables extracted in steps S101 and S102, the design token library includes multiple groups of design tokens, the multiple groups of design tokens include color tokens, font tokens, spacing tokens and size tokens, receive a design token library configuration, and the design token library loads the design token library configuration; An object model generation unit is used to integrate the design token library with the design tool, encapsulate the design token into an object model, establish a design token variable relationship between the design token library and the design tool according to the calling relationship between the components and variables in the UI component library, and encapsulate the design token variable relationship and the design token into an object model; The result output unit is used to receive real-time design variables, configure the real-time design variables in the design token encapsulated into an object model, obtain the real-time design token encapsulated into an object model, substitute the user operation requirements into the real-time design token encapsulated into the object model, and output the design results by encapsulating the real-time design token into the object model.

7. The UI component data processing system based on design tokens as claimed in claim 6, characterized in that: The data processing unit is further used for: The data processing unit receives the UI component library feature data sent from the front end or the design tool, and the server parses the UI component library feature data to extract information. The server extracts semantic component variables based on the parsed component library feature data. The data processing unit performs semantic definition detection on each variable, and generates variable information to be supplemented with semantic definition for variables without semantic definition; The data processing unit constructs a variable calling relationship based on the logical relationship between component variables; The data processing unit receives a request from a front end or design tool to query component variables and their calling relationships. When the front end or design tool needs to reference or modify component variables, the data processing unit obtains the latest variable information and calling relationships through the server interface.

8. The UI component data processing system based on design tokens as claimed in claim 6, characterized in that: The design token library building unit is also used to: The design token library construction unit collects variable data extracted from the data acquisition unit and the data processing unit, and the variable data includes semantic component variables of color, font, spacing, and size; The variable data is sorted, and the server constructs a design token library according to the sorted variable data. The design token library stores multiple groups of design tokens in a structured form. The multiple groups of design tokens include color tokens, font tokens, spacing tokens, and size tokens. The design token library construction unit receives the design token library configuration information from the front end or the configuration management tool, the design token library configuration information includes the version, update frequency and access rights of the token library; The object model generation unit parses the design token library configuration information, converts the design token library configuration information into an internally recognizable format, and stores it in a configuration file. The object model generation unit loads the design token library based on the parsed configuration information. Loading the design token library includes reading the token library data from a database or file system and building a corresponding data structure in memory.

9. The UI component data processing system based on design tokens as claimed in claim 6, characterized in that: The object model generating unit is further used for: Receiving the design token library API interface information, the server matches the data interface for the design tool to access the design token library according to the design token library API interface information, and the API interface is used to provide query, acquisition and update of the design token; The object model generation unit encapsulates the design token into an object model, and the object model includes the attributes and calling relationships of the design token; The object model generation unit monitors the changes in the calling relationship between components and variables in the UI component library, and updates the information in the design token library in real time; When the design token library or UI component library is updated, the model generation unit automatically synchronizes the changes to the design tool. The model generation unit is also used to process user modification requests for design tokens in the design tool and synchronize user modifications to the design tokens back to the design token library.

10. The UI component data processing system based on design tokens according to claim 6, characterized in that: The result output unit is further used for: The result output unit receives real-time design variables from the front end or design tool through an API interface. The real-time design variables include color codes, font sizes, and spacing values. The result output unit configures the received real-time design variables in the object model encapsulated by the design token to update the corresponding attribute values ​​and call relationships in the object model; The result output unit analyzes user operation requirements, which include modifying design elements, applying new themes, or adjusting layouts; The result output unit processes the object model encapsulated by the real-time design token according to the user's operation requirements; The result output unit converts the object model encapsulated by the processed real-time design token into a design result, and returns it to the front end or design tool through the API interface; The design results include updated design artwork, CSS code, and JSON configuration data.

Citation Information

Patent Citations

  • Component style management method and device, electronic equipment and storage medium

    CN114168132A

  • Component determination method and device and storage medium

    CN115629758A

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

    CN118733012A

  • Board game apparatus and a method of placing tokens on the same

    US20200289916A1

Cited By

  • Design token-based front-end business component visual construction method and system

    CN122733290A