Natural language and code generation instruction conversion method and device, equipment and medium

By combining iterative self-feedback reinforcement learning with large model technology, user natural language is converted into embedded software development code generation instructions, which solves the shortcomings of traditional code generation tools in terms of syntax parsing and intelligence, and realizes efficient embedded software development.

CN121858084APending Publication Date: 2026-04-14XIAN AVIATION COMPUTING TECH RES INST OF AVIATION IND CORP OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Traditional code generation and completion functions based on IDEs and programming syntax cannot accurately understand users' functional requirements. They suffer from difficulties in syntax parsing, limited intelligence, and performance bottlenecks, resulting in low development efficiency.

Method used

By employing an iterative self-feedback reinforcement learning method combined with large model technology, user natural language is converted into embedded software development code generation instructions through specific prompt word engineering. The code generation instruction adapter is then used for format matching and automated operations to achieve accurate code generation.

Benefits of technology

It improves the accuracy of embedded software development and user coding efficiency, solves the efficiency bottleneck caused by the large model illusion, and realizes automated code generation for intelligent software development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121858084A_ABST
    Figure CN121858084A_ABST
Patent Text Reader

Abstract

The invention provides a natural language and code generation instruction conversion method and device, equipment and a medium, and relates to the field of intelligent software development, and the method comprises the steps: defining a large model output template in a specific cue word project based on a use demand, performing natural language conversion on an input user natural language through a large model based on a specific cue word project, and outputting a code generation instruction; on the basis of the output template, performing demand content information screening on the code generation instruction according to a preset information screening template; if the screening is passed, performing format matching on the code generation instruction and an output template; and if the matching is successful, adapting the code generation instruction conforming to the output template by an embedded code generation instruction adapter and then outputting the code generation instruction. According to the method, the user natural language input including the user demand is converted into the embedded software code generation instruction which can be recognized by the system, so that the automatic code generation accuracy and the user coding efficiency of the intelligent embedded software development system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent software development technology, specifically to a method, apparatus, device, and medium for converting natural language into code generation instructions. Background Technology

[0002] In recent years, intelligent software development has become a major trend in the next generation of software development. In the process of combining large language models with intelligent empowerment in the field of airborne embedded software development, it is often necessary to address how to convert the natural language questions raised by users into code generation instructions that can be recognized by the automatic code generation process through large model technology.

[0003] Traditional code generation and completion features based on IDEs and programming syntax often fall short in terms of code validity and whether the code meets user requirements. They rely solely on the context and syntax of the user's current code editing, failing to align with functional needs and offering limited improvement to development efficiency. Specifically, this manifests in the following ways: 1. Relies on the accuracy of syntax structure: It cannot provide code completion for syntactically incorrect code (such as unclosed parentheses). It has difficulty parsing complex language features (such as dynamic typing and macros).

[0004] 2. Limited intelligence: Recommendations are based solely on static structures and cannot understand the developer's intent (e.g., recommending a misspelled function name). Handling cross-file dependencies (e.g., classes not imported) is weak.

[0005] 3. Performance bottleneck exists: Frequent AST parsing for large projects can cause lag (the incremental update strategy needs to be optimized).

[0006] With the development of large model technology, intelligent software development methods based on large models can effectively utilize user requirements to generate software code that meets user needs, thereby greatly improving user development efficiency. However, large models have defects such as the large model illusion, which makes users need to pay more for intelligent development by integrating the code generated by the large model into their own coding standards for application. This often requires users to pay extra time and work. Summary of the Invention

[0007] In view of this, embodiments of this application provide a method, apparatus, device, and medium for converting natural language into code generation instructions. This application utilizes an iterative self-feedback reinforcement learning method to convert user-input natural language into embedded software development code generation instructions through a large model technique combined with specific prompt word engineering. This achieves the goal of accurate code generation in an intelligent embedded software development mode based on user needs, and can automatically insert the generated code into the user code, thereby improving the accuracy of intelligent embedded software development code generation and user coding efficiency. This application provides the following technical solution: a method for converting natural language into code generation instructions, comprising: Based on usage requirements, a large model output template is defined in a specific prompt word project. The large model based on the specific prompt word project performs natural language conversion on the input user natural language and outputs code generation instructions. Based on the predefined output template, the code generation instructions output by the large model are screened for requirement content information according to the preset information screening template; if the screening passes, the code generation instructions are matched with the predefined output template in terms of format. If a match is successful, the code generation instructions that conform to the output template will be adapted and output by the embedded code generation instruction adapter.

[0008] According to one embodiment of this application, a large model output template is defined in a specific prompt word project, including: The detailed rules within a specific prompt word project are defined according to the embedded software development code generation instruction format to obtain the output template, including: the definition of system roles and user roles, the definition of code generation instruction format, the definition of the meaning represented by each code generation instruction format, and the definition of the actual content that each code generation instruction should contain.

[0009] According to one embodiment of this application, the code generation instructions output by the large model are screened for requirement content information based on a preset information screening template, including: Natural language and code generation instructions are converted using a large model based on specific prompt words. The code generation instructions are then output as code generation instructions. These instructions are then validated using an iterative self-feedback information screening template to determine if further information supplementation is needed. Finally, the code generation instructions are validated and formatted using an iterative reinforcement learning method, resulting in code generation instructions that can be recognized by the code generation instruction adapter.

[0010] According to one embodiment of this application, it further includes: if the code generation instruction adapter still cannot be recognized after reaching the iteration number threshold through verification based on iterative self-feedback and reinforcement learning methods, the system outputs an instruction generation failure prompt to the user, and the system is maintained after manual diagnosis by system experts.

[0011] According to one embodiment of this application, the code generation instruction is used to perform self-feedback requirement verification using an information screening template based on iterative self-feedback to determine whether further information supplementation is needed. If it is determined that self-feedback information supplementation is needed, the predefined question content in the information screening template is used to feed back to the user to supplement the user's natural language.

[0012] According to one embodiment of this application, the method further includes: after generating code generation instructions that can be recognized by the code generation instruction adapter, performing a next automated operation based on the content preset by the code generation instruction adapter, including code writing, compilation, and execution.

[0013] According to one embodiment of this application, natural language conversion processing is performed on the input user natural language using a large model based on specific prompt word engineering, including: The user's natural language input is encapsulated by a large model based on specific prompt words to obtain the encapsulated large model input content. The large model then transforms the input content and outputs the code generation instruction.

[0014] This application also provides a natural language to code generation instruction conversion apparatus, including: The large-model natural language conversion module is used to define a large model output template in a specific prompt word project based on usage requirements. It then performs natural language conversion on the input user natural language using the large model based on the specific prompt word project and outputs code generation instructions. The self-feedback verification module is used to screen the code generation instructions output by the large model based on the predefined output template and according to the preset information screening template; if the screening passes, the code generation instructions are matched with the predefined output template in terms of format. The adaptation and output module is used to adapt and output the code generation instructions that conform to the output template by the embedded code generation instruction adapter after the format matching is successful.

[0015] This application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described natural language to code generation instruction conversion method.

[0016] This application also provides a computer-readable storage medium storing a computer program that performs the above-described natural language to code generation instruction conversion method.

[0017] Compared with the prior art, the beneficial effects that the above-mentioned at least one technical solution adopted in the embodiments of this specification can achieve include at least the following: the embodiments of this invention transform the traditional code generation process based on programming syntax into an intelligent software development process based on a large model. At the same time, it uses an iterative self-feedback method and a verification process based on reinforcement learning to solve the output deviation caused by the illusion of a large model. Finally, it combines an intelligent development code generation instruction adapter to perform instruction adaptation, thereby realizing the automated writing and compilation of code, thereby providing intelligent software development assistance for developers, improving the efficiency of embedded software development, and saving costs and improving efficiency in embedded software development. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the natural language and code generation instruction conversion method of the present invention; Figure 2 This is a schematic diagram of the natural language and code generation instruction conversion process according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the natural language and code generation instruction conversion device of the present invention; Figure 4 This is a schematic diagram of the structure of the computer device of the present invention. Detailed Implementation

[0020] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0021] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. This application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] like Figure 1 As shown, this embodiment of the invention provides a method for converting natural language into code generation instructions, including: S101. Based on usage requirements, define a large model output template in a specific prompt word project, and perform natural language conversion on the input user natural language through the large model based on the specific prompt word project to output code generation instructions; S102. Based on the predefined output template, the code generation instructions output by the large model are screened for requirement content information according to the preset information screening template; if the screening passes, the code generation instructions are matched with the predefined output template in terms of format. S103. If the match is successful, the code generation instruction that conforms to the output template will be adapted and output by the embedded code generation instruction adapter.

[0023] This invention provides a technology that can identify and process natural language using a large model and convert it into code generation instructions. The method for converting natural language into code generation instructions based on a large model and an iterative self-feedback reinforcement learning method can utilize the iterative self-feedback method to naturally supplement the demand side, and then use a limited iterative reinforcement learning method to automatically fit the large model generation results into the user code, thereby solving the user efficiency bottleneck problem caused by the illusion of a large model.

[0024] Specifically, the embodiments of the present invention convert user natural language input, including user requirements, into embedded software code generation instructions that the system can recognize, thereby achieving the goal of intelligent software development standard integration. This process uses a multi-round iterative self-regression method to ensure that the entire intelligent generation process is controllable by humans, thereby improving the accuracy of automatic code generation and user coding efficiency of the intelligent embedded software development system.

[0025] In some embodiments, defining a large model output template in a specific prompt word project includes: defining detailed rules within the specific prompt word project according to the embedded software development code generation instruction format to obtain the output template, including: the definition of system roles and user roles, the definition of code generation instruction format, the definition of the meaning represented by each code generation instruction format, and the definition of the actual content that each code generation instruction should contain.

[0026] In some embodiments, the code generation instructions output by the large model are screened for requirement content information according to a preset information screening template. This includes: converting natural language into code generation instructions using a large model based on specific prompt word engineering, outputting code generation instructions, performing self-feedback requirement verification on the code generation instructions using an iterative self-feedback information screening template to determine whether further information supplementation is needed, and then further verifying and correcting the format of the code generation instructions using an iterative reinforcement learning method, ultimately generating code generation instructions that can be recognized by the code generation instruction adapter. If it is determined that self-feedback information supplementation is needed, predefined question content in the information screening template is fed back to the user to supplement the user's natural language.

[0027] In some embodiments, if the code generation instruction adapter still cannot be recognized after reaching the iteration threshold through verification based on iterative self-feedback and reinforcement learning methods, the system outputs an instruction generation failure message to the user, and the system is maintained after manual diagnosis by system experts.

[0028] In some embodiments, after generating code generation instructions that can be recognized by the code generation instruction adapter, the next automated operation is performed according to the preset content of the code generation instruction adapter, including code writing, compilation, and execution.

[0029] In some embodiments, natural language conversion processing of the input user natural language is performed by a large model based on a specific prompt word engineering, including: encapsulating the input user natural language by a large model based on a specific prompt word engineering to obtain encapsulated large model input content, and then outputting the code generation instruction after the large model converts the input content.

[0030] This invention provides a natural language to code generation instruction conversion technology based on a large model and iterative self-feedback reinforcement learning method. It converts user natural language input, including user requirements, into embedded software code generation instructions that the system can recognize, thereby improving the accuracy of automatic code generation and user coding efficiency in intelligent embedded software development systems. Figure 2 As shown, the basic components of the entire natural language conversion method include: Large-scale natural language conversion based on specific prompt words: Through complex prompt word logic, the conversion rules required for converting natural language into code generation instructions during embedded software development are set, and the large model is required to strictly follow the conversion rules when generating inference answers. If the result of the previous iteration does not meet the instruction format required by the code generation instruction adapter, the format verification content based on reinforcement learning method and the current context are submitted to the large model at the same time, so that it generates new and more accurate code generation instruction results for the next iteration.

[0031] Self-feedback verification based on self-feedback information check template: The inference results generated by the large model through the specific prompt word project are subjected to self-feedback information check template self-feedback verification to determine whether the requirement details provided by the user to the large model in the current iteration need to be further supplemented. If so, the required supplementary details are fed back to the user to realize the self-feedback closed loop of the current iteration until the user has supplemented the required details completely, thus providing requirement integrity guarantee for the entire natural language conversion process.

[0032] Large Model Output Instruction Verification Based on Reinforcement Learning: Combining the embedded software development automatic code generation instruction format in specific prompt words, the instruction format in the large model output result is verified by reinforcement learning. Through multiple rounds of iteration, the large model output instruction format can finally meet the input requirements of the instruction adapter, thereby improving the accuracy of large model code generation and the efficiency of user use of the generated code.

[0033] Embedded code generation instruction adapter: Utilizes the adapter pattern to adapt the final output code generation instructions, and uses the matching instruction format to automate the subsequent code writing, compilation, and execution processes, thereby improving the efficiency of user program development, saving development costs and increasing work efficiency for the entire embedded software R&D.

[0034] The following are application examples of the natural language and code generation instruction conversion method based on large models and iterative self-feedback reinforcement learning in a real system: (1) The user enters their request in the system: "Start a new thread to print the clock on line 68 of main.cpp". After being encapsulated by a specific prompt word for handling user tasks, the input is transformed into the following large model: "``` Your name is Tianmai Engineer. You are a highly skilled software engineer with extensive knowledge and are proficient in multiple programming languages, frameworks, design patterns, and best practices.

[0035] ==== You have the right to use a set of tools with user approval. You can only use one tool per message and will receive the results of that tool's use in the user's reply. You complete a given task by using tools progressively, with the use of each tool influenced by the results of the previous tool's use. The tool uses an XML-like tag format. Tool names are enclosed in on and off tags, as are each parameter. The structure is as follows: <tool_name> <parameter1_name> value1< / parameter1_name> <parameter2_name> value2< / parameter2_name> ... < / tool_name> For example: <read_file> <path> src / main.js< / path> < / read_file> Please always follow the usage format of this tool to ensure correct parsing and execution.

[0036] ...{Explanation of various predefined tool formats and their properties}... ## read_file Description: Requests the reading of file contents at a specified path. Use this request when you need to inspect the contents of an existing file whose contents you don't know, such as analyzing code, reviewing text files, or extracting information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files as it returns the raw content as a string.

[0037] property: - path: (required) The path to the file to be read Tool Template: <read_file> <path> {file path}< / path> < / read_file> ...... ## replace_in_file Description: This command requests the replacement of a portion of a file with a SEARCH / REPLACE block that defines precise changes to that specific section. This tool should be used when specific changes to a particular part of a file are required.

[0038] Parameters: - path: (required) The path to the file to be modified - diff: (required) One or more SEARCH / REPLACE blocks that follow the exact format below: \`\`\` <<<<<< <SEARCH [Currently existing code awaiting modification] ======= [New Code] >>>>>>>REPLACE \`\`\` Tool Template: <replace_in_file> <path> {file path}< / path> <diff> SEARCH / REPLACE block < / diff> < / replace_in_file> ...... User: In main.cpp, on line 68, start a new thread to print the clock. The file path is path=src / main.cpp. Tianmai Engineer: ``` (2) After the above content is transmitted to the large model and analyzed by the large model, the following content is output: ``` I need to start a new thread to print the clock on line 68 of the 'src / main.cpp' file. Let me first analyze the file contents to determine the location and context of line 68. ...... <read_file> <path> src / main.cpp< / path> < / read_file> ``` After the system filters the feedback information, the above file read request is sent to the user. After the user authorizes the request, the file content is obtained and the following new input content is generated: ``` {The input in (1) plus the output in (2)} user: The result of reading the contents of file src / main.cpp is: {File Content} Tianmai Engineer: ``` After connecting it to the input in (1) and the output of the large model, a new input is formed and transmitted to the large model, waiting for the next round of output from the large model; (3) After receiving the input content in (2), the large model analyzes it and outputs the following content: ``` ...... By examining the file, I can see the code in the main function. Based on the file structure, line 68 should be located before `return 0;`. ...... <replace_in_file> <path> src / main.cpp< / path> <diff> <<<<<< <SEARCH std::cout<<"Sorted array using quicksort: ";\r\n\tfor (int i = 0; i <n2; i++) {\r\n\t\tstd::cout<<arr2[i]<<" ";\r\n\t}\r\n\tstd::cout<<std::endl;\r\n\t\r\n\treturn 0;\r\n}\r\n ======= std::cout<<"Sorted array using quicksort: ";\r\n\tfor (int i = 0; i <n2; i++) {\r\n\t\tstd::cout<<arr2[i]<<" ";\r\n\t}\r\n\tstd::cout<<std::endl;\r\n\t\r\n\t / / Start a new thread to print the clock\r\n\tstd::thread clockThread([](){\r\n\t\twhile(true) {\r\n\t\t\tstd::time_t now = std::time(0);\r\n\t\t\tstd::cout<<"Current time: "< <std::ctime(&now)<<std::endl;\r\n\t\t\tstd::this_thread::sleep_for(std::chrono::seconds(1));\r\n\t\t}\r\n\t});\r\n\t\r\n\treturn 0;\r\n}\r\n >>>>>>>REPLACE < / diff> < / replace_in_file> ...... ``` After the system performs output correction and verification based on reinforcement learning, the content that conforms to the code generation instruction adapter template is extracted, and the corresponding code is generated and given to the user to compare with the original code and decide whether to accept the modification.

[0041] If the output content template in (3) does not meet the requirements, the error will be pointed out according to the predefined verification process and a new input will be formed. After connecting the output content of (2), the new input content will be returned to the large model to wait for the new output of the large model.

[0042] like Figure 3 As shown, this embodiment of the invention also provides a natural language and code generation instruction conversion device 200, comprising: The large model natural language conversion module 201 is used to define a large model output template in a specific prompt word project based on usage requirements. It performs natural language conversion processing on the input user natural language through the large model based on the specific prompt word project and outputs code generation instructions. The self-feedback verification module 202 is used to screen the code generation instructions output by the large model based on the predefined output template and according to the preset information screening template; if the screening passes, the code generation instructions are matched with the predefined output template in terms of format. The adaptation and output module 203 is used to adapt and output the code generation instructions that conform to the output template by the embedded code generation instruction adapter after the format matching is successful.

[0043] This invention utilizes a large model incorporating specific prompt word engineering to convert natural language into code generation instructions, thereby generating code that better meets the natural language requirements of developers and is more aligned with user needs. Simultaneously, it employs an iterative self-feedback method and a reinforcement learning-based verification process to address output biases caused by large model illusions. Finally, it combines an intelligent development code generation instruction adapter for instruction adaptation, automating code writing and compilation processes. This provides developers with intelligent software development assistance, improving the efficiency of embedded software development and saving costs.

[0044] In one embodiment, a computer device is provided, such as Figure 4 As shown, it includes a memory 301, a processor 302, and a computer program stored in the memory 301 and executable on the processor 302. When the processor 302 executes the computer program, it implements the above-described natural language and code generation instruction conversion method.

[0045] Specifically, the computer device can be a computer terminal, a server, or a similar computing device.

[0046] In this embodiment, a computer-readable storage medium is provided, which stores a computer program that performs the above-described natural language to code generation instruction conversion method.

[0047] Specifically, computer-readable storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer-readable storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable storage media does not include transient media, such as modulated data signals and carrier waves.

[0048] Obviously, those skilled in the art should understand that the modules or steps of the above-described embodiments of the present invention can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of the present invention are not limited to any particular hardware and software combination.

[0049] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for converting natural language into code generation instructions, characterized in that, include: Based on usage requirements, a large model output template is defined in a specific prompt word project. The large model based on the specific prompt word project performs natural language conversion on the input user natural language and outputs code generation instructions. Based on the predefined output template, and according to the preset information screening template, the code generation instructions output by the large model are screened for requirement content information. If the screening passes, the code generation instructions will be matched with the predefined output template in terms of format. If a match is successful, the code generation instructions that conform to the output template will be adapted and output by the embedded code generation instruction adapter.

2. The natural language and code generation instruction conversion method according to claim 1, characterized in that, Define large model output templates in specific prompt word projects, including: The detailed rules within a specific prompt word project are defined according to the embedded software development code generation instruction format to obtain the output template, including: the definition of system roles and user roles, the definition of code generation instruction format, the definition of the meaning represented by each code generation instruction format, and the definition of the actual content that each code generation instruction should contain.

3. The natural language and code generation instruction conversion method according to claim 1, characterized in that, Based on a preset information screening template, the code generation instructions output by the large model are screened for requirement content information, including: Natural language and code generation instructions are converted using a large model based on specific prompt words. The code generation instructions are then output as code generation instructions. These instructions are then validated using an iterative self-feedback information screening template to determine if further information supplementation is needed. Finally, the code generation instructions are validated and formatted using an iterative reinforcement learning method, resulting in code generation instructions that can be recognized by the code generation instruction adapter.

4. The natural language and code generation instruction conversion method according to claim 3, characterized in that, Also includes: If, after verification using iterative self-feedback and reinforcement learning methods, the code generation instruction adapter still cannot recognize the code after reaching the iteration threshold, the system will output an instruction generation failure message to the user, and the system will be maintained after manual diagnosis by system experts.

5. The natural language and code generation instruction conversion method according to claim 3, characterized in that, The code generation instructions are validated for self-feedback requirements using an iterative self-feedback-based information screening template to determine whether further information supplementation is needed. If it is determined that self-feedback information supplementation is needed, the predefined question content in the information screening template is fed back to the user to supplement the user's natural language.

6. The natural language and code generation instruction conversion method according to claim 3, characterized in that, Also includes: After generating code generation instructions that can be recognized by the code generation instruction adapter, the next automated operation is performed according to the preset content of the code generation instruction adapter, including code writing, compilation, and execution.

7. The natural language and code generation instruction conversion method according to claim 1, characterized in that, Natural language processing (NLP) is performed on the input user natural language using a large model based on specific prompt word engineering, including: The user's natural language input is encapsulated by a large model based on specific prompt words to obtain the encapsulated large model input content. The large model then transforms the input content and outputs the code generation instruction.

8. A natural language and code generation instruction conversion device, characterized in that, include: The large-model natural language conversion module is used to define a large model output template in a specific prompt word project based on usage requirements. It then performs natural language conversion on the input user natural language using the large model based on the specific prompt word project and outputs code generation instructions. The self-feedback verification module is used to screen the code generation instructions output by the large model based on the predefined output template and according to the preset information screening template. If the screening passes, the code generation instructions will be matched with the predefined output template in terms of format. The adaptation and output module is used to adapt and output the code generation instructions that conform to the output template by the embedded code generation instruction adapter after the format matching is successful.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the natural language and code generation instruction conversion method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that performs the natural language and code generation instruction conversion method according to any one of claims 1 to 7.