Query function development method and system based on large language model
By enabling architect and engineer agents to work collaboratively, and utilizing pre-built knowledge sources and agent control modules, the problem of code fragmentation in large language models in enterprise-level projects is solved. This achieves efficient and automated code generation and integration, ensuring code quality and compatibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HI-THINK YONDERVISION (BEIJING) TECH CO LTD
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-02
AI Technical Summary
Existing software development models based on large language models are fragmented and have obstacles to implementation in enterprise-level projects. The generated code lacks an understanding of the project context and enterprise development framework, leading to difficulties in code integration and time-consuming adjustments.
The architect's intelligent agent identifies and queries functional requirements, utilizes pre-built knowledge sources and the intelligent agent's main control module to generate code that conforms to enterprise standards, and ensures code quality through static analysis and iterative correction. Combined with the engineer's intelligent agent to simulate the division of labor in a human development team, the code is integrated automatically.
The system achieves end-to-end automated development of the query function from requirements to code, significantly improving development efficiency. The generated code conforms to enterprise standards, requires minimal manual adjustments, and greatly improves code quality and adaptability.
Smart Images

Figure CN122132019A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of large language model development, more specifically, to a query function development method and system based on a large language model. BACKGROUND
[0002] In recent years, artificial intelligence technology represented by generative pre-training large language models (LLM) has made breakthrough progress, and has had a revolutionary impact on the field of software development. The traditional development mode of developers manually writing code to implement functions is gradually shifting to a natural language driven development paradigm. Developers describe the required functions through natural language, call large language model services, and directly generate corresponding code segments by large language models. This mode significantly reduces the technical threshold of function implementation and improves the development efficiency of software basic functions through the end-to-end ability of semantic understanding and code generation.
[0003] The current development mode based on large language model code generation relies on developers to manually design prompts (Prompts), explicitly input task descriptions and basic constraints (such as target programming language), and obtain generated code output by calling large model interfaces. The existing development mode has significant gaps and landing barriers in actual enterprise-level project applications, mainly reflected in: 1) Lack of project context integration: The generated code often lacks necessary understanding of the existing data structure (database table structure, field definition, relationship model) and business knowledge base of the project. The generated code may be syntactically correct, but it may not match the actual database design of the project, conflict with field names, or be unable to utilize existing business logic modules.
[0004] 2) Separation from enterprise development framework: General models lack deep knowledge of enterprise internal private development frameworks, internal libraries, and coding specifications. The generated code may not be seamlessly integrated into the project, may not conform to the best practices of the internal framework, and may require developers to perform extensive manual adjustments, rewriting, and adaptation work, thereby increasing the integration burden and potential risks (such as performance issues, security vulnerabilities).
[0005] To address the above problems, the usual solution is for developers to manually write detailed prompts and perform extensive manual review and modification of the generated code. However, this solution is relatively time-consuming and inefficient, sacrificing the productivity improvement advantage brought by large language models.
[0006] Therefore, there is an urgent need for a software development solution that can seamlessly integrate project development with enterprise development frameworks in actual enterprise-level project applications. SUMMARY
[0007] In view of the above problems, the purpose of this invention is to provide a query function development method and system based on a large language model, so as to solve the problems of disconnection and implementation obstacles that exist in the existing large language model in the software development process due to its separation from enterprise-level projects.
[0008] On the one hand, this invention provides a method for developing query functions based on a large language model, including: The architect's intelligent agent identifies the business entities, query conditions, query result items, and functional characteristics in the query function requirement description to determine the knowledge retrieval keywords. The system retrieves target knowledge data from a pre-built knowledge source based on the knowledge retrieval keywords, and combines the retrieved target knowledge data into a structured task step sequence corresponding to the development process of the query function. The knowledge source includes a development knowledge base and a data standard library. The development knowledge base stores internal software development framework knowledge, development specifications, and code examples, supporting semantic retrieval. The data standard library stores standardized data structures, including data dictionaries, tables, and entity relationships. The structured task step sequence includes the step number, execution role, task description, input source, and output requirements for each atomic task. The main control module of the intelligent agent schedules the corresponding engineer intelligent agents according to the structured task step sequence. Based on the input source of the atomic task, the knowledge search module is called to retrieve relevant knowledge fragments or obtain the output of the previous task and assemble them into context information. Based on the preset prompt word template and the large language model, the engineer intelligent agent generates code fragments according to the context information and the task description and output requirements of the atomic task. The main control module integrates the code snippets generated by each engineer's agent into complete functional code according to a preset project structure template.
[0009] In addition, an optional solution is that after the code snippets generated by each engineer agent are integrated into complete functional code according to a preset project structure template through the agent master control module, the solution further includes: putting the complete functional code into a sandbox environment for static analysis and compilation and verification; wherein, when the verification fails, an iterative correction process is triggered, and the corresponding engineer agent is rescheduled to correct the complete functional code until the verification passes.
[0010] Alternatively, the static analysis can be performed using a code quality scanning tool to check whether the code conforms to coding standards and whether there are security vulnerabilities; the compilation and building can be performed using a project build tool to verify the correctness of the code syntax and the completeness of dependencies.
[0011] Alternatively, the data dictionary can be used to describe data elements in the system, the database table can be used to define specific database table structures, the fields in the database table structure can be generated by referencing the data dictionary, and the entity relationship can be used to clarify the business relationships between tables.
[0012] Alternatively, the architect agent is based on a general large language model and uses preset prompt word templates to achieve semantic parsing of requirements and identification of elements. The structured task step sequence is JSON format data, and the input sources include the development knowledge base, the data standard library, and the output of the preceding tasks.
[0013] Alternatively, the engineer agent may include a database engineer agent, a front-end development engineer agent, and a back-end development engineer agent. Each engineer agent is configured with a unique prompt word template and domain knowledge. The prompt word template includes role definition, available data structures, task description, and output requirements.
[0014] Alternatively, the agent control module can manage engineer agent instances through an agent object pool and store atomic task output results through a task output bus; wherein the agent object pool uses "engineer agent name-agent object" key-value pairs for storage; and the task output bus uses "atomic task step number-output content" key-value pairs for storage.
[0015] On the other hand, this invention also provides a query function development system based on a large language model, including a knowledge search module, an engineer intelligent agent, an architect intelligent agent, and an intelligent agent control module; wherein, The knowledge search module is used to retrieve target knowledge data from pre-built knowledge sources based on knowledge retrieval keywords; The architect agent is used to identify business entities, query conditions, query result items, and functional features in the query function requirement description to determine knowledge retrieval keywords; and to combine the target knowledge data retrieved by the knowledge search module into a structured task step sequence corresponding to the development process of the query function; wherein the structured task step sequence includes the step number, execution role, task description, input source, and output requirements of each atomic task. The intelligent agent main control module is used to schedule the corresponding engineer intelligent agents to generate code snippets according to the structured task step sequence; and to integrate the code snippets generated by each engineer intelligent agent into complete functional code according to the preset project structure template. The engineer agent is used to retrieve relevant knowledge fragments or obtain the output of the preceding task by calling the knowledge search module according to the input source of the atomic task, and assemble them into context information; and generate code fragments based on the context information and the task description and output requirements of the atomic task according to the preset prompt word template and the large language model.
[0016] On the other hand, the present invention also provides an electronic device, the electronic device including a memory, a processor, and a query function development program based on a large language model stored in the memory and executable on the processor, wherein the query function development program based on a large language model, when executed by the processor, implements the query function development method based on a large language model as described above.
[0017] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the query function development method based on a large language model as described above.
[0018] This invention utilizes multiple collaborative intelligent agents to simulate the division of labor and cooperation among human developers, achieving end-to-end automated development of query functions from requirement description to production-ready code. This ensures that the generated code conforms to enterprise development standards and adapts to existing data structures. Compared to existing technologies, it offers the following advantages: 1. Significantly improved development efficiency: Enables end-to-end automated development of the query function from requirements to code, shortening the development cycle from several days to several hours, and greatly reducing labor costs; 2. Strong code adaptability: It provides enterprise-specific context through dual knowledge bases, and the generated code conforms to internal development specifications and adapts to existing data structures, so that it can be integrated without a lot of manual adjustment; 3. Guaranteed code quality: Automated verification and iterative correction loop reduces the risk of syntax errors, security vulnerabilities, and code violations, increasing the code pass rate to over 90%; 4. Good scalability: The dual knowledge bases support dynamic updates, and the engineer intelligent agent can add roles as needed to adapt to the development needs of different types of query functions; 5. Lowered technical barriers to software development: Developers do not need to have in-depth knowledge of framework details and coding standards; they only need to describe their requirements in natural language to obtain production-ready code, thus expanding the scope of technology application.
[0019] To achieve the foregoing and related objectives, one or more aspects of the invention include the features which will be described in detail below and specifically pointed out in the claims. The following description and accompanying drawings illustrate certain exemplary aspects of the invention. However, these aspects indicate only a few of the various ways in which the principles of the invention can be used. Furthermore, the invention is intended to include all such aspects and their equivalents. Attached Figure Description
[0020] Other objects and results of the invention will become more apparent and readily understood with reference to the following description taken in conjunction with the accompanying drawings and the contents of the claims, and with a more complete understanding of the invention. In the drawings: Figure 1 This is a schematic diagram of the development process of a query function based on a large language model according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the framework structure of a query function development system based on a large language model according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the development process of the query function according to an embodiment of the present invention; Figure 4 A schematic diagram of the system architecture for a query function development system based on a large language model according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the overall operation process of the query function development method based on a large language model according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the logical structure of an electronic device for implementing a query function development method based on a large language model according to an embodiment of the present invention.
[0021] In all the accompanying drawings, the same reference numerals indicate similar or corresponding features or functions. Detailed Implementation
[0022] In the following description, numerous specific details are set forth for illustrative purposes and to provide a thorough understanding of one or more embodiments. However, it will be apparent that these embodiments may also be implemented without these specific details. In other instances, well-known structures and devices are shown in block diagram form for ease of description of one or more embodiments.
[0023] To address the problem of disconnect between the code generated by the large language model and the enterprise-level project context in traditional software development methods that rely on large language models, this invention provides a query function development solution based on large language models, which achieves automated and standardized development of query functions through multi-dimensional innovation.
[0024] Figure 1 This paper illustrates a method flow for developing a query function based on a large language model according to an embodiment of the present invention. Figure 2 This paper illustrates the framework structure of a query function development system based on a large language model according to an embodiment of the present invention. Figure 3 The development process of the query function according to an embodiment of the present invention is shown; Figure 4 The system architecture of a query function development system based on a large language model according to an embodiment of the present invention is shown. Combined with...Figures 1 to 4 As shown in the figure, the query function development scheme based on a large language model provided by this invention comprises four core modules: a knowledge search module 210, an architect agent 220, an engineer agent 230, and an agent control module 240. These modules work together to automate the development of the query function. Each module in this invention can also be called a unit, referring to a series of computer program segments that can be executed by the processor of an electronic device and perform a fixed function, stored in the memory of the electronic device. The query function development method based on a large language model implemented through the above four modules mainly includes... Figure 1 The following steps are shown: S110: Use the architect's intelligent agent to identify business entities, query conditions, query result items, and functional characteristics in the query function requirement description to determine knowledge retrieval keywords; S120: Retrieve target knowledge data from the pre-built knowledge source based on the knowledge retrieval keywords, and combine the retrieved target knowledge data into a structured task step sequence corresponding to the development process of the query function.
[0025] To ensure that the generated code conforms to enterprise development standards and adapts to existing data structures, the pre-built knowledge source in this invention provides a dual-drive mode for an enterprise-level knowledge base. This means the pre-built knowledge source includes a development knowledge base and a data standard library. Through retrieval-enhanced generation technology, contextual information such as enterprise-specific framework specifications, code templates, and data structures is dynamically injected into the code generation process, ensuring that the generated code conforms to enterprise engineering standards and can be directly integrated into existing projects. Specifically, the development knowledge base stores internal software development framework knowledge, development standards, and code examples, supporting semantic retrieval; the data standard library stores standardized data structures, including data dictionaries, tables, and entity relationships; and the structured task step sequence includes the step number, execution role, task description, input source, and output requirements for each atomic task.
[0026] S130: The main control module of the intelligent agent schedules the corresponding engineer intelligent agents according to the structured task step sequence, so as to call the knowledge search module to retrieve relevant knowledge fragments or obtain the output of the previous task according to the input source of the atomic task, and assemble them into context information; based on the preset prompt word template and the large language model, the engineer intelligent agent generates code fragments according to the context information and the task description and output requirements of the atomic task. S140: The main control module of the intelligent agent integrates the code fragments generated by each engineer intelligent agent into complete functional code according to the preset project structure template.
[0027] The above method and process will be explained in detail below with reference to specific system modules.
[0028] like Figure 2 As shown, the knowledge search module 210 is used to retrieve target knowledge data from a pre-built knowledge source based on knowledge retrieval keywords. The knowledge search module of this invention is built upon knowledge sources and can retrieve knowledge sources based on keywords. It employs vector similarity search combined with keyword filtering to return knowledge fragments highly relevant to the keywords, ensuring the accuracy of subsequent agent operations. The knowledge source comprises two parts: a development knowledge base and a data standard library. The knowledge search module provides knowledge services through these two core data sources.
[0029] The development knowledge base employs a distributed vector storage system to store the enterprise's internal software development framework knowledge, development standards (such as coding style, security rules, and performance requirements), and code examples. The knowledge base supports semantic retrieval, allowing agents to quickly search for relevant best practices. For example, when adding a new query function requirement, the knowledge base can provide code templates and design patterns for similar functionality as a development foundation, ensuring that the code generated by subsequent automation steps meets the enterprise's engineering requirements. The data standards library stores standardized data structures, including data dictionaries, tables, and entity relationships.
[0030] Specifically, as an example, the process of building a development knowledge base includes: a) Technical Documentation Input: Receive internal enterprise technical documents (such as the "Pagination Query Development Specification", which includes text descriptions, code examples, configuration instructions, etc.); b) Semantic parsing: By reading the document titles and content of internal technical documents, a large language model is invoked to perform deep semantic analysis on the documents, generating core semantic summaries, such as "This document describes the standard method for implementing database pagination queries using the PageHelper component under the Spring Boot and MyBatis framework." and automatic tags, such as [Pagination Query], [Backend Development], [Code Style Guide]; c) Knowledge Unit Segmentation: By calling the large language model, the document is broken down into atomic, independently reusable knowledge fragments based on its structure and semantics, such as principle descriptions, code templates, and development specifications; In one specific embodiment of the present invention, knowledge is divided into the following five units: c-1) UNIT_001 - Principle: Three-layer architecture for paginated queries (Controller receives parameters -> Service calls pagination plugin -> Mapper executes SQL); c-2) UNIT_002 - Code Template 1: Code example for the Controller layer, showing how to define the pagination interface and parameter validation; c-3) UNIT_003 - Code Template 2: Code example for the Service layer, focusing on the call to PageHelper.startPage(pageNum, pageSize); c-4) UNIT_004 - Code Template 3: How to write the SQL mapping file (Mapper.xml) for paginated queries in MyBatis; c-5) UNIT_005 - Development Guidelines: For example, avoid using SELECT statements when writing SQL. wait.
[0031] d) Vectorization: Each segmented knowledge unit (e.g., the Controller code template for UNIT_002) is vectorized using a text embedding model (e.g., Sentence-BERT) to convert the text content of each knowledge unit into a high-dimensional vector. After vectorization, each knowledge unit obtains a unique vector representing its semantics. Units with similar semantics have vectors that are closer together in space. For example, units about "pagination" and units about "list query" will have high vector similarity.
[0032] e) Indexing and Tag Construction: Store the vectors of all knowledge units in a vector database (such as PGVector), build an HNSW algorithm index, and simultaneously construct a "tag-knowledge unit" inverted index to support fast retrieval. Specifically, as an example, the vector database uses an algorithm similar to HNSW to build its index, enabling the system to quickly find the few knowledge units most similar to the query question from a massive amount of vectors; at the same time, establish a "tag -> knowledge unit" mapping relationship, for example: tag [pagination query] -> [UNIT_001, UNIT_002, ...], tag [code style] -> ...
[0033] [UNIT_002, UNIT_003, UNIT_004] is an inverted index. When users filter by tags, they can quickly locate all relevant documents.
[0034] After completing the above steps, the original document becomes a series of knowledge units in the knowledge base with rich tags and vector representations.
[0035] To build a data standard library, data structure design needs to be systematized to form a unified data standard. This involves defining the core elements of the data structure, including entities, fields, data types, constraints, and relationships between entities. These standardized data structures (including table names, field names, data types, lengths, constraints, comments, and relationship models between tables) are then fully stored in a structured database.
[0036] Specifically, as an example, the process of building a data standard library can sequentially include building a data dictionary, defining database tables, and defining relationships. A development platform should be established, providing a visual interface for developers to input and maintain these definitions via forms. During the process of developers inputting and maintaining definitions, they are prohibited from arbitrarily defining table structures, fields, and data types in the code. When version control is implemented for changes to the data dictionary and table structures, the reason, time, and responsible person for each change should be recorded. The development platform must include functions for defining the data dictionary, defining database tables, and defining entity relationships.
[0037] The data dictionary is used to describe the data elements in the system. Specifically, as an example, a data dictionary definition might include the following fields: A1) Dictionary name: Unique identifier (English, such as user_status); A2) Dictionary description: Business meaning (in Chinese, such as user account status); A3) Data type: Select from the preset list (such as fixed-length character, variable-length character, integer, number, date and time, enumeration, etc.); A4) Data length / precision: determined according to data type; A5) Default value: Optional; A6) Enumeration value definition: When the data type is "enumeration", define all possible values and their business meanings; A7) Data dictionary types: public data dictionary and general data dictionary. The public data dictionary is used to define the most basic, core data standards within an enterprise that are widely shared across multiple business domains, such as: status identifier (state), yes / no identifier (yn_flag), and name (name); the general data dictionary is used to define data standards, task status (task_status), and account status (account_status) based on the public data dictionary or independently defined for use in specific business domains or systems.
[0038] A8) References: Ordinary data dictionaries can reference public data dictionaries, establishing an "inheritance" relationship. For example, defining a public data dictionary `[state]` (1 - enabled, 0 - disabled), when defining `[task_state]`, `[state]` can be referenced. `[task_state]` can then inherit the data type, data length, and enumeration value definitions. All fields involving "state" in business operations must reference the `[state]` data dictionary, fundamentally eliminating the confusion of "using 1 / 0 for task status and Y / N for account status".
[0039] The following table shows an example of a user entering two data dictionaries:
[0040] It provides a database table definition function, which is used to design database tables and enter the fields to be stored and related constraints.
[0041] Database table definitions are used to define the specific database table structure. Specifically, as an example, a database table definition may include the following fields: B1) Table name: e.g., user; B2) Database and table descriptions: such as user basic information table; B3) Field List: Fields are not freely entered but referenced from the data dictionary. The system provides a drop-down list for developers to select from the predefined data dictionary. Field names, descriptions, data types, lengths, and precisions are all synchronized from the data dictionary, eliminating the need for redefinition. This ensures the standardization of table structures. When the data dictionary length or enumeration value is updated, the structure of all tables referencing that dictionary is also updated synchronously to guarantee consistency. B4) Constraints: These are validation rules for database table fields to determine whether a field is not null, including not null constraints, etc. B5) Index: Define the index name, index fields, and index type (unique / non-unique).
[0042] Relationship definitions are used to clarify the business relationships between database tables. In this invention, relationship definitions are crucial for the architect's intelligent agent to understand the business logic and generate correct relational queries. Specifically, as an example, a relationship definition may include the following fields: C1) Relationship name: e.g., user-organization; C2) Main table: e.g., user; C3) From the table: such as organization; C4) Association types: one-to-one, one-to-many, many-to-one; C5) Related fields: such as user.org_id->organization.id.
[0043] The following table shows an example of the relationship between a user entry table and an organization table:
[0044] Once the knowledge source is constructed, target knowledge data can be retrieved from the constructed knowledge source based on knowledge retrieval keywords. The knowledge retrieval keywords are determined by the architect agent 220 through step S110, which involves the architect agent identifying the business entities, query conditions, query result items, and functional characteristics in the query function requirement description to determine the knowledge retrieval keywords.
[0045] In this invention, the architect intelligent agent 220 is used to identify the business entities, query conditions, query result items, and functional features in the query function requirement description to determine knowledge retrieval keywords; and to combine the target knowledge data retrieved through the knowledge search module into a structured task step sequence corresponding to the development process of the query function.
[0046] Specifically, after receiving query function requirements as input, the architect agent 220 utilizes the analysis, reasoning, and structuring capabilities of a large language model to perform functional requirement analysis. It identifies business entities, query conditions, and query result items within the requirements, derives the knowledge scope needed to develop the function, and extracts keywords. Based on the requirements analysis results, the architect agent 220 can decompose and plan tasks, structurally breaking down the entire query function development process into multiple specific, executable atomic tasks. These atomic tasks are organized into a structured sequence of task steps, including the step number, execution role, task description, input source, and output requirements for each atomic task. Finally, the structured sequence of task steps is output as a structured data object.
[0047] The architect agent in this invention can be implemented without relying on a specific proprietary model that needs to be trained from scratch. Specifically, as an example, it can be based on the powerful natural language understanding and reasoning capabilities of existing general-purpose large language models (such as Qwen-32B), and achieve requirements analysis and task planning through a prompt word engineering framework, outputting a machine-readable structured sequence of task steps.
[0048] Each element in the structured task step sequence represents an independently runnable atomic task. Each atomic task definition includes the following elements:
[0049] The structured data format for a sequence of structured task steps is as follows: [{ "id":"Step number", "role":"Execution role type", "job":"Task objective description", "input":[{"source":"Input source type: Development knowledge base, Data standard library","param":"Keyword"}, {"source":"Input source type: Output of previous task","param":"Step number"}], "output": "Output result specifications" }...] The professional capabilities of the architect agent in this invention are not achieved by modifying the underlying weights of the model, but rather through a sophisticated prompt word engineering framework and context management system. This makes the invention highly versatile and evolvable, automatically enhancing itself as the capabilities of the base model improve.
[0050] The workflow of the architect agent in this invention is a multi-step, parsable decision-making process. A specific example is provided below to illustrate this: In response to the user's requirement: "Create an employee query that allows users to find current employees by department and to navigate through pages," the architect agent in this embodiment performs the following processing: S111: Semantic Analysis and Element Recognition of Requirements: This involves using a large language model to transform fuzzy natural language requirements into structured technical elements, including business entities, query conditions, result items, functional characteristics, and search keywords. The goal of semantic analysis and element recognition is to transform fuzzy natural language requirements into structured technical elements; this is achieved by using a large model. An example of a prompt word template is shown below: You are a system architect. Please analyze the following user requirements and output the analysis results strictly in JSON format.
[0051] Requirements: [User Requirements Text]
[0052] Analysis rules: 1. Identify business entities: Find the core business objects described in the requirements (usually nouns). 2. Identify query criteria: Find all filter criteria (usually verbs or qualifiers).
[0053] 3. Identify Result Items: Find the data content expected to be returned.
[0054] 4. Identify functional characteristics: Find out non-functional requirements.
[0055] 5. Derivation of keywords: Based on the above analysis, a list of keywords for retrieving the knowledge base and data standard library is extracted.
[0056] Output format: json { "business_entities":["employees","departments"], "query_conditions":["department","employment status"], "requirement": "Function: Employee Query. Function Description: Able to filter current employees based on the selected department. Requirements: The query area on the page needs to provide a department filter dropdown, supporting filtering by department, and an employment status filter dropdown, with "Employed" selected by default. Query results should be displayed in a table format and must include a pagination component to support page turning." "keywords":["Employee Search","Department Filter","Pagination","Employment Status"], } This step is essentially an information extraction task, leveraging the named entity recognition and relation extraction capabilities of a large model. Underlying this step is the model's syntactic and semantic understanding capabilities, developed through training on massive amounts of code and documentation.
[0057] S112: Knowledge Scope Derivation and Retrieval: Based on keywords, the knowledge search module is called in parallel to obtain relevant code templates and specifications from the development knowledge base and corresponding table structures and entity relationships from the data standard library.
[0058] The goal of this step is to determine what knowledge is needed to implement the function and to proactively acquire it.
[0059] Example implementation: The main control module of the intelligent agent calls the knowledge search module in parallel based on the keywords output in the previous step. It retrieves data from the standard database using the keyword: ["Employee", "Department"]. The returned results include: the structure of the employee and department tables, and the relationships between the tables. It also retrieves data from the development knowledge base using the keyword: ["Pagination query", "Multi-condition filtering"]. The returned results include: pagination query code templates, backend code templates, and other knowledge fragments.
[0060] S113: Task Decomposition and Planning: The development process of the query function is broken down into atomic tasks. Each task defines a step ID, execution role, task description, input source, and output requirements to form a structured task step sequence (JSON format). The task order follows the development logic of "backend interface → data access layer → frontend interface".
[0061] The goal of this step is to break down macro-level requirements into a series of atomic tasks that can be performed by a single engineer agent.
[0062] Implementation example: Call the large model again, using the results of the first two steps as context. Example of a prompt word template is as follows: You are a system architect. Based on the following requirements analysis and technical context, generate a sequence of task steps.
[0063] Requirement: [The requirement output in step one]
[0064] Knowledge: [Summary of knowledge fragments retrieved in Step Two]
[0065] Planning rules: Plan tasks in the order of "backend interface -> data access layer -> frontend interface".
[0066] Each task must be atomic and can be completed independently by an engineer with a specific role.
[0067] Define the following for each task: Step ID, Execution Role, Task Description, Input Source, and Output Requirements.
[0068] Available engineers: Database Engineer: Focuses on developing the data persistence layer. Core responsibilities include understanding business requirements, defining data structures, and writing SQL queries. Front-end Development Engineer: Focuses on user interface development. Core responsibilities include understanding query page requirements, writing front-end code, and integrating with back-end APIs. Backend Development Engineer: Focuses on developing backend business logic; core responsibilities include understanding query functionality requirements and developing query interfaces. Output format: A JSON array.
[0069] [{
[0070] "id":"Step number", "role":"Execution role type", "job":"Task objective description", "input":[{"source":"Input source type: Development knowledge base, Data standard library","param":"Keyword"}, {"source":"Input source type: Output of previous task","param":"Step number"}], "output": "Output result specifications" }] The essence of Architect Agent 220 is to solidify the thinking patterns and analytical processes of senior architects into an automated system through prompt templates and process design. It simulates the complete workflow of an architect: "understanding requirements -> reviewing specifications -> designing architecture -> breaking down tasks." Through this workflow, the architect agent acts as the technical brain, transforming vague requirements into clear and executable development blueprints, which is the core of the entire system's automated operation.
[0071] Engineer agent 230 is a group of multi-role specialized agents used, under the scheduling of agent master module 240, to call the knowledge search module to retrieve relevant knowledge fragments or obtain the output of previous tasks based on the input source of atomic tasks, assembling them into context information; and generating code fragments based on preset prompt word templates and a large language model, according to the context information and the task description and output requirements of the atomic tasks. The engineer agent in this invention can simulate the division of labor in a human development team, with each agent focusing on a specific domain, achieving high-quality code output through exclusive prompt word templates and domain knowledge injection.
[0072] Specifically, as an example, the engineer agent in this invention may include: The database engineer agent focuses on developing the data persistence layer, writing SQL query statements and MyBatis mapping files; it is used to simulate a database development engineer in a real project.
[0073] The backend development engineer intelligent agent focuses on backend business implementation and develops query interfaces (Controller and Service layer code); it is used to simulate a backend engineer in a real project.
[0074] The front-end development engineer agent focuses on user interface development, writing query page code and interaction logic; it is used to simulate a front-end engineer in a real project.
[0075] Taking the database engineer agent as an example, it is used to simulate the role of a development engineer in a human development team who focuses on the data persistence layer. The role is specifically responsible for generating code related to database operations, i.e., SQL statements. The model used can be a code-specific large language model (such as Qwen2.5-Coder-32B, Qwen3-Coder-480B-A35B, etc.).
[0076] To strictly limit the role of the database engineer agent to SQL development prompts, this embodiment configures a dedicated, highly structured prompt template for it. An example of a domain-specific prompt template is as follows: #Role You are a professional SQL development engineer. Your task is to generate secure, efficient, and compliant SQL statements based solely on the provided data table structure and task requirements.
[0077] #Available Data Structures
[0078] {context}
[0079] #Task Description
[0080] {task_description}
[0081] #Output Requirements: 1. The table names and field names provided above must be used.
[0082] 2. SQL injection protection must be considered, using the #{} placeholder.
[0083] 3. The output must be pure code, without any explanation.
[0084] Based on the aforementioned domain role requirements, relevant data structures (such as table names, field names, and relationships) from the data standard library and SQL writing specifications and performance and safety rules from the development knowledge base are forcibly injected into its context. At runtime, the domain knowledge context is dynamically assembled: when the agent master module schedules the database engineer agent, it dynamically retrieves relevant table structures and entity relationships (such as the user table and organization table) from the data standard library according to the "input source" defined in the task plan, and injects them as context into the {context} placeholder of the aforementioned prompt word template. In this way, the database engineer agent can accurately use the field names and relationships agreed upon in the project when generating SQL.
[0085] Regarding the output format, the structured output requirements strictly limit the output to SQL statements or MyBatisXML fragments that meet the requirements, rather than natural language descriptions.
[0086] In terms of interfaces, the engineer agent needs to implement a unified standard interface, which defines three methods: initialization, execution, and destruction. Initialization: initialize method, input parameters: none; return: none. Processing flow: (1) Load the role-specific prompt word template; (2) Load the development specifications; (3) Mark the engineer agent's status as ready.
[0087] Execution: The execute method has the following input parameters: context information, task description text, and output format specification. The return parameter is the task output result. Processing flow: (1) Check the status of the engineer agent. If it is ready, continue execution; (2) Integrate the context information and output format specification into the preset prompt word template to generate the system prompt words used in this task; (3) Call the large language model, pass in the prompt words and task description, and generate the task output based on the model's reasoning ability.
[0088] Destroy: destroy method, input parameters: none; return: none. Processing flow: (1) The engineer agent's state is marked as closed; (2) Wait for the currently running task to complete; (3) Close the large model session, clear the internal cache, and release resources.
[0089] Through the above mechanism, each engineer agent can be deeply customized into a highly specialized domain expert, ensuring the accuracy and direct usability of the generated code. Based on the above embodiment, when the architect agent 220 decomposes the "user pagination query function" into atomic tasks such as "writing SQL", "building the front-end list page", "writing the Controller", "writing the Service", and "writing the MyBatis mapping file", the agent master module 240 will sequentially schedule the database engineer, front-end development engineer, and back-end development engineer agents to execute their respective tasks, and finally aggregate the code fragments.
[0090] The main control module 240 receives and parses the structured task step sequence planned by the architect agent 220, and schedules the corresponding engineer agents to generate code snippets according to the sequence. It then integrates the code snippets generated by each engineer agent into complete functional code based on a preset project structure template. The main control module, based on the input source, calls the knowledge search module to retrieve knowledge or obtain the output of previous tasks, assembling the context information required for the engineer agents to execute tasks. Based on the engineer role, it calls the corresponding engineer agent, passing in the task description, context information, and output requirements. Finally, it assembles and aggregates the code snippets output by each engineer agent to form complete functional code, performs functional verification to ensure that the generated code matches business requirements.
[0091] In summary, the intelligent agent main control module 240 in this invention serves as the core scheduling engine, responsible for transforming the structured task step sequence planned by the architect intelligent agent into specific execution actions, and coordinating the collaborative work of various engineer intelligent agents to achieve task execution, code aggregation, and verification. Its core workflow can include the following stages: D1) Context assembly: Based on the task input source, retrieve the dual knowledge base or obtain the output of the previous task and assemble them into complete context information.
[0092] The goal of this phase is to dynamically prepare all the necessary background information for each atomic task to be executed. Specifically, as an example, the processing flow of this phase includes: D1-1) Input parsing: The main control module reads the "input source" field of the current task in the structured task step sequence. This field defines the source channel and specific parameters of the information. D1-2) Multi-source information retrieval: The module initiates different retrieval strategies based on the type of "input source".
[0093] If the input source is a development knowledge base or data standard library, the main control module calls the knowledge search module and passes in the specified keywords (such as "pagination query specification" or "user table structure"). The knowledge search module returns a series of knowledge fragments sorted by relevance through its internal hybrid retrieval mechanism (combining vector similarity and keyword matching). If the input source is the output of a previous task, the main control module will accurately extract the complete output result of the previous task from the task output bus maintained internally, according to the specified task step number (such as "T001").
[0094] D1-3) Information Assembly: Information fragments retrieved from different sources (knowledge base content and results of previous tasks) are assembled in logical order into a rich and clearly structured context string. This string provides the engineer agent with all the background knowledge and constraints required to perform the current task.
[0095] D2) Agent Invocation and Execution: Based on the task execution role, obtain the corresponding instance from the agent object pool, pass in the context, task description and output requirements, and drive the corresponding engineer agent to generate code snippets.
[0096] The goal of this phase is to schedule the correct engineer agent to complete the task. Specifically, as an example, the specific processing flow of this phase includes: D2-1) Agent Instance Acquisition: The main control module queries its internally maintained agent object pool based on the "execution role" defined in the task steps. This agent object pool is a resource pool that can be created in the form of a registry, which records the calling object instances corresponding to each type of engineer agent.
[0097] In the agent object pool, key-value pair pooling can be used for storage, where the key is the name of the engineer agent and the value is the engineer agent object. The lifecycle of the agent object pool is as follows: (1) Initialization phase: an engineer agent instance is created according to the predefined engineer role, the initialization method of the engineer agent instance is called, and the instance is stored in the agent object pool; (2) Invocation phase: the agent master module retrieves the agent object pool according to the execution role field in the atomic task metadata, obtains the agent instance of the corresponding type, and calls the execution method; (3) Destruction phase: before the system stops, a termination signal is sent, the agent object pool is traversed, the destruction method of the agent instance is executed, resources are released, and finally the agent object pool storage space is cleared.
[0098] D2-2) Task Instruction Issuance: Before invoking the execution method, the main control module verifies whether the agent instance's state is "ready" to ensure it has the ability to execute the task. If the state is abnormal (such as "busy" or "closed"), code generation failure is returned. The main control module passes in the context information assembled in the previous steps, the task description text of the current task, and the output format specification of the task definition as parameters; (D2-3) Task Execution: After receiving the parameters, the core task of the agent instance is to generate a high-quality instruction. It dynamically populates its role-specific prompt word template with the incoming context information and output format specifications. This process generates a complete system prompt word customized for the current task, containing specific constraints and background knowledge. The final synthesized system prompt word and task description text are submitted together to the large language model service connected to it. The large model performs inference based on this information and generates a task output that meets the requirements.
[0099] D3) Result Assembly and Aggregation: Store the results of each task through the task output bus, fill the code snippets into the corresponding file locations according to the predefined project structure template, and generate a complete project folder.
[0100] The goal of this phase is to integrate the scattered, atomized task outputs into a final, usable result. Specifically, as an example, the processing flow of this phase includes: D3-1) Result Bus Storage: After each task is successfully executed, its output result is immediately stored in the task output bus. This is a temporary storage area allocated in memory, with a structure similar to a key-value dictionary, where the key is the task step number (e.g., "T001") and the value is the output content of the corresponding task; D3-2) Lifecycle Management: The lifecycle of the task output bus is bound to a complete workflow. The bus is initialized when the workflow starts; it is updated immediately after each task is completed; the bus is cleared and released when the entire workflow is finally completed. D3-3) Structured Aggregation: After all atomic tasks have been executed, the output text is not simply concatenated together. Instead, a dedicated code aggregator component uses a predefined project structure template to populate the output results of different tasks in the bus into their corresponding file locations. For example, MyBatis mapping statements are written to the MapperXML file, and Controller code is written to the Java source file, ultimately generating a complete and well-structured project folder.
[0101] In other words, after the agent's main control module completes the scheduling of all atomic tasks, it still needs to perform final system-level code integration. This process no longer generates new business code, but rather acts as a high-level project builder, assembling scattered outputs into a complete application.
[0102] Specifically, the input to the integration process is the entire contents of the task output bus. The bus now stores the output of each atomic task: T001: SQL statement for querying the user list.
[0103] T002: Contents of the MyBatis Mapper XML file.
[0104] T003: Java code for the UserService interface and its implementation class.
[0105] T004: Java code for the UserController class.
[0106] T005: Vue / React component code for the user query page.
[0107] The integration logic is based on code injection using a project template. The architect agent has a pre-built or accessible standard project structure template. This template defines the locations of different types of code files and the basic project configuration. The integration process involves matching the code snippets from the bus to their corresponding templates.
[0108] Example of specific integration operation: Create the project root directory: First, create a folder named user-query-feature as the project root directory.
[0109] Build the backend project structure: Create a standard Maven project structure in the root directory: src / main / java / com / example / ; Write the data access layer code: Write the contents (Mapper XML) of T002 in the task output bus to src / main / resources / mapper / UserMapper.xml; Write the business logic layer code: Write the content of T003 (Service code) to src / main / java / com / example / service / UserService.java and UserServiceImpl.java; Write the controller code: Write the contents of T004 (Controller code) to src / main / java / com / example / controller / UserController.java; Build the front-end project structure: Create a `frontend / ` folder in the root directory and initialize the front-end project structure (e.g., `src / components`, `src / views` in a Vue project). Write the front-end page code: Write the content of T005 (the user query page code) to `frontend / src / views / UserQuery.vue` (or the corresponding `React.jsx` file).
[0110] In one specific embodiment of the invention, this integration function is implemented using a template engine-based generation method. The agent uses a template engine (such as Jinja2 or Freemarker) with a pre-made project skeleton template containing a directory structure and file placeholders. The architect agent uses the content in the task output bus as variables, renders it through the template engine, and finally generates a complete, populated project folder.
[0111] The result of the integration is not a code snippet, but a complete, ready-to-use project folder with the following structure:
[0112] In another specific embodiment of the present invention, after the intelligent agent main control module 240 completes the result assembly and aggregation, it further performs functional verification and iterative correction, deploys the complete code to the sandbox environment, and performs automated verification through static analysis (such as SonarQube) and compilation and building (such as mvn compile); when the verification fails, the error is located and the relevant intelligent agents are rescheduled for iterative correction until the code meets the production requirements.
[0113] The goal of this functional verification and iterative correction is to ensure the quality of the final generated code. Specifically, as an example, the specific processing flow at this stage includes: D4-1) Sandbox Environment Deployment: The agent master control module 240 places the aggregated complete code into an isolated, clean sandbox environment; D4-2) Automated Quality Production Line: Static analysis: Use code quality scanning tools (such as SonarQube) to perform static analysis on the code to check whether it conforms to coding standards and whether there are security vulnerabilities or potential defects.
[0114] Compile and build: Execute the project's build commands (such as mvn compile) to verify the syntax correctness of the code and the completeness of all dependencies; (D4-3) Exception Handling and Iteration: If any verification step fails, the specific error point is located, and the main control module 240 will reschedule the relevant engineer agents according to the error type, pass in the error information, and drive them to correct the code. This process will be iterated until code that has passed all verifications and meets production requirements is generated.
[0115] The above embodiments describe the development method and system for query function based on a large language model of the present invention step by step and module by module. In order to better understand the development method and system for query function based on a large language model of the present invention, the present invention will be described more completely by taking an overall operation process as an example below.
[0116] Figure 5 The overall operation flow of a query function development method based on a large language model according to an embodiment of the present invention is shown. For example... Figure 5 As shown, the overall operation flow of this embodiment includes: S510: Input / Query Function Requirements: Users submit a query function requirement description to the system; S520: Requirements Analysis: Based on the large language model, the architect's intelligent agent identifies the core elements in the query function requirements description, including business entities, query conditions, and query results. S530: Mission Planning.
[0117] The above step S530 may specifically include the following: S531: The architect agent breaks down the development process into atomic tasks based on a large language model; S532: Define the metadata for each task: step number, execution role (the type of engineer agent that executes the task step), task description, input source (development knowledge base, data standard library, output of previous tasks), and output requirements; S533: Output a structured sequence of task steps.
[0118] S540: Constructing a task workflow: The main control module of the intelligent agent receives a structured sequence of task steps and executes the tasks in sequence according to the dependencies in the task execution flow; S550: The main control module of the intelligent agent drives the intelligent agent to perform tasks.
[0119] The above step S550 may specifically include the following: S551: Prepare Context. When the input source is a development knowledge base or data standard library, call the knowledge search module, pass in knowledge keywords, retrieve relevant development knowledge and data structures, and use the search results as context; when the input source is the output of a preceding task, directly use the output results of the specified task step as context.
[0120] S552: Scheduling Agent: The main control module of the agent invokes the corresponding engineer agent according to the execution role of the task metadata, and passes in the context and task metadata; S553: Execute the task: The engineer agent receives the assembled context, executes the task based on the task description according to the large model, and generates code snippets that meet the output requirements.
[0121] S560: Result Aggregation: The main control module of the intelligent agent integrates the code snippets output by each engineer intelligent agent to form complete functional code.
[0122] S570: Functional Verification: The agent's main control module first compiles the functional code in a sandbox environment to ensure the correctness of the generated code syntax. Alternatively, manual review can be used to verify whether the functional code meets expectations. If it does not, an exception handling mechanism is triggered, and the agent's main control module reschedules the engineer agent for iterative correction. After successful verification, the final functional code is output as the development result.
[0123] Compared with existing technologies, the query function development method and system based on a large language model provided by this invention have the following specific improvements: 1) Multi-agent collaborative architecture based on role division of labor: The architecture adopts "architect agent" and multiple specialized "engineer agents" to simulate the division of labor and collaboration mode of human software teams. Through orderly scheduling and context passing between agents, it solves the problems of insufficient capacity and chaotic context when a single model is used to handle complex software development tasks. 2) Dual-drive model of enterprise-level knowledge base: Construct two major knowledge sources, "development knowledge base" and "data standard base". Through retrieval-enhanced generation technology, the enterprise's unique framework specifications, code templates and data structures and other contextual information are dynamically injected into the code generation process to ensure that the generated code conforms to the enterprise's engineering specifications and can be directly integrated into existing projects; 3) Standardization and structured output of task planning: Define the planning results of the architect agent as a machine-readable and executable "structured task step sequence" (such as a specific JSON format), so that task planning is no longer a natural language description, but a "work order" that can be accurately parsed and automatically scheduled by the main control module, realizing the decoupling and automation of planning and execution; 4) Deep integration mechanism of knowledge base and intelligent agent: The knowledge base is developed through the process of "semantic parsing-knowledge segmentation-vectorization-index construction" to transform technical documents into atomic searchable knowledge units; the data standard library supports the inheritance and reuse of data dictionaries and the association and synchronization of database table fields to ensure data structure consistency; the intelligent agent dynamically acquires knowledge through hybrid retrieval (vector similarity + keyword filtering) to achieve accurate matching of "knowledge-task-code".
[0124] like Figure 6 As shown, the present invention also provides an electronic device 1 for implementing a query function development method based on a large language model.
[0125] The electronic device 1 may include a processor 10, a memory 11, and a bus. It may also include computer programs stored in the memory 11 and executable on the processor 10, such as a query function development program 12 based on a large language model. The memory 11 may include both internal storage units for the query function development system based on a large language model and external storage devices. The memory 11 can be used not only to store application software and various types of data, such as the code for the query function development program based on a large language model, but also to temporarily store data that has been output or will be output.
[0126] Figure 6 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 6 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0127] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.
[0128] The query function development program 12 based on a large language model stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When run in the processor 10, it can implement the steps in the query function development method based on a large language model as described above.
[0129] Specifically, the processor 10's implementation method for the above instructions can be found in [reference needed]. Figure 2The descriptions of the relevant steps in the corresponding embodiments are not repeated here. Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable medium may include: any entity or system capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory.
[0130] This invention also provides a computer-readable storage medium, which may be non-volatile or volatile, and stores a computer program. When the computer program is executed by a processor, it performs the steps of the query function development method based on a large language model as described above.
[0131] Specifically, the specific implementation method when the computer program is executed by the processor can be referred to the description of the relevant steps in the embodiment of the query function development method based on a large language model, and will not be repeated here. In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for example, the division of modules is merely a logical functional division, and there may be other division methods in actual implementation.
[0132] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0133] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0134] The method and system for developing query functions based on a large language model according to the present invention have been described above with reference to the figures as examples. However, those skilled in the art should understand that various improvements can be made to the method and system for developing query functions based on a large language model proposed in the present invention without departing from the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the content of the appended claims.
Claims
1. A method for developing query functions based on a large language model, characterized in that, include: The architect's intelligent agent identifies the business entities, query conditions, query result items, and functional characteristics in the query function requirement description to determine the knowledge retrieval keywords. The system retrieves target knowledge data from a pre-built knowledge source based on the knowledge retrieval keywords, and combines the retrieved target knowledge data into a structured task step sequence corresponding to the development process of the query function. The knowledge source includes a development knowledge base and a data standard library. The development knowledge base stores internal software development framework knowledge, development specifications, and code examples, supporting semantic retrieval. The data standard library stores standardized data structures, including data dictionaries, tables, and entity relationships. The structured task step sequence includes the step number, execution role, task description, input source, and output requirements for each atomic task. The main control module of the intelligent agent schedules the corresponding engineer intelligent agents according to the structured task step sequence. Based on the input source of the atomic task, the knowledge search module is called to retrieve relevant knowledge fragments or obtain the output of the previous task and assemble them into context information. Based on the preset prompt word template and the large language model, the engineer intelligent agent generates code fragments according to the context information and the task description and output requirements of the atomic task. The main control module integrates the code snippets generated by each engineer's agent into complete functional code according to a preset project structure template.
2. The method for developing query functions based on a large language model as described in claim 1, characterized in that, After the main control module integrates the code snippets generated by each engineer's agent into complete functional code according to a preset project structure template, it also includes: The complete functional code is placed in a sandbox environment for static analysis and compilation and verification. If the verification fails, an iterative correction process is triggered, and the corresponding engineer agent is rescheduled to correct the complete functional code until the verification passes.
3. The method for developing query functions based on a large language model as described in claim 2, characterized in that, The static analysis is performed using a code quality scanning tool to check whether the code conforms to coding standards and whether there are security vulnerabilities; the compilation and building are performed using a project build tool to verify the correctness of the code syntax and the completeness of dependencies.
4. The method for developing a query function based on a large language model as described in any one of claims 1 to 3, characterized in that, The data dictionary is used to describe the data elements in the system, the database table is used to define the specific database table structure, the fields in the database table structure are generated by referencing the data dictionary, and the entity relationship is used to clarify the business relationship between tables.
5. The method for developing query functions based on a large language model as described in claim 4, characterized in that, The architect agent is based on a general large language model and uses preset prompt word templates to realize semantic parsing of requirements and identification of elements. The structured task step sequence is JSON format data, and the input sources include the development knowledge base, the data standard library, and the output of the previous tasks.
6. The method for developing query functions based on a large language model as described in claim 5, characterized in that, The engineer agents include database engineer agents, front-end development engineer agents, and back-end development engineer agents. Each engineer agent is configured with a unique prompt word template and domain knowledge. The prompt word template includes role definition, available data structures, task description, and output requirements.
7. The method for developing query functions based on a large language model as described in claim 6, characterized in that, The intelligent agent main control module manages engineer intelligent agent instances through an intelligent agent object pool and stores the output results of atomic tasks through a task output bus; wherein... The pool of intelligent agent objects is stored using key-value pairs of "engineer intelligent agent name - intelligent agent object"; the task output bus is stored using key-value pairs of "atomic task step number - output content".
8. A query function development system based on a large language model, characterized in that, It includes a knowledge search module, an engineer intelligent agent, an architect intelligent agent, and an intelligent agent control module; among them, The knowledge search module is used to retrieve target knowledge data from pre-built knowledge sources based on knowledge retrieval keywords; The architect agent is used to identify business entities, query conditions, query result items, and functional features in the query function requirement description to determine knowledge retrieval keywords; and to combine the target knowledge data retrieved by the knowledge search module into a structured task step sequence corresponding to the development process of the query function; wherein the structured task step sequence includes the step number, execution role, task description, input source, and output requirements of each atomic task. The intelligent agent main control module is used to schedule the corresponding engineer intelligent agents to generate code snippets according to the structured task step sequence; and to integrate the code snippets generated by each engineer intelligent agent into complete functional code according to the preset project structure template. The engineer agent is used to retrieve relevant knowledge fragments or obtain the output of the preceding task by calling the knowledge search module according to the input source of the atomic task, and assemble them into context information; and generate code fragments based on the context information and the task description and output requirements of the atomic task according to the preset prompt word template and the large language model.
9. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a query function development program based on a large language model stored in the memory and executable on the processor. When the query function development program based on a large language model is executed by the processor, it implements the query function development method based on a large language model as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the query function development method based on a large language model as described in any one of claims 1 to 7.