A resource protocol instant generation method, a generation system and a storage medium

By using an on-demand generation paradigm and a multi-agent collaborative architecture, resource protocols with minimal context are dynamically generated and assembled, solving the problems of resource waste, low generation quality, and slow response in existing technologies, and achieving efficient and accurate resource generation and system scalability.

CN123137740APending Publication Date: 2026-11-20BEIJING BAILONG MAYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611090598.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing technologies suffer from resource waste, low generation quality, slow response, and poor scalability when generating resource definitions, especially in recursive nested structures where it is difficult to guarantee the completeness and accuracy of the generated results.

Method used

Employing a Just-In-Time (JIT) paradigm, this approach dynamically generates and assembles resource protocols with minimal context through a declarative resource dependency model and a multi-agent collaborative architecture. This includes intent understanding, task determination, parallel execution, protocol fusion, and recursive processing, ensuring the accuracy of the generated protocols and the scalability of the system.

Benefits of technology

It significantly reduces resource consumption and costs, improves generation speed and user experience, ensures the accuracy and completeness of generated results, and achieves modularity and horizontal scalability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123137740A_ABST
    Figure CN123137740A_ABST
Patent Text Reader

Abstract

The application discloses a resource protocol instant generation method, a generation system and a storage medium, belongs to the technical field of artificial intelligence assisted programming, and aims to solve the problems of context resource waste, generation quality decline and large response delay caused by preloading full or coarse-grained resource definitions in the prior art. The method comprises the following steps: receiving and processing a natural language instruction to output a structured intent description; querying a predefined declarative resource dependency model based on the intent to determine a plurality of subtasks; executing the subtasks in parallel by a plurality of independent domain expert protocol agents to generate partial resource protocols respectively responsible for; according to a preset fusion rule, integrating the plurality of partial resource protocols into a unified resource protocol; and taking the unified resource protocol as a precise context to construct a prompt for sending to a generative artificial intelligence model. The application can significantly reduce the Token cost of AI generation service, improve the response speed and generation quality, and enhance the scalability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of low-code / no-code development platforms and AI-assisted programming technology, specifically to a method, system, and storage medium for real-time generation of resource protocols. Background Technology

[0002] As generative AI models become more powerful, modern low-code development platforms are moving towards directly generating complex applications through natural language descriptions. In this scenario, to generate a specific user interface component or business logic, the AI ​​model needs to understand all possible configurations of the resource, which are typically represented by a structured resource definition protocol (Schema).

[0003] Currently, the main technologies for providing resource definition information to generative AI models adopt a "full or coarse-grained preloading" approach. One mainstream approach is to serialize the entire component library's type definitions, API documentation, etc., during session initialization to form a large, fixed prompt template, which is then sent to the model along with the user's commands. Another slightly optimized approach is to match a pre-defined resource category based on keywords in the user's commands and then load all definitions for all resources within that category.

[0004] However, the aforementioned existing technical solutions have significant drawbacks. First, when a user only needs to generate a simple resource, the system loads a large number of irrelevant resource definitions, resulting in a serious waste of context resources and high service costs based on token billing. Second, excessively long contexts can easily lead to model attention decay, creating "illusions" by incorrectly using the attributes of resource A for resource B or ignoring dependencies between key attributes, resulting in unusable and low-quality generated results. Furthermore, loading and transmitting massive amounts of context information leads to significant system response latency and long user wait times, failing to meet the development needs of real-time interaction. Simultaneously, any update or addition to a resource definition requires modifying and retesting the entire large prompt template, resulting in poor system scalability and high maintenance costs. For complex, recursively nested structures such as "forms embedded in tables, tables embedded in selectors," existing solutions also struggle to guarantee that inner resources correctly obtain the specific protocols required by their context, leading to incomplete generated results or runtime errors. Summary of the Invention

[0005] To address the technical problems of resource waste, low generation quality, slow response, and poor scalability in the aforementioned background technologies, this invention provides a resource protocol instant generation method, generation system, and storage medium. The aim is to dynamically, accurately, and completely generate resource definition protocols that meet current needs with minimal context resource consumption, while ensuring the accuracy of the generation and the scalability of the system.

[0006] This invention provides a method for real-time generation of resource protocols, comprising: Receive and process natural language instructions to generate structured intent descriptions; Based on the structured intent description query, a predefined declarative resource dependency model is used to determine multiple subtasks for generating the protocol; wherein, the declarative resource dependency model is used to describe the attributes of the target resource and the dependencies between the attributes, and the subtasks correspond one-to-one with the attributes of the target resource; The multiple subtasks are executed in parallel, generating the respective portions of the resource protocol that each task is responsible for. According to preset fusion rules, the multiple partial resource protocols are integrated into a unified resource protocol; When a hierarchical resource reference to other resources is detected in the unified resource protocol, the query, generation, and integration process of the protocol is recursively executed with the referenced resource as the new target. Using the Uniform Resource Protocol as context, and combining it with the natural language instructions, a prompt is constructed to be sent to the generative artificial intelligence model.

[0007] This Just-In-Time (JIT) paradigm replaces the traditional Ahead-of-Time (AOT) model, thereby enabling precise control over contextual resources.

[0008] Optionally, the declarative resource dependency model is a component protocol dependency graph, which is a directed acyclic graph. Nodes in the graph represent resource attributes or sub-protocols, edges represent dependencies, and nodes are marked with attributes of different priorities, and include conditional dependency rules. This structured metadata makes dependency management clearer and more maintainable.

[0009] Furthermore, the attributes with different priorities include frequently used "hot" attributes and infrequently used "cold" attributes; querying the declarative resource dependency model includes: prioritizing the hot attributes as the protocol content to be generated. By distinguishing the priorities of attributes, the system can prioritize the generation of core functional protocols, achieving rapid response.

[0010] In one implementation, the parallel execution of the multiple subtasks includes: generating a portion of the resource protocol each is responsible for by protocol proxies of multiple independent domain experts, wherein the protocol proxies include at least two of the following: core attribute proxies, data protocol proxies, style proxies, event proxies, and container proxies. This multi-proxygent collaborative architecture decouples the complex generation tasks, improving the modularity and processing efficiency of the system.

[0011] Optionally, the recursive execution of the protocol's query, generation, and integration processes further includes: preventing circular dependencies through a hierarchical locking mechanism and ensuring the termination of the recursive process through a depth-limiting mechanism. These mechanisms guarantee the stability and reliability of the system when dealing with complex nested structures.

[0012] Furthermore, the preset fusion rules include at least one of the following: merging sibling attributes of multiple partial resource protocols, resolving attribute conflict overriding according to preset priority rules, and combining one partial resource protocol as a substructure of another. These rules ensure that protocol fragments generated by different proxies can be correctly integrated into a consistent and complete unified protocol.

[0013] In one implementation, the method further includes: prioritizing the generation and delivery of a protocol containing core attributes, followed by incremental delivery and enhancement into a complete Uniform Resource Protocol. This strategy significantly improves the user experience, allowing users to see initial results and interact more quickly.

[0014] Optionally, the structured intent description includes at least one of the target resource type, functional requirements, and constraints, providing explicit input for subsequent precise protocol generation.

[0015] The present invention also provides a resource protocol real-time generation system, comprising: The intent understanding module is used to receive and process natural language instructions, and generate a structured intent description. The task determination module is used to query a predefined declarative resource dependency model based on the structured intent description to determine multiple subtasks for generating the protocol; wherein, the declarative resource dependency model is used for the attributes of the target resource and the dependency relationships between the attributes, and the subtasks correspond one-to-one with the attributes of the target resource; The task execution module is used to execute the multiple sub-tasks in parallel and generate the resource protocols that each is responsible for. The protocol fusion module is used to integrate the multiple partial resource protocols into a unified resource protocol according to preset fusion rules. The recursive processing module is used to recursively execute the query, generation, and integration process of the protocol, taking the referenced resource as the new target, when the unified resource protocol is detected to contain hierarchical resource references to other resources. The prompt construction module is used to combine the Uniform Resource Protocol as context with the natural language instructions to construct a prompt for sending to a generative artificial intelligence model.

[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the resource protocol real-time generation method as described above.

[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. Significantly reduced resource consumption and costs: By using an instant protocol generation paradigm and attribute-level precise loading, resource protocols are dynamically compiled only at runtime based on current needs, completely avoiding the loading of irrelevant resources. This significantly reduces the context consumption sent to generative AI models, thereby lowering the operating costs of AI services.

[0018] 2. Significantly improved generation speed and user experience: Through parallelized agent scheduling and precise context provisioning, system response time has been reduced from seconds to milliseconds, providing users with a near real-time interactive experience. Combined with an incremental delivery strategy, users can see usable results much faster.

[0019] 3. Significantly improved generation quality: Due to the precise and concise context provided to the model, the "illusion" phenomenon of the model is greatly reduced, and the accuracy and usability of the generated results are significantly improved. The recursive protocol acquisition mechanism ensures the integrity and correctness of the protocol in complex nested scenarios.

[0020] 4. Fundamentally improved system scalability and maintainability: System resource consumption and response time are decoupled from the total size of the resource repository. The multi-agent collaboration architecture decouples protocol generation responsibilities by domain. Adding or modifying resources only requires updating their independent dependency models and corresponding agents, without affecting the global scope, achieving true modularity and horizontal scalability. Attached Figure Description

[0021] Figure 1 A flowchart illustrating the steps of the resource protocol real-time generation method provided in this embodiment of the invention.

[0022] Figure 2 This is a flowchart illustrating the resource protocol real-time generation method provided in an embodiment of the present invention.

[0023] Figure 3 This is a module composition diagram of the resource protocol real-time generation system provided in an embodiment of the present invention.

[0024] Figure 4 This is a flowchart illustrating the incremental delivery strategy provided in an embodiment of the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0026] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0027] This invention aims to address the problems of wasted context resources, low generation quality, high response latency, and poor scalability in existing technologies for code or configuration generation using generative artificial intelligence models. Its core idea is to abandon the "Ahead-of-Time" (AOT) model, which preloads all or coarse-grained resource definitions, and instead adopts a "Just-In-Time" (JIT) paradigm. This paradigm dynamically and precisely generates and assembles the minimum required resource protocols only at runtime, based on the user's specific and immediate needs, thereby providing a highly optimized and non-redundant context for the generative artificial intelligence model. To achieve this, this invention introduces a series of key concepts, including a declarative resource dependency model, a domain expert protocol proxy cluster, and hierarchical resource referencing and recursive processing mechanisms, which will be further explained in subsequent sections.

[0028] In the description of this invention, the core terms involved in the solution are first defined. A resource protocol refers to structured information provided to enable generative artificial intelligence models to understand and generate specific resources (such as UI components, API interfaces, etc.). Its content may include resource attributes, methods, events, styles, data structures, etc. A declarative resource dependency model is a key data structure in this invention. It is a predefined data model used to describe the various attributes of a target resource and the dependencies between attributes. This model declares, in a machine-readable manner, what protocol content is needed under what conditions, serving as the basis for on-demand generation and dynamic assembly. A component protocol dependency graph is a preferred implementation of the declarative resource dependency model. It adopts the form of a directed acyclic graph (DAG) to more intuitively represent the dependencies, combinations, and conditional triggering relationships between attributes. Domain expert protocol proxies refer to a series of independent, autonomous processing units responsible for generating or calculating protocol fragments specific to a particular domain. For example, some proxies are specifically responsible for core attributes, while others are specifically responsible for data-related protocols. Hierarchical resource referencing refers to a situation where a resource protocol references another independent resource, such as a form protocol referencing a form component, thus forming a nested or hierarchical structure.

[0029] This embodiment details the execution process of the resource protocol real-time generation method. (Refer to...) Figure 1 and Figure 2 As shown, taking the user's natural language command "Help me generate a data entry form containing a tree selector" as an example, the method includes the following steps: Step S10: Receive and process natural language instructions to output a structured intent description.

[0030] This embodiment receives a user's natural language instruction, performs semantic analysis on the instruction, identifies the user's core intent, and converts it into a structured intent description. For the instruction in this example, the generated structured intent description will explicitly state: the target resource type is "Form," which contains a hierarchical resource reference to a "TreeSelect," and the functional requirement is "data entry." This structured intent description includes at least one of the following: target resource type, functional requirement, and constraints, providing precise input for subsequent steps.

[0031] Step S20: Based on the structured intent description, query the predefined declarative resource dependency model to determine multiple subtasks for generating the protocol.

[0032] This step, based on the structured intent description generated in the previous step, queries the declarative resource dependency model of the target resource "form". In this embodiment, the model is a Component Protocol Dependency Graph (CPDG), which is a directed acyclic graph where nodes represent resource attributes or sub-protocols, and edges represent dependencies. Nodes are labeled with attributes of different priorities, such as frequently used hot attributes (e.g., the form's layout) and infrequent or conditionally triggered cold attributes. During the query, the system first determines the "hot attribute" content that needs to be generated. Simultaneously, based on the "data entry" requirement and the nested information of "containing tree selectors" in the intent description, the system matches the preset conditional dependency rules in the CPDG to determine the sub-tasks related to activating data protocols and container protocols. Finally, the complex protocol generation task is decomposed into multiple explicit sub-tasks, such as generating core attribute protocols, generating data-related protocols, and generating container layout protocols. It is evident that each sub-task corresponds one-to-one with the attributes of the target resource, i.e., the represented sub-protocols.

[0033] Step S30: Execute multiple subtasks in parallel to generate the respective portions of the resource protocol.

[0034] The multiple subtasks identified in the previous step are assigned to several independent domain expert protocol agents, which work in parallel. Specifically, the Core Agent is responsible for generating some resource protocols for basic attributes such as form layout; the Data Agent is responsible for generating some resource protocols related to data binding and validation rules; and the Container Agent is responsible for generating some resource protocols related to the layout used to contain sub-components. This parallel execution method significantly reduces the total time for protocol generation.

[0035] Step S40: According to the preset fusion rules, integrate multiple partial resource protocols into a unified resource protocol.

[0036] The fusion rules include at least one of the following: merge, override, or combine. In this example, the "merge" operation is performed first, aggregating sibling attributes generated by the three proxies into the same protocol object. If attribute conflicts exist, the "override" operation is performed, resolving the conflicts according to preset priority rules (e.g., data protocols have higher priority than core attributes). This ultimately forms a preliminary unified resource protocol for the "form".

[0037] Step S50: When a hierarchical resource reference to other resources is detected in the unified resource protocol, the query, generation and integration process of the protocol is recursively executed with the referenced resource as the new target.

[0038] When a hierarchical resource reference to a "TreeSelect" is detected in the form protocol generated in the previous step, a recursive process is triggered. Steps S20 to S40 are repeated, using the "TreeSelect" as the new target resource, to generate a dedicated Uniform Resource Protocol (URL). The TreeSelect's CPDG also defines its hot attributes (such as 'treeData' and 'value') and cold attributes with activation conditions (such as 'multiple' and 'treeCheckable'). To ensure the stability and safety of the recursive process, a hierarchical locking mechanism is used to prevent circular dependencies, and a depth constraint mechanism ensures that the recursive process will always terminate. The recursively generated TreeSelect protocol is ultimately integrated into the form's URL as a substructure through a "composition" rule.

[0039] Step S60: Combine the Uniform Resource Protocol as context with natural language instructions to construct a prompt to be sent to the generative artificial intelligence model.

[0040] The final generated, nested, and complete Uniform Resource Protocol (URI) is used as the core context and combined with the user's original natural language command, "Generate a data entry form with a tree selector," to construct the final prompt. This precise and concise prompt is then sent to a generative AI model to generate high-quality final code.

[0041] This invention also includes a resource protocol real-time generation system, as described in the embodiments of the present invention. Figure 3 As shown, the system includes: The intent understanding module 10 is used to implement step S10 in the above method embodiment, that is, to receive and process the user's natural language instructions to output a structured intent description.

[0042] The task determination module 20 is used to implement step S20 in the above method embodiment. Based on the intent description output by the intent understanding module 10, this module queries the internally stored declarative resource dependency model (such as CPDG) to decompose a complex protocol generation task into multiple independent subtasks.

[0043] The task execution module 30 is used to implement step S30 in the above method embodiment. This module is typically represented as a cluster of multiple domain expert protocol proxies, which, under the unified scheduling of the system, execute multiple sub-tasks decomposed by the task determination module in parallel to efficiently generate the resource protocols they are responsible for.

[0044] The protocol fusion module 40 is used to implement step S40 in the above method embodiment. This module integrates multiple heterogeneous partial resource protocols output by the task execution module 30 into a unified, complete and consistent resource protocol according to preset fusion rules.

[0045] The recursive processing module 50 is used to implement step S50 in the above method embodiment. This module is responsible for detecting hierarchical resource references in the unified resource protocol, and triggering a new round of protocol query, generation and integration process with the referenced resource as the new target. At the same time, the security of recursion is ensured through mechanisms such as hierarchical locking and depth restriction.

[0046] The prompt construction module 60 is used to implement step S60 in the above method embodiment. This module takes the final unified resource protocol output by the protocol fusion module 40 as the precise context and combines it with the user's original natural language instructions to construct the final prompt to be sent to the generative artificial intelligence model.

[0047] All the above modules work together under the coordination of a core control center (which may be called the Dynamic Protocol Orchestration System DPOS in some implementations) to complete the real-time generation of resource protocols.

[0048] To further optimize the user experience, the method and system of this invention can also employ a progressive delivery strategy, such as... Figure 4 As shown, this strategy breaks down the protocol delivery and front-end rendering process into multiple stages: Phase 1: Skeleton Response (T1, 0-100ms). After the user issues a command, the system only completes intent parsing and immediately returns a skeleton UI to the user interface, allowing the user to immediately perceive that the system has responded.

[0049] Phase Two: Core Protocol Rendering (T2, 300-800ms). The system prioritizes subtasks related to "hot attributes" and quickly merges them to generate a basic version of the Unified Resource Protocol containing only core attributes. This protocol is immediately used to construct prompts and send them to the generative AI model, generating a prototype component with basic interactive capabilities.

[0050] Phase 3: Full Protocol Enhancement (T3, 1-2s). The system continues to execute subtasks related to "cold attributes" and nested resources, generating incremental partial resource protocols. These protocols are used to enhance existing unified resource protocols and interact again, or streamed, with the generative AI model to refine and enhance previously generated components, populating them with advanced functionality and complete content.

[0051] In this way, the user experience changes from "seeing the result all at once after waiting" to a smooth process of "instant response, rapid availability, and gradual enhancement".

[0052] The present invention also provides an electronic device, which may be a server, a personal computer, a mobile terminal, etc. The electronic device includes at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the resource protocol real-time generation method as described in any of the foregoing method embodiments.

[0053] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program is capable of implementing the steps of the resource protocol on-the-fly generation method as described in any of the foregoing method embodiments. The computer-readable storage medium can be any type of storage device, including but not limited to read-only memory (ROM), random access memory (RAM), solid-state drive (SSD), optical disk, or magnetic tape.

[0054] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for real-time generation of resource protocols, characterized in that, include: Receive and process natural language instructions to generate structured intent descriptions; Based on the structured intent description query, a predefined declarative resource dependency model is used to determine multiple subtasks for generating the protocol; wherein, the declarative resource dependency model is used to describe the attributes of the target resource and the dependencies between the attributes, and the subtasks correspond one-to-one with the attributes of the target resource; The multiple subtasks are executed in parallel, generating the respective portions of the resource protocol that each task is responsible for. According to preset fusion rules, the multiple partial resource protocols are integrated into a unified resource protocol; When a hierarchical resource reference to other resources is detected in the unified resource protocol, the query, generation, and integration process of the protocol is recursively executed with the referenced resource as the new target. Using the Uniform Resource Protocol as context, and combining it with the natural language instructions, a prompt is constructed to be sent to the generative artificial intelligence model.

2. The resource protocol real-time generation method according to claim 1, characterized in that, The declarative resource dependency model is a component protocol dependency graph, which is a directed acyclic graph. The nodes of the component protocol dependency graph represent the attributes or sub-protocols of resources, the edges represent dependency relationships, and the nodes are marked with attributes with different priorities and contain conditional dependency rules.

3. The resource protocol real-time generation method according to claim 2, characterized in that, The attributes with different priorities include high-frequency thermal attributes and low-frequency cold attributes; The query of the declarative resource dependency model includes: The thermal properties are prioritized as the protocol content to be generated.

4. The resource protocol real-time generation method according to claim 1, characterized in that, The parallel execution of the multiple subtasks includes: The protocol proxies, each responsible for a portion of the resource protocol, are generated by multiple independent domain experts. These protocol proxies include at least two of the following: core attribute proxies, data protocol proxies, style proxies, event proxies, and container proxies.

5. The resource protocol real-time generation method according to claim 1, characterized in that, The method also includes: preventing circular dependencies through a hierarchical locking mechanism, and ensuring the termination of the recursive process through a depth restriction mechanism.

6. The resource protocol real-time generation method according to claim 1, characterized in that, The preset fusion rules include at least one of the following: merging the same-level attributes of multiple partial resource protocols, resolving attribute conflict coverage according to preset priority rules, and combining one partial resource protocol as a substructure of another.

7. The resource protocol real-time generation method according to claim 1, characterized in that, The method also includes: prioritizing the generation and delivery of a protocol containing core attributes, and then incrementally delivering and enhancing it into a complete unified resource protocol.

8. The resource protocol real-time generation method according to claim 1, characterized in that, The structured intent description includes at least one of the target resource type, functional requirements, and constraints.

9. A resource protocol real-time generation system, characterized in that, include: The intent understanding module is used to receive and process natural language instructions, and generate a structured intent description. The task determination module is used to query a predefined declarative resource dependency model based on the structured intent description to determine multiple subtasks for generating the protocol; wherein the declarative resource dependency model is used to describe the attributes of the target resource and the dependencies between the attributes, and the subtasks correspond one-to-one with the attributes of the target resource; The task execution module is used to execute the multiple sub-tasks in parallel and generate the resource protocols that each is responsible for. The protocol fusion module is used to integrate the multiple partial resource protocols into a unified resource protocol according to preset fusion rules. The recursive processing module is used to recursively execute the query, generation, and integration process of the protocol, taking the referenced resource as the new target, when the unified resource protocol is detected to contain hierarchical resource references to other resources. The prompt construction module is used to combine the Uniform Resource Protocol as context with the natural language instructions to construct a prompt for sending to a generative artificial intelligence model.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-8.