Artificial intelligence-based software development method, device, equipment and medium
By combining a multi-agent system with natural language interaction and dynamic knowledge graphs, the problem of complex business logic not being reusable in existing code development has been solved, realizing an efficient, self-learning no-code software development platform and improving the efficiency and quality of code generation.
Patent Information
- Application Number
- CN202511249111.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2045-09-03
AI Technical Summary
Existing technologies for code development solutions are limited to surface-level syntax matching, which cannot effectively reuse complex business logic from historical projects, resulting in wasted resources from repeated development and a high error rate in the generated code.
Through a multi-agent system, user requirements are received using a natural language interface. Combined with a dynamic knowledge graph, historical solutions are retrieved. The architect agent generates executable code, and the testing agent performs syntax verification and requirement compliance checks. Finally, the summarizing agent pushes the final code.
It improves the efficiency and quality control of code generation, enhances the reusability of historical solutions, and reduces the waste of resources in repeated development and the error rate of code.
Smart Images

Figure CN120723218B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software development, and in particular to a software development method and device based on artificial intelligence, equipment and medium. BACKGROUND
[0002] In the traditional software development method, the processes of requirement analysis, code design, writing and testing usually require manual intervention, which has the disadvantages of low efficiency and easy to make mistakes. With the development of artificial intelligence technology, more and more intelligent tools have been introduced into the software development process, especially in the fields of code automatic generation and automatic testing. The existing intelligent development tools mainly rely on rule matching and template generation, which can improve the code writing efficiency, but still lack flexibility and adaptive ability, and often cannot fully understand complex user requirements and environmental context. In the field of artificial intelligence assisted software development, traditional no-code development platforms generally use a single generative model for requirement transformation, which can realize basic function development, but has many problems. For example, under the existing technology, the code development solution retrieval is limited to surface syntax matching, which cannot effectively reuse the complex business logic in historical projects, resulting in waste of repeated development resources and high error rate of generated code. Therefore, there is an urgent need for a new software development method based on artificial intelligence to solve the problems of code based on artificial intelligence in the existing software development platform. SUMMARY
[0003] Embodiments of the present application provide a software development method, device, equipment and medium based on artificial intelligence, which aims to solve the problem of waste of repeated development resources caused by the limitation of code development solution retrieval to surface syntax matching under the existing technology, which cannot effectively reuse the complex business logic in historical projects.
[0004] In a first aspect, the embodiments of the present application provide a software development method based on artificial intelligence, applied to a multi-agent system including a product agent, an architect agent, a test agent and a summary agent. The method comprises: receiving the development requirements of a user through a natural language interaction interface, and capturing the context state information of the current development environment; retrieving the historical solution of the development requirements based on a dynamic knowledge graph through the product agent; when the historical solution based on the development requirements is retrieved, generating executable code through the architect agent based on the historical solution according to a layered code generation strategy; performing syntax checking, running verification and requirement compliance detection on the executable code based on a layered verification mechanism combined with the context state information through the test agent, and obtaining a verification result; when the test agent judges that the verification result meets the development requirements, pushing the executable code to the user as a final code implementation scheme through the summary agent.
[0005] In a second aspect, the embodiments of the present application also provide an artificial intelligence-based software development device for executing the artificial intelligence-based software development method as described above.
[0006] In a third aspect, the embodiments of the present application also provide a computer device, which comprises a memory and a processor connected to the memory; the memory is used to store a computer program; and the processor is used to run the computer program stored in the memory to execute the steps of the artificial intelligence-based software development method as described above.
[0007] In a fourth aspect, the embodiments of the present application also provide a computer readable storage medium, which stores a computer program; the computer program comprises program instructions; and the program instructions can implement the steps of the artificial intelligence-based software development method as described above when executed by a processor.
[0008] Compared with the prior art, the present application has the following beneficial effects:
[0009] In the technical solution of the present application, the development requirements of the user are received through the natural language interaction interface, and the context state information of the current development environment is captured at the same time. Then, the historical solution of the development requirements is retrieved based on the dynamic knowledge graph through the product intelligent agent. When the historical solution based on the development requirements is retrieved, the executable code is generated based on the historical solution according to the layered code generation strategy through the architect intelligent agent. Then, the syntax checking, running verification and requirement compliance detection of the executable code are performed based on the layered verification mechanism and the context state information through the test intelligent agent, and the verification result is obtained. When the test intelligent agent judges that the verification result meets the development requirements, the executable code is summarized into the final code implementation scheme through the summary intelligent agent and pushed to the user. Thus, an efficient, self-learning and scalable no-code software development platform is constructed, and the code development reuse rate and quality control capability are effectively improved. BRIEF DESCRIPTION OF DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0011] Figure 1 The flowchart of the artificial intelligence-based software development method provided by the present application;
[0012] Figure 2 The first sub-flowchart of the artificial intelligence-based software development method provided by the present application;
[0013] Figure 3 a second sub-flowchart of the software development method based on artificial intelligence provided by the present application;
[0014] Figure 4 a third sub-flowchart of the software development method based on artificial intelligence provided by the present application;
[0015] Figure 5 a fourth sub-flowchart of the software development method based on artificial intelligence provided by the present application;
[0016] Figure 6 a fifth sub-flowchart of the software development method based on artificial intelligence provided by the present application;
[0017] Figure 7 a sixth sub-flowchart of the software development method based on artificial intelligence provided by the present application;
[0018] Figure 8 a schematic block diagram of units of the software development device based on artificial intelligence provided by the present application;
[0019] Figure 9 a schematic block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0021] It should be understood that, when used in the specification and the appended claims, the terms “comprise” and “include” indicate the presence of described features, integers, steps, operations, elements, and / or components, but do not exclude one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0022] It should also be understood that the terms used in the present application specification are only for the purpose of describing the medical embodiments and are not intended to limit the present application. As used in the present application specification and the appended claims, the singular forms “a”, “an” and “the” are intended to include the plural forms, unless the context clearly indicates otherwise.
[0023] It should be further understood that the term “and / or” used in the present application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
[0024] The present application aims to solve the problem of repeated development resource waste caused by the limitation of surface syntax matching in the retrieval of code development solution in the prior art, and provides a software development method, device, equipment and medium based on artificial intelligence. Referring to Figures 1 to 7 The software development method based on artificial intelligence comprises the following steps.
[0025] S110, receiving the development requirement of the user through a natural language interaction interface, and capturing the context state information of the current development environment;
[0026] S120, retrieving the historical solution of the development requirement based on a dynamic knowledge graph through the product agent;
[0027] S130, when the historical solution based on the development requirement is retrieved, generating executable code based on the historical solution according to a layered code generation strategy through the architect agent;
[0028] S140, performing syntax checking, running verification and requirement compliance detection on the executable code based on a layered verification mechanism in combination with the context state information through the test agent, and obtaining a verification result;
[0029] S150, when the test agent judges that the verification result meets the development requirement, pushing the executable code summarized into a final code implementation scheme to the user through the summary agent.
[0030] The present application provides a software development method based on artificial intelligence, which is particularly suitable for a multi-agent system, and the system comprises a product agent, an architect agent, a test agent and a summary agent.
[0031] When the user uses the multi-agent to develop software without code, first, the product agent receives the development requirement of the user through a natural language interaction interface. The requirement of the user is usually input in the form of natural language, and the system uses natural language processing technology to convert these requirements into structured information understandable by machines. Specifically, the user realizes requirement input through a dual-mode interaction module integrating a voice user interface (LUI) and a graphical user interface (GUI). In addition, the system will capture the context state information of the current development environment, which includes the current development tools, environment configuration, and possible external dependencies. The capture of the context state information provides necessary environmental basis for subsequent code generation and verification.
[0032] When the user's needs are parsed, the product agent will search for historical solutions based on a dynamic knowledge graph engine. This graph contains past solutions and their related technical implementations. Through the semantic relationships and paths between nodes in the graph, the product agent can quickly find historical solutions similar to the current needs and use this solution as a basis to guide the code generation process. Specifically, for example, when the user selects "AI-generated development mode" through the web designer, the system starts the context-aware engine, which parses the current page DOM tree structure in real time and extracts the page Schema metadata. This retrieval process is not limited to surface-level syntax matching, but delves into the business logic and solution context, providing more reusable and targeted solutions.
[0033] When the historical solution is successfully retrieved, the architect agent will start writing executable code that meets engineering specifications based on the selected historical solution and layered code generation strategy. The architect agent uses the business logic and code templates extracted from the knowledge graph, combined with development needs, to generate the basic framework of the code and its core logic. In this process, the architect agent not only needs to generate standard functional implementations, but also needs to focus on the structural, maintainability, and extensibility of the code to ensure that the generated code can adapt to future modifications and optimizations.
[0034] After the code generation is complete, the testing agent stage begins. The testing agent first performs static analysis of the code, including syntax and logic checking, to ensure that the code can be executed smoothly without runtime errors. Second, the testing agent also performs environment compatibility testing to verify whether the generated code can run normally in different development environments, such as different browsers or devices. Finally, the testing agent will also perform verification according to user needs, simulating user operations in actual applications to ensure that the final generated code functions are consistent with user needs.
[0035] If the test results show that the code meets the needs, the summary agent will be notified to obtain the code implementation solution from the architect agent and push it to the user. If the test results show that the code has problems or does not fully meet the needs, the architect agent will return the reasons for the test failure to the scenario agent to discuss the solution again. The architect agent will optimize based on feedback. The optimization content can include fixing syntax errors, improving business logic, enhancing code robustness, etc., to ensure continuous improvement of code quality.
[0036] When the architect agent confirms that the code meets all requirements and passes the verification of the test agent, the summary agent will summarize the final code implementation plan and generate a detailed code implementation report. This report not only includes the final code, but also contains key decisions during development, optimization process, and suggestions for future modifications. Finally, the system will push the code solution to the user, completing the entire software development process.
[0037] In the method scheme of the present application, through the efficient cooperation of product agents, architect agents and test agents, as well as the dynamic support of knowledge graphs, not only the efficiency of code generation is improved, but also the reuse ability of historical solutions is enhanced. The multi-agent system can perform deep semantic analysis based on historical data, avoiding relying only on surface syntax matching, solving the problem of not being able to reuse complex business logic in traditional methods, and improving efficiency and accuracy.
[0038] In an embodiment, referring to Figure 2 , the multi-agent system further includes triage agents and scenario specialist agents, and the step S120 includes:
[0039] S121, when the historical solution of the development requirement is not retrieved, the development requirement is decomposed and consciousness recognized by the triage agent, and a plurality of sub-development tasks are obtained by decomposing the development requirement;
[0040] S122, each sub-development task is discussed by a plurality of scenario specialist agents to obtain a sub-task process plan and is handed over to the architect agent for scheme integration into a to-be-written plan;
[0041] S123, the to-be-written plan is coded into executable code by the architect agent according to a layered code generation strategy.
[0042] In this embodiment, the multi-agent system further includes a triage agent and a scenario specialist agent. After the product agent retrieves historical solutions based on the dynamic knowledge graph, if the system fails to retrieve a historical solution that meets the development requirements, the system automatically enters the requirement decomposition phase. At this time, the triage agent is responsible for deep decomposition and awareness recognition of the original development requirements. The requirement decomposition process first structures the requirements, splits them into specific subtasks, and identifies the underlying business logic and functional requirements. The triage agent analyzes the language expression and logical relationship of the development requirements, and automatically converts complex requirements into multiple sub-development tasks. These subtasks are further refined into independent development modules, providing a clear direction for subsequent expert agent collaboration. Specifically, a semantic dependency analysis model is used to parse user requirements, extract core verb-object groups, and construct initial task feature vectors, such as the "identify" action in "developing an electroencephalogram recognition system" and the "electroencephalogram signal" object. A pre-trained classification model is used to identify the operation type (add / modify) and functional domain (biometric recognition / data security) of the development intent, and generate structured intent labels. Subsequently, based on the component dependency relationships defined in the knowledge graph, such as the chain dependency of signal acquisition module → feature extraction algorithm → database interface, complex requirements are decomposed into atomic-level subtasks, such as "signal acquisition module development" and "feature extraction algorithm implementation." If a parameter such as sampling rate is detected to be missing, the triage agent initiates multiple rounds of clarification dialogue, generates a parameter completion list, and feeds it back to the user through a natural language interface until all subtasks are executable.
[0043] Once the triage agent completes requirement decomposition and generates multiple sub-development tasks, these tasks will be handed over to multiple scenario specialist agents for solution discussion. Each scenario specialist agent, based on its domain knowledge and experience, proposes technical solutions suitable for a specific subtask. In particular, the scenario specialist agent group is dynamically scheduled by the triage agent based on the technical feature labels of the subtasks. The scenario specialist agent integrates the best practices from historical solutions to discuss multiple possible solutions, ensuring that each subtask is handled to fully meet the complexity of user requirements and business logic.
[0044] During this process, the scenario expert agent not only relies on its professional knowledge, but also can propose innovative solutions based on historical data and model analysis, improving the efficiency and feasibility of the solution. Specifically, the scenario expert agent will retrieve similar field solutions based on the semantic similarity algorithm of the knowledge graph. For example, for the "feature extraction algorithm" subtask, the Mel Frequency Cepstral Coefficient (MFCC) implementation scheme in the speech recognition field is retrieved. Then, the retrieved scheme is adapted to the current task scenario for discussion, and the architect agent reaches a consensus by using a consistency voting algorithm. When the discussion is completed, the obtained subtask process scheme can be obtained by the architect agent for scheme testing. It should be emphasized that the output of this stage is multiple subtask solutions that have been discussed by experts and optimized.
[0045] When the scenario expert agent completes the solution discussion of the subtask, the solution will be handed over to the architect agent for further scheme integration. After completing the scheme integration, the architect agent will write the scheme as code and store it in a relational database such as PostgreSOL using an incremental persistence strategy, realizing the traceability and reuse of knowledge assets.
[0046] The testing agent will verify the feasibility of the subtask solution in a sandbox environment. Through this code testing stage, the testing agent not only verifies the effectiveness of the integrated solution, but also can perform iterative optimization of the solution based on the test results. For example, if a subtask solution has potential performance bottlenecks or does not consider the running situation in a specific scenario, the testing agent will return the reasons for failing the test to the scenario expert agent for re-discussion and necessary adjustments to optimize the solution until it fully meets the requirements.
[0047] Further, with reference to Figure 3 , the steps of S121 include:
[0048] S1211, by the triage agent, using a natural language model to analyze the development requirements, combining node embedding of the dynamic knowledge graph to generate requirement semantic features;
[0049] S1212, by the triage agent, using a pre-trained classification model to perform intent recognition on the development requirements, generating structured intent labels;
[0050] S1213, by the triage agent, based on the component dependency relationship in the dynamic knowledge graph, the requirement semantic features and the structured intent labels, splitting the development requirements to obtain the multiple sub-development tasks.
[0051] If the product agent cannot find a historical solution that meets the development needs through dynamic knowledge graph-based retrieval, the system will perform demand decomposition and awareness recognition through the triage agent, thereby breaking down the original development demand into multiple sub-development tasks. First, the triage agent will use a natural language processing model (NLP) to analyze the development demand. This process converts the demand text into structured information that can be understood by machines through the deep learning mechanism of the natural language model. In particular, the triage agent will extract the core features of the demand from the semantic level by combining node embedding in the dynamic knowledge graph. Node embedding technology matches keywords, phrases, or concepts in the demand with related nodes in the knowledge graph, thereby generating semantic features of the demand. This process not only improves the accuracy of demand analysis, but also ensures that implicit business logic in the demand is identified and captured. Specifically, the triage agent uses a natural language processing model with a bidirectional Transformer architecture to perform semantic analysis on the user's input development demand, extracting core verb-object structures such as the "identify" action and "brain wave signal" object in "develop a brain wave recognition system." During the analysis process, the dynamic knowledge graph is accessed simultaneously to obtain the context state information of the current development environment, including the DOM structure of the deployed components, event binding relationships, and data flow dependencies. Related entity nodes such as sensor interface components and signal processing modules are encoded into high-dimensional vectors through graph neural networks (GNN). After the semantic analysis results and knowledge graph node embedding vectors are fused through an attention mechanism, a multi-dimensional demand semantic feature vector is generated, which includes text semantic features, graph embedding features, and context parameters. This feature vector serves as the quantitative input for subsequent task decomposition, ensuring comprehensive demand understanding and environmental awareness.
[0052] Next, the triage agent uses a pre-trained classification model to identify the intent of the development demand. Through this model, the triage agent can analyze the language features in the demand and generate corresponding structured intent labels. These labels represent the core goals and task types in the demand, such as whether they involve data processing, interface design, performance optimization, etc. The purpose of intent recognition is to convert abstract goals in the development demand into specific, executable development tasks for subsequent task splitting and scheme discussion. Specifically, the pre-trained classification model operates based on a hierarchical classification architecture. In the operation type recognition layer, a Softmax classifier is used to distinguish between "add," "modify," and "delete" three basic operations, with the input being the main semantic features of the demand semantic feature vector. In the function domain recognition layer, a multi-label classification model is used to label function domain tags, with the input being the full dimension of the feature vector.
[0053] After generating the requirement semantic features and intent labels, the triage agent will further split the requirements based on the component dependency relationships in the dynamic knowledge graph, combined with the requirement semantic features and structured intent labels. The dynamic knowledge graph provides a network of dependency relationships between components, which can effectively identify the interconnections between various modules in the requirements. For example, if a subtask depends on a database operation, the system will automatically identify this and split it into a subtask that includes the database operation. In this way, the system can break down a complex development requirement into multiple smaller, independent sub-development tasks, each of which can be executed and optimized independently. Specifically, the triage agent performs atomic-level task splitting based on three core elements: component dependency relationships, requirement semantic features, and structured intent labels. Among them, the component dependency relationships are obtained by analyzing the upstream and downstream connection paths of the target functional modules in the knowledge graph, and the requirement semantic features are used to determine the task priority according to the weight distribution in the feature vector. In the structured intent label, the triage agent determines the granularity of the split according to the operation type and limits the knowledge graph search range according to the functional domain. During the splitting process, parameter integrity verification and environment compatibility verification are also implemented to detect whether the subtasks have all the necessary input parameters and ensure that the subtask output matches the technology stack and hardware constraints of the current development environment. The final output of the atomic-level subtask list will carry complete metadata description, including dependency relationship graph, parameter constraints, and acceptance criteria, for the scene specialist agent to handle.
[0054] Further, with reference to Figure 4 , the steps of S122 include:
[0055] S1221, assigning multiple corresponding scene specialist agents to each sub-development task through the triage agent;
[0056] S1222, identifying parameter missing items and ambiguous items in the corresponding sub-development task through each scene specialist agent, and generating multiple clarification lists;
[0057] S1223, obtaining the clarification list through the product agent and continuously interacting with the user until the supplement of the parameter missing items and ambiguous items is completed;
[0058] S1224, retrieving historical solutions similar to the domain of the sub-development task based on the dynamic knowledge graph through multiple corresponding scene specialist agents and conducting scheme discussion;
[0059] S1225, when the scheme discussion of multiple scene specialist agents corresponding to the same sub-development task does not conflict, the scene specialist agent outputs the result of the scheme discussion as the sub-task process scheme, and the architect agent integrates the sub-task process scheme into the to-be-written scheme.
[0060] The system conducts scheme discussions for each sub-development task by multiple scenario specialist agents, and the final sub-task process scheme is handed over to the architect agent for scheme testing. After the development requirements are decomposed into multiple sub-tasks, the triage agent assigns multiple corresponding scenario specialist agents for each sub-task. These specialist agents handle specific task modules according to their expertise in the field. For example, for a sub-task involving data processing, agents with backgrounds in data science and machine learning may be assigned; for a sub-task related to user interface design, UI design specialist agents may be assigned. In this way, the system ensures that each sub-task can be thoroughly discussed and designed in the professional field. Specifically, the triage agent matches the technical feature vector of the sub-development task with the ability label matrix of the scenario specialist agent. The ability label matrix is dynamically updated based on historical task execution results, and the cosine similarity algorithm is used to calculate the matching degree of the task and the specialist.
[0061] After each scenario specialist agent receives the assigned sub-task, they will conduct a detailed analysis of the task content, especially identifying possible missing parameters and ambiguous items. Missing parameters refer to necessary inputs or information that may be missing in the sub-task, and ambiguous items refer to parts of the requirements that may have multiple interpretations or are unclear. Based on their knowledge in the professional field, these specialist agents will identify these problems and generate multiple clarification lists, clearly indicating which parts need further clarification and supplementation. This process is an important step to ensure task completeness and accuracy. Specifically, scenario specialist agents will first conduct static analysis by comparing sub-task descriptions with parameter templates of similar tasks in the knowledge graph, and then conduct dynamic inference by detecting implicit dependencies between parameters through the LLM inference engine, finally generating structured clarification lists in JSON format, marking missing parameters and ambiguous items.
[0062] Next, the product agent will obtain these clarification lists and continuously interact with the user. Based on the questions listed in the clarification list, the user provides missing parameters or answers ambiguous items until the system confirms that all parameters and requirements have been fully clarified and supplemented. During this process, the product agent will maintain continuous communication with the user to ensure that no key development information is missed. Specifically, the product agent aggregates the clarification lists submitted by various scenario specialists, and uses a de-duplication and priority sorting strategy to generate user interaction sequences. The clarification process includes: gradual confirmation of presenting only a single parameter confirmation request at a time; support for natural language responses and multi-modal feedback through visual configuration interfaces; maintaining parameter context using a dialog history LSTM model.
[0063] After all parameters and ambiguous items are clarified, the system will retrieve historical solutions based on the dynamic knowledge graph. Through the information in the knowledge graph, the system can search for historical solutions similar to the current sub-task field and hand over to multiple scenario expert agents for scheme discussion. Scenario expert agents, based on their knowledge base and field experience, combine the best practices in historical solutions to propose multiple possible solutions for discussion. These solutions will be further refined and optimized to ensure that they can solve the current development needs and meet the user's business requirements. Specifically, scenario expert agents perform semantic retrieval based on the completed sub-task parameters, convert the task description into a SPARQL query statement, and retrieve similar field solutions from the dynamic knowledge graph. Then adjust the parameter configuration of the historical solution and inject environmental constraints. When multiple scenario expert agents reach a consensus, integrate the scheme discussion.
[0064] When multiple scenario expert agents propose solutions for the same sub-task, if these solutions do not conflict, the system will enter the next phase. At this time, the architect agent will integrate the solutions proposed by each scenario expert agent. If there are potential conflicts or problems in some parts of the solution, when the test agent's test feedback fails, it will be fed back to the architect agent for scenario expert agents to discuss and adjust or redesign the solution to ensure the unity and executability of the final solution.
[0065] Further, with reference to Figure 5 , the steps after S1224 include:
[0066] S1226, when multiple scenario expert agents corresponding to the same sub-development task appear scheme discussion conflicts, group meditation based on the context state information and the dynamic knowledge graph to obtain a consensus solution, the architect agent integrates the consensus solution and performs scheme testing.
[0067] In the process of discussing the scheme, if multiple scenario expert agents conflict with each other on the solution of the same subtask, for example, have different opinions on the selection of technical path, the applicability of algorithm, etc., the system will identify these conflicts and start the processing mechanism of the next stage. The system will summarize the opinions of each expert agent through group meditation, and analyze according to the context state information, in order to find the optimal solution. This process uses context state information to analyze the current development environment, demand changes, technical feasibility and other factors, and finds a consensus solution through collective wisdom. The system further optimizes the conflicting parts according to the detailed dependency relationship and historical solution mode provided by the dynamic knowledge graph, and forms a consensus solution after multi-party discussion. Specifically, when multiple scenario expert agents propose conflicting solutions, a multi-round residual discussion is started. The discussion process is divided into three stages: hypothesis generation stage, each expert submits candidate solutions and theoretical basis; verification iteration stage, quickly verify the core indicators of each solution in the sandbox environment; consensus formation stage, determine the final solution by weighted voting method, if 10 rounds are not decided, trigger manual intervention, wherein the weight of the so-called weighted voting method is the historical accuracy rate of the scenario expert agent.
[0068] In an embodiment, referring to Figure 6 , the steps of S150 further include:
[0069] S160, receiving the judgment result of the user on the final code implementation scheme through the thinking chain agent, and storing the verification result in the correct answer knowledge base or the thinking chain knowledge base in the dynamic knowledge graph according to the judgment result.
[0070] In the method scheme of this embodiment, the multi-agent system further includes a thinking chain agent. When the architect agent completes code generation and pushes the final code implementation scheme to the user, the system receives the user's judgment result on the scheme through the thinking chain agent. The user's judgment result may include feedback on the function, performance, compatibility, etc. of the code implementation. These feedbacks can be positive or negative, that is, the code meets the requirements or the code has defects and problems. The thinking chain agent decides to store the relevant information in which knowledge base according to these judgment results. Specifically, when the summary agent pushes the final code implementation scheme, the thinking chain agent starts the user feedback processing flow. First, collect feedback information, collect the functional evaluation of the user on the code implementation scheme through the natural language interface, capture the user operation log, and analyze the user's improvement suggestions.
[0071] Further, referring to Figure 7 , the steps of S160 include:
[0072] S161, receiving the intervention judgment result of the user on the final code implementation scheme through the thinking chain agent;
[0073] S162, if the intervention judgment result is that the final code implementation scheme is correct, the final code implementation scheme is stored in the correct answer knowledge base through the thinking chain agent;
[0074] S163, if the intervention judgment result is that the final code implementation scheme is incorrect, the thinking chain is extracted from the final code implementation scheme through the thinking chain agent and error reflection is performed, and then the final code implementation scheme and the thinking chain are stored in the thinking chain knowledge base.
[0075] The thinking chain agent receives the intervention judgment result of the user. If the user's intervention judgment result indicates that the pushed code implementation scheme meets the expectations, has no errors and meets the development requirements, the thinking chain agent regards the scheme as a successful code implementation and stores it in the correct answer knowledge base. The correct answer knowledge base is part of the dynamic knowledge graph, used to store code schemes that have been verified and meet the requirements, successful test cases and best practices. These verified correct schemes will provide important reference in future development process, and can be quickly matched and called through the intelligent agent, improving development efficiency and accuracy. Specifically, when the user confirms that the scheme is correct, the thinking chain agent performs knowledge sedimentation operation. Including completing code vectorization through Doc2Vec model, storing the relationship between scheme and knowledge graph entity node in triple form for knowledge graph association, and improving the priority weight of correct scheme in semantic retrieval through retrieval optimization to ensure that the same type of demand is matched preferentially in the future.
[0076] If the user feedbacks that the pushed code implementation scheme has errors or does not meet the requirements, the thinking chain agent will further analyze the scheme. In this process, the thinking chain agent will first extract the relevant thinking chain from the erroneous code implementation scheme, that is, reflect and summarize the information such as the problems involved, error types and their repair methods. This reflection process helps the agent understand the root cause of the problem and improve future error identification ability. Specifically, when the user determines that the scheme has errors, the thinking chain agent starts the deep analysis process. Including backtracking development full-process log and positioning key error node to complete error tracing, extracting complete reasoning path of error generation and correction to complete structured storage and thinking chain construction, using pre-trained error classification model to complete error pattern classification, binding the thinking chain with related nodes in the knowledge graph to form knowledge association storage.
[0077] These error solutions and their corresponding thought chains will be stored in the thought chain knowledge base. The thought chain knowledge base is used to store information such as failed cases, debugging logs, error pattern classification models, etc., to help the agent optimize the accuracy of requirement clarification and solution design. During the self-evolution of the system, these stored information will serve as training materials to help the agent gradually improve its code generation and debugging capabilities.
[0078] It should be noted that one of the main functions of the thought chain knowledge base is to train the error pattern recognition model. By analyzing and summarizing past failed cases, the system can identify common error patterns and solidify them as static analysis rules, thereby improving the accuracy of future code development. The system avoids making the same mistakes in subsequent development by reflecting on and gradually correcting these errors. In addition, the agent improves the process of requirement analysis and solution design by continuously learning and summarizing failed cases. This self-learning mechanism ensures that the software development system can continuously evolve and adapt to new requirements and challenges while providing high-quality solutions.
[0079] Through the information stored in the correct answer knowledge base and the thought chain knowledge base, the system can continuously optimize its code generation and problem solving process. Each time the semantic analysis is performed through the knowledge graph engine, the system will preferentially refer to the best practices and successful cases in the correct answer knowledge base. At the same time, the system will also use the failed cases in the thought chain knowledge base for optimization to prevent the repeated occurrence of similar errors, thereby improving the overall development efficiency and quality.
[0080] The method of the present application can be applied to multiple fields, such as for enterprise-level application rapid development, suitable for traditional enterprise digital transformation or cross-department collaboration tool construction, such as manufacturing enterprise MES system customization, retail CRM development, financial reimbursement process automation, HR performance management system, which can enable non-technical department employees to directly generate applications that meet enterprise IT specifications through natural language description of requirements. At the same time, it is also suitable for programming beginners and teaching education institutions to develop management tools, store teaching cases through powerful knowledge graph, support users to quickly reuse and adapt, and avoid common errors in student code through a three-fold verification system to improve learning efficiency.
[0081] Figure 8 is a schematic block diagram of a software development device 600 based on artificial intelligence provided by an embodiment of the present application. As shown in Figure 8 According to the above-mentioned software development method based on artificial intelligence, the present application also provides a software development device 600 based on artificial intelligence. The software development device 600 based on artificial intelligence includes units for executing the above-mentioned software development method based on artificial intelligence, and the device can be configured in a desktop computer, a tablet computer, a smart phone, etc.
[0082] In particular, referring to Figure 8 The artificial intelligence-based software development device 600 comprises:
[0083] A requirement acquisition unit 610 is configured to receive a development requirement of a user through a natural language interaction interface and capture context state information of a current development environment;
[0084] A first historical solution retrieval unit 620 is configured to retrieve a historical solution for the development requirement based on a dynamic knowledge graph through the product agent;
[0085] A first historical solution execution unit 630 is configured to, when the historical solution based on the development requirement is retrieved, generate executable code based on the historical solution according to a hierarchical code generation strategy through the architect agent;
[0086] A rationality verification unit 640 is configured to perform syntax checking, running verification, and requirement compliance detection on the executable code based on a hierarchical verification mechanism in combination with the context state information through the test agent to obtain a verification result;
[0087] A result pushing unit 650 is configured to, when the test agent determines that the verification result meets the development requirement, push the executable code summarized as a final code implementation solution to the user through the summary agent.
[0088] In an embodiment, the first historical solution retrieval unit 620 comprises:
[0089] A diagnosis decomposition unit is configured to, when the historical solution for the development requirement is not retrieved, perform requirement decomposition and awareness recognition on the development requirement through a triage agent, and obtain a plurality of sub-development tasks through decomposition of the development requirement;
[0090] A solution discussion unit is configured to perform solution discussion on each of the sub-development tasks through a plurality of scenario expert agents to obtain a sub-task process solution and hand over the sub-task process solution to the architect agent for solution integration into a to-be-written solution;
[0091] A test code generation unit is configured to generate executable code from the to-be-written solution according to a hierarchical code generation strategy through the architect agent.
[0092] In an embodiment, the diagnosis decomposition unit comprises:
[0093] A semantic feature generation unit is configured to parse the development requirement through the triage agent using a natural language model and generate requirement semantic features in combination with node embedding of the dynamic knowledge graph;
[0094] An intent label generation unit is configured to generate a structured intent label by performing intent recognition on the development requirement by the triage agent using a pre-trained classification model.
[0095] A subtask splitting unit is configured to split the development requirement to obtain the plurality of sub-development tasks by the triage agent based on component dependency relationships in the dynamic knowledge graph, the requirement semantic features, and the structured intent label.
[0096] Further, the scheme discussion unit comprises:
[0097] A scenario specialist allocation unit is configured to allocate a plurality of corresponding scenario specialist agents for each of the sub-development tasks by the triage agent.
[0098] A clarification list generation unit is configured to identify parameter missing items and ambiguity items in the corresponding sub-development task by each of the scenario specialist agents, and generate a plurality of clarification lists.
[0099] An interactive clarification unit is configured to obtain the clarification list by the product agent and continuously interact with the user until the parameter missing items and ambiguity items are supplemented and clarified.
[0100] A second historical scheme retrieval unit is configured to retrieve historical solutions similar to the field of the sub-development task based on the dynamic knowledge graph by the corresponding plurality of scenario specialist agents and perform scheme discussion.
[0101] A second historical scheme execution unit is configured to integrate the results of the scheme discussion by the architect agent and perform scheme testing when the scheme discussion of the plurality of scenario specialist agents corresponding to the same sub-development task does not conflict.
[0102] Further, the second historical scheme retrieval unit is further associated with:
[0103] A group contemplation unit is configured to output the results of the scheme discussion as the sub-task process scheme by the scenario specialist agent when the scheme discussion of the plurality of scenario specialist agents corresponding to the same sub-development task does not conflict, and integrate the sub-task process scheme as the to-be-written scheme by the architect agent.
[0104] In an embodiment, the result pushing unit 650 is associated with:
[0105] A knowledge base updating unit is configured to receive the judgment result of the user on the final code implementation scheme by the thought chain agent, and store the verification result in a correct answer knowledge base or a thought chain knowledge base in the dynamic knowledge graph according to the judgment result.
[0106] Further, the knowledge base updating unit comprises:
[0107] an intervention judgment unit configured to receive an intervention judgment result of the user on the final code implementation scheme through the thinking chain agent;
[0108] a correct scheme updating unit configured to, if the intervention judgment result is that the final code implementation scheme is correct, store the final code implementation scheme into the correct answer knowledge base through the thinking chain agent;
[0109] an error scheme updating unit configured to, if the intervention judgment result is that the final code implementation scheme is incorrect, extract a thinking chain from the final code implementation scheme and perform error reflection through the thinking chain agent, and then store the final code implementation scheme and the thinking chain into the thinking chain knowledge base.
[0110] The software development apparatus 600 based on artificial intelligence can be implemented in the form of a computer program, which can run on a computer device as shown in the drawings. Figure 9
[0111] Please refer to Figure 9 , Figure 9 is a schematic block diagram of a computer device provided by an embodiment of the present application. The computer device 500 can be a terminal or a server, wherein the terminal can be a desktop computer, a tablet computer, a smart phone, or the like electronic device having a communication function. The server can be a stand-alone server or a server cluster composed of multiple servers.
[0112] Please refer to Figure 9 , the computer device 500 comprises a processor 502, a memory and a network interface 505 connected through a system bus 501, wherein the memory can comprise a non-volatile storage medium 503 and an internal memory 504.
[0113] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. The computer program 5032 comprises program instructions, which, when executed, can cause the processor 502 to perform a software development method based on artificial intelligence.
[0114] The processor 502 is configured to provide computing and control capabilities to support the operation of the entire computer device 500.
[0115] The internal memory 504 provides an environment for the running of the computer program 5032 in the non-volatile storage medium 503, which, when executed by the processor 502, can cause the processor 502 to perform a software development method based on artificial intelligence.
[0116] The network interface 505 is configured to perform network communication with other devices. Those skilled in the art can understand that Figure 9 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device 500 to which the scheme of the present application is applied. The specific computer device 500 can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0117] The processor 502 is configured to run the computer program 5032 stored in the memory to implement the steps of the above method.
[0118] It should be understood that, in the embodiments of the present application, the processor 502 can be a central processing unit (CPU), and the processor 502 can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0119] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments of the method can be completed by a computer program instructing relevant hardware. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the above-mentioned embodiments of the method.
[0120] Therefore, the present application also provides a storage medium. The storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. The program instructions are executed by the processor to make the processor perform the steps of the above method.
[0121] The storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk, and various computer-readable storage media that can store program codes.
[0122] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0123] In several embodiments provided by the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. For example, the apparatus embodiments described above are merely schematic. For example, the division of each unit is only a logical function division, and actual implementation can have another division manner. For example, a plurality of units or components can be combined or integrated into another system, or some features can be omitted or not executed.
[0124] The steps in the method embodiments of the present application can be adjusted, combined and deleted in sequence according to actual needs. The units in the apparatus embodiments of the present application can be combined, divided and deleted according to actual needs. In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0125] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a terminal or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application.
[0126] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed by the present application, and these modifications or replacements should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. An artificial intelligence-based software development method, characterized by, The method is applied to a multi-agent system including a product agent, an architect agent, a test agent, a summary agent, a triage agent, and a scenario expert agent, and the method comprises: receiving a development requirement of a user through a natural language interaction interface, and capturing context state information of a current development environment; retrieving a historical solution of the development requirement based on a dynamic knowledge graph through the product agent; when no historical solution of the development requirement is retrieved, decomposing the development requirement and identifying awareness through the triage agent, and obtaining a plurality of sub-development tasks by decomposing the development requirement; discussing a solution for each of the sub-development tasks through a plurality of scenario expert agents to obtain a sub-task process solution and hand over the sub-task process solution to the architect agent for solution integration into a to-be-written solution; encoding the to-be-written solution into executable code according to a layered code generation strategy through the architect agent; when a historical solution based on the development requirement is retrieved, encoding executable code based on the historical solution according to a layered code generation strategy through the architect agent; performing syntax checking, running verification, and requirement compliance detection on the executable code based on a layered verification mechanism in combination with the context state information through the test agent to obtain a verification result; when the test agent determines that the verification result meets the development requirement, summarizing the executable code into a final code implementation solution through the summary agent and pushing the final code implementation solution to the user.
2. The artificial intelligence-based software development method of claim 1, wherein, The step of, when no historical solution of the development requirement is retrieved, decomposing the development requirement and identifying awareness through the triage agent, and obtaining a plurality of sub-development tasks by decomposing the development requirement, comprises: analyzing the development requirement through the triage agent using a natural language model, and generating requirement semantic features in combination with node embedding of the dynamic knowledge graph; performing intent recognition on the development requirement through the triage agent using a pre-trained classification model to generate a structured intent label; splitting the development requirement into the plurality of sub-development tasks based on component dependency relationships in the dynamic knowledge graph, the requirement semantic features, and the structured intent label through the triage agent. 3.The artificial intelligence-based software development method of claim 1, wherein, The step of, discussing a solution for each of the sub-development tasks through a plurality of scenario expert agents to obtain a sub-task process solution and hand over the sub-task process solution to the architect agent for solution integration into a to-be-written solution, comprises: allocating a plurality of corresponding scenario expert agents for each of the sub-development tasks through the triage agent; identifying missing items and ambiguous items in the corresponding sub-development tasks through each of the scenario expert agents to generate a plurality of clarification lists; obtaining the clarification lists through the product agent and continuously interacting with the user until the missing items and the ambiguous items are supplemented and clarified; discussing a solution through a plurality of corresponding scenario expert agents based on historical solutions similar to the domain of the sub-development task, and retrieving the historical solutions based on the dynamic knowledge graph; When the scheme discussions of the multiple scenario specialist agents corresponding to the same sub-development task do not conflict, the scenario specialist agents output the results of the scheme discussions as the sub-task process schemes, and the architect agent integrates the sub-task process schemes into the to-be-written scheme.
4. The artificial intelligence-based software development method of claim 3, wherein, The step of retrieving a historical solution similar to the scenario of the sub-development task based on the dynamic knowledge graph and performing scheme discussions through the corresponding multiple scenario specialist agents further includes: When the scheme discussions of the multiple scenario specialist agents corresponding to the same sub-development task conflict, a consensus scheme is obtained through group meditation based on the context state information and the dynamic knowledge graph, and the architect agent integrates the consensus scheme and performs scheme testing.
5. The artificial intelligence-based software development method of claim 1, wherein, The multi-agent system further includes a thought chain agent, and the step of pushing the final code implementation scheme to the user through the summary agent after the test agent determines that the verification result meets the development requirements further includes: The thought chain agent receives a judgment result of the user on the final code implementation scheme, and stores the verification result in a correct answer knowledge base or a thought chain knowledge base in the dynamic knowledge graph according to the judgment result.
6. The artificial intelligence-based software development method of claim 5, wherein, The dynamic knowledge graph includes a correct answer knowledge base and a thought chain knowledge base, and the step of receiving a judgment result of the user on the final code implementation scheme through the thought chain agent and storing the verification result in a correct answer knowledge base or a thought chain knowledge base in the dynamic knowledge graph includes: The thought chain agent receives a judgment result of the user on the final code implementation scheme; If the intervention judgment result is that the final code implementation scheme is correct, the thought chain agent stores the final code implementation scheme in the correct answer knowledge base; If the intervention judgment result is that the final code implementation scheme is incorrect, the thought chain agent extracts a thought chain from the final code implementation scheme and performs error reflection, and then stores the final code implementation scheme and the thought chain in the thought chain knowledge base.
7. An artificial intelligence-based software development apparatus, characterized by comprising: A computer device for executing the artificial intelligence-based software development method according to any one of claims 1 to 6.
8. A computer device, comprising: The computer device includes a memory and a processor connected to the memory; the memory is used to store a computer program; and the processor is used to run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and the computer program includes program instructions which, when executed by a processor, can implement the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Code generator based on SSH (secure shell) architecture and method
CN102591654A
Enterprise-level software development auxiliary system and method based on large model
CN117130592A
Code generation method and device based on agent, electronic equipment and storage medium
CN120295632A