Enterprise software on-demand automatic generation method and system
Patent Information
- Application Number
- CN202611219959.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-12
- Publication Date
- 2026-10-09
AI Technical Summary
[0006]本发明的目的在于提供企业软件按需自动生成方法及系统,以解决上述背景技术中提出的软件开发周期较长、效率低的问题
1、企业软件按需自动生成方法及系统,本系统通过知识库单元构建了代码库和验证案例库并实时更新同步,为软件开发提供了数据基础缩减了编码过程,提高了软件开发的效率。
Smart Images

Figure CN122884446A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software generation technology, specifically to a method and system for automatically generating enterprise software on demand. Background Technology
[0002] Software development is the process of building a software system or a software component within a system according to user requirements. Software development includes designing the software's functions and implementation algorithms and methods, designing the overall software structure and modules, programming and debugging, program integration and testing, and then writing and submitting the program.
[0003] In the software development process, developers first need to manually break down requirements into sub-tasks, write code for the corresponding sub-tasks and write corresponding acceptance test cases, and then manually execute tests to verify the correctness of the code logic.
[0004] However, as the complexity of software systems increases, the difficulty of manually breaking down requirements, writing test cases, and debugging code also gradually increases, leading to a gradual decrease in development efficiency. Developers need to repeatedly modify code to meet the constraints of test cases, resulting in long development cycles and high costs.
[0005] In light of this, we propose a method and system for automatically generating enterprise software on demand. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for automatically generating enterprise software on demand, so as to solve the problems of long software development cycles and low efficiency mentioned in the background art.
[0007] To achieve the above objectives, the present invention provides the following technical solution: The enterprise software on-demand automatic generation system includes: a requirement decomposition module, a knowledge base module, a retrieval module, and an AI agent module. The requirement decomposition module breaks down user requirements into multiple sub-tasks and extracts features. It decomposes user requirements for generating software functions, ensuring each software function corresponds to a sub-task, and analyzes the logical relationships between these functions. The knowledge base module stores function codes and related verification cases, with a one-to-one mapping between function codes and verification cases. The retrieval module accesses the knowledge base module to retrieve relevant code and sends it to the AI agent module. After the requirement decomposition module extracts the sub-tasks, it sends the required functions of each sub-task to the retrieval module. The retrieval module, based on the sub-task function information, accesses the knowledge base module to retrieve relevant function codes and verification cases and sends them to the AI agent module for code generation. The AI agent module adjusts, verifies, and assembles the function codes to generate the required software. By adjusting, verifying, and assembling existing function codes, the AI agent module achieves rapid software development and generation, improving software development efficiency.
[0008] Preferably, the requirement decomposition module includes a task sorting unit, a task decomposition unit, and a subtask feature extraction unit. The task sorting unit, based on a large language model, sorts user requirements to determine software functions and the relationships between them. The large language model helps to better understand various user inputs, enabling the decomposition of user requirements and the sorting of logical relationships, thus achieving function decomposition and the sorting of logical relationships between functions. The task decomposition unit, based on the sorting results, performs subtask decomposition. The task decomposition unit generates multiple subtasks based on the software functions sorted out by the task sorting unit, completing the decomposition of user requirements. The subtask feature extraction unit extracts feature information from subtasks to facilitate function code retrieval. The subtask feature extraction unit extracts specific functional feature information from subtasks, improving the accuracy of the retrieval module through multi-feature extraction.
[0009] Preferably, the knowledge base module includes a functional code unit, a verification case unit, and a cloud synchronization unit. The functional code unit stores various functional codes, which are distributed and grouped into broad categories based on the technical fields in which they are applied, and then further grouped into subcategories based on their specific functions. The verification case unit maps corresponding verification cases to the functional codes. It stores verification cases for various functional codes, ensuring the correct operation of the functional codes. The cloud synchronization unit automatically connects to the cloud and synchronizes open-source functional code and verification cases.
[0010] Preferably, the AI agent module includes a sub-code unit, a software code unit, and a verification unit. The sub-code unit generates corresponding sub-code based on sub-tasks. The sub-code unit receives the functional code and verification cases corresponding to the sub-tasks from the retrieval module, and optimizes and adjusts the functional code based on the two to make the function more closely match the sub-task. The software code unit assembles and generates software code based on the sub-task relationship between the sub-codes. The software code unit obtains the sub-codes corresponding to each sub-task and assembles the sub-codes to complete the writing and development of the software code. The verification unit verifies the sub-codes and software code and returns the corresponding error results. The verification unit verifies the sub-codes and software code respectively. If the verification is successful, it means that the code is correct and the software development is complete. If the verification fails, the failure node and failure problem are returned to the sub-code unit and software code unit for iterative optimization.
[0011] Preferably, the sub-code unit includes a code integration component, a constraint loading component, and a code optimization component. The code integration unit integrates multiple functional codes to obtain the core code. The code integration unit splits the main code and auxiliary code, and determines the core code of the function by comparing the main code and auxiliary code. The constraint loading unit obtains corresponding verification cases to provide boundary constraints for the code optimization unit. The constraint loading unit obtains verification cases corresponding to the main functional code to provide constraints during the code generation process and limit the functional boundaries of the code. The code optimization unit adjusts and optimizes the core code based on the core code and verification cases to generate sub-code. The code optimization unit optimizes and adjusts the core code based on the verification cases to generate sub-code that better meets user needs.
[0012] The method for automatically generating enterprise software on demand includes the following steps: Step 1: The requirement decomposition module breaks down user requirements into multiple sub-tasks based on user descriptions; The requirement splitting module breaks down the user-input requirements into multiple sub-tasks based on the specific requirements. Step 2: The retrieval module accesses the knowledge base module based on subtasks to obtain functional code and verification cases; The retrieval module accesses the knowledge base module based on the information from the subtasks to obtain relevant functional codes and corresponding verification cases; Step 3: The AI agent module generates corresponding sub-code based on the functional code and verification cases; The AI agent module obtains the functional code and corresponding verification cases for the sub-tasks, and fine-tunes the functional code with the verification cases as constraints to generate sub-code that better meets user needs. Step 4: The AI agent module generates the required software by composing sub-code based on the relationships between sub-tasks; After generating corresponding sub-code based on each sub-task, the AI intelligent agent module assembles the sub-code to form complete software code, thus completing the software generation.
[0013] Furthermore, step 1 above also includes the following steps; Step 1.1: The task analysis unit divides user requirements into functional categories; The task analysis unit analyzes the user's input to determine the function the user wants to achieve; Step 1.2: The task analysis unit analyzes the logical relationships between functions to determine the assembly relationships; The task analysis unit analyzes the logical relationships between various functions and sends the analysis results to the software code unit to facilitate subsequent code assembly. Step 1.3: The task splitting unit splits subtasks based on the sorting results; The task breakdown unit divides the functions according to the sorting results, thereby splitting them into multiple independent sub-tasks; Step 1.4: The subtask feature extraction unit extracts the functional feature information of the subtask and sends it to the retrieval module; The subtask feature extraction unit extracts the functional feature information of the subtask, thereby improving the retrieval accuracy of the retrieval module through the functional feature information.
[0014] Furthermore, step 2 above also includes the following steps: Step 2.1: The retrieval module retrieves information from the functional code units based on the functional characteristics of the subtasks. The retrieval module uses functional features to correspond to relevant functional codes within the retrieval function code unit; Step 2.2: The retrieval module retrieves the code with the closest functionality as the main code and sends it along with multiple auxiliary codes to the code integration component; The retrieval module sorts the function codes retrieved from the function code unit by relevance, and then selects the closest function as the main code, and selects several as auxiliary codes in order. Step 2.3: The retrieval module jumps to the verification case unit to obtain the verification case based on the mapping relationship in the main code; The retrieval module reads the verification cases corresponding to the main code based on the mapping of the main code to the verification case unit; Step 2.4: If the verification unit does not find the relevant functional code, the cloud synchronization unit will access the cloud to obtain it; If no relevant functional code is found, the detection module triggers the cloud synchronization unit, which reads the relevant open-source functional code from the cloud. Step 2.5: If relevant data is obtained, the cloud synchronization unit will send the obtained data to the retrieval module; The cloud synchronization unit sends the relevant function codes it acquires to the retrieval module, which then sends them to the AI intelligent agent module. Step 2.6: If no data is obtained, an error message will be manually coded and sent to the software code unit; If no data is obtained, an error warning is issued, and the subtask is manually coded and the code is sent to the software code unit.
[0015] Furthermore, step 3 above also includes the following steps: Step 3.1: The code integration component, in conjunction with auxiliary code, performs relevant code analysis and extraction on the main code; The code integration unit separates the main code and auxiliary code, and determines the core code of the function by comparing the main code and auxiliary code; Step 3.2: The constraint loading component retrieves the verification cases obtained by the retrieval module and sends them to the code optimization unit; The constraint loading unit obtains the verification cases corresponding to the main function code and sends them to the code optimization component to provide constraints during the code generation process; Step 3.3: The code optimization component optimizes and generates sub-code based on the extracted code and verification cases; The code optimization unit optimizes and adjusts the core code based on verification cases to generate sub-code that better meets user needs; Step 3.4: The verification unit verifies the sub-code based on the verification cases; The verification unit inputs verification cases into the sub-code for verification and makes a judgment based on the output of the sub-code. Step 3.5: If verification is successful, the sub-code will be sent to the software code unit for assembly. If the output meets expectations, the sub-code optimization and adjustment is successful and sent to the software code unit for storage; Step 3.6: If verification fails, send the failure data to the code optimization component for further adjustments; If the verification fails, the failed node and the failure issue will be sent back to the code optimization component for targeted adjustments. After the adjustments are completed, it will be sent back to the verification unit for verification. Step 3.7: If the number of adjustments exceeds the set number, manual adjustment shall be performed; If the code optimization unit fails to pass verification after multiple adjustments to the sub-code, an alarm will be triggered, requiring manual modification and adjustment until verification is passed.
[0016] Furthermore, step 4 above also includes the following steps: Step 4.1: The software code unit obtains and assembles the logical relationships sorted out by the task sorting unit; The software code unit connects to the task sorting unit to obtain the logical relationships between various functions and completes the assembly of corresponding sub-tasks based on the logical relationships, thereby forming complete software code; Step 4.2: The software code unit sends the software code to the verification unit for verification; The software code unit sends the software code to the verification unit and imports verification cases for verification; Step 4.3: If the verification is successful, the software generation is complete; If the verification is successful, the software code unit will output the software code to complete the software generation; Step 4.4: If the verification fails, the failure data will be fed back to the software unit for manual adjustment. If software code verification fails, an alarm will be triggered and the failed node and issue will be returned to the software code unit for manual adjustment until verification is successfully completed.
[0017] Compared with the prior art, the beneficial effects of the present invention are: 1. Enterprise software on-demand automatic generation method and system: This system builds a code library and a verification case library through knowledge base units and updates them in real time, providing a data foundation for software development, reducing the coding process, and improving the efficiency of software development.
[0018] 2. Enterprise software on-demand automatic generation method and system: This system optimizes and fine-tunes the functional code through the AI intelligent agent module, making the functional code more in line with user needs, thereby ensuring the accuracy of software development and implementation.
[0019] 3. Enterprise software on-demand automatic generation method and system: This system realizes automatic verification through AI intelligent agent module to ensure the correctness of functional code, thereby ensuring the correctness of software development and avoiding the generation of defects and vulnerabilities. Attached Figure Description
[0020] Figure 1 The enterprise software of this invention automatically generates the main framework diagram of the system on demand; Figure 2 This invention provides a detailed framework diagram of the enterprise software's on-demand automatic generation system. Figure 3 This is the main flowchart of the enterprise software on-demand automatic generation method of the present invention; Figure 4 This is a detailed flowchart of the enterprise software on-demand automatic generation method of the present invention.
[0021] In the picture: 1. Requirement breakdown module; 11. Task organization unit; 12. Task breakdown unit; 13. Subtask feature extraction unit; 2. Knowledge Base Module; 21. Functional Code Unit; 22. Verification Case Unit; 23. Cloud Synchronization Unit; 3. Search module; 4. AI Intelligent Agent Module; 41. Sub-code Unit; 411. Code Integration Component; 412. Constraint Loading Component; 413. Code Optimization Component; 42. Software Code Unit; 43. Verification Unit. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] In the software development process, developers first need to manually break down the requirements into sub-tasks, write code for the corresponding sub-tasks and write corresponding acceptance test cases, and then manually execute tests to verify the correctness of the code logic.
[0024] However, as the complexity of software systems increases, the difficulty of manually breaking down requirements, writing test cases, and debugging code also gradually increases, leading to a gradual decrease in development efficiency. Developers need to repeatedly modify code to meet the constraints of test cases, resulting in long development cycles and high costs.
[0025] like Figures 1 to 4 As shown, the enterprise software on-demand automatic generation method and system include: like Figures 1 to 2 As shown, the enterprise software on-demand automatic generation system includes: a requirement decomposition module 1, a knowledge base module 2, a retrieval module 3, and an AI agent module 4. The requirement decomposition module 1 breaks down user requirements into multiple sub-tasks and extracts features. The knowledge base module 2 stores functional code and related verification cases. The retrieval module 3 accesses the knowledge base module 2 to retrieve relevant code and sends it to the AI agent module 4. The AI agent module 4 adjusts, verifies, and assembles the functional code to generate the required software. Specifically, the requirement decomposition module 1 breaks down user requirements into multiple sub-tasks and extracts features. Users input the application domain, specific functions, and functional relationships of the software they want to generate through this module. The module then breaks down the user's software function requirements, assigning each function to a sub-task and analyzing the logical relationships between these functions. The knowledge base module 2 stores function code and related verification cases. It maintains a one-to-one mapping between function code and verification cases. The knowledge base module 2 periodically accesses the cloud to retrieve and store open-source function code, ensuring data updates and maintaining the real-time, novelty, and comprehensiveness of the function code. This modular approach to function code avoids writing code from scratch, improving development efficiency. Furthermore, the mapping of function code to verification cases further reduces the need for writing verification cases, further enhancing development efficiency. The retrieval module 3 accesses the knowledge base module 2 to retrieve relevant code. The code is sent to the AI agent module 4. After the requirement decomposition module 1 breaks down the subtasks, it sends the functions that the subtasks need to implement to the retrieval module 3. The retrieval module 3 retrieves relevant functional codes and verification cases from the knowledge base module 2 based on the functional information of the subtasks and sends them to the AI agent module 4 for code generation. The retrieval module 3 sorts the functional codes according to their similarity, and the functional code ranked first is sent as the main code, and several subsequent functional codes are sent as auxiliary codes to the AI agent module 4. The number of auxiliary codes can be freely set by the system administrator according to the hardware performance. The AI agent module 4 adjusts, verifies, and assembles the functional codes to generate the required software. The AI agent module 4 fine-tunes the functional codes sent by the retrieval module 3 based on the functional requirements of the subtasks to make the functional codes more in line with user needs. Then, it completes the verification through verification cases, thereby completing the generation of the sub-codes corresponding to the subtasks. Finally, the sub-codes are assembled to form the software code to complete the software generation. By adjusting, verifying, and assembling the existing functional codes, the rapid development and generation of software is achieved, improving the efficiency of software development.
[0026] In this embodiment, the requirement splitting module 1 includes a task sorting unit 11, a task splitting unit 12, and a subtask feature extraction unit 13; the task sorting unit 11 sorts user requirements based on a large language model to determine software functions and the relationships between each function; the task splitting unit 12 completes the subtask splitting based on the sorting results; the subtask feature extraction unit 13 extracts the feature information of the subtasks to facilitate function code retrieval; Specifically, Task Analysis Unit 11 analyzes user needs based on a large language model to determine software functions and their interrelationships. The large language model refers to a deep learning model trained on a large amount of text data, enabling it to generate natural language text or understand the meaning of spoken text. Task Analysis Unit 11 is built upon this large language model, which allows for a better understanding of various user inputs, enabling the breakdown of user needs and the analysis of logical relationships. This results in the breakdown of functions and the analysis of their logical relationships, which are then sent to the AI agent module 4 for subsequent code assembly to generate complete software. Task Decomposition Unit 12, based on the analysis results… If the subtask decomposition is completed, the task decomposition unit 12 decomposes the software functions sorted out by the task sorting unit 11 into multiple subtasks, thus completing the decomposition of user requirements. Each subtask is an independent software function. By decomposing the functions, the complexity of the function code is reduced, thereby improving the efficiency of writing the function code. The subtask feature extraction unit 13 extracts the feature information of the subtasks to facilitate the retrieval of function codes. The subtask feature extraction unit 13 extracts the specific functional feature information of the subtasks. Through multi-feature extraction, the accuracy of the retrieval by the retrieval module 3 is improved. The retrieval component accesses the knowledge base module 2 based on the multi-feature information to retrieve similar function codes.
[0027] In this embodiment, the knowledge base module 2 includes a functional code unit 21, a verification case unit 22, and a cloud synchronization unit 23; the functional code unit 21 stores various functional codes; the verification case unit 22 maps corresponding verification cases to the functional codes; the cloud synchronization unit 23 is used to automatically access and synchronize open-source functional codes and verification cases from the cloud. Specifically, the functional code unit 21 stores various functional codes. This unit uses distributed storage to group functional codes into broad categories based on their technical fields of application, and then further groups them into smaller categories based on their specific functions. Distributed storage improves the retrieval efficiency of the retrieval module 3, thereby ensuring efficient software generation. Furthermore, the functional codes within unit 21 improve the efficiency of writing functional codes, avoiding starting from scratch. The verification case unit 22 maps corresponding verification cases to the functional codes. It stores verification cases for various functional codes, ensuring the correct operation of the functional codes. Verification cases are stored in a one-to-one mapping with functional codes. When the retrieval module 3 obtains relevant functional code, it retrieves the corresponding verification case, avoiding the need to write verification cases. The cloud synchronization unit 23 automatically connects to the cloud to synchronize open-source functional codes and verification cases. The knowledge base module 2 periodically connects to the cloud to retrieve and store open-source functional codes, thereby updating the knowledge base data and ensuring the real-time nature, novelty, and comprehensiveness of the functional codes.
[0028] In this embodiment, the AI agent module 4 includes a sub-code unit 41, a software code unit 42, and a verification unit 43; the sub-code unit 41 generates corresponding sub-code according to the sub-task; the software code unit 42 assembles and generates software code based on the sub-task relationship between the sub-code and the software code; the verification unit 43 verifies the sub-code and the software code and returns the corresponding error results. Specifically, sub-code unit 41 generates corresponding sub-code based on sub-tasks. Sub-code unit 41 receives the functional code and verification case corresponding to the sub-task sent by retrieval module 3, and optimizes and adjusts the functional code based on the two to make the function more consistent with the sub-task. Software code unit 42 assembles and generates software code based on the sub-task relationship of the sub-code. Software code unit 42 obtains the sub-code corresponding to each sub-task and assembles the sub-code to complete the writing and development of software code. Verification unit 43 verifies the sub-code and software code and returns the corresponding error results. Verification unit 43 verifies the sub-code and software code respectively. If the verification is successful, it means that the code is correct and the software development is completed. If the verification fails, the failure node and failure problem are returned to sub-code unit 41 and software code unit 42 for iterative optimization.
[0029] In this embodiment, the sub-code unit 41 includes a code integration component 411, a constraint loading component 412, and a code optimization component 413; the code integration unit integrates multiple functional codes to obtain core code; the constraint loading unit obtains corresponding verification cases to provide boundary constraints for the code optimization unit; the code optimization unit adjusts and optimizes the core code and verification cases to generate sub-code; Specifically, the code integration unit integrates multiple functional codes to obtain the core code. The code integration unit splits the main code and auxiliary code, and determines the core code of the function by comparing the main code and auxiliary code. The constraint loading unit obtains corresponding verification cases to provide boundary constraints for the code optimization unit. The constraint loading unit obtains verification cases corresponding to the main functional code to provide constraints during the code generation process and limit the functional boundaries of the code. The code optimization unit adjusts and optimizes the core code based on the core code and verification cases to generate sub-code. The code optimization unit optimizes and adjusts the core code based on the verification cases to generate sub-code that better meets user needs.
[0030] Figure 1The present invention provides an on-demand automatic generation system framework diagram for enterprise software. The user inputs enterprise details and functional requirements. The task organization unit 11 determines the required functions and the logical relationships between them based on the user's needs. Then, the task splitting unit 12 splits the sub-tasks. The sub-task feature extraction unit 13 extracts the specific functional feature information of the sub-tasks and sends it to the retrieval module 3. The retrieval module 3 retrieves the functional code and verification cases and sends them to the sub-code unit 41 to generate corresponding sub-code. The sub-code unit 41 sends the sub-code to the verification unit 43 for verification. After successful verification, it is sent to the software code unit 42. The software code unit 42 assembles and verifies the sub-code to generate the software required by the user.
[0031] Figure 2 The present invention provides a detailed framework diagram of an on-demand automatic generation system for enterprise software. The user inputs enterprise details and functional requirements. The task analysis unit 11 determines the required functions and the logical relationships between them based on user needs. Then, the task splitting unit 12 splits the sub-tasks. The sub-task feature extraction unit 13 extracts the specific functional features of the sub-tasks and sends them to the retrieval module 3. The retrieval module 3 retrieves the main code and auxiliary code from the relevant functional code in the functional code unit 21 based on the functional features, and obtains the verification cases corresponding to the main code. The retrieval module 3 sends the functional code and verification cases to the code integration unit. The code integration unit splits the main code and auxiliary code to determine the core code of the function. The constraint loading unit obtains the verification cases corresponding to the main functional code and provides constraints. The code optimization unit optimizes and adjusts the core code based on the verification cases to generate sub-code that better meets user needs. The verification unit 43 inputs the verification cases into the sub-code for verification and judges based on the output results of the sub-code. If the output results meet expectations, the sub-code optimization and adjustment are successful and sent to the software code unit 42 for storage. The software code unit 42 assembles and verifies the sub-code based on the functional logic, completing the software generation.
[0032] The method for automatically generating enterprise software on demand includes the following steps: Step 1: Module 1 of the requirement decomposition module breaks down user requirements into multiple sub-tasks based on user descriptions; Step 2: The retrieval module 3 obtains the functional code and verification cases from the knowledge base module 2 based on the sub-task; Step 3: The AI agent module 4 generates corresponding sub-code based on the functional code and verification cases; Step 4: The AI agent module 4 generates the required software by composing sub-code based on the relationships between sub-tasks; Specifically, the requirement decomposition module 1 breaks down the user's input requirements into multiple sub-tasks based on the specific requirements; the retrieval module 3 retrieves relevant functional codes and corresponding verification cases from the knowledge base module 2 based on the information of the sub-tasks; the AI agent module 4 retrieves the functional codes and corresponding verification cases corresponding to the sub-tasks, and fine-tunes the functional codes with the verification cases as constraints to generate sub-codes that better meet the user's needs; after generating the corresponding sub-codes based on each sub-task, the AI agent module 4 assembles the sub-codes to form complete software code, thus completing the software generation.
[0033] In this embodiment, step 1 above further includes the following steps; Step 1.1: Task Analysis Unit 11 divides user requirements into functional categories; Step 1.2: Task analysis unit 11 analyzes the logical relationships between functions to determine the assembly relationships; Step 1.3: Task splitting unit 12 splits subtasks based on the sorting results; Step 1.4: Subtask feature extraction unit 13 extracts the functional feature information of the subtask and sends it to retrieval module 3; Specifically, the task sorting unit 11 analyzes the user's input to determine the function the user wants to achieve; the task sorting unit 11 sorts out the logical relationships between the functions and sends the sorting results to the software code unit 42 to facilitate subsequent code assembly; the task splitting unit 12 divides the functions according to the sorting results, thereby splitting them into multiple independent sub-tasks; the sub-task feature extraction unit 13 extracts the functional feature information of the sub-tasks, thereby improving the retrieval accuracy of the retrieval module 3 through the functional feature information.
[0034] In this embodiment, step 2 above further includes the following steps: Step 2.1: The retrieval module 3 performs retrieval based on the functional feature information of the subtask and accesses the functional code unit 21. Step 2.2: The retrieval module 3 retrieves the code with the closest function as the main code and sends it along with multiple auxiliary codes to the code integration component 411; Step 2.3: The retrieval module 3 jumps to the verification case unit 22 to obtain the verification case based on the mapping relationship of the main code; Step 2.4: If the verification unit 43 does not find the relevant function code, the cloud synchronization unit 23 will access the cloud to obtain it; Step 2.5: If relevant data is obtained, the cloud synchronization unit 23 will send the obtained data to the retrieval module 3; Step 2.6: If no data is obtained, an error message will be manually coded and sent to software code unit 42; Specifically, the retrieval module 3 retrieves relevant functional codes within the functional code unit 21 based on functional features; the retrieval module 3 ranks the functional codes detected by the functional code unit 21 according to their relevance, and then selects the most similar codes as the main codes, and selects several as auxiliary codes in order; the retrieval module 3 maps the main codes to the verification case unit 22 and reads the verification cases corresponding to the main codes; if no relevant functional codes are found, the detection module triggers the cloud synchronization unit 23, which reads the relevant open-source functional codes in the cloud; the cloud synchronization unit 23 sends the acquired relevant functional codes to the retrieval module 3, which then sends them to the AI intelligent agent module 4; if no data is acquired, an error warning is issued and the subtask is manually coded, and the code is sent to the software code unit 42.
[0035] In this embodiment, step 3 above further includes the following steps: Step 3.1: The code integration component 411, in conjunction with auxiliary code, performs relevant code analysis and extraction on the main code; Step 3.2: Constraint loading component 412 obtains the verification cases obtained by retrieval module 3 and sends them to the code optimization unit; Step 3.3: Code optimization component 413 optimizes and generates sub-code based on the extracted code and verification cases; Step 3.4: Verification unit 43 verifies the sub-code based on the verification cases; Step 3.5: If verification is successful, the sub-code will be sent to software code unit 42 for assembly. Step 3.6: If verification fails, send the failure data to code optimization component 413 for further adjustments; Step 3.7: If the number of adjustments exceeds the set number, manual adjustment shall be performed; Specifically, the code integration unit splits the main code and auxiliary code, and determines the core code of the function by comparing the main code and auxiliary code; the constraint loading unit obtains the verification cases corresponding to the main function code and sends them to the code optimization component 413, providing constraints during the code generation process; the code optimization unit optimizes and adjusts the core code based on the verification cases to generate sub-code that better meets user needs; the verification unit 43 inputs the verification cases into the sub-code for verification and judges based on the output results of the sub-code; if the output results meet expectations, the sub-code optimization and adjustment is successful and sent to the software code unit 42 for storage; if the verification fails, the failure node and failure problem are returned to the code optimization component 413 for targeted adjustment, and after adjustment, it is sent back to the verification unit 43 for verification; if the code optimization unit still cannot pass the verification after multiple adjustments to the sub-code, an alarm is triggered for manual modification and adjustment until the verification is passed.
[0036] In this embodiment, step 4 above further includes the following steps: Step 4.1: Software code unit 42 obtains and assembles the logical relationships sorted out by task sorting unit 11; Step 4.2: Software code unit 42 sends the software code to verification unit 43 for verification; Step 4.3: If the verification is successful, the software generation is complete; Step 4.4: If the verification fails, the failure data will be fed back to the software unit for manual adjustment. Specifically, the software code unit 42 connects to the task sorting unit 11 to obtain the logical relationships between various functions and assembles the corresponding sub-tasks according to the logical relationships, thereby forming complete software code; the software code unit 42 sends the software code to the verification unit 43 and imports verification cases for verification; if the verification is successful, the software code unit 42 outputs the software code to complete the generation of the software; if the software code verification fails, an alarm is triggered and the failure node and failure problem are returned to the software code unit 42 for manual targeted adjustment until the verification is successfully completed.
[0037] Figure 3 This is the main flowchart of the enterprise software on-demand automatic generation method of the present invention; the requirement decomposition module 1 decomposes the user input requirements into multiple sub-tasks and extracts functional features; the retrieval module 3 accesses the knowledge base module 2 to obtain relevant functional codes and corresponding verification cases based on the sub-functional features; the AI intelligent agent module 4 obtains the functional codes and corresponding verification cases corresponding to the sub-tasks, and fine-tunes the functional codes with the verification cases as constraints to generate sub-codes that better meet the user's needs; after generating the corresponding sub-codes based on each sub-task, the AI intelligent agent module 4 assembles the sub-codes to form complete software code, thus completing the software generation.
[0038] Figure 4This is a detailed flowchart of the enterprise software on-demand automatic generation method of the present invention. The task sorting unit 11 divides user requirements into functional categories and sorts functional logic. The task splitting unit 12 splits multiple independent subtasks based on the sorting results. The subtask feature extraction unit 13 extracts the functional feature information of the subtasks, thereby improving the retrieval accuracy of the retrieval module 3. The retrieval module 3 accesses the knowledge base module 2 based on the sub-functional features to obtain relevant functional codes and corresponding verification cases. The code integration unit splits the main code and auxiliary code to determine the core code of the function. The constraint loading unit obtains the verification cases corresponding to the main functional code as constraints. The code optimization unit optimizes and adjusts the core code based on the verification cases to generate sub-code that better meets user needs. Then, the verification unit 43 inputs the verification cases into the sub-code for verification and judges the results based on the output of the sub-code. If the verification fails, it is considered a failure. The nodes and failure issues are returned to the code optimization component 413 for targeted adjustments. After adjustment, they are sent back to the verification unit 43 for verification. If the code optimization unit still fails to pass verification after multiple adjustments to the sub-code, an alarm is triggered for manual modification and adjustment until verification is passed. If the output result meets expectations, the sub-code optimization and adjustment is successful and sent to the software code unit 42 for storage. The software code unit 42 connects to the task sorting unit 11 to obtain the logical relationships between various functions and completes the assembly of corresponding sub-tasks according to the logical relationships, thereby forming complete software code. The software code unit 42 sends the software code to the verification unit 43 and imports verification cases for verification. If the verification is successful, the software code unit 42 outputs the software code to complete the software generation. If the software code verification fails, an alarm is triggered and the failed nodes and failure issues are returned to the software code unit 42 for manual targeted adjustments until verification is successfully completed.
[0039] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. An enterprise software on-demand automatic generation system, characterized in that, include: The module consists of a demand breakdown module (1), a knowledge base module (2), a retrieval module (3), and an AI agent module (4). The requirement splitting module (1) splits user requirements into multiple sub-tasks and extracts features; The knowledge base module (2) is used to store functional codes and related verification cases; The retrieval module (3) is used to access the knowledge base module (2) to retrieve relevant code and send it to the AI agent module (4); The AI agent module (4) adjusts, verifies, and assembles the functional code to generate the required software.
2. The on-demand automatic generation system according to claim 1, characterized in that: The requirement splitting module (1) includes a task sorting unit (11), a task splitting unit (12), and a sub-task feature extraction unit (13). The task sorting unit (11) sorts out user needs based on the large language model to determine software functions and the relationships between each function; The task splitting unit (12) completes the sub-task splitting based on the sorting results; The subtask feature extraction unit (13) extracts the feature information of the subtask, thereby facilitating the retrieval of the function code.
3. The on-demand automatic generation system according to claim 1, characterized in that: The knowledge base module (2) includes a functional code unit (21), a verification case unit (22), and a cloud synchronization unit (23). The functional code unit (21) stores various functional codes; The corresponding functional code within the verification case unit (22) is mapped to relevant verification cases; The cloud synchronization unit (23) is used to automatically access the cloud and automatically synchronize open source function code and verification cases.
4. The on-demand automatic generation system according to claim 1, characterized in that: The AI agent module (4) includes a sub-code unit (41), a software code unit (42), and a verification unit (43). The sub-code unit (41) generates corresponding sub-code according to the sub-task; The software code unit (42) is assembled to generate software code based on the sub-code corresponding to the sub-task relationship; The verification unit (43) verifies the sub-code and the software code and returns the corresponding error results.
5. The on-demand automatic generation system according to claim 4, characterized in that: The sub-code unit (41) includes a code integration component (411), a constraint loading component (412), and a code optimization component (413). The code integration unit integrates multiple functional codes to obtain the core code; The constraint loading unit obtains the corresponding verification cases to provide boundary constraints for the code optimization unit; The code optimization unit adjusts and optimizes the core code and verification cases to generate sub-code.
6. An on-demand automatic software generation method, used in the on-demand automatic generation system according to any one of claims 1-5, characterized in that, Includes the following steps: Step 1, Requirement decomposition module (1) Based on user description, user requirements are decomposed into multiple sub-tasks; Step 2: The retrieval module (3) accesses the knowledge base module (2) based on the subtask to obtain the functional code and verification cases; Step 3: The AI agent module (4) generates corresponding sub-code based on the functional code and verification cases; Step 4: The AI intelligent agent module (4) generates the required software by composing sub-code based on the relationship between sub-tasks.
7. The on-demand automatic generation method according to claim 6, characterized in that: Step 2 above also includes the following steps; Step 1.1, Task Analysis Unit (11) divides user requirements into functional categories; Step 1.2, Task sorting unit (11) sorts out the logical relationships between functions to determine the assembly relationship; Step 1.3, Task splitting unit (12) splits subtasks based on the sorting results; Step 1.4: The subtask feature extraction unit (13) extracts the functional feature information of the subtask and sends it to the retrieval module (3).
8. The on-demand automatic generation method according to claim 6, characterized in that: Step 2 above also includes the following steps: Step 2.1: The retrieval module (3) performs retrieval by accessing the functional code unit (21) based on the functional feature information of the subtask; Step 2.2, the retrieval module (3) retrieves the code with the closest function as the main code and multiple auxiliary codes and sends them to the code integration component (411). Step 2.3: The retrieval module (3) jumps to the verification case unit (22) according to the mapping relationship of the main code to obtain the verification case; Step 2.4: If the verification unit (43) does not find the relevant function code, the cloud synchronization unit (23) accesses the cloud to obtain it; Step 2.5: If relevant data is obtained, the cloud synchronization unit (23) will send the obtained data to the retrieval module (3); Step 2.5: If no data is obtained, an error message will be sent manually to the software code unit (42).
9. The on-demand automatic generation method according to claim 6, characterized in that: Step 3 above also includes the following steps: Step 3.1: The code integration component (411) combines auxiliary code to perform relevant code analysis and extraction on the main code; Step 3.2: The constraint loading component (412) obtains the verification cases obtained by the retrieval module (3) and sends them to the code optimization unit; Step 3.3: The code optimization component (413) optimizes and generates sub-code based on the extracted code and verification cases; Step 3.4, Verification unit (43) verifies the sub-code based on the verification cases; Step 3.5: If the verification is successful, the sub-code will be sent to the software code unit (42) for assembly. Step 3.6: If verification fails, the failure data will be sent to the code optimization component (413) for further adjustments; Step 3.7: If the number of adjustments exceeds the set number, manual adjustment shall be performed.
10. The on-demand automatic generation method according to claim 6, characterized in that: Step 4 above also includes the following steps: Step 4.1: The software code unit (42) obtains the logical relationships sorted out by the task sorting unit (11); Step 4.2: The software code unit (42) sends the software code to the verification unit (43) for verification; Step 4.3: If the verification is successful, the software generation is complete; Step 4.4: If the verification fails, the failure data will be fed back to the software unit for manual adjustment.