AI-based component library construction method and device, equipment and storage medium
Through the AI-based component library construction method, the problems of poor flexibility and low development efficiency of component library on the low-code development platform are solved, and seamless docking across frameworks and flexibility of component library applications are achieved.
Patent Information
- Application Number
- CN202510512654.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-05-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In terms of component expansion, low-code development platforms face the problems of poor flexibility of component libraries and low development efficiency.
Using the AI-based component library construction method, by determining the target functions and component library, parsing the API information of the component library, converting it into a format recognized by the target framework, and generating a configuration interface.
It realizes seamless docking across frameworks, improving the efficiency of component library construction and application flexibility.
Smart Images

Figure CN120029665A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology. Specifically, the present application relates to a method, device, equipment and storage medium for constructing an AI-based component library. Background Art
[0002] The low-code development platform is an important branch of the current software development field. It aims to lower the technical threshold of software development and improve development efficiency through a graphical interface, drag-and-drop operation, and a small amount of code writing, while maintaining the maintainability and scalability of the software. The emergence of this technology field allows even non-professional developers to participate in the development of software applications.
[0003] Current low-code development platforms generally face multiple challenges in component expansion, including poor flexibility of developed component libraries and low development efficiency. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device and storage medium for constructing an AI-based component library, which are used to solve the technical problems of poor flexibility and low development efficiency of the developed component library.
[0005] According to a first aspect of an embodiment of the present application, a method for constructing a component library based on AI is provided, the method comprising: determining a target function and a target component library for realizing the target function; the target component library comprises at least one component; Parsing the target component library to obtain an application programming interface API information set of the target component library; the API information set includes API information of each component, and the API information is described in a general component description language; Determine the target framework of the target platform, and convert the API information set into an API information set in a target format recognizable by the target framework according to a preset mapping rule; According to the API information set in the target format, a configuration interface including a target component library is generated on the target platform.
[0006] In one possible implementation, determining a target function; Determine whether there is a third-party component library that implements the target function; If there is a third-party component library that implements the target function, the third-party component library will be used as the target component library; If there is no third-party target component library that implements the target function, the target component library is generated according to the preset template.
[0007] In another possible implementation, the target component library is statically parsed; If the metadata of the target component library is obtained through static analysis, an API information set is generated according to the metadata and preset conversion rules; If the metadata of the target component library is not obtained based on static analysis, the target component library is analyzed using natural language processing technology to extract the metadata of each component, and an API information set is generated based on the metadata and preset conversion rules.
[0008] In yet another possible implementation, component documentation and code comments of a target component library are obtained; Use natural language processing technology to analyze component documents and code comments to extract metadata for each component; Metadata includes at least one of the following: The properties of the component; Component events; The structure of the component.
[0009] In yet another possible implementation, determining a target framework of a target platform; Based on the target framework, determine the target format that the framework can recognize; Determine the corresponding mapping rule from the rule base according to the target format; the rule base stores the mapping rules corresponding to each format; Convert the API information set into the target format according to the mapping rules.
[0010] In yet another possible implementation, determining at least one first component configured on the configuration interface within a preset time period; Determining at least one component to be recommended according to at least one first component and a pre-recommendation method; Displaying at least one component to be recommended in a recommendation area of the configuration interface; The recommendation area is used to display components to be recommended.
[0011] According to a second aspect of an embodiment of the present application, a device for constructing a component library is provided, the device comprising: A determination module, used to determine a target function and a target component library for realizing the target function; the target component library includes at least one component; A parsing module is used to parse the target component library to obtain an application programming interface API information set of the target component library; the API information set includes API information of each component, and the API information is described in a general component description language; A conversion module, used to determine a target framework of a target platform, and convert the API information set into an API information set in a target format recognizable by the target framework according to a preset mapping rule; The generation module is used to generate a configuration interface including a target component library on a target platform according to an API information set in a target format.
[0012] According to a third aspect of an embodiment of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory, and when the processor executes the program, the steps of the method provided in the first aspect are implemented.
[0013] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method provided in the first aspect are implemented.
[0014] According to the fifth aspect of the embodiment of the present application, a computer program product is provided, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. When a processor of a computer device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the computer device executes the steps of implementing the method provided in the first aspect.
[0015] The beneficial effects of the technical solution provided by the embodiment of the present application are: The method for constructing an AI-based component library provided in an embodiment of the present application determines the target function and the target component library that realizes the target function, then parses the target component library, and describes the API information of each component in the component library in a general component description language to obtain an API information set, determines the target framework of the target platform, and converts the API information set into API information in a target format recognizable by the target framework according to preset mapping rules, so that a configuration interface containing the target component library can be generated on the target platform for developers to configure, and describes the API interface information by using a general component description language, and uses preset rules to convert the target component library from the general component description language to a target format recognizable by various frameworks, thereby achieving seamless docking across frameworks, and enabling component libraries of different frameworks to be applicable to platforms of different frameworks, thereby improving the efficiency of component library construction and the flexibility of component library application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0017] Figure 1 A schematic diagram of the system architecture for implementing a method for building an AI-based component library provided in an embodiment of the present application; Figure 2 A flowchart of a method for constructing an AI-based component library provided in an embodiment of the present application; Figure 3 A schematic diagram of a process for determining a target component library provided in an embodiment of the present application; Figure 4A flowchart of a method for obtaining an API information set provided in an embodiment of the present application; Figure 5 A flowchart of a method for converting an API information set provided in an embodiment of the present application; Figure 6 A flowchart of a method for constructing an AI-based component library provided in an embodiment of the present application; Figure 7 A schematic diagram of the structure of a component library construction device provided in an embodiment of the present application; Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0019] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "an" and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we call an element "connected" or "coupled" to another element, the one element can be directly connected or coupled to the other element, or it can refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used here may include wireless connection or wireless coupling. The term "and / or" used here indicates at least one of the items defined by the term, for example, "A and / or B" can be implemented as "A", or as "B", or as "A and B".
[0020] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0021] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0022] Figure 1A schematic diagram of a system architecture for implementing a method for constructing an AI-based component library provided in an embodiment of the present application, wherein the system architecture includes: a terminal 120 and a server 140.
[0023] The terminal 120 installs and runs an application program of a method for constructing a component library based on AI. The terminal 120 is used to determine a target component library according to a target function and to generate a configuration interface including the target component library on a target platform.
[0024] The terminal 120 is connected to the server 140 via a wireless network or a wired network.
[0025] The server 140 includes at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. Schematically, the server 140 includes a first processor 144 and a first memory 142, and the first memory 142 includes a display module 1421, a control module 1422, and a receiving module 1423. The server 140 is used to provide background services for the application of the method for building an AI-based component library. Optionally, the server 140 undertakes the main computing work and the terminal 120 undertakes the secondary computing work; or, the server 140 undertakes the secondary computing work and the terminal 120 undertakes the main computing work; or, a distributed computing architecture is used between the server 140 and the terminal 120 for collaborative computing.
[0026] Optionally, the device type of the terminal includes at least one of a smart phone, a tablet computer, an e-book reader, a laptop computer and a desktop computer.
[0027] Those skilled in the art will appreciate that the number of the above terminals may be more or less. For example, the above terminal may be only one, or the above terminals may be dozens or hundreds, or more. The embodiment of the present application does not limit the number of terminals and device types.
[0028] The present application provides a method for constructing an AI-based component library, such as Figure 2 As shown, the method includes: S101, determining a target function and a target component library for realizing the target function.
[0029] In an embodiment of the present application, during the development process of the front-end and mobile applications, in order to enable the front-end and mobile applications to achieve the expected use effect, the functions required when using the front-end and mobile applications, that is, the target functions, will be determined in advance. The target functions can be functions for user interface construction, functions for data display and interaction, functions for layout and interaction, or functions for customization.
[0030] In an embodiment of the present application, the target component library includes at least one component, and the target component library is a collection that contains a series of components for building a user interface. These components encapsulate common UI elements and interactive behaviors, allowing developers to quickly build a fully functional and consistent application interface. The target component library contains a rich variety of component types, such as buttons, input boxes, forms, navigation bars, pop-ups, etc., as well as corresponding styles and interactive logic. Developers can reduce the workload of repeated development, improve development efficiency, and ensure the consistency and maintainability of the application interface by calling these components; the components in the target component library are the basic elements that constitute the user interface, and they have specific functions and interactive behaviors.
[0031] In an embodiment of the present application, the target component library may be an existing third-party component library. A third-party component library refers to a collection of multiple components provided by an external developer or organization to provide target functions for the project. The target component library may also be a target component library created based on the target functions.
[0032] In the embodiment of the present application, after determining the target function to be applied, a target component library that can realize the target function is determined according to the target function.
[0033] S102, parsing the target component library to obtain an application programming interface API information set of the target component library.
[0034] In an embodiment of the present application, the target component library can be parsed through methods such as document review, component classification and structural analysis, functional testing and verification, style and interaction analysis, code review and performance evaluation, and tool-assisted parsing, so as to fully understand the function, structure, and performance of the component library.
[0035] In an embodiment of the present application, the API information set includes API information of each component, and the API information is described using a general component description language. That is, the target component library is parsed in order to obtain the API information of each component in the target component library. The API information is used to characterize the function, purpose, and classification of each component in the target component library.
[0036] In an embodiment of the present application, the API information of the component is described by a general component description language. The general component description language can define API information such as the component, the properties of the component, the time when the component can be triggered, the method that the component can execute, etc. by using specific keywords. The use of the component description language to describe the API information is to provide a unified way to describe the relevant information of the component. Components for different frameworks can also be described in a unified way to facilitate subsequent configuration.
[0037] S103, determining a target framework of a target platform, and converting the API information set into an API information set in a target format recognizable by the target framework according to a preset mapping rule.
[0038] In an embodiment of the present application, the target platform refers to a low-code platform, that is, a platform currently used by developers for software development. On the target platform, developers can create applications by dragging and dropping components, configurations and logic settings without having to write a lot of code in depth.
[0039] In an embodiment of the present application, different target platforms support different front-end frameworks, such as mainstream front-end frameworks such as React and Vue. Therefore, it is necessary to determine the target framework supported by the target platform currently used for software development and the target format recognizable by the target framework, and convert the API information set into the target format to ensure that the API information set of the target component library can be recognized by the target platform.
[0040] In an embodiment of the present application, mapping rules for the specific implementation of the API information set from a general description language to a target format recognizable by the target framework are defined for different target frameworks. After the API information set of the target component library is determined, the conversion is performed based on the target framework of the current target platform, and the API information set in the general description language is converted into code in the target format to achieve seamless integration across frameworks.
[0041] In an embodiment of the present application, a pre-generated cross-framework component conversion engine can be used to achieve hybrid development and seamless docking of different front-end frameworks, greatly reducing the complexity of cross-framework migration, promoting the sharing and deep integration of different framework component ecosystems, and providing developers with a high degree of flexibility and choice.
[0042] S104, generating a configuration interface including a target component library on a target platform according to the API information set in the target format.
[0043] In an embodiment of the present application, after the API information of the target component library is converted into an API information set in a target format recognizable by the target platform, a configuration interface including the target component library is generated according to the API information set in the target format for the developer to select and use in the configuration interface.
[0044] In the embodiment of the present application, the configuration interface includes an interface design area for developers to use a drag-and-drop interface to build an application user interface, including: layout, components and style configuration. Components may include forms, sliders, drop-down lists and other components.
[0045] In an embodiment of the present application, the configuration interface may further include an instant preview area, which will instantly reflect each operation of the developer on the component on the configuration interface, thereby improving configuration efficiency.
[0046] In the embodiment of the present application, by generating a configuration interface, the complexity and error rate of manual configuration are significantly reduced, and the development efficiency and user experience are greatly improved, making the component configuration process simple and fast.
[0047] Based on the above embodiments, as an optional embodiment, refer to Figure 3 As shown, a method for determining a target component library is provided, and the specific contents are as follows: S201, determining the target function; S202, determining whether there is a third-party component library that implements the target function; S203-1, if there is a third-party component library that implements the target function, use the third-party component library as the target component library; S203-2: If there is no third-party target component library that implements the target function, generate the target component library according to a preset template.
[0048] In S201 of the embodiment of the present application, the functions to be applied in the front-end development process are determined. Since there are some functions that are not available on the current target platform, the functions to be applied but not available on the current target platform, namely, the target functions, are determined.
[0049] In S202 of the embodiment of the present application, the present application can directly and seamlessly connect to a third-party component library of any framework on the market through an automatic integration tool. Therefore, it is first determined whether any third-party component library can meet the above-mentioned target functions.
[0050] In S203-1 of the embodiment of the present application, if it is determined that there is a third-party component library in the existing third-party component library on the market that can achieve the target function, the above-mentioned third-party component library is directly used as the target component library, so that developers can easily use existing resources to quickly build function-rich applications.
[0051] In S203-2 of the embodiment of the present application, if it is determined that there is no third-party component library on the market that can realize the target function, the component library is constructed by itself, that is, the target component library is generated according to the preset template.
[0052] In an embodiment of the present application, the preset template is a reusable template. According to the target function, the properties, methods and events of each component in the target component library are determined, and then the code of each component in the target component library is generated according to the properties, methods and events of each component in the target component library. At the same time, the usage documents of each component are generated to facilitate subsequent use and maintenance.
[0053] In the above scheme, after determining the target function, first determine whether the existing third-party functional component library can achieve the target function. If it can, the third-party component library can be directly used as the target component library. If not, a third-party component library that achieves the target function is generated according to a preset template. By integrating third-party component libraries, for functions that cannot be directly implemented using third-party component libraries, generating target component libraries according to preset templates can also be convenient and quick. By integrating external third-party components, the resources of the component library of the target platform are enriched, and the application building process is accelerated, allowing developers to easily use existing resources to quickly build feature-rich applications.
[0054] Based on the above embodiments, as an optional embodiment, refer to Figure 4 As shown, a method for obtaining an API information set is provided, the specific contents are as follows: S301, statically analyzing the target component library; S302-1, if the metadata of the target component library is obtained according to the static analysis, an API information set is generated according to the metadata and the preset conversion rules; S302-2: If the metadata of the target component library is not obtained according to the static analysis, the target component library is analyzed using natural language processing technology to extract the metadata of each component, and an API information set is generated according to the metadata and preset conversion rules.
[0055] In the embodiments of the present application, static analysis refers to the process of analyzing the code of the component library without actually running the program. In the case of static analysis, the following aspects are included: Code structure analysis: By parsing the code files, a component structure tree is generated to analyze the component's hierarchical relationship, properties, and methods.
[0056] Dependency Analysis: Identifying dependencies between components helps understand how the components fit together.
[0057] Analysis of properties and events: Determine the properties and events of components, etc.
[0058] Style analysis: Analyze the style rules used by components, and check style priorities, inheritance relationships, etc.
[0059] In S301 of the embodiment of the present application, by performing static analysis on the target component library, relevant information of each component in the target component library can be obtained quickly and efficiently without consuming operating resources.
[0060] In an embodiment of the present application, the preset conversion rule defines in advance how to convert the acquired metadata into an API information set of a general component description language. The corresponding preset conversion rule can be determined according to the attribute type of the component. For example, if the data type of the component is an enumeration, the matching preset conversion rule is to convert the metadata into the description language of the drop-down box. When the data type of the component is a Boolean value, the matching preset conversion rule is to convert the metadata into the description language of the switch. In addition, for special attributes, a preset conversion rule will also be defined for conversion.
[0061] In S302-1 of the embodiment of the present application, the metadata of the target component library can be obtained by performing static analysis on the target component library. The metadata of the target component library is data used to describe the properties and characteristics of each component in the target component library. If the metadata of the target component library can be obtained directly through static parsing, the metadata can be directly converted into an API information set described in a general component description language based on the metadata and preset conversion rules.
[0062] In the embodiment of the present application, parsing the target component library by natural language processing technology refers to understanding the contents of all textual parts in the documents and codes of the target component library, thereby extracting metadata of the target component library.
[0063] In S302-2 of the embodiment of the present application, since there is a situation where the metadata of the target component library cannot be obtained after static parsing of the target component library, when the metadata cannot be obtained through static parsing, natural language processing technology is used to parse the target component library to extract the metadata of each component. After the metadata of each component is extracted, the metadata is converted into an API information set described in a general component description language according to set rules.
[0064] In the above scheme, static parsing is first used to obtain the metadata of the target component library. If the metadata can be obtained directly, the metadata is converted into an API information set described in a common component language according to the metadata and preset conversion rules. When the metadata of the target component library cannot be obtained through static parsing, the target component library is parsed through natural language processing technology to obtain the metadata of each component, and then the metadata is converted into an API information set described in a common component language according to the metadata and preset conversion rules, so that component libraries for different frameworks can be applied uniformly.
[0065] Based on the above embodiments, as an optional embodiment, component documents and code comments of the target component library are obtained; the component documents and code comments are analyzed using natural language processing technology to extract metadata of each component.
[0066] Metadata includes at least one of the following: The properties of the component; Component events; The structure of the component.
[0067] In an embodiment of the present application, when using natural language processing technology to analyze the target component library, the component documentation and code comments of the target component library are first obtained. The component documentation of the target component library is a document used to introduce the applicable scenarios and usage methods of the components in the component library. The target component library document can classify the components in the component library according to function or style, such as form components, layout components, and chart components. The component document will also list the properties, methods, events and other information of the components in detail; the code comments of the target component library refer to the text descriptions added by the developer in the source code of the component library to improve the readability, usability and maintainability of the code. By performing natural language processing on the component documentation and code comments of the target component library, the metadata of each component in the target component library can be obtained.
[0068] In the embodiments of the present application, the properties of a component refer to external inputs that the component can receive, and are usually used to configure the behavior or appearance of the component. The properties can be static or dynamic.
[0069] In the embodiments of the present application, an event refers to an operation triggered within a component or when a user interacts with a component. Typical events include a user clicking a button, a mouse hover, keyboard input, etc. In many frameworks, event handling functions can be passed through properties and called when an event occurs. This enables components to respond to user operations and update status.
[0070] In the embodiments of the present application, the structure of a component generally refers to the internal composition of the component, including its state, subcomponents, and rendered UI elements. The structure describes how the component organizes and nests other elements, and how the final user interface is generated through rendering functions or templates.
[0071] In an embodiment of the present application, the metadata of the target component library is used to help developers understand and build flexible and reusable components to improve development efficiency and code maintainability.
[0072] In the above solution, natural language processing technology is used to analyze the target component library that cannot be statically parsed, which significantly improves the convenience and accuracy of component library integration and reduces the difficulty and cost of integration.
[0073] Based on the above embodiments, as an optional embodiment, refer to Figure 5 As shown, a method for converting an API information set is provided, the specific contents are as follows: S401, determining a target framework of a target platform; S402, determining a target format recognizable by the framework according to the target framework; S403, determining a corresponding mapping rule from a rule base according to the target format; S404: Convert the API information set into an API information set in a target format according to the mapping rule.
[0074] In S401 of the embodiment of the present application, since different target platforms support different front-end frameworks, it is necessary to first determine the target framework of the target platform.
[0075] In S402 of the embodiment of the present application, each target framework has its corresponding recognizable target format. Therefore, in order to ensure that the component can be recognized by the target platform, it is necessary to determine the target format recognizable by the framework. For example, the file format of the React framework usually ends with .jsx, and the file format of the Vue framework usually ends with .vue.
[0076] In S403 of the embodiment of the present application, the rule base stores mapping rules corresponding to each format. Each target format in the rule base has its corresponding mapping rule. After the target format is determined, the corresponding mapping rule is determined from the rule base according to the target format.
[0077] In S404 of the embodiment of the present application, after determining the corresponding mapping rules, the API information set can be converted according to the mapping rules to obtain an API information set in a target format. For example, the API information set described in a common component language is automatically converted into a code in a target format recognizable by the target framework through the engine and mapping rules.
[0078] In the above scheme, by pre-storing the corresponding mapping rules in the rule base, after determining the format of the target framework, the corresponding mapping rules are determined, so that the API information set is converted into an API information set in the target format recognizable by the target framework according to the mapping rules, thereby achieving compatibility and interoperability with multiple mainstream front-end frameworks.
[0079] Based on the above embodiments, as an optional embodiment, at least one first component configured in the configuration interface within a preset time period is determined; at least one component to be recommended is determined based on the at least one first component and a preset recommendation method; at least one component to be recommended is displayed in a recommendation area of the configuration interface; and the recommendation area is used to display the components to be recommended.
[0080] In an embodiment of the present application, during the process of configuring components of the front-end interface to be constructed in the configuration interface of the target platform, multiple first components will be selected for configuration in the configuration interface according to usage requirements, that is, the first component refers to the component that has been configured to the front-end interface to be constructed.
[0081] In an embodiment of the present application, the preset recommendation method may be to determine the components to be recommended based on the association relationship between pre-built components, or may be to determine the components to be recommended based on the context information of the front-end interface currently to be built.
[0082] In one example, since the construction of the front-end interface is completed based on multiple configured components, the historical usage of each component can be collected to determine components with associated relationships. Therefore, during the process of building the front-end interface, at least one first component that has been configured is determined, and through the configured components and the determined associated relationships, the components that have associated relationships with the configured components are determined. Then, the above components are used as components to be recommended, and the components to be recommended are displayed in the recommended area of the configuration interface. Displaying the components to be recommended in the recommended area can facilitate developers to directly and quickly configure and select components.
[0083] Based on the above embodiments, as an optional embodiment, components can be dynamically loaded when running an application, that is, components can be loaded according to demand when the application is running, thereby reducing the initial loading time; components can also be lazily loaded when running an application, that is, loading of non-core and non-essential components or component libraries in the application is postponed until the above components or component libraries are needed, which can improve the application's loading performance and user experience, especially for application scenarios that use more or larger components.
[0084] In the above solution, an intelligent recommendation system can be introduced to recommend appropriate component configuration options based on the developer's historical behavior, thereby achieving automation and intelligence in component configuration and improving development efficiency and accuracy.
[0085] refer to Figure 6 As shown, it exemplarily shows a flow chart of a method for building a component library based on AI, and the specific contents are as follows: S501, determining the target function; S502, determine whether there is a third-party component library that implements the target function; if so, execute step S503; if not, execute step S504; S503, taking the third-party component library as the target component library; S504, generating a target component library according to a preset template; S505, statically analyzing the target component library; S506, determining whether the metadata of the target component library is obtained through static analysis; if the metadata of the target component library is not obtained through static analysis, executing step S507, otherwise executing step S508.
[0086] S507, obtaining component documents and code comments of the target component library, processing the component documents and code comments of the target component library by natural language processing technology, and extracting metadata of the target component library.
[0087] S508, generating an API information set according to the metadata and preset rules; S509, determining a target framework of the target platform and a target format recognizable by the target framework; S510, determining a corresponding mapping rule from a rule base according to a target format, and converting an API information set into an API information set of a target format according to the mapping rule.
[0088] S511, generating a configuration interface including a target component library on a target platform according to an API information set in a target format.
[0089] In the above scheme, the API information of the target component library for different frameworks is described in a common component language, and then the API information is converted into API information in a target format recognizable by the target framework according to the target framework of the target platform used, thereby achieving compatibility and interoperability with multiple front-end frameworks and having broad application prospects; through static parsing and artificial natural language processing technology, the integration convenience and accuracy of third-party component libraries are significantly improved, and the integration difficulty and cost of third-party component libraries are reduced; through the generation of configuration interfaces, the automation and intelligence of component configuration are realized, and the development efficiency and accuracy are improved.
[0090] The method for constructing an AI-based component library provided in the embodiment of the present application utilizes cutting-edge AI technologies, such as machine learning, deep learning, natural language processing, computer vision, and reinforcement learning, to construct a component library. Through an intelligent analysis engine, the API information of each component in the component library is automatically extracted and parsed, and a configuration interface is intelligently generated based on the acquired API information. Through the intelligent assistance of AI, the development process of the component library is greatly simplified, while the diversity and flexibility of component design are significantly improved. At the same time, it supports cross-framework compatibility and seamless integration of third-party component libraries, allowing developers to easily build and optimize the component library of the low-code platform. With the automatic configuration and optimization assisted by AI, combined with a highly scalable architecture, the development efficiency and quality are greatly improved, which directly promotes the intelligentization and efficiency of low-code development technology.
[0091] The present application embodiment provides a device for constructing a component library, such as Figure 7 As shown, the component library construction device 70 may include: a determination module 701 , a parsing module 702 , a conversion module 703 and a generation module 704 .
[0092] Specifically, the determination module 701 is used to determine a target function and a target component library for realizing the target function; the target component library includes at least one component; The parsing module 702 is used to parse the target component library to obtain an application programming interface API information set of the target component library; the API information set includes API information of each component, and the API information is described in a general component description language; The conversion module 703 is used to determine the target framework of the target platform and convert the API information set into an API information set in a target format recognizable by the target framework according to a preset mapping rule; The generating module 704 is used to generate a configuration interface including a target component library on a target platform according to an API information set in a target format.
[0093] The component library construction device provided in the embodiment of the present application determines the target function and the target component library that realizes the target function, parses the target component library, and describes the API information of each component in the component library in a general component description language to obtain an API information set, determines the target framework of the target platform, and converts the API information set into API information in a target format recognizable by the target framework according to preset mapping rules, so that a configuration interface including the target component library can be generated on the target platform for the developer to configure, and describes the API interface information by using a general component description language, and uses preset rules to convert the target component library from the general component description language to a target format recognizable by various frameworks, thereby realizing seamless docking across frameworks, and realizing that component libraries of different frameworks can be applicable to platforms of different frameworks, thereby improving the efficiency of component library construction and the flexibility of component library application.
[0094] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.
[0095] Further, in one possible implementation, determining a target function; Determine whether there is a third-party component library that implements the target function; If there is a third-party component library that implements the target function, the third-party component library will be used as the target component library; If there is no third-party target component library that implements the target function, the target component library is generated according to the preset template.
[0096] In another possible implementation, the target component library is statically parsed; If the metadata of the target component library is obtained through static analysis, an API information set is generated according to the metadata and preset conversion rules; If the metadata of the target component library is not obtained based on static analysis, the target component library is analyzed using natural language processing technology to extract the metadata of each component, and an API information set is generated based on the metadata and preset conversion rules.
[0097] In yet another possible implementation, component documentation and code comments of a target component library are obtained; Use natural language processing technology to analyze component documents and code comments to extract metadata for each component; Metadata includes at least one of the following: The properties of the component; Component events; The structure of the component.
[0098] In yet another possible implementation, determining a target framework of a target platform; Based on the target framework, determine the target format that the framework can recognize; Determine the corresponding mapping rule from the rule base according to the target format; the rule base stores the mapping rules corresponding to each format; Convert the API information set into the target format according to the mapping rules.
[0099] In yet another possible implementation, determining at least one first component configured on the configuration interface within a preset time period; Determining at least one component to be recommended according to at least one first component and a pre-recommendation method; Displaying at least one component to be recommended in a recommendation area of the configuration interface; The recommendation area is used to display components to be recommended.
[0100] In an embodiment of the present application, an electronic device (computer device / equipment / system) is provided, including a memory, a processor and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of a method for constructing a component library based on AI. Compared with the related art, it can achieve: after determining the target function and the target component library that realizes the target function, the target component library is parsed, and the API information of each component in the component library is described in a general component description language to obtain an API information set, and the target framework of the target platform is determined. According to preset mapping rules, the API information set is converted into API information in a target format recognizable by the target framework, so that a configuration interface containing the target component library can be generated on the target platform for developers to configure, and the API interface information is described by using a general component description language, and the target component library is converted from the general component description language to a target format recognizable by various frameworks using preset rules, thereby achieving seamless docking across frameworks, and achieving that component libraries of different frameworks can be applicable to platforms of different frameworks, thereby improving the efficiency of component library construction and the flexibility of component library application.
[0101] In an alternative embodiment, an electronic device is provided, such as Figure 8 As shown, Figure 8 The electronic device 4000 shown includes: a second processor 4001 and a second memory 4003. The second processor 4001 and the second memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0102] The second processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The second processor 4001 may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0103] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0104] The second memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0105] The second memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the second processor 4001. The second processor 4001 is used to execute the computer program stored in the second memory 4003 to implement the steps shown in the above method embodiment.
[0106] Among them, the electronic equipment package may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0107] The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented. Compared with the prior art, it can be implemented as follows: after determining the target function and the target component library that realizes the target function, the target component library is parsed, and the API information of each component in the component library is described in a general component description language to obtain an API information set, determine the target framework of the target platform, and convert the API information set into API information in a target format that can be recognized by the target framework according to a preset mapping rule, so that a configuration interface containing the target component library can be generated on the target platform for the developer to configure, and the API interface information is described by using a general component description language, and the target component library is converted from the general component description language to a target format that can be recognized by various frameworks using preset rules, so as to achieve seamless docking across frameworks, and achieve component libraries of different frameworks can be applied to platforms of different frameworks, thereby improving the efficiency of component library construction and the flexibility of component library application.
[0108] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0109] The present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the above method embodiments when executed by a processor. Compared with the prior art, it can achieve: After determining the target function and the target component library that implements the target function, the target component library is parsed, and the API information of each component in the component library is described in a general component description language to obtain an API information set, determine the target framework of the target platform, and convert the API information set into API information in a target format recognizable by the target framework according to preset mapping rules. This allows a configuration interface containing the target component library to be generated on the target platform for developers to configure. The API interface information is described in a general component description language, and preset rules are used to convert the target component library from the general component description language to a target format recognizable by various frameworks, thereby achieving seamless cross-framework integration and making component libraries of different frameworks applicable to platforms of different frameworks, thereby improving the efficiency of component library construction and the flexibility of component library application.
[0110] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.
[0111] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0112] The above are only optional implementation methods for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the scheme of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A method for constructing a component library based on AI, characterized in that: include: Determine a target function and a target component library that realizes the target function; The target component library includes at least one component; Parsing the target component library to obtain an application programming interface API information set of the target component library; the API information set includes API information of each component, and the API information is described in a general component description language; Determine a target framework of a target platform, and convert the API information set into an API information set in a target format recognizable by the target framework according to a preset mapping rule; A configuration interface including the target component library is generated on the target platform according to the API information set in the target format.
2. The method according to claim 1, characterized in that The determining of the target function and the target component library for realizing the target function include: determining the target function; Determine whether there is a third-party component library that implements the target function; If there is a third-party component library that implements the target function, the third-party component library is used as the target component library; If there is no third-party target component library that implements the target function, the target component library is generated according to a preset template.
3. The method according to claim 1, characterized in that The step of parsing the target component library to obtain an application programming interface API information set of the target component library includes: Performing static analysis on the target component library; If metadata of the target component library is obtained according to the static analysis, an API information set is generated according to the metadata and preset conversion rules; If the metadata of the target component library is not obtained according to the static analysis, the target component library is analyzed using natural language processing technology to extract the metadata of each component, and an API information set is generated according to the metadata and preset conversion rules.
4. The method according to claim 3, characterized in that The use of natural language processing technology to parse the target component library and extract metadata of each component includes: Obtain component documents and code comments of the target component library; Using natural language processing technology to analyze the component documents and code comments to extract metadata of each component; The metadata includes at least one of the following: The properties of the component; Component events; The structure of the component.
5. The method according to claim 1, characterized in that The step of determining a target framework of a target platform and converting the API information set into an API information set in a target format recognizable by the target framework according to a preset mapping rule includes: Determine the target framework for the target platform; According to the target framework, determining a target format recognizable by the framework; Determining a corresponding mapping rule from a rule base according to the target format; the rule base stores mapping rules corresponding to each format; The API information set is converted into an API information set in a target format according to the mapping rule.
6. The method according to claim 1, characterized in that The method further comprises: Determining at least one first component configured on the configuration interface within a preset time period; Determining at least one component to be recommended according to the at least one first component and the preset recommendation method; Displaying the at least one component to be recommended in a recommendation area of the configuration interface; The recommendation area is used to display components to be recommended.
7. A device for constructing a component library, characterized in that: include: A determination module, used to determine a target function and a target component library that implements the target function; The target component library includes at least one component; A parsing module, used to parse the target component library to obtain an application programming interface API information set of the target component library; the API information set includes API information of each component, and the API information is described in a general component description language; A conversion module, used to determine a target framework of a target platform, and convert the API information set into an API information set in a target format recognizable by the target framework according to a preset mapping rule; A generation module is used to generate a configuration interface including the target component library on the target platform according to the API information set in the target format.
8. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Cross-platform API sharing method, device and system and storage medium
CN112947897A
Method and system for automatically identifying component attributes in interface mode
CN116302294A
Component library adding method and device, equipment and storage medium
CN117111941A
Component ecological application development method based on low-code platform
CN117950652A
Self-adaptive UI component library system based on artificial intelligence and implementation method
CN118733923A