An AI-assisted plug-in automatic generation method and device

By using an AI-based automatic plugin generation method, leveraging a large language model for deep semantic understanding and intent recognition, the plugin specification is automatically generated. The appropriate template is selected to build the basic engineering skeleton, and the business logic code for API call placeholders is automatically generated. Automated testing and deployment are then performed, solving the problem of insufficient intelligence in existing plugin development models. This achieves full-chain automation of plugin development, improving efficiency and reducing costs.

CN122152292APending Publication Date: 2026-06-05QIJIAYOUDAO NETWORK TECH (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QIJIAYOUDAO NETWORK TECH (BEIJING) CO LTD
Filing Date
2026-03-05
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

The existing plugin development model lacks sufficient intelligence, which limits the improvement of efficiency and quality, and the generated code lacks deep binding and automatic adaptation with specific main systems.

Method used

By using an AI-based plugin auto-generation method, leveraging a large language model for deep semantic understanding and intent recognition, plugin specifications are automatically generated. Adaptive templates are selected to build the basic engineering skeleton, business logic code for API call placeholders is automatically generated, and automated testing and deployment are performed before finally registering the plugin to the main system's plugin marketplace.

Benefits of technology

It achieves full-chain automation of plugin development, improves development efficiency, reduces manual intervention and tool switching costs, simplifies the development process, and lowers the technical threshold and development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152292A_ABST
    Figure CN122152292A_ABST
Patent Text Reader

Abstract

The application discloses an AI auxiliary-based plug-in automatic generation method and device, which comprises the following steps: receiving a natural language plug-in function requirement input by a user; performing deep semantic understanding and intention recognition on the requirement by using a large language model, and analyzing the requirement into a structured plug-in specification, including a function point list, a data structure definition, an interface calling plan and a plug-in function type; selecting an adaptive template from a preset template library according to the plug-in function type, and automatically constructing a plug-in basic engineering skeleton; calling an AI model to generate a business logic code containing an API calling placeholder on the skeleton; referring to a main system API definition document, automatically generating adaptive code and replacing the placeholder, and forming a complete code engineering; automatically packaging and deploying the engineering to a sandbox test environment, generating simulation data based on the data structure to perform automatic testing and capture errors; and after the testing, automatically registering the plug-in to a main system plug-in market or a plug-in library, so that the automatic generation and release of the plug-in are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software development technology, and in particular to an AI-assisted automatic plugin generation method and apparatus. Background Technology

[0002] In the modern software ecosystem, plugins or extensions play a crucial role in enhancing the functionality of the main system and meeting users' personalized needs. However, the current plugin development model suffers from insufficient intelligence, hindering its efficiency and quality improvement. Although the development of artificial intelligence technology, especially Large Language Models (LLM), has led to the emergence of code generation tools such as GitHub Copilot and Amazon CodeWhisperer, which can provide developers with code snippet completion or single-file generation capabilities in integrated development environments, these tools have significant limitations. They primarily focus on code snippet-level generation and lack the ability to directly output complete and structured plugin projects based on high-level requirements. Furthermore, the generated code is typically generic, lacking deep binding and automatic adaptation to the APIs, data models, and plugin protocols of specific main systems.

[0003] Therefore, it is necessary to provide a new systematic technical solution for plugin development. Summary of the Invention

[0004] This specification provides an AI-assisted automatic plugin generation method and apparatus to solve at least one of the technical problems mentioned above.

[0005] According to a first aspect of the present invention, an AI-assisted automatic plugin generation method is provided, the method comprising: Receive user input describing plugin functional requirements in natural language; The plugin functional requirements are analyzed using a large language model to perform deep semantic understanding and intent recognition. The plugin functional requirements are then parsed into a structured plugin specification, which includes a list of plugin functional points, data structure definitions, interface call plans, and plugin functional types. Based on the plugin function type in the plugin specification, select the appropriate template from the pre-set plugin framework template library and automatically build the basic engineering skeleton of the plugin. The AI ​​model is invoked to automatically generate business logic code containing API call placeholders on the basic engineering skeleton, based on the list of functional points and data structure definitions in the plugin specification. Based on the interface call plan in the plugin specification and referring to the main system API definition document, the plugin and the main system API adaptation code are automatically generated, and the API call placeholders in the business logic code are replaced with the adaptation code to form a complete code project. The complete code project is automatically packaged and deployed to an isolated sandbox testing environment. Simulated data is automatically generated based on the data structure definition in the plugin specification to perform automated testing on the plugin functions in the complete code project, capturing runtime logs and potential errors. After the plugins in the complete code project have been debugged and verified in the sandbox testing environment, the verified plugins will be automatically registered in the plugin marketplace or plugin library of the main system.

[0006] In some optional implementations, the use of a large language model to perform deep semantic understanding and intent recognition of the plugin functional requirements includes: The plugin functional requirements are preprocessed to remove irrelevant characters and standardize the format, resulting in the modified plugin functional requirements. The modified plugin functional requirements are processed by word segmentation and converted into word sequence; Each word in the word sequence is mapped to a high-dimensional vector using a word embedding model. The high-dimensional vector is input into a large language model that has been fine-tuned for a specific domain for inference. The large language model is guided by prompts to generate structured plugin specifications, which are in JSON or YAML format.

[0007] In some alternative implementations, the plugin functionality types include UI classes, data processing classes, and background task classes.

[0008] In some optional implementations, the AI ​​model invokes business logic code containing API call placeholders on the basic engineering skeleton, based on the list of function points and data structure definitions in the plugin specification, including: Iterate through the list of features in the plugin specification; For each function point in the list of function points, perform task decomposition to identify the required UI components and processing functions; Based on the identified UI components and processing functions, prompts containing technology stack information, file paths, data model definitions, and functional implementation requirements are sent to the AI ​​model to generate corresponding code snippets; The generated code snippet is inserted into the corresponding position in the basic engineering skeleton.

[0009] In some optional implementations, the step of automatically generating adaptation code between the plugin and the main system API based on the interface call plan in the plugin specification and referring to the main system API definition document, and replacing the API call placeholders in the business logic code with the adaptation code, includes: Load and parse the main system API definition document; Scan the API call placeholders in the business logic code; For the scanned API call placeholders, according to the interface call plan, generate adaptation code that conforms to the main system interface protocol; Replace the API call placeholders in the business logic code with the adaptation code.

[0010] In some optional implementations, the automatic generation of simulated data based on the data structure definitions in the plugin specification to perform automated testing of the plugin functionality in the complete code project includes: The sandbox testing environment provides a simulated main system interface; Using the simulated data and the simulated main system interface, unit tests or end-to-end tests are automatically run; Capture runtime error messages, console logs, and assertion failures for the plugin.

[0011] In some alternative implementations, upon detecting an error, the following is also included: The error message, along with the relevant code snippets and the plugin specification, is fed back to the business logic code generation step. The error messages and code snippets are analyzed using an AI model to provide automatic repair suggestions. Based on the auto-repair suggestions, an auto-repair loop is triggered to regenerate and test the repaired code.

[0012] In some optional implementations, the automatic registration of verified plugins to the main system's plugin marketplace or plugin library includes: The verified plugin package contains all the necessary metadata; After successful verification, the plugin package is uploaded by calling the registration API of the plugin marketplace. The plugins are listed in the plugin marketplace, making them available for end users to search, install, and enable.

[0013] In some alternative implementations, the large language model is a deep learning model based on the Transformer architecture and fine-tuned in the plugin development domain.

[0014] According to a second aspect of the present invention, an AI-assisted automatic plugin generation device is provided, the device comprising: The requirement receiving module is used to receive user input describing plugin function requirements in natural language. The requirement parsing module is used to perform deep semantic understanding and intent recognition on the plugin functional requirements using a large language model, and parse the plugin functional requirements into a structured plugin specification, which includes a list of plugin functional points, data structure definitions, interface call plans and plugin functional types. The plugin template generation module is used to select a suitable template from the pre-set plugin framework template library according to the plugin function type in the plugin specification and automatically build the basic engineering skeleton of the plugin. The code generation module is used to call the AI ​​model and automatically generate business logic code containing API call placeholders on the basic engineering skeleton based on the list of function points and data structure definitions in the plugin specification. The interface binding module is used to automatically generate adaptation code between the plugin and the main system API based on the interface call plan in the plugin specification and with reference to the main system API definition document, and replace the API call placeholders in the business logic code with the adaptation code to form a complete code project; The deployment and debugging module is used to automatically package and deploy the complete code project to an isolated sandbox testing environment, automatically generate simulated data based on the data structure definition in the plugin specification, perform automated testing on the plugin functions in the complete code project, and capture runtime logs and potential errors. The plugin publishing module is used to automatically register verified plugins in the main system's plugin marketplace or plugin library after they have been debugged and verified in the sandbox testing environment.

[0015] The technical solution of this application has the following technical effects: The technical solution of this application integrates the functions of requirement analysis, code generation, interface binding, test deployment and release into a unified automated chain. This can, to a certain extent, replace the traditional decentralized development model that relies on manual code writing, manual interface debugging and separate deployment. This integrated end-to-end automated design can improve the overall efficiency of plugin development, reduce manual intervention and tool switching costs in the development process, simplify the development process, and thus lower the technical threshold and development cost. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] Figure 1 The overall architecture diagram of the system upon which the AI-assisted automatic plugin generation method provided in the embodiments of this application is based; Figure 2 A complete flowchart of the AI-assisted automatic plugin generation method provided for the technical solution of this application; Figure 3 for Figure 4 A schematic diagram illustrating the collaborative workflow between the code generator and the interface binding module in the AI-assisted plugin automatic generation device provided in the document; Figure 4 This is a schematic diagram of an AI-assisted automatic plugin generation device provided in an embodiment of this application. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of one or more embodiments of this specification.

[0019] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another.

[0020] like Figure 1As shown, the overall architecture of this application's technical solution can be composed of four collaborative parts: a user interaction layer, an AI-assisted plugin automatic generation system, core data and resources, and a target system. Through data flow between these modules, the entire process from natural language requirements to plugin deployment is automated. In the user interaction layer, users (developers or business personnel) input functional requirements described in natural language through the system interface, such as "I need a sidebar plugin to display company news." The AI-assisted plugin automatic generation system acts as the processing engine, with its internal modules connected according to a workflow. The requirement input module receives the user's requirement text and passes it to the requirement parsing engine. The requirement parsing engine performs deep semantic understanding of the requirements, outputs a structured plugin specification, and passes it to the plugin template generator, code generator, and interface binding module. The plugin template generator selects an appropriate template from the plugin framework template library based on the plugin type in the specification, constructs and outputs a basic engineering skeleton to the code generator. The code generator then generates a code project containing business logic and API call placeholders and passes it to the interface binding module. The interface binding module generates compliant adaptation code based on the main system's API definition library, replaces placeholders to form a complete code project, and outputs it to the deployment and debugging module. The deployment and debugging module deploys the project in a sandbox testing environment for automated testing and debugging. Finally, it outputs the verified plugin to the one-click release module, which is responsible for registering and uploading the finished plugin to the target system. Here, the main system refers to the core software platform or foundational system that the plugin aims to extend or integrate. It provides standardized API interfaces, data models, and plugin runtime frameworks, allowing third-party plugins to extend its functionality. For example, a browser (such as Chrome) is the main system, and browser extensions (such as ad-blocking plugins) rely on its API; or a SaaS platform (such as WeChat Work / DingTalk) is the main system, and third-party applications integrate through its open platform.

[0021] Meanwhile, core data and resources are used to provide support, which may include a plugin framework template library that provides the basic framework for the plugin template generator, a main system API definition library that provides interface specifications for the interface binding module, and a sandbox testing environment that provides an isolated running environment for the deployment and debugging module. The target system, namely the main system plugin marketplace, receives and hosts verified plugins uploaded by the one-click release module, which are ultimately available for end users of the main system to search, install, and use, completing the end-to-end delivery loop from requirement to runnable plugin.

[0022] The following is based on the appendix Figure 2 The technical solution of this application is described in detail, such as... Figure 2 As shown, Figure 2 A flowchart of an AI-assisted automatic plugin generation method provided in this application embodiment is included, which may include the following steps: Step 202: Receive the user's input of plugin function requirements described in natural language.

[0023] In this step, users can include developers or non-technical business personnel. Plugin functional requirements can be described in a vague, unstructured natural language text format, such as through rich text boxes, conversational interfaces, or voice input channels combined with a speech-to-text engine.

[0024] Step 204: Utilize a large language model to perform deep semantic understanding and intent recognition on the plugin functional requirements, and parse the plugin functional requirements into a structured plugin specification. The plugin specification includes a list of plugin functional points, data structure definitions, interface call plans, and plugin functional types.

[0025] In this step, the plugin specification can include a list of plugin functionalities, data structure definitions, API call plans, and plugin functional types. Specifically, the large language model can use its semantic understanding capabilities to parse the natural language requirement text, identify the specific functionalities corresponding to the user's intent, and define the data structures required by the plugin and the main system interfaces to be called accordingly. Simultaneously, the large language model can determine the plugin's functional type based on the requirements, such as UI-related, data processing, or background task-related, thus providing clear input for subsequent plugin engineering.

[0026] Step 206: Based on the plugin function type in the plugin specification, select the appropriate template from the preset plugin framework template library and automatically build the basic engineering skeleton of the plugin.

[0027] In this step, the plugin template generator receives structured plugin specifications from the requirements parsing engine as input. It then parses the plugin functionality type field in the specifications, using this as the selection criterion to match the most suitable project template from a pre-built plugin framework template library. This library can contain multiple standardized project structures pre-built for different functional scenarios. For example, it can configure a React or Vue-based front-end project template for UI plugins focusing on user interaction, or a corresponding back-end project template for data processing plugins focusing on logic processing. After selecting a template, the plugin template generator automatically starts the scaffolding process to build the basic project skeleton. This process dynamically creates a standardized directory structure, generates and initializes the necessary configuration files for the project, including a package.json file defining project dependencies and metadata, and a manifest.json file conforming to the main system plugin framework specifications. It also automatically fills in the corresponding configuration fields with metadata such as the plugin name parsed from the plugin specifications. Finally, it outputs a basic project package with a complete directory structure, initialization configuration, and basic dependencies, but without specific business logic code.

[0028] Step 208: Invoke the AI ​​model and automatically generate business logic code containing API call placeholders on the basic engineering skeleton based on the list of function points and data structure definitions in the plugin specification.

[0029] The purpose of this step is to transform structured functional requirements into concrete business logic code. Specifically, the code generator receives plugin specifications from the requirements parsing engine and a basic project skeleton from the plugin template generator as input. Upon startup, the code generator invokes a dedicated AI model. First, it iterates through the list of functional points explicitly listed in the plugin specifications, analyzing the description of each functional point to determine the type of code unit to be generated and the specific logic to be implemented. Then, the code generator sends a generation instruction containing detailed context to the AI ​​model. This instruction integrates the current project's technology stack information, target file paths, detailed functional requirements, and data structures defined in the plugin specifications. Based on this instruction, the AI ​​model generates code snippets that conform to the syntax and context requirements, and the code generator accurately populates these code snippets into the corresponding files and locations in the basic project skeleton. For parts of the code that need to interact with the main system to complete data access, service calls, and other operations, the AI ​​model will insert explicit API call placeholders during generation. These placeholders are usually manifested as specific comment markers or general function calls that are not bound to specific implementations, in order to indicate that special interface adaptation is required in subsequent processes, thus forming an intermediate code project with complete business functions but with external interfaces not yet finally bound.

[0030] Step 210: Based on the interface call plan in the plugin specification and referring to the main system API definition document, automatically generate the adaptation code between the plugin and the main system API, and replace the API call placeholders in the business logic code with the adaptation code to form a complete code project.

[0031] In this step, based on the interface call plan parsed from the plugin specification in the previous steps and referring to the pre-defined main system API definition document, adaptation code is automatically generated to connect the plugin with the main system API. This adaptation code then replaces the API call placeholders in the business logic code, thus forming a complete code project. Specifically, this process first loads and parses the main system API definition document to obtain the signatures and protocol specifications of all available interfaces. Next, it scans the business logic code to locate the placeholders inserted in the code generation step that indicate the need to call the main system API. Then, for each scanned placeholder, combined with the call intent explicitly stated in the interface call plan, specific adaptation code that conforms to the main system interface protocol and is syntactically correct is generated. Finally, the generated adaptation code accurately replaces the corresponding placeholders, achieving deep binding and seamless integration between the plugin's business logic and the main system API, forming a complete code project ready for subsequent deployment and testing.

[0032] Step 212: Automatically package and deploy the complete code project to an isolated sandbox testing environment, automatically generate simulated data based on the data structure definition in the plugin specification, perform automated testing on the plugin functions in the complete code project, and capture runtime logs and potential errors.

[0033] This step automatically packages and deploys the complete code project generated earlier to an isolated sandbox testing environment. This sandbox environment can simulate the runtime environment of the real main system but is isolated from it. Then, based on the data structures defined in the plugin specification, simulated data conforming to its type and constraints is automatically generated. Next, using the simulated data and the simulated main system interface provided in the sandbox testing environment, automated testing is performed on the plugin functionality in the complete code project. This testing can include running unit tests or end-to-end tests to verify the correctness of the plugin functionality. During this process, runtime logs, any potential error messages, and test assertion failure results can be continuously captured.

[0034] Step 214: After the plugins in the complete code project have been debugged and verified in the sandbox testing environment, the verified plugins will be automatically registered in the plugin marketplace or plugin library of the main system.

[0035] This step automatically registers verified plugins to the main system's plugin marketplace or plugin library. Specifically, it may include confirming whether the plugin package contains all the necessary metadata, then calling the main system's plugin marketplace registration application interface to upload the verified plugin package, and finally listing the plugin in the plugin marketplace so that it can be searched, installed, and enabled by the main system's end users.

[0036] The technical solution of this application integrates the functions of requirement analysis, code generation, interface binding, test deployment and release into a unified automated chain. This can, to a certain extent, replace the traditional decentralized development model that relies on manual code writing, manual interface debugging and separate deployment. This integrated end-to-end automated design can improve the overall efficiency of plugin development, reduce manual intervention and tool switching costs in the development process, simplify the development process, and thus lower the technical threshold and development cost.

[0037] Based on the technical solutions described above, this specification also provides some specific implementation schemes, which are described below.

[0038] In an optional embodiment, the step of using a large language model to perform deep semantic understanding and intent recognition of the plugin's functional requirements may include: The plugin functional requirements are preprocessed to remove irrelevant characters and standardize the format, resulting in the modified plugin functional requirements. The modified plugin functional requirements are processed by word segmentation and converted into word sequence; Each word in the word sequence is mapped to a high-dimensional vector using a word embedding model. The high-dimensional vector is input into a large language model that has been fine-tuned for a specific domain for inference. The large language model is guided by prompts to generate structured plugin specifications, which are in JSON or YAML format.

[0039] The purpose of this embodiment is to preprocess the original plugin functional requirements to remove irrelevant characters and standardize the format, resulting in modified plugin functional requirements. This preprocessing stage, as a data cleaning step, can filter out redundant spaces, special symbols, or characters unrelated to the functional description that may be present in the user input. Simultaneously, it can also standardize the text format, such as unifying the capitalization of English characters, correcting obvious spelling errors, and transforming colloquial expressions into more standardized technical description language.

[0040] Next, the modified plugin functional requirements can be segmented into word sequences, and each word can be mapped to a high-dimensional vector using a word embedding model. Word segmentation breaks down continuous natural language text into discrete basic semantic units; for example, "display the company's latest news" can be broken down into ["display", "company", "latest", "news"]. Then, a pre-trained word embedding model (such as Word2Vec or BERT) is used to convert these word sequences into vector representations in a high-dimensional space. This vectorization encodes the semantic information of each word sequence into a numerical form, preserving the semantic connections and contextual relationships between words. These high-dimensional vectors are then input into a domain-specific fine-tuned large language model for inference, and a structured plugin specification is generated through a designed prompting engineering guidance model.

[0041] In optional embodiments, the plugin functional types include UI classes, data processing classes, and background task classes.

[0042] In this embodiment, UI plugins can focus on user interface interaction, such as sidebar plugins or to-do list plugins. Their templates can be built based on front-end frameworks such as React or Vue to implement the rendering of visual components and user operation responses. Data processing plugins can focus on data transformation, import / export, or logical processing. Their templates are configured as data adapters or backend project structures to perform data model mapping, cleaning, or storage operations. Background task plugins can focus on background operations that do not require direct user intervention, such as scheduled tasks or batch data processing. Their templates are configured as background workers or microservice instances to perform continuous or periodic computing tasks in the background. In this embodiment, these functional type classifications based on the functional intent in the plugin specifications allow the plugin template generator to select a matching project template from the pre-set template library according to the specific type. For example, selecting the template-ui-react template for UI, the template-data-adapter template for data processing, and the template-background-worker template for background task, thereby ensuring that the generated basic project skeleton matches the plugin's functional requirements.

[0043] In an optional embodiment, the step of calling the AI ​​model, based on the list of function points and data structure definitions in the plugin specification, automatically generates business logic code containing API call placeholders on the basic engineering skeleton, which may include: Iterate through the list of features in the plugin specification; For each function point in the list of function points, perform task decomposition to identify the required UI components and processing functions; Based on the identified UI components and processing functions, prompts containing technology stack information, file paths, data model definitions, and functional implementation requirements are sent to the AI ​​model to generate corresponding code snippets; The generated code snippet is inserted into the corresponding position in the basic engineering skeleton.

[0044] In this embodiment, the technical solution first iterates through the list of functional points in the structured plugin specification output by the requirements parsing engine. This list can be an array containing the various functions that the plugin needs to implement, such as "displaying a task list," "allowing users to add new tasks," or "retrieving data from an external API." By processing each functional point one by one, it can be ensured that all user requirements are fully covered at the code level.

[0045] Next, a detailed task breakdown is performed for each functionality to identify the UI components and processing functions required to implement that function. For example, for the functionality of "allowing users to add new tasks," the task breakdown can identify the need to create a form component containing input fields and buttons, as well as processing functions to handle form submission, data validation, and status updates. This breakdown process must be based on the data model definition and functional logic in the plugin specification to ensure that each functionality can be mapped to a specific code implementation unit. Based on this, prompts containing technology stack information (such as Vue or React), specified file paths, data model definitions (such as the JSON schema of Task objects), and detailed functional implementation requirements are sent to the AI ​​model. This guides the AI ​​model to generate accurate and integrable code snippets and inserts explicit placeholders, such as " / / TODO: Call host API to save task," where the main system API needs to be called.

[0046] Finally, in this embodiment, the code snippets generated by the AI ​​model are accurately inserted into the corresponding positions of the basic engineering skeleton pre-built by the plugin template generator. The basic engineering skeleton includes a predefined directory structure, configuration files, and basic code files. Based on the file paths specified in the prompts, the generated component code or logic processing code is integrated into the corresponding directories of the skeleton.

[0047] In an optional embodiment, the step of automatically generating adaptation code between the plugin and the main system API based on the interface call plan in the plugin specification and referring to the main system API definition document, and replacing the API call placeholders in the business logic code with the adaptation code, includes: Load and parse the main system API definition document; Scan the API call placeholders in the business logic code; For the scanned API call placeholders, according to the interface call plan, generate adaptation code that conforms to the main system interface protocol; Replace the API call placeholders in the business logic code with the adaptation code.

[0048] In this embodiment, the technical solution automatically generates adaptation code and replaces placeholders based on the interface call plan in the plugin specification and with reference to the main system API definition document. Specifically, the main system API definition document is first loaded and parsed. This document can be in the form of an OpenAPI specification or a type definition file, which can define the complete specifications of all available application interfaces of the main system, including the interface signature, parameter structure, return type, and calling protocol. Next, a full scan of the business logic code is performed to locate the API call placeholders inserted in the previous code generation step. These placeholders can be represented in the code as specific comment markers or general function calls that are not bound to specific implementations. For example, regarding the previously mentioned " / / TODO: Call API to save task", for each placeholder identified by the scan, combined with the clearly defined call intent of the structured interface call plan in the plugin specification, and based on the specific interface specifications provided by the parsed main system API definition document, adaptable code that fully conforms to the main system interface protocol and is syntactically correct can be generated. This adaptable code can be "glue code" that implements specific interface calls, such as replacing the general fetch call with compliant code using the main system's specific module hostApi.httpClient.get, and automatically handling necessary module imports, parameter construction, and error handling mechanisms. Finally, the generated adaptable code accurately replaces the corresponding API call placeholders in the business logic code, thereby completing the binding between the plugin and the main system API, forming a final, runnable, complete code project.

[0049] In an optional embodiment, the step of automatically generating simulated data based on the data structure definition in the plugin specification to automate testing of the plugin functionality in the complete code project may include: The sandbox testing environment provides a simulated main system interface; Using the simulated data and the simulated main system interface, unit tests or end-to-end tests are automatically run; Capture runtime error messages, console logs, and assertion failures for the plugin.

[0050] In this embodiment, a simulated main system interface can be provided in a sandbox testing environment. This sandbox testing environment is a test space isolated from the real main system environment. It simulates various API interfaces provided by the main system (such as data storage interfaces, network request interfaces, user interface containers, etc.), allowing plugins to run securely without touching the real main system and data. These simulated interfaces must comply with the interface protocols and behavioral specifications defined in the main system's API definition document. For example, when a plugin calls the `host.storage.set` method, the simulated interface in the sandbox testing environment will simulate data storage behavior and return a preset response result without actually modifying any persistent data.

[0051] Next, using simulated data automatically generated based on the data structure definitions in the plugin specification, combined with the simulated main system interface, unit tests or end-to-end tests are automatically run. Specifically, the data structures explicitly defined in the plugin specification (e.g., a "Task" object described in JSON Schema format, containing attributes such as "id", "content", and "isDone" and their type constraints) can be parsed, and simulated data instances with reasonableness and diversity can be automatically generated based on these structure definitions. For example, for the string type "content" field, simulated text such as "Example Task Content" may be generated; for the boolean type "isDone" field, two values, true and false, are generated. During the test execution phase, the sandbox testing environment loads this simulated data and runs test cases through an automated testing framework (such as the unit testing framework Jest, or the end-to-end testing tool Playwright). The testing process can simulate real user operation scenarios, such as automatically triggering plugin interface interactions, calling plugin business functions, verifying whether the plugin correctly calls the simulated main system interface according to the functional requirements, and asserting whether the plugin's output results and behaviors meet expectations.

[0052] In optional embodiments, when an error is detected, the following may also be included: The error message, along with the relevant code snippets and the plugin specification, is fed back to the business logic code generation step. The error messages and code snippets are analyzed using an AI model to provide automatic repair suggestions. Based on the auto-repair suggestions, an auto-repair loop is triggered to regenerate and test the repaired code.

[0053] In an optional embodiment, the automatic registration of verified plugins to the main system's plugin marketplace or plugin library may include: The verified plugin package contains all the necessary metadata; After successful verification, the plugin package is uploaded by calling the registration API of the plugin marketplace. The plugins are listed in the plugin marketplace, making them available for end users to search, install, and enable.

[0054] In an optional embodiment, the large language model is a deep learning model based on the Transformer architecture and fine-tuned in the plugin development domain.

[0055] In this embodiment, the large language model used can be a deep learning model based on the Transformer architecture and fine-tuned in the plugin development domain. The core mechanism of the Transformer architecture is multi-head self-attention, which can process all lexical units in the input sequence in parallel and calculate their dependencies. Through this mechanism, the model can effectively capture long-distance semantic relationships in natural language requirements, such as accurately identifying the logical connections between "to-do items" and a series of functionalities like "add," "complete," and "persistent storage." Its calculation process can be represented as follows: Where Q, K, and V represent the query, key, and value matrices, respectively. It is the dimension of the key vector. This architectural feature enables the model to excel at understanding user needs with complex contextual relationships.

[0056] It should be noted that, in this embodiment, to enable the model to be more accurately applied to the specific task of plugin generation, the model was further fine-tuned using specialized data from the plugin development field, building upon its general training. Specifically, the fine-tuning process utilized massive datasets of (natural language requirements, plugin specifications) pairs. These datasets contain typical requirement descriptions and corresponding standardized specifications for various plugin development scenarios, allowing the model to deeply understand the specialized terminology, common functional patterns, and main system integration specifications within the plugin development field. After this targeted training, the model can more accurately identify key elements related to plugin development in user input, such as intents like "sidebar," "get data," and "call API."

[0057] like Figure 3 As shown, Figure 3This paper describes the collaborative workflow between the code generator and the interface binding module in an AI-assisted automatic plugin generation device. The input sources for the process consist of two parts: first, a structured specification from the requirements analysis engine, which defines the plugin's functionalities, data model, and interface call plan; and second, a basic engineering skeleton from the plugin template generator, which provides a pre-defined directory structure and configuration files for code generation. The code generator, as the core of process A (business logic generation), automatically generates the plugin's core functional code, such as implementing interface rendering logic and data processing logic, by calling the AI ​​code model and based on the input specification and engineering skeleton. During this process, the code generator inserts explicit API call placeholders at all points requiring interaction with the main system, ultimately outputting an intermediate project containing placeholders but with complete business functionality yet without external interface binding.

[0058] The generated project containing placeholders then enters process B (interface binding), where it is processed by the interface binding module. This module first loads and parses the main system API definition library, which contains the complete specifications of all open interfaces of the main system, such as function signatures, parameters, and protocols. Next, the interface binding module comprehensively scans the incoming code project, accurately locating all API call placeholders inserted in process A. For each identified placeholder, the module automatically generates fully compliant and syntactically correct adaptation layer code based on its semantic context and the interface call plan in the plugin specification, referring to the specific specifications in the main system API definition library.

[0059] The interface binding module replaces the corresponding API call placeholders in the business logic code one by one with the generated, deeply integrated adaptation code. This replacement process ensures that the plugin's calls to the main system's APIs are secure, compliant, and directly executable, thus achieving seamless integration between the plugin and the main system's runtime environment. Ultimately, the interface binding module outputs a deeply bound, complete, and runnable plugin project. This complete project is then passed to the deployment and debugging module for subsequent automated testing, verification, and release processes, thereby completing the end-to-end automated generation from natural language requirements to a deployable plugin.

[0060] Based on the foregoing technical solutions, this invention also provides an AI-assisted automatic plugin generation device, such as... Figure 4 As shown, the device, from a macroscopic perspective, may include the following modules: The requirement receiving module 402 is used to receive user input of plugin function requirements described in natural language. The requirement parsing module 404 is used to perform deep semantic understanding and intent recognition on the plugin functional requirements using a large language model, and to parse the plugin functional requirements into a structured plugin specification, which includes a list of plugin functional points, data structure definition, interface call plan and plugin functional type. The plugin template generation module 406 is used to select an appropriate template from a pre-set plugin framework template library according to the plugin function type in the plugin specification and automatically build the basic engineering skeleton of the plugin. The code generation module 408 is used to call the AI ​​model and automatically generate business logic code containing API call placeholders on the basic engineering skeleton according to the list of function points and data structure definitions in the plugin specification. The interface binding module 410 is used to automatically generate the adaptation code between the plugin and the main system API according to the interface call plan in the plugin specification and with reference to the main system API definition document, and replace the API call placeholder in the business logic code with the adaptation code to form a complete code project. The deployment and debugging module 412 is used to automatically package the complete code project and deploy it to an isolated sandbox testing environment, automatically generate simulated data based on the data structure definition in the plugin specification, perform automated testing on the plugin functions in the complete code project, and capture runtime logs and potential errors. The plugin publishing module 414 is used to automatically register the verified plugins in the main system's plugin marketplace or plugin library after the plugins in the complete code project have been debugged and verified in the sandbox testing environment.

[0061] It should be noted that the above modules are only for illustrating the technical solution of this application from a macro perspective. In the actual design of the technical solution of this application, the functional modules can be developed in other module division forms.

[0062] Those skilled in the art will understand that the modules in the apparatus of the embodiments can be distributed in the apparatus of the embodiments as described in the embodiments, or they can be located in one or more devices different from this embodiment with corresponding changes. The modules of the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0063] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for automatically generating plugins based on AI assistance, characterized in that, The method includes: Receive user input describing plugin functional requirements in natural language; The plugin functional requirements are analyzed using a large language model to perform deep semantic understanding and intent recognition. The plugin functional requirements are then parsed into a structured plugin specification, which includes a list of plugin functional points, data structure definitions, interface call plans, and plugin functional types. Based on the plugin function type in the plugin specification, select the appropriate template from the pre-set plugin framework template library and automatically build the basic engineering skeleton of the plugin. The AI ​​model is invoked to automatically generate business logic code containing API call placeholders on the basic engineering skeleton, based on the list of functional points and data structure definitions in the plugin specification. Based on the interface call plan in the plugin specification and referring to the main system API definition document, the plugin and the main system API adaptation code are automatically generated, and the API call placeholders in the business logic code are replaced with the adaptation code to form a complete code project. The complete code project is automatically packaged and deployed to an isolated sandbox testing environment. Simulated data is automatically generated based on the data structure definition in the plugin specification to perform automated testing on the plugin functions in the complete code project, capturing runtime logs and potential errors. After the plugins in the complete code project have been debugged and verified in the sandbox testing environment, the verified plugins will be automatically registered in the plugin marketplace or plugin library of the main system.

2. The AI-assisted automatic plugin generation method according to claim 1, characterized in that, The method of using a large language model to perform deep semantic understanding and intent recognition on the plugin's functional requirements includes: The plugin functional requirements are preprocessed to remove irrelevant characters and standardize the format, resulting in the modified plugin functional requirements. The modified plugin functional requirements are processed by word segmentation and converted into word sequence; Each word in the word sequence is mapped to a high-dimensional vector using a word embedding model. The high-dimensional vector is input into a large language model that has been fine-tuned for a specific domain for inference. The large language model is guided by prompts to generate structured plugin specifications, which are in JSON or YAML format.

3. The AI-assisted automatic plugin generation method according to claim 1, characterized in that, The plugin functionalities include UI-related, data processing-related, and background task-related types.

4. The AI-assisted automatic plugin generation method according to claim 1, characterized in that, The AI ​​model, based on the list of functional points and data structure definitions in the plugin specification, automatically generates business logic code containing API call placeholders on the basic engineering skeleton, including: Iterate through the list of features in the plugin specification; For each function point in the list of function points, perform task decomposition to identify the required UI components and processing functions; Based on the identified UI components and processing functions, prompts containing technology stack information, file paths, data model definitions, and functional implementation requirements are sent to the AI ​​model to generate corresponding code snippets; The generated code snippet is inserted into the corresponding position in the basic engineering skeleton.

5. The AI-assisted automatic plugin generation method according to claim 1, characterized in that, The process involves automatically generating adaptation code between the plugin and the main system API based on the interface call plan in the plugin specification and referring to the main system API definition document, and replacing the API call placeholders in the business logic code with the adaptation code, including: Load and parse the main system API definition document; Scan the API call placeholders in the business logic code; For the scanned API call placeholders, according to the interface call plan, generate adaptation code that conforms to the main system interface protocol; Replace the API call placeholders in the business logic code with the adaptation code.

6. The AI-assisted automatic plugin generation method according to claim 1, characterized in that, The automatic generation of simulated data based on the data structure definition in the plugin specification to perform automated testing of the plugin functionality in the complete code project includes: The sandbox testing environment provides a simulated main system interface; Using the simulated data and the simulated main system interface, unit tests or end-to-end tests are automatically run; Capture runtime error messages, console logs, and assertion failures for the plugin.

7. The AI-assisted automatic plugin generation method according to claim 6, characterized in that, When an error is caught, it also includes: The error message, along with the relevant code snippets and the plugin specification, is fed back to the business logic code generation step. The error messages and code snippets are analyzed using an AI model to provide automatic repair suggestions. Based on the auto-repair suggestions, an auto-repair loop is triggered to regenerate and test the repaired code.

8. The AI-assisted automatic plugin generation method according to claim 1, characterized in that, The automatic registration of verified plugins to the main system's plugin marketplace or plugin library includes: The verified plugin package contains all the necessary metadata; After successful verification, the plugin package is uploaded by calling the registration API of the plugin marketplace. The plugins are listed in the plugin marketplace, making them available for end users to search, install, and enable.

9. The AI-assisted automatic plugin generation method according to claim 1, characterized in that, The large language model is a deep learning model based on the Transformer architecture and fine-tuned in the field of plugin development.

10. An AI-assisted automatic plugin generation device, characterized in that, The device includes: The requirement receiving module is used to receive user input describing plugin function requirements in natural language. The requirement parsing module is used to perform deep semantic understanding and intent recognition on the plugin functional requirements using a large language model, and parse the plugin functional requirements into a structured plugin specification, which includes a list of plugin functional points, data structure definitions, interface call plans and plugin functional types. The plugin template generation module is used to select a suitable template from the pre-set plugin framework template library according to the plugin function type in the plugin specification and automatically build the basic engineering skeleton of the plugin. The code generation module is used to call the AI ​​model and automatically generate business logic code containing API call placeholders on the basic engineering skeleton based on the list of function points and data structure definitions in the plugin specification. The interface binding module is used to automatically generate adaptation code between the plugin and the main system API based on the interface call plan in the plugin specification and with reference to the main system API definition document, and replace the API call placeholders in the business logic code with the adaptation code to form a complete code project; The deployment and debugging module is used to automatically package and deploy the complete code project to an isolated sandbox testing environment, automatically generate simulated data based on the data structure definition in the plugin specification, perform automated testing on the plugin functions in the complete code project, and capture runtime logs and potential errors. The plugin publishing module is used to automatically register verified plugins in the main system's plugin marketplace or plugin library after they have been debugged and verified in the sandbox testing environment.