Intelligent agent-based applet code automatic generation system and control method thereof
Through the intelligent agent-based automatic mini-program code generation system, the problem of high user programming ability and industry knowledge requirements in the existing technology is solved, and efficient and accurate mini-program code generation is achieved without manual programming, ensuring that the code meets user needs and improving the stability and interactivity of the system.
Patent Information
- Application Number
- CN202511164403.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-08-20
AI Technical Summary
Existing industry software has high requirements on user programming ability and industry knowledge when generating mini-program code, and lacks support for specific industries, making it difficult for users to obtain executable logic code that meets industry standards. Existing intelligent programming assistance tools lack fine-grained understanding, resulting in users frequently manually troubleshooting mismatched codes.
An agent-based automatic mini-program code generation system is adopted, including a user requirement input module, a mini-program generation module and a stage verification module. The mini-program code is automatically generated and verified through the agent, and the user description agent, code implementation agent and reflective agent are coordinated. The RAG module is used for vectorization and preset knowledge base retrieval to ensure that the code meets user requirements.
It achieves cross-platform login stability and compatibility without manual programming. The generated code precisely meets user needs, avoids hallucination problems, and improves the accuracy of mini-program code generation and user interaction experience.
Smart Images

Figure CN120653231A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of auxiliary programming, and in particular relates to an intelligent agent-based mini-program code automatic generation system and a control method thereof. Background Art
[0002] Current industry software, such as Zhiyuan Zxdoc's Python programming: full code programming, only examples and supporting functions, requires high user programming ability, function proficiency and industry knowledge.
[0003] Just like TsMast's C applet and Vector's Canoe: the combination of manual addition of code blocks in the interface and manual programming also requires high user programming ability, function proficiency and industry knowledge.
[0004] Existing industry software relies heavily on documentation, requiring users to possess strong reading comprehension and programming backgrounds. Programming can still be challenging due to insufficiently detailed and understandable documentation, forcing users to rely heavily on manual guidance. While various intelligent agent-based programming assistance tools exist, such as ChatGPT, GitHub Copilot, Tabnine, CodeGeeX, and Tongyi Lingma, these tools focus on general programming syntax and lack support for specialized communication protocols, system integration documentation, and SDKs for specific industries (such as automotive electronics). While there is precedent for using RAG for processing assistance, traditional RAG systems often only chop technical documentation into fixed-length chunks and lack understanding of fine-grained context like protocol types, call constraints, and hardware limits. This often leads to recalls of ambiguous or inappropriate fragments, forcing users to frequently manually troubleshoot mismatched code. Overall, users typically only receive syntax-level suggestions, rather than complete, industry-standard executable logic code. This results in very limited precision assistance in actual development. Existing systems cannot automatically generate mini-program code that meets user needs. Summary of the Invention
[0005] In order to solve the technical problems existing in the above-mentioned prior art, the present invention provides an intelligent agent-based mini-program code automatic generation system and its control method, which does not rely on manual programming and is not limited by the technical field. It is efficient, accurate and easy to operate.
[0006] The present invention solves the technical problem by the following technical solutions: An agent-based automatic code generation system for small programs, comprising: A user requirement input module is used to input the user's requirements for the generated mini-program code in text form; Mini-program generation module, used to automatically generate mini-program codes that meet user needs through intelligent agents; The stage verification module is used to complete the verification of each stage during the process of the intelligent agent automatically generating the mini program code; The interactive module is used to realize user cross-platform login and data interaction.
[0007] The control method of the agent-based mini-program code automatic generation system includes the following steps: Step S1: After logging in to the C language applet, the user obtains a unique identity authentication; Step S2: The user inputs user requirements through the C language applet; Step S3: The C language applet delivers the user request to the agent. If the agent verifies that the user's unique identity authentication is valid, step S4 is executed; otherwise, the request is rejected. Step S4: The agent translates the user requirement into a user requirement code, and then verifies whether the user requirement code is correct. If it is correct, step S5 is executed. If it is incorrect, an error message is returned, and after updating the user requirement, step S4 is repeated. Step S5: The agent searches the preset knowledge base based on the user's required code, edits the search results, and obtains the preliminary results of the mini-program code compilation. It verifies whether the preliminary results of the mini-program code compilation meet the user's requirements. If they do, it outputs the mini-program code execution results and implements step S6. If they do not, it corrects the errors detected by the agent, including parameter adjustment, process modification, and reconstruction optimization of the preliminary results of the mini-program code compilation. Step S6: The intelligent agent verifies the execution result of the mini-program code. If the operation meets the requirements, the entire mini-program code automatic generation process is completed and the result is output. If the operation does not meet the requirements, S3 is repeated.
[0008] Furthermore, in steps S4-S6, the agent includes a user description agent, a code implementation agent, and a reflection agent; wherein, The user description agent can translate user requirements into user requirement codes, which are then input into the code implementation agent; The code implementation agent can output the preliminary results of the mini-program code compilation that meets the user's requirements according to the user's required code; The reflective agent is used to verify whether the user requirement code is correct, whether the preliminary results of the mini-program code compilation meet the user requirements, and whether the mini-program code execution results meet the running requirements. At the same time, it analyzes the differences between the current mini-program code execution results and user requirements, and intelligently adjusts and corrects the generated mini-program code.
[0009] Furthermore, in step S1, the unique identity authentication obtained is a valid token, which serves as a credential for user authentication and all platform authorizations. After obtaining the token, the C language applet carries it. In step S3, a request is sent to the intelligent agent through a network request. After receiving the request, the intelligent agent verifies it through the Redis system of the cloud platform. The Redis system is used to store and verify whether the token is valid. During the verification process, the Redis system quickly checks whether the token exists in the cache data of the current system. If it exists and is valid, the intelligent agent will continue to process the request; otherwise, the request will be rejected and the user will be prompted to log in again.
[0010] Furthermore, in step S5, parameter adjustment refers to adjusting the parameters of the function calls involved in the preliminary results of the mini-program code compilation according to the reflective agent detection results; Process modification refers to optimizing the execution process of the preliminary results of the Mini Program code compilation; Refactoring optimization refers to optimizing the preliminary results of mini-program code compilation after confirming that the logic is correct.
[0011] Furthermore, in step S6, when executing the mini-program code execution result, its logical correctness is verified through the log information, message receiving interface, system variables, and graphic window of the mini-program code execution result.
[0012] Furthermore, the reflective agent verifies whether the user requirement code is correct, which means checking whether the code can be compiled normally. If it can be compiled normally, the user requirement code is judged to be correct. If it cannot be compiled normally, the user requirement code is judged to be incorrect. Reflective intelligence verifies whether the preliminary results of the mini-program code compilation meet user requirements. Specifically, the reflective intelligence compares the user requirement code with the preset knowledge base to check whether the code logic of the preliminary results of the mini-program code compilation is correct and whether the function call parameters are correct. If the result is correct, it is output to the C language mini-program through the SSE protocol.
[0013] Furthermore, the user description agent, code implementation agent and reflection agent all vectorize the input text information to obtain information vectors through the RAG module, retrieve them from the preset knowledge base, and then use the RRF reciprocal sorting fusion algorithm to uniformly sort the semantic units in the preset knowledge base retrieved by the information vectors and the keyword search results to achieve the fusion of semantic unit relevance and keyword accuracy. Specifically, first, a sorted list is obtained through the keyword retriever. , and then get the sorted list through the semantic search engine After the final calculation, sort the user text descriptions from high to low according to their consistency, and then take the k semantic units with the highest consistency of the user text descriptions as the final generated semantic units. The specific calculation formula is: ; In the formula, d represents the current semantic unit, Score RRF represents the final fusion score of the current semantic unit, R keyword (d) represents the ranking of the current semantic unit in the keyword search ranking list, R semantic (d) represents the ranking of the current semantic unit in the semantic retrieval ranking list, and k is the number of semantic units.
[0014] Furthermore, the user description agent, code implementation agent, and reflection agent each contain their corresponding preset knowledge base; When the user description agent, code implementation agent, and reflection agent vectorize their respective input text information, RAG first stores the original data, then stores the vectorized vector data, and finally identifies the label; The preset knowledge base includes preset applet functions and industry document codes; The industry document code performs grammatical and semantic analysis on the industry document to obtain the industry document semantic unit, and then adds metadata tags to each minimum industry document semantic unit and stores them in the preset knowledge base. When the intelligent agent searches the preset knowledge base, it first identifies several metadata tags corresponding to the vectorized vector data, stores several metadata tags, and then searches for industry document semantic units based on several metadata tags.
[0015] Furthermore, when the reflective agent verifies whether the user requirement code is correct, it will search the preset knowledge base to see whether it contains the semantic unit corresponding to the current user requirement code. If some of the code is not included in the preset knowledge base, the unincluded user code part will be output back to the code generation agent as a difference, and the next instruction will be immediately rejected, and the corresponding step of user code input will be returned; RAG calls Function Calling and MCP as needed to obtain the current time and location information based on the input of the previous step and the semantic units in the preset knowledge base.
[0016] Compared with the prior art, the present invention has the following beneficial effects: Cooperating with different intelligent agents, they are processed through RAG respectively, so both full and segmented codes can be included. At the same time, the required professional knowledge and industry documents are placed in the preset knowledge base, and programming codes are provided directly. Non-prompt programming is free from manual programming. Full programming can be directly handed over to the system for writing. Users only need to fully describe the requirements to be implemented to the intelligent agent, and the intelligent agent will automatically generate small program codes that meet user needs.
[0017] 2. The present invention utilizes the cooperation of user demand agents, code implementation agents and reflective agents, and performs stage verification in each process step to ensure that the generated code meets the expected functions, effectively avoiding the occurrence of hallucination problems, improving the accuracy of the mini-program code generation process, and solving data security and obsolescence problems through RAG and FunctionCalling technologies.
[0018] 3. The present invention uses the SSE protocol to establish a long connection with the intelligent body. The system ensures that messages are not lost and maintains a good user interaction experience. At the same time, the cross-platform login problem is also effectively solved, improving the stability and compatibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a system structure diagram of Example 1; Figure 2 is a flow chart of the control method of Example 1; Figure 3 This is a schematic diagram of Effect Example 1. DETAILED DESCRIPTION
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.
[0022] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0023] In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer" and the like indicate positions or locations based on the positions shown in the accompanying drawings, or the positions or locations in which the inventive product is typically placed when in use. These terms are intended solely to facilitate the description of the present invention and to simplify the description, and are not intended to indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on the present invention. Furthermore, the terms "first," "second," and "third," etc., are used solely to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0024] Furthermore, terms such as "horizontal," "vertical," and "overhanging" do not necessarily imply that a component must be absolutely horizontal or overhanging, but rather that it can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but rather that it can be slightly tilted.
[0025] In the description of the present invention, it should also be noted that, unless otherwise expressly specified or limited, the terms "disposed," "installed," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; they may refer to mechanical connections or electrical connections; they may refer to direct connections or indirect connections through an intermediate medium; and they may refer to internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on the specific circumstances.
[0026] Example 1 like Figure 1 As shown, a system for automatically generating applet codes based on an intelligent agent includes: A user requirement input module is used to input the user's requirements for the generated mini-program code in text form; Mini-program generation module, used to automatically generate mini-program codes that meet user needs through intelligent agents; The stage verification module is used to complete the verification of each stage during the process of the intelligent agent automatically generating the mini program code; The interactive module is used to realize user cross-platform login and data interaction.
[0027] The control method of the agent-based mini-program code automatic generation system includes the following steps: Step S1: After logging in to the C language applet, the user obtains a unique identity, that is, a valid token. The token serves as a credential for user authentication and all platform authorizations. After obtaining the token, the C language applet carries it; Step S2: The user inputs user requirements through the C language applet; In step S3, the C language applet delivers the user request to the agent. If the agent verifies that the user's unique identity authentication is valid, step S4 is implemented; otherwise, the request is rejected. (The specific process is to send a request to the agent via a network request. After receiving the request, the agent verifies it through the cloud platform's Redis system. The Redis system is used to store and verify whether the token is valid. During the verification process, the Redis system quickly checks whether the token exists in its system cache data. If it exists and is valid, the agent will continue to process the request; otherwise, the request is rejected and the user is prompted to log in again.) Step S4: The agent translates the user requirement into a user requirement code, and then verifies whether the user requirement code is correct. If it is correct, step S5 is executed. If it is incorrect, an error message is returned, and after updating the user requirement, step S4 is repeated. Step S5: The agent searches the preset knowledge base based on the user's required code, edits the search results, obtains the preliminary results of the mini-program code compilation, verifies whether the preliminary results of the mini-program code compilation meet the user's requirements, and if so, outputs the mini-program code execution results and implements step S6. If not, corrections are made based on the errors or inconsistencies detected by the agent. The corrections include parameter adjustment, process modification, and reconstruction optimization of the preliminary results of the mini-program code compilation (parameter adjustment refers to adjusting the parameters of the function calls involved in the preliminary results of the mini-program code compilation based on the detection results of the reflective agent; process modification refers to optimizing the execution process of the preliminary results of the mini-program code compilation; reconstruction optimization refers to optimizing the preliminary results of the mini-program code compilation after confirming that the logic is correct). Step S6: The intelligent agent verifies the execution result of the mini-program code (during the execution verification, the logical correctness of the mini-program code execution result is verified through its log information, message receiving interface, system variables, and graphic windows). If the operation meets the requirements, the entire mini-program code automatic generation process is completed and the results are output. If the operation does not meet the requirements, S3 is repeated.
[0028] It should be noted that, in this embodiment, the agents include user description agents, code implementation agents and reflection agents; The user description agent can translate user requirements into user requirement codes, which are then input into the code implementation agent; The code implementation agent can output preliminary results of mini-program code compilation that meet the user's requirements based on the user's required code (this process includes searching the preset knowledge base for code, and can also generate results after optimization through applicable large models in existing technologies); The reflective agent is used to verify whether the user requirement code is correct (the reflective agent verifies whether the user requirement code is correct, which means whether the code can be compiled normally. If it can, the user requirement code is determined to be correct. If it cannot, the user requirement code is determined to be wrong), whether the preliminary results of the mini-program code compilation meet the user requirements (the reflective agent verifies whether the preliminary results of the mini-program code compilation meet the user requirements. Specifically, the reflective agent compares the user requirement code with the preset knowledge base to check whether the code logic of the preliminary results of the mini-program code compilation is correct and whether the function call parameters are correct. If the result is correct, it is output to the C language mini-program through the SSE protocol) and whether the mini-program code execution results meet the running requirements. At the same time, it analyzes the differences between the current mini-program code execution results and user requirements, and intelligently adjusts and corrects the generated mini-program code.
[0029] In this embodiment, the user description agent, the code implementation agent and the reflection agent all vectorize the input text information to obtain information vectors through the RAG module, retrieve them from the preset knowledge base, and then use the RRF reciprocal sorting fusion algorithm to uniformly sort the semantic units in the preset knowledge base retrieved by the information vectors and the keyword search results to achieve the fusion of semantic unit relevance and keyword accuracy. Specifically, first, a sorting list is obtained through the keyword retriever. , and then get the sorted list through the semantic search engine After the final calculation, all documents are sorted from high to low according to the degree of conformity of the user text description, and the k semantic units with the highest degree of conformity of the user text description are taken as the final generated semantic units. The specific calculation formula is: ;
[0030] In the formula, d represents the current semantic unit, Score RRF represents the final fusion score of the current semantic unit, R keyword (d) represents the ranking of the current semantic unit in the keyword search ranking list, R semantic (d) represents the ranking of the current semantic unit in the semantic retrieval ranking list, and k is the number of semantic units.
[0031] In this embodiment, the user description agent, the code implementation agent, and the reflection agent each contain their corresponding preset knowledge bases; When the user description agent, code implementation agent, and reflection agent vectorize their respective input text information, RAG first stores the original data, then stores the vectorized vector data, and finally identifies the label; The preset knowledge base includes preset applet functions, industry document codes (user manuals, function interface description document codes, etc.); The industry document code performs grammatical and semantic analysis on the industry document to obtain the industry document semantic unit, and then adds metadata tags to each minimum industry document semantic unit and stores them in the preset knowledge base. When the intelligent agent searches the preset knowledge base, it first identifies several metadata tags corresponding to the vectorized vector data, stores several metadata tags, and then searches for industry document semantic units based on several metadata tags.
[0032] In this embodiment, when the reflective agent verifies whether the user requirement code is correct, it will search the preset knowledge base to see whether it contains the semantic unit corresponding to the current user requirement code. If some of the code is not included in the preset knowledge base, the unincluded user code part will be output back to the code generation agent as a difference, and the next instruction will be immediately rejected, and the process will return to the step corresponding to the user code input. RAG calls Function Calling and MCP as needed to obtain the current time and location information based on the input of the previous step and the semantic unit in the preset knowledge base.
[0033] At the same time, in step S6, it is verified whether the mini program code meets the user requirements. In actual use, it can also be divided into three stages: static analysis stage, compilation stage and user acceptance stage. Among them, static analysis uses reflective intelligent agents to directly check the mini program code to determine whether there are grammatical errors; in the compilation stage, the user clicks the compile and run button or compiles it in the built-in compiler of the intelligent agent. If no error occurs, it is judged to be qualified; in the user acceptance stage, if the user does not click to regenerate, it is correct.
[0034] It should be noted that the User Requirements Agent, Code Implementation Agent, and Reflection Agent all have a built-in big model. These agents input their results into the big model through the RAG module, and the big model outputs results based on the input content and the pre-set knowledge base. The big model can utilize a cloud-based big model, incorporate local business knowledge, and perform fine-tuning. This can then be deployed locally to ensure data file security. The pre-set database and big model provide question-and-answer services to the cloud service, which in turn provides the question-and-answer responses for the system of this embodiment.
[0035] Effect Example 1 like Figure 3 As shown, after the technical solution of Example 1 is implemented, various necessary industry documents are preset in the knowledge base and then fine-tuned.
[0036] The vector database and the large model used in this example can provide question-answering services to the cloud service, and the cloud service provides question-answering responses to the computer-side agent-based mini-program code automatic generation system.
[0037] The agent-based automatic code generation system for mini-programs on the computer has an agent dialog box that can communicate with users about questions. The agent service provided by the cloud displays the answer here.
[0038] Users can also selectively or completely copy the agent's answers to the full code editor of the C applet.
[0039] Users can also switch to segmented editing to view the code on the left.
[0040] After the overall compilation is run, the functions required to be executed in the sending function and receiving events can be executed.
[0041] Therefore, it can be seen that the structured display of C applet code is segmented editing and full editing, and the code is decomposed into different nodes for display and use according to the syntax tree.
[0042] In this example, the large model involved in the intelligent agent combines the business processes of the automotive industry and adds the corresponding content to the preset knowledge base, which also includes various diagnostic communication protocols and system usage programming methods.
[0043] The code provided by the intelligent agent is obtained through user communication and can be directly applied to the full editing code for compilation and execution.
[0044] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0045] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0046] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. An agent-based automatic generation system for small program codes, characterized in that: include: A user requirement input module is used to input the user's requirements for the generated mini-program code in text form; Mini-program generation module, used to automatically generate mini-program codes that meet user needs through intelligent agents; The stage verification module is used to complete the verification of each stage during the process of the intelligent agent automatically generating the mini program code; The interactive module is used to realize user cross-platform login and data interaction.
2. The control method of the agent-based mini-program code automatic generation system according to claim 1, characterized in that: The following steps are involved: Step S1: After logging in to the C language applet, the user obtains a unique identity authentication; Step S2: The user inputs user requirements through the C language applet; Step S3: The C language applet delivers the user request to the agent. If the agent verifies that the user's unique identity authentication is valid, step S4 is executed; otherwise, the request is rejected. Step S4: The agent translates the user requirement into a user requirement code, and then verifies whether the user requirement code is correct. If it is correct, step S5 is executed; if it is incorrect, an error message is returned, the user requirement is updated, and step S4 is repeated; Step S5: The agent searches the preset knowledge base based on the user's required code, edits the search results, and obtains the preliminary results of the mini-program code compilation. It verifies whether the preliminary results of the mini-program code compilation meet the user's requirements. If so, it outputs the mini-program code execution results and implements step S6. If not, it corrects the errors detected by the agent, including parameter adjustment, process modification, and reconstruction optimization of the preliminary results of the mini-program code compilation. Step S6: The intelligent agent verifies the execution result of the mini-program code. If the operation meets the requirements, the entire mini-program code automatic generation process is completed and the result is output. If the operation does not meet the requirements, S3 is repeated.
3. The control method of the agent-based mini-program code automatic generation system according to claim 2, characterized in that: In the steps S4-S6, the agents include a user description agent, a code implementation agent and a reflection agent; wherein, The user description agent can translate user requirements into user requirement codes, and then input them into the code implementation agent; The code implementation agent can output the preliminary result of compiling the small program code that meets the user's requirements according to the user's required code; The reflective agent is used to verify whether the user requirement code is correct, whether the preliminary results of the mini-program code compilation meet the user requirements, and whether the mini-program code execution results meet the operation requirements. At the same time, it analyzes the differences between the current mini-program code execution results and user requirements, and adjusts and corrects the generated mini-program code.
4. The control method of the agent-based mini-program code automatic generation system according to claim 2, characterized in that: In step S1, the unique identity authentication obtained is a valid token, which serves as a credential for user identity authentication and all platform authorizations. After obtaining the token, the C language applet carries it. In step S3, a request is sent to the intelligent agent through a network request. After receiving the request, the intelligent agent verifies it through the Redis system of the cloud platform. The Redis system is used to store and verify whether the token is valid. During the verification process, the Redis system quickly checks whether the token exists in the cache data of the current system. If it exists and is valid, the intelligent agent will continue to process the request; otherwise, the request will be rejected and the user will be prompted to log in again.
5. The control method of the agent-based mini-program code automatic generation system according to claim 3 is characterized in that: In step S5, parameter adjustment refers to adjusting the parameters of the function calls involved in the preliminary results of the mini-program code compilation according to the reflective agent detection results; Process modification refers to optimizing the execution process of the preliminary results of the Mini Program code compilation; Refactoring optimization refers to optimizing the preliminary results of mini-program code compilation after confirming that the logic is correct.
6. The control method of the agent-based mini-program code automatic generation system according to claim 3, characterized in that: In step S6, when executing the mini-program code execution result, its logical correctness is verified through the log information, message receiving interface, system variables, and graphic window of the mini-program code execution result.
7. The control method of the agent-based mini-program code automatic generation system according to claim 3, characterized in that: The reflective agent verifies whether the user requirement code is correct, which means checking whether the code can be compiled normally. If it can be compiled normally, the user requirement code is judged to be correct; if it cannot be compiled normally, the user requirement code is judged to be incorrect. The reflective intelligent verification verifies whether the preliminary result of the mini-program code compilation meets the user requirements. Specifically, the reflective intelligent agent compares the user requirement code with the preset knowledge base to check whether the code logic of the preliminary result of the mini-program code compilation is correct and whether the function call parameters are correct. If the result is correct, it is output to the C language mini-program through the SSE protocol.
8. The control method of the agent-based mini-program code automatic generation system according to claim 7, characterized in that: The user description agent, code implementation agent and reflection agent all vectorize the input text information to obtain information vectors through the RAG module, retrieve from the preset knowledge base, and then use the RRF reciprocal sorting fusion algorithm to uniformly sort the semantic units in the preset knowledge base retrieved by the information vectors and the keyword search results to achieve the fusion of semantic unit relevance and keyword accuracy. Specifically, first, a sorted list is obtained through the keyword searcher. , and then get the sorted list through the semantic search engine After the final calculation, sort the user text descriptions from high to low according to their consistency, and then take the k semantic units with the highest consistency of the user text descriptions as the final generated semantic units. The specific calculation formula is: ; In the formula, d represents the current semantic unit, Score RRF represents the final fusion score of the current semantic unit, R keyword (d) represents the ranking of the current semantic unit in the keyword search ranking list, R semantic (d) represents the ranking of the current semantic unit in the semantic retrieval ranking list, and k is the number of semantic units.
9. The control method of the agent-based mini-program code automatic generation system according to claim 8, characterized in that: The user description agent, code implementation agent and reflection agent each contain their corresponding preset knowledge base; When the user description agent, code implementation agent, and reflection agent vectorize their respective input text information, RAG first stores the original data, then stores the vectorized vector data, and finally identifies the label; The preset knowledge base includes preset applet functions and industry document codes; The industry document code performs grammatical and semantic analysis on the industry document to obtain industry document semantic units, and then adds metadata tags to each minimum industry document semantic unit and stores them in a preset knowledge base. When the intelligent agent searches the preset knowledge base, it first identifies several metadata tags corresponding to the vectorized vector data, stores the several metadata tags, and then performs industry document semantic unit retrieval for the several metadata tags.
10. The control method of the agent-based mini-program code automatic generation system according to claim 9, characterized in that: When the reflective agent verifies whether the user requirement code is correct, it will search the preset knowledge base to see whether it contains the semantic unit corresponding to the current user requirement code. If some of the code is not included in the preset knowledge base, the unincluded user code part will be output back to the code generation agent as a difference, and the next instruction will be immediately rejected, and the return will be made to the corresponding step of user code input; the RAG will call Function Calling and MCP as needed to obtain the current time and location information based on the input of the previous step and the semantic unit in the preset knowledge base.
Citation Information
Patent Citations
Code generation method and device based on multi-intelligence collaboration, medium and equipment
CN119960742A
Multi-agent-based programmable logic controller structured text generation method
CN120450033A
Code generation method based on graph alignment coding large model and multi-agent collaboration
CN120508285A
Automated software development workflows via multi-agent computational framework
US20250165890A1
Cited By
IFC model cognitive agent based on MCP protocol and working method thereof
CN121433759A