Intelligent programming model optimization method for complex programming scene
By introducing visual interactive interface, task processor and subcomponent manager into the intelligent programming model, refine programming tasks and use local model libraries, the problems of low accuracy of intelligent programming models in complex scenarios and relying on third-party services are solved. Improves the accuracy and security of generated code.
Patent Information
- Application Number
- CN202411271194.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-13
AI Technical Summary
The existing intelligent programming models have low generation accuracy when dealing with complex programming scenarios, and rely on third-party large language model services, affecting network quality and code privacy and security.
Using visual interactive interface, task processor and subcomponent manager, refine programming tasks through the requirements identification module, component orchestration module matches and executes sub-tasks, and use the local model library to provide large language model services, reducing dependence on third-party services while improving generation Code accuracy.
It improves the problem-solving success rate in complex programming scenarios, enhances the accuracy and scalability of intelligent programming models, reduces dependence on external networks, and improves the efficiency and security of code generation.
Smart Images

Figure CN119127155A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent programming in software engineering, and in particular to an intelligent programming model optimization method for complex programming scenarios. Background Art
[0002] Intelligent programming models (hereinafter referred to as models) are tools commonly used in software development in recent years. Developers send prompts to the model (i.e., raise questions or requirements), and the model will analyze, interpret, and generate relevant code snippets to help developers quickly complete software development work. The model provides developers with powerful programming support, which can greatly improve the work efficiency of developers and help enterprises reduce software development costs.
[0003] Recent intelligent programming models (such as GitHub Copilot) are usually based on deep learning and large language models (such as OpenAI's GPT series models). These models are trained with massive data and can understand programming language syntax. Developers use natural language to put forward requirements to the model, which uses large language model technology to analyze the requirements and automatically generate relevant code snippets and text descriptions. The model is usually expanded in the form of plug-in tools in integrated development environments such as Visual Studio Code and JetBrains, allowing developers to use large language models to achieve a series of code development requirements without leaving the development environment.
[0004] Although the code generated by the model is usually effective, when dealing with complex programming scenarios such as multi-step programming problems, cross-file dependency problems, and unconventional error debugging problems, the model may not correctly understand the problem requirements, resulting in low accuracy of the generated results or the generated code cannot solve the problem. In these cases, the incorrect solution generated by the programming model will lead to more debugging time; on the other hand, these models usually use large language models based on the cloud or external services, and have rigid requirements for maintaining network connections for a long time, and also have performance requirements for network quality and connection stability. In addition, the use of large language models provided by third parties also affects the code privacy and security of developers. Summary of the invention
[0005] In view of the above problems existing in the application of the prior art, the present invention aims to solve the following problems: the low accuracy of programming model generation when facing complex logic and the general reliance of programming models on third-party large language model services.
[0006] To solve the above problems, the technical solution adopted by the present invention is as follows:
[0007] The present invention provides an intelligent programming model optimization method for complex programming scenarios, including a visual interactive interface, a task processor, a subcomponent manager and a model library.
[0008] The visual interaction interface includes a dialog interaction interface for direct interaction between the user and the intelligent programming model and a visual command execution panel for the user to quickly execute preset commands.
[0009] The task processor includes a requirement identification module for determining a specific programming task from a requirement problem description, a task decomposition module for breaking down the programming task into subtasks, and a component arrangement module for matching appropriate components to subtasks and determining task priorities.
[0010] Among them, the sub-component manager includes a code generation and completion component for generating completion code, a code summary interpretation component for explaining the function and detailed information of the code, a test case generation component for generating unit test code and test cases, a code vulnerability detection component for performing vulnerability detection and locating and generating corresponding solutions, and a code quality detection component for checking code quality issues and bad programming habits and generating optimization suggestions.
[0011] The model library includes all large language models and model parameter files stored locally, and is used to provide large language model services.
[0012] Step S1: Visual interaction proposes requirements. The user sends the requirement problem description to the intelligent programming model in the visual interaction interface;
[0013] Step S2, receiving and analyzing user needs. The task processor receives the demand problem description issued by the user and sends it to the internal demand identification module. The demand identification module determines the specific programming task to be completed from the demand problem description and sends it to the task decomposition module. The task decomposition module decomposes the programming task into a series of smaller and clearer sub-tasks. The task decomposition module sends the sub-tasks with clear goals and boundaries to the component orchestration module. The component orchestration module selects a suitable component for each sub-task to process and determines the task processing order, thereby obtaining a task-component matching pair. The component orchestration module sends the suitable components selected for each sub-task and the task execution priority plan to the sub-component manager.
[0014] Step S3, subtasks are coordinated and executed. The subcomponent manager calls the corresponding components in the subcomponent manager in sequence to execute subtasks based on the task-component matching pairs obtained in step S2 and the processing priority information of each subtask, and coordinates the information transmission between different components.
[0015] Step S4: Aggregate execution results: the sub-component manager organizes and merges the execution results of each sub-task to form a complete solution.
[0016] Step S5: Feedback the final result: the subcomponent manager sends the complete solution obtained in step S4 to the visual interactive interface to show the final result to the user.
[0017] Furthermore, the step of visually interacting and proposing requirements in step S1 includes:
[0018] The user can enter the description of the requirement in the input box of the dialogue interaction page of the visual interaction interface, and then click the send button to pass it to the task processor, and can optionally attach the code to be queried. The user can also select some pre-set commands in the visual command execution panel of the visual interaction interface to pass to the task processor.
[0019] Further, step S2, the step of receiving and analyzing user needs, includes:
[0020] Step S21: The task processor receives the requirement problem description sent by the user and sends it to the internal requirement identification module to select and use a large language model in the model library to extract and confirm the specific programming task that needs to be completed from the overall problem description.
[0021] Step S22, the requirement identification module sends the extracted specific programming task to the task decomposition module. The task decomposition module selects and uses a large language model in the model library to analyze the programming task, decompose the task steps, discover the implicit steps of the task and generate the optimal subtask set for the task. Each subtask has a clear purpose and clear boundaries.
[0022] Step S23: The task decomposition module sends the subtask set to the component orchestration module. The component orchestration module selects and uses a large language model in the model library to select the most matching subcomponent for each subtask to execute, forming a task-component matching pair, and uses the large language model to generate a subtask priority order to form a task execution plan.
[0023] Step S24: The component orchestration module transmits the task-component matching pair and the task execution plan to the sub-component manager.
[0024] Further, step S3, the step of coordinating the execution of subtasks includes:
[0025] Step S31, the sub-component manager creates a thread execution stack according to the task-component matching pairs and sub-task processing priority order obtained in step S24, and sequentially puts the sub-components corresponding to each sub-task into the stack for execution.
[0026] Step S32, taking out components from the thread execution stack in turn and calling the execution component program. If there is information that needs to be passed to subsequent sub-components after the sub-component program is executed, the sub-component manager will pass the information between different sub-components.
[0027] Furthermore, in step S4, the step of aggregating execution results includes: the sub-component manager records the execution results of each component in step S32 and integrates them to form a complete solution.
[0028] Further, in step S5, the step of feeding back the final result includes: the subcomponent manager sends the complete solution obtained in step S4 to the visual interaction interface, and the dialogue interaction interface of the visual interaction interface displays the complete solution to the user in the form of dialogue.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. The present invention does not directly submit the demand problem description proposed by the user to the large language model for analysis and generation of solutions. Instead, it first uses the demand identification module to determine the specific programming tasks that need to be completed in the user's demand problem description, and then uses the task decomposition module to decompose the specific programming tasks into a series of sub-tasks with clear goals and boundaries. Finally, the component orchestration module determines the execution order of each sub-task and allocates components to execute the corresponding sub-tasks. Such a task determination and decomposition execution process can reduce the errors caused by processing complex tasks at one time. By gradually refining the tasks, the accuracy of the complete solution can be improved, and the success rate of solving problems in complex programming scenarios can be improved.
[0031] 2. The present invention uses a componentized approach to encapsulate common programming tasks, such as code generation, code interpretation, and code optimization, into components, rather than directly requesting a large language model to implement related tasks. The execution effect of each component is equal to or better than the effect of using a large language model alone to perform the corresponding task. In addition, using a componentized approach, when new task requirements arise or better components are upgraded, they can be easily integrated and replaced, thereby enhancing the scalability and maintainability of the intelligent programming model.
[0032] 3. The present invention uses components to encapsulate common tasks, and some components do not call the large language model to assist in implementing tasks, avoiding handing over all subtasks to the large language model for processing, thereby better allocating computing resources and improving the efficiency of the intelligent programming model.
[0033] 4. The present invention provides an intelligent programming model optimization method for complex programming scenarios. On the one hand, it can improve the accuracy of programming model understanding problems, thereby improving the processing success rate in complex programming scenarios; on the other hand, the method realizes model connection and management functions, and uses a large language model deployed locally on individual users, thereby eliminating the impact that may be caused by relying on external large language model services. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 The figure is a simplified flow chart of the method of the present invention. DETAILED DESCRIPTION
[0035] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0036] like Figure 1 As shown, an intelligent programming model optimization method for complex programming scenarios includes a visual interactive interface, a task processor, a sub-component manager, and a model library.
[0037] The visual interaction interface includes a dialog interaction interface for direct interaction between the user and the intelligent programming model and a visual command execution panel for the user to quickly execute preset commands.
[0038] The task processor includes a demand identification module, a task decomposition module, and a component arrangement module.
[0039] Among them, the sub-component manager includes a code generation and completion component for generating completion code, a code summary interpretation component for explaining the function and detailed information of the code, a test case generation component for generating unit test code and test cases, a code vulnerability detection component for performing vulnerability detection and locating and generating corresponding solutions, and a code quality detection component for checking code quality issues and bad programming habits and generating optimization suggestions.
[0040] Step S1: Visual interaction proposes requirements. The user sends the requirement problem description to the intelligent programming model in the visual interaction interface;
[0041] Step S2, receiving and analyzing user needs. The task processor receives the demand problem description issued by the user and sends it to the internal demand identification module. The demand identification module determines the specific programming task to be completed from the demand problem description and sends it to the task decomposition module to decompose the overall task into a series of smaller and clearer sub-tasks. The task decomposition module sends the sub-tasks with clear goals and boundaries to the component orchestration module to select the appropriate component to process each sub-task and determine the task processing order. The component orchestration module sends each sub-task execution component and the task execution priority plan to the sub-component manager.
[0042] Step S3, subtasks are coordinated and executed. The subcomponent manager calls the corresponding components in the subcomponent manager in sequence to execute subtasks based on the task-component matching pairs obtained in S2 and the processing priority information of each subtask, and coordinates the information transmission between different components.
[0043] Step S4: Aggregate execution results: the sub-component manager organizes and merges the execution results of each sub-task to form a complete solution.
[0044] Step S5: Feedback the final result: the subcomponent manager sends the complete solution obtained in step S4 to the visual interactive interface to show the final result to the user.
[0045] like Figure 1 As shown, step S1, the step of visually interacting and proposing requirements includes:
[0046] The user can enter the description of the requirement in the input box of the dialogue interaction page of the visual interaction interface, and then click the send button to pass it to the task processor, and can optionally attach the code to be queried. The user can also select some pre-set commands in the visual command execution panel of the visual interaction interface to pass to the task processor.
[0047] like Figure 1 As shown, step S2, the step of receiving and analyzing user needs, includes:
[0048] Step S21: The task processor receives the requirement problem description sent by the user and sends it to the internal requirement identification module to select and use a large language model in the model library to extract and confirm the specific programming task that needs to be completed from the overall problem description.
[0049] Step S22, the requirement identification module sends the extracted specific programming task to the task decomposition module. The task decomposition module selects and uses a large language model in the model library to analyze the programming task, decompose the task steps, discover the implicit steps of the task and generate the optimal subtask set for the task. Each subtask has a clear purpose and clear boundaries.
[0050] Step S23: The task decomposition module sends the subtask set to the component orchestration module. The component orchestration module selects and uses a large language model in the model library to select the most matching subcomponent for each subtask to execute, forming a task-component matching pair, and uses the large language model to generate a subtask priority order to form a task execution plan.
[0051] Step S24: The component orchestration module transmits the task-component matching pair and the task execution plan to the sub-component manager.
[0052] like Figure 1 As shown, step S3, the step of coordinating the execution of subtasks includes:
[0053] Step S31, the sub-component manager creates a thread execution stack according to the task-component matching pairs and sub-task processing priority order obtained in step S24, and sequentially puts the sub-components corresponding to each sub-task into the stack for execution.
[0054] Step S32, taking out components from the thread execution stack in turn and calling the execution component program. If there is information that needs to be passed to subsequent sub-components after the sub-component program is executed, the sub-component manager will pass the information between different sub-components.
[0055] like Figure 1 As shown, step S4, the step of aggregating execution results, includes: the sub-component manager records the execution results of each component in step S32 and integrates them to form a complete solution.
[0056] like Figure 1 As shown, step S5, the step of feeding back the final result includes: the subcomponent manager sends the complete solution obtained in step S4 to the visual interaction interface, and the dialogue interaction interface of the visual interaction interface displays the complete solution to the user in the form of dialogue.
[0057] In the specific implementation of the present invention, first, the user sends the requirement problem description and the code to be queried to the intelligent programming model by using the dialogue interaction interface of the visual interaction interface or the visual command execution panel; secondly, the task processor receives the requirement problem description, uses the requirement identification module to extract the specific programming tasks in the problem description and passes them to the task decomposition module, the task decomposition module decomposes the programming task into a series of smaller and clearer subtasks and passes the subtask set to the component orchestration module, the component orchestration module matches each subtask with a suitable subcomponent to execute the task and determine the priority of the subtask execution, forms a subtask execution plan and passes it to the subcomponent manager.
[0058] The subcomponent manager executes the subcomponent program in sequence according to the task-component matching pair and the subtask processing priority order, and completes the subtasks in order. When each subtask is completed, the subcomponent manager integrates the subtask results, aggregates the execution results, and forms a complete solution. Then, the subcomponent manager sends the solution to the visual interactive interface, which presents the solution in the dialogue interface and shows the user the final answer to the current demand question.
Claims
1. An intelligent programming model optimization method for complex programming scenarios, characterized by: Includes visual interactive interface, task processor, subcomponent manager and model library; The visual interaction interface includes a dialog interaction interface for direct interaction between the user and the intelligent programming model and a visual command execution panel for the user to quickly execute preset commands; Wherein, the task processor includes a demand identification module, a task decomposition module, and a component arrangement module; The subcomponent manager includes a code generation and completion component for generating completion codes, a code summary interpretation component for explaining code functions and detailed information, a test case generation component for generating unit test codes and test cases, a code vulnerability detection component for performing vulnerability detection and positioning and generating corresponding solutions, and a code quality detection component for checking code quality issues and bad programming habits and generating optimization suggestions; The model library includes all large language models and model parameter files stored locally, which are used to provide large language model services. Step S1: Visual interaction proposes requirements. The user sends the requirement problem description to the intelligent programming model in the visual interaction interface; Step S2, receiving and analyzing user needs. The task processor receives the demand problem description sent by the user and sends it to the internal demand identification module. The demand identification module determines the specific programming task to be completed from the demand problem description and sends it to the task decomposition module. The task decomposition module decomposes the programming task into a series of subtasks. The task decomposition module sends the subtasks with clear goals and clear boundaries to the component orchestration module. The component orchestration module selects a suitable component for each subtask to process and determines the task processing order, thereby obtaining a task-component matching pair. The component orchestration module sends the suitable components selected for each subtask and the task execution priority plan to the subcomponent manager; Step S3, subtasks are coordinated and executed. The subcomponent manager sequentially calls the corresponding components in the subcomponent manager to execute subtasks according to the subtask-component matching pairs obtained in step S2 and the processing priority information of each subtask, and coordinates the information transmission between different components. Step S4: Aggregate execution results: the sub-component manager organizes and merges the execution results of each sub-task to form a complete solution; Step S5: Feedback the final result: the subcomponent manager sends the complete solution obtained in step S4 to the visual interactive interface to show the final result to the user.
2. The intelligent programming model optimization method for complex programming scenarios according to claim 1, characterized in that: In step S2, the steps of receiving and analyzing user needs include: Step S21: The task processor receives the requirement problem description sent by the user and sends it to the internal requirement identification module to select and use a large language model in the model library to extract and confirm the specific programming task that needs to be completed from the overall problem description; Step S22: The requirement identification module sends the extracted specific programming task to the task decomposition module. The task decomposition module selects and uses a large language model in the model library to analyze the programming task, decompose the task steps, discover the task implicit steps and generate the optimal subtask set for the task. Each subtask has a clear purpose and clear boundaries. Step S23: The task decomposition module sends the subtask set to the component orchestration module. The component orchestration module selects and uses a large language model in the model library to select the most matching subcomponent for each subtask to execute, forming a task-component matching pair, and uses the large language model to generate a subtask priority order to form a task execution plan. Step S24: The component orchestration module transmits the task-component matching pair and the task execution plan to the sub-component manager.
3. The intelligent programming model optimization method for complex programming scenarios according to claim 2, characterized in that: In step S3, the steps of coordinating the execution of subtasks include: Step S31, the sub-component manager creates a thread execution stack according to the task-component matching pairs and the sub-task processing priority order obtained in step S24, and sequentially puts the sub-components corresponding to each sub-task into the stack for execution; Step S32, taking out components from the thread execution stack in turn and calling the execution component program. If there is information that needs to be passed to subsequent sub-components after the sub-component program is executed, the sub-component manager will pass the information between different sub-components.
