program

The program automates source code generation and conversion using a generation AI, addressing manual debugging challenges and reducing development time by integrating an interpreter-type source code execution unit and conversion unit.

JP7756385B1Active Publication Date: 2025-10-20村上聡
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2025075058
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-10-20
Estimated Expiration
2045-04-29

AI Technical Summary

Technical Problem

Users are required to manually check and debug source code generated by generative AI, necessitating programming knowledge and time-consuming efforts, especially when creating programs or processing data on information processing devices.

Method used

A program that automates the generation and conversion of source code by integrating an operation request instruction with a generation AI, utilizing an interpreter-type source code execution unit and a source code conversion unit to generate and modify code without manual intervention.

Benefits of technology

Facilitates easy operation of information processing devices by eliminating the need for manual debugging and reducing development time through automated source code generation and conversion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007756385000001_ABST
    Figure 0007756385000001_ABST
Patent Text Reader

Abstract

A program is obtained that can easily cause an information processing device to perform a desired operation using a generation AI. [Solution] A computer is caused to execute the steps of acquiring an operation request instruction for operating an information processing device, inputting the acquired operation request instruction and a first prompt for creating a first source code based on the operation request instruction into a generation AI, and acquiring the first source code output from the generation AI and outputting the first source code to an interpreter-type source code execution unit.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a program that utilizes generative AI. [Background technology]

[0002] With the advancement of artificial intelligence (AI) technology, technology that uses natural language processing to generate source code for application programs is attracting attention. In conventional methods, users input prompts into the generating AI, manually paste the generated source code into the development environment, and then complete the application program by running it in the operating environment and debugging it. Summary of the Invention [Problem to be solved by the invention]

[0003] Previously, source code was generated by generative AI, but users had to manually check and debug the program converted from the source code. These tasks required programming knowledge and debugging skills, and were still difficult and time-consuming for users. Furthermore, not only when creating programs, but also when creating source code to automatically create files or process data on information processing devices, users were required to manually check and correct the program's operation.

[0004] The present invention has been made to solve such problems, and provides a program that can easily cause an information processing device to perform a desired operation using a generation AI. [Means for solving the problem]

[0005] The program according to the present invention includes the steps of: acquiring an operation request instruction for operating an information processing device; inputting the acquired operation request instruction and a first prompt for creating a first source code based on the operation request instruction into a generation AI; acquiring the first source code output from the generation AI, and outputting the first source code to an interpreter-type source code execution unit; a step of inputting the successful first source code and a second prompt for creating a second source code including an instruction to convert the first source code into a format executable by the information processing device, when an execution result indicating success is obtained from the source code execution unit that executed the first source code, to the generation AI; and a step of acquiring the second source code output from the generation AI and outputting the second source code to the source code execution unit. The above is executed by a computer. [Effects of the Invention]

[0006] According to the present invention, it is possible to easily cause an information processing device to perform a desired operation. [Brief explanation of the drawings]

[0007] [Figure 1] 1 is a diagram illustrating a first configuration example of a system according to an embodiment. [Figure 2] FIG. 10 is a diagram illustrating a second configuration example of a system according to an embodiment. [Figure 3] FIG. 10 is a diagram showing an example of a screen of an AI interface unit according to the embodiment. [Figure 4] 10 is a flowchart illustrating an example of processing by an AI interface unit according to the embodiment. [Figure 5] 10 is a flowchart showing an example of a first execution process according to an embodiment. [Figure 6] 10 is a flowchart illustrating an example of a second execution process according to the embodiment. [Figure 7] FIG. 10 is a diagram illustrating an example of the operation of the system according to the embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0008] Hereinafter, embodiments of the present disclosure will be described with reference to the drawings. In all drawings describing the embodiments, common components are designated by the same reference numerals. Note that the following embodiments do not unduly limit the content of the present disclosure described in the claims. Furthermore, each drawing is a schematic diagram and is not necessarily a precise illustration.

[0009] Embodiment (System Configuration) FIG. 1 is a diagram showing a first example configuration of a system 1000 according to an embodiment. The system 1000 is a system for causing a computer 10 to perform a desired operation using a generation AI 200. The system 1000 shown in FIG. 1 includes a computer 10. The computer 10 includes an input unit 1, an output unit 2, a source code execution unit 3, a source code conversion unit 4, a communication unit 5, and an AI interface unit 100. The input unit 1 is a device that accepts input from a user, such as a keyboard, mouse, or microphone. The output unit 2 is a device that outputs to a user, such as a display or speaker.

[0010] The source code execution unit 3 executes the source code in an interpretive manner. Specifically, it reads the source code line by line, performs syntax analysis, and executes the instructions contained in the source code sequentially.

[0011] The source code conversion unit 4 converts (compiles) the entire source code into machine language or the like, and generates a program that the computer 10 can execute.

[0012] The communication unit 5 is a communication interface for communicating with a communication network N such as the Internet. In this embodiment, the computer 10 communicates via the communication unit 5 with the generated AI 200 connected to the communication network N such as the Internet or an intranet.

[0013] The AI ​​interface unit 100 mediates the sending and receiving of data between the user, the source code execution unit 3, and the generation AI 200. Specifically, the AI ​​interface unit 100 transmits instructions and the like from the user input to the input unit 1 to the generation AI 200, and outputs data transmitted from the generation AI 200 to the source code execution unit 3 or the output unit 2. The AI ​​interface unit 100 also outputs data input from the source code execution unit 3 to the generation AI 200 or the output unit 2. Examples of processing executed by the AI ​​interface unit 100 will be described later as a first execution processing and a second execution processing.

[0014] The computer 10 is equipped with a processor such as a CPU or GPU, and memory, and the processor executes programs stored in the memory to realize the functions of the AI ​​interface unit 100, source code execution unit 3, and source code conversion unit 4.

[0015] FIG. 2 is a diagram showing a second configuration example of a system 1000 according to an embodiment. In the second configuration example, the system 1000 includes a computer 10 and a computer 20 connected via a communications network N. In the example of FIG. 2, a source code execution unit 3 and a source code conversion unit 4 are implemented in a computer 20 separate from the computer 10 in which the AI ​​interface unit 100 is provided. The AI ​​interface unit 100 transmits and receives data to and from the source code execution unit 3 via the communications network N using UDP communications or the like. The computer 20 includes a processor such as a CPU or GPU, and a memory, and the functions of the source code execution unit 3 and the source code conversion unit 4 are realized by the processor executing a program stored in the memory.

[0016] The generation AI 200 is a system that generates content such as natural language, images, and source code in response to natural language input. The generation AI 200 is realized, for example, by a machine learning model including a large-scale language model. The generation AI 200 collects various information present on the Internet and has learned the collected information. The generation AI 200 may also be capable of collecting new information and learning sequentially. In this embodiment, the generation AI 200 generates source code of an application program for operating the information processing device (e.g., computer 10 or computer 20) and instruction code for the source code execution unit 3, based on an operation request instruction for operating the information processing device.

[0017] (Example screen of AI interface unit 100) FIG. 3 is a diagram showing an example screen of the AI ​​interface unit 100 according to the embodiment. The AI ​​interface unit 100 displays a screen 101, such as the one shown in FIG. 3, on the output unit 2, which is a display. The screen 101 has an output area 102, an input area 103, and a send button 104. The output area 102 is an area for displaying information acquired from the generation AI 200 or the source code execution unit 3 in the form of text or graphics. For example, the output area 102 may display a question from the generation AI 200, a first source code, a second source code, or an execution result (described later). The input area 103 is an area for displaying information entered by the user using the input unit 1, such as instructions to the generation AI 200. The send button 104 is a button for sending information entered in the input area 103 to the generation AI 200. When the send button 104 is pressed, the AI ​​interface unit 100 sends to the generation AI 200 information entered in the input area 103 that has not yet been sent to the generation AI 200.

[0018] (Operation of AI interface unit 100) Conventionally, when developing an application program using a generation AI, the user inputs prompts into the generation AI, manually pastes the generated source code into the development environment, and performs operation checks and debugging to complete the application program. In contrast, in this embodiment, the AI ​​interface unit 100 causes the generation AI 200 to create source code that operates normally. The processing of the AI ​​interface unit 100 will be described in detail below.

[0019] Figure 4 is a flowchart showing an example of processing by the AI ​​interface unit 100 according to the embodiment. The AI ​​interface unit 100 has started operation, and is currently displaying a screen 101 such as that shown in Figure 3 on the output unit 2. Information is output to the user via the output area 102, and information is input by the user via the input area 103 in Figure 3.

[0020] (Step S10) The AI ​​interface unit 100 receives an operation request instruction from a user. An operation request instruction is, for example, an instruction to create a program to make an information processing device perform a desired operation. Specific examples include "Please create a text editor," "Please create an image viewer," and "Please create a TCP / UDP designated port scanner."

[0021] (Step S20) The AI ​​interface unit 100 executes a first execution process (S20) based on the operation request instruction acquired in step S10. The first execution process is a process for generating source code for a program that causes the information processing device to perform an operation that conforms to the operation request instruction for the generation AI 200. In the first execution process, as will be described later, the AI ​​interface unit 100 relays cooperation between the source code execution unit 3 and the generation AI 200 to generate source code that operates normally.

[0022] (Step S30) The AI ​​interface unit 100 displays the result that the source code was successfully generated in the first execution process. At this time, the AI ​​interface unit 100 may output a question to the user asking whether or not to generate a program using the generated source code.

[0023] (Step S40) The AI ​​interface unit 100 determines whether or not a program generation instruction has been received from the user, and if so (step S40: YES), proceeds to the next step.

[0024] (Step S50) The AI ​​interface unit 100 executes a second execution process, which is a process for generating an application program based on the source code.

[0025] (Step S60) The AI ​​interface unit 100 displays the results of program generation as execution results.

[0026] (First execution process) FIG. 5 is a flowchart showing an example of the first execution process according to the embodiment. FIG. 5 shows a specific example of the process of step S10 shown in FIG. 4. First, a first execution instruction is sent to the generation AI (step S101). The first execution instruction includes an operation request instruction (step S10 in FIG. 4) and a first prompt. The first prompt includes source code generation conditions. The source code generation conditions include OS information and language used of the information processing device on which the target application program runs, tagging conditions for the source code, etc., and may also include constraints. Constraints include, for example, prohibiting the generation of malicious code and avoiding excessive load on computer 10 or computer 20. The first prompt is stored in advance, and the AI ​​interface unit 100 reads out the stored first prompt and sends it as the first execution instruction. The AI ​​interface unit 100 may output the first prompt to the user and accept user editing. Alternatively, a template for each item of the pre-stored first prompt may be output to the user, and the user may input generation conditions based on the template.

[0027] Next, it is determined whether or not a reply has been received from the generation AI 200 (step S102). If no reply has been received (step S102: NO), the process waits. If a reply has been received (step S102: YES), it is determined whether or not the reply contains source code (step S103).

[0028] If the first execution instruction in step S101 contains enough information for the generation AI 200 to generate source code, the generation AI 200 will send the source code. On the other hand, if the first execution instruction does not contain enough information to generate source code, the generation AI 200 will not be able to generate source code and will instead send a question to the user, for example.

[0029] If the reply from the generation AI 200 does not include source code (step S103; NO), the reply from the generation AI 200, such as a question requesting additional information, is output (step S104). When the user enters a response to this reply, the response from the user is acquired (step S105), and the acquired response is sent to the generation AI 200 (step S106), and the process returns to step S102.

[0030] If the reply content from the generation AI 200 includes source code (step S103: YES), the source code is extracted from the reply content and sent to the source code execution unit 3 (step S107). Here, the source code generated in the first execution process is referred to as the first source code to distinguish it from the source code generated in the second execution process described later.

[0031] The source code execution unit 3, which has acquired the first source code, executes the first source code using an interpreter. Then, the source code execution unit 3 returns the execution result of the source code to the AI ​​interface unit 100. The execution result is either success or failure, and in the case of failure, the execution result may include error content and an error code.

[0032] It is determined whether or not there is a reply from such source code execution unit 3 (step S108), and if there is no reply (step S108: NO), it waits, and if there is a reply (step S108: YES), it is determined whether the reply content is successful or not (step S109).

[0033] If the execution result is successful (step S109: YES), return and proceed to step S20 in Fig. 4. If the execution result is not successful (step S109: NO), the execution result is sent to the generated AI 200 (step S110), and return to step S102.

[0034] The generation AI 200, which has received the execution result transmitted in step S110, i.e., the execution result indicating failure, generates new first source code. If the execution result includes an error, the generation AI 200 generates new first source code based on the error. Alternatively, the generation AI 200 may generate a question or the like for the user. The new first source code or the question or the like generated by the generation AI 200 is then transmitted to the AI ​​interface unit 100, and the processing of steps S102 onward is executed.

[0035] In this manner, in this embodiment, the AI ​​interface unit 100 allows the generation AI 200 and the source code execution unit 3 to cooperate until a first source code that operates normally is generated.

[0036] (Second execution process) FIG. 6 is a flowchart illustrating an example of the second execution process according to the embodiment. FIG. 6 illustrates a specific example of the process of step S50 illustrated in FIG. 4. First, a second execution instruction is sent to the generation AI 200 (step S501). The second execution instruction includes the successful first source code obtained in the first execution process and a second prompt. The second prompt instructs the source code execution unit 3 and the source code conversion unit 4 to generate second source code based on the first source code, thereby generating an application program. The second prompt may include generation conditions for the target application program. The second prompt is stored in advance, and the AI ​​interface unit 100 reads the stored second prompt and sends it as the second execution instruction. The AI ​​interface unit 100 may output the second prompt to the user and allow the user to edit it. Alternatively, a template for each item of the pre-stored second prompt may be output to the user, and the user may input generation conditions based on the template.

[0037] Next, it is determined whether or not a reply has been received from the generation AI 200 (step S502). If there is no reply (step S502: NO), the process waits. If the second source code is received (step S502: YES), the acquired second source code is sent to the source code execution unit 3 (step S503). The second source code is a source code for instructing the interpreter-type source code execution unit 3 to convert (compile) the first source code using the source code conversion unit 4.

[0038] Having acquired the second source code, the source code execution unit 3 executes the second source code using an interpreter. Specifically, the source code execution unit 3 causes the source code conversion unit 4 to convert (compile) the first source code based on the second source code, thereby generating an application program based on the first source code. The result of the application program generation is returned from the source code conversion unit 4 to the source code execution unit 3, and then from the source code execution unit 3 to the AI ​​interface unit 100.

[0039] It is determined whether or not there is a reply from the source code execution unit 3 (step S504), and if there is no reply (step S504: NO), the process waits, and if there is a reply (step S504: YES), the process returns and proceeds to step S60 in FIG.

[0040] (Example of operation of system 1000) The following describes an example of the operation of the system 1000 realized by the processing of the AI ​​interface section 100 shown in Figures 4 to 6. Figure 7 is a diagram showing an example of the operation of the system 1000 according to the embodiment.

[0041] First, an operation request instruction is input by the user (ST1), and the AI ​​interface unit 100 sends a first execution instruction to the generation AI 200 (ST2). In response to this first execution instruction, the generation AI 200 generates a first source code and sends it to the AI ​​interface unit 100 (ST3). The AI ​​interface unit 100 extracts the first source code from the data acquired from the generation AI 200 (ST4) and sends the extracted first source code to the source code execution unit 3 (ST5). The source code execution unit 3 executes the acquired first source code with an interpreter (ST6) and sends the execution result to the AI ​​interface unit 100 (ST7). Here, it is assumed that the execution result is an error.

[0042] The AI ​​interface unit 100 sends the execution result (error) to the generation AI 200 (ST8). The generation AI 200 generates a first source code based on the execution result and sends it to the AI ​​interface unit 100 (ST9). The AI ​​interface unit 100 extracts the first source code from the data acquired from the generation AI 200 (ST10) and sends the extracted first source code to the source code execution unit 3 (ST11). The source code execution unit 3 executes the acquired first source code using an interpreter (ST12) and sends the execution result to the AI ​​interface unit 100 (ST13). Here, it is assumed that the execution result was successful. Note that if the target application program has a GUI, the GUI is displayed on the output unit 2 (display) of the computer 10 in ST12, allowing the user to confirm the execution result by the source code execution unit 3.

[0043] The AI ​​interface unit 100 outputs the execution result (success) to the user (ST14), and the user inputs an execution instruction for program generation (ST15). In response to this execution instruction for program generation, the AI ​​interface unit 100 sends a second execution instruction to the generation AI 200 (ST16), and the generation AI 200 generates and sends second source code (ST17). The AI ​​interface unit 100 sends the second source code 200 to the source code execution unit (ST18), and the source code execution unit 3 executes the second source code with an interpreter, outputs a program conversion instruction for the first source code to the source code conversion unit 4 (ST19), and obtains the result (ST20). Subsequently, the source code execution unit 3 sends the execution result (success) to the AI ​​interface unit 100 (ST21), and the AI ​​interface unit 100 outputs the execution result to the user (ST22).

[0044] FIG. 7 shows an example in which the execution result in ST6 is an error, followed by a successful execution result in ST12. However, the error may continue multiple times. In this case, the generation of the first source code by the generation AI 200 and the execution of the first source code by the source code execution unit 3 are repeated until the error is resolved and normal operation resumes. If the error continues, the generation AI 200 may suspend the generation of the first source code and send information for resolving the error to the AI ​​interface unit 100. In this case, information from the generation AI 200 is output in steps S103: NO to S104 of FIG. 5.

[0045] 5, it has been described that the AI ​​interface unit 100 determines whether the return of the execution result from the source code execution unit 3 is successful, but this determination may also be made by the generated AI 200. In this case, the AI ​​interface unit 100 transmits the return value returned from the source code execution unit 3 to the generated AI 200, and acquires the determination result of the return value made by the generated AI 200. Then, when the AI ​​interface unit 100 acquires the determination result of success from the generated AI 200, it may end the first execution process.

[0046] In the embodiment, the second execution process is executed upon receiving a program generation instruction from the user (steps S40 and S50 in FIG. 4). However, the second execution process may be executed without a user instruction following a successful first execution process. For example, by including in the first prompt an instruction to proceed to the second execution process if the first execution process is successful, the first execution process and the second execution process can be executed automatically and consecutively.

[0047] As described above, according to this embodiment, the generation AI 200 can automatically generate and modify source code, thereby eliminating the burden of manual debugging on the user and shortening the development time of the application program.

[0048] Furthermore, as shown in the configuration example of FIG. 2, by separating the computer 10 on which the AI ​​interface unit 100 runs and which is operated by a user from the computer 20 on which the source code execution unit 3 and source code conversion unit 4 run, it becomes possible to develop an application program by operating the computer 10, which does not have a development environment like the source code execution unit 3 and source code conversion unit 4. Also, a tool that integrates the AI ​​interface unit 100 with the source code execution unit 3 and / or source code conversion unit 4 is conceivable. However, if the AI ​​interface unit 100 and the source code execution unit 3 and / or source code conversion unit 4 are integrated, information input by the user to the AI ​​interface unit 100 and information acquired by the AI ​​interface unit 100 from the generated AI 200 may be initialized and lost when the source code execution unit 3 and / or source code conversion unit 4 are updated. In contrast, by separating them as shown in FIG. 2, it becomes possible to inherit information input and output to the AI ​​interface unit 100 even when the source code execution unit 3 and / or source code conversion unit 4 are updated.

[0049] In the embodiment, the operation request instruction for operating the information processing device is described as an example of generating an application program, but specific examples of the operation request instruction are not limited to this. For example, the operation request instruction may be to run a general-purpose application program, such as a spreadsheet program, installed on computer 10 or computer 20 to create a file that collects information or perform calculation processing. In this case, there is no need to convert the source code into a program, so the source code conversion unit 4 is not required. Instead, the source code execution unit 3 runs the pre-installed application program based on instructions from the generated AI via the AI ​​interface unit 100. [Explanation of symbols]

[0050] 1 Input unit, 2 Output unit, 3 Source code execution unit, 4 Source code conversion unit, 5 Communication unit, 10 Computer, 20 Computer, 100 AI interface unit, 200 Generative AI, 1000 System.

Claims

1. obtaining an operation request instruction for operating an information processing device; inputting the acquired operation request instruction and a first prompt for generating a first source code based on the operation request instruction into a generating AI; acquiring the first source code output from the generating AI and outputting the first source code to an interpreter-type source code execution unit; When an execution result indicating success is obtained from the source code execution unit that executed the first source code, inputting the successful first source code and a second prompt for creating second source code including an instruction to convert the first source code into a format executable by the information processing device to the generation AI; acquiring the second source code output from the generating AI and outputting the second source code to the source code execution unit; A program that causes a computer to execute the following.

2. the source code execution unit is provided in the information processing device connected to the computer via a communication network, and configured to output to the source code execution unit via the communication network. The program according to claim 1.

Citation Information

Patent Citations

  • Programming language for interacting with large language model

    JP2025041568A