Code generation method and device and computer readable storage medium

By decomposing user problems on the cloud computing platform, retrieving code knowledge bases and inputting them into the code generation model, the problem of inefficient code writing in the existing technology is solved, and efficient and accurate code generation and program development are achieved.

CN119883269APending Publication Date: 2025-04-25HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202311535400.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-10-23
Filing Date
2023-11-15
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The prior art is difficult to improve code writing efficiency and program development efficiency, especially when enterprise developers write code manually.

Method used

Provide a code generation method, which receives code generation requests from terminal devices through cloud computing platform, decomposes user problems, retrieves code knowledge base, enters solution steps and code knowledge to the code generation model, generates target code and sends it back to the terminal device.

Benefits of technology

It realizes automatic code generation based on natural language problems entered by users, improves code writing efficiency and program development efficiency, and the generated code has high accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883269A_ABST
    Figure CN119883269A_ABST
Patent Text Reader

Abstract

The invention provides a code generation method and device and a computer readable storage medium, which can be applied to a code generation system comprising a cloud computing platform and a terminal device, and the method comprises the following steps: the cloud computing platform receives a code generation request carrying a first problem sent by the terminal device; the method comprises the steps of decomposing a first problem to obtain solving steps of the first problem, then retrieving a code knowledge base based on each step in the solving steps of the first problem to obtain code knowledge matched with each step, and finally inputting each step in the solving steps of the first problem and the code knowledge matched with each step into a code generation model. After the code generated by the code generation model is obtained, the code is sent to the terminal equipment, and the terminal equipment presents the code. According to the method, the user only needs to input the code related problem on the terminal equipment, and the code automatically generated by the system according to the problem input by the user can be checked, so that the code writing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on October 23, 2023, with application number 202311377535.6, and priority to the Chinese patent application with the invention name “Code generation method, device and computer-readable storage medium”, all contents of which are incorporated by reference in this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a code generation method, device and computer-readable storage medium. Background Art

[0003] With the development of computer technology and the increasingly faster pace of people's work and life, enterprise developers' manual coding for program development on terminal devices such as personal computers (PCs), desktops, and laptops using software with code writing functions on terminal devices (such as integrated development environments (IDEs)) can no longer meet the pursuit of high efficiency by enterprises and developers.

[0004] Therefore, there is an urgent need to provide a method to help developers improve code writing efficiency and help enterprises improve program development efficiency. Summary of the invention

[0005] The present application provides a code generation method, device and computer-readable storage medium, which can automatically generate code according to natural language questions input by developers, help developers improve code writing efficiency, and help enterprises improve program development efficiency.

[0006] In a first aspect, a code generation method is provided, which is applied to a code generation system, the code generation system includes a cloud computing platform and a terminal device, the method includes the following steps: the cloud computing platform receives a code generation request carrying a first problem sent by the terminal device, decomposes the first problem, obtains the solution steps of the first problem, then retrieves a code knowledge base based on each step in the solution steps of the first problem, obtains target code knowledge, the target code knowledge includes code knowledge in the code knowledge base that matches each step in the solution steps of the first problem, then the cloud computing platform inputs the solution steps of the first problem and the target code knowledge into a code generation model, uses the code output by the code generation model as the target code, and sends the target code to the terminal device, and the terminal device presents the target code. The above-mentioned code generation model is obtained by using artificial intelligence (AI) technology to train the solution steps of multiple known problems, the code knowledge matching the solution steps of multiple known problems, and the code for solving multiple known problems, and the code for solving each known problem includes the code in the code knowledge matching the solution steps of each known problem.

[0007] It can be seen that in the above solution, users only need to enter code-related questions on the terminal device, and they can view the code automatically generated by the cloud computing platform based on the questions entered by the user and fed back to the terminal device. Therefore, it can help users improve code writing efficiency, and then help enterprises improve program development efficiency.

[0008] In addition, since the cloud computing platform decomposes user problems to obtain solution steps for user problems, retrieves the code knowledge base based on each step in the solution steps for the user problems, obtains the code knowledge matching each step, and then inputs each step and the code knowledge matching the step into the code generation model to generate code, it does not simply input the user problem into the model to output the code. Therefore, the code generated by the above solution has higher accuracy.

[0009] In some possible implementations, the code knowledge base includes the language type to which each code knowledge in the code knowledge base belongs;

[0010] The above method further comprises the following steps: the cloud computing platform obtains the desired code language type of the first user, the first user being the user of the terminal device;

[0011] The cloud computing platform retrieves the code knowledge base based on each step in the solution to the first problem to obtain target code knowledge, and the target code knowledge includes code knowledge that matches each step in the solution to the first problem, including: the cloud computing platform retrieves the code knowledge base based on each step in the solution to the first problem and the expected code language type to obtain target code knowledge, and the target code knowledge includes code knowledge in the code knowledge base whose language type is the same as the expected code language type, that matches each step in the solution to the first problem.

[0012] In the above implementation, since the code knowledge base includes the language type to which each code knowledge in the code knowledge base belongs, the cloud computing platform obtains the user's expected code language type, and retrieves the code knowledge base for knowledge recommendation based on the problem-solving steps and the expected code language type, so that the code knowledge matched to each step is more detailed. Therefore, the granularity of the code generated by the code generation model will also be refined to the user's expected code language field, and the generated code will better meet user needs and optimize user experience.

[0013] In some possible implementations, the method further includes the following steps: the cloud computing platform obtains information of the first user, and queries a first corresponding relationship based on the information of the first user, and uses a prompt template corresponding to the information of the first user among multiple prompt templates as a target prompt template, wherein the first corresponding relationship indicates a corresponding relationship between multiple user information and multiple prompt templates, the first user is a user of the terminal device, and the first user belongs to multiple users;

[0014] The cloud computing platform inputs the solution steps of the first problem and the target code knowledge into the code generation model, including: the cloud computing platform fills the solution steps of the first problem and the target code knowledge into the target prompt template, and then inputs the target prompt template into the code generation model.

[0015] Since the prompt template can help the model better understand the user's intention, generate responses that are more in line with user needs, and improve the quality of the model's responses, the above implementation method is implemented. The cloud computing platform fills the solution steps of the first problem and the target code knowledge into the prompt template corresponding to the user information, and then inputs the prompt template into the code generation model to generate code. The code will be more in line with user needs and have higher code quality.

[0016] In some possible implementations, the method further includes the following steps: the cloud computing platform receives an update request for the code knowledge base sent by the terminal device, and then updates the code knowledge base based on the update request.

[0017] It is understandable that with the rapid development of computer technology and the passage of time, new code knowledge and expired code knowledge will appear in various language fields. If the code generation model is not updated, the code generation model may face the problem of insufficient training data / expired training data, resulting in low reasoning accuracy. If the code generation model is updated and trained, it will face the problem of long training cycle and high cost. By implementing the above implementation method, since the code knowledge in the code knowledge base is updated, when the subsequent cloud computing platform receives a new user question and generates code based on the new user question, it can search in the updated code knowledge base based on the new user question. The retrieved matching code knowledge is updated, so that the code generation model can generate code based on the updated code knowledge, which helps to maintain the timeliness, adaptability and accuracy of the model.

[0018] In some possible implementations, the update request carries new code knowledge;

[0019] The cloud computing platform updates the code knowledge base based on the update request, including: the cloud computing platform adds the new code knowledge carried in the update request to the code knowledge base.

[0020] In some possible implementations, the language type to which the code knowledge in the above code knowledge base belongs includes any one or more of the following: C language, C++ language, C# language, Java language, Python language, JavaScript language, Visual Basic language and Golang language.

[0021] In some possible implementations, the terminal device is installed with an IDE, and the code generation request is generated based on the first question after the IDE on the terminal device receives the first question and is sent to the cloud computing platform.

[0022] In a second aspect, a code generation device is provided, which is applied to a cloud computing platform, wherein the cloud computing platform belongs to a code generation system, and the code generation system further includes a terminal device. The device includes:

[0023] An acquisition module, configured to receive a code generation request carrying a first question sent by the terminal device;

[0024] A problem decomposition module, used for decomposing the first problem to obtain solution steps for the first problem;

[0025] A knowledge retrieval module, configured to retrieve a code knowledge base based on each step in the solution to the first problem to obtain target code knowledge, wherein the target code knowledge includes code knowledge in the code knowledge base that matches each step in the solution to the first problem;

[0026] A code generation module, used for inputting the solution steps of the first problem and the target code knowledge into a code generation model, and taking the code output by the code generation model as the target code, wherein the code generation model is obtained by training the solution steps of multiple known problems, the code knowledge matching the solution steps of the multiple known problems, and the code for solving the multiple known problems using artificial intelligence AI technology, wherein the code for solving each known problem includes the code in the code knowledge matching the solution steps of each known problem;

[0027] A sending module is used to send the target code to the terminal device.

[0028] In some possible implementations, the code knowledge base includes a language type to which each code knowledge in the code knowledge base belongs;

[0029] The acquisition module is further used to acquire the desired code language type of a first user, where the first user is a user of the terminal device;

[0030] The knowledge retrieval module is used to retrieve the code knowledge base based on each step in the solution steps of the first problem and the expected code language type to obtain target code knowledge, wherein the target code knowledge includes code knowledge in the code knowledge base that has the same language type as the expected code language type and matches each step in the solution steps of the first problem.

[0031] In some possible implementations, the acquisition module is further used to acquire information of the first user, and query a first corresponding relationship based on the information of the first user, and use a prompt template corresponding to the information of the first user among multiple prompt templates as a target prompt template, wherein the first corresponding relationship indicates a corresponding relationship between multiple user information and the multiple prompt templates, the first user is a user of the terminal device, and the first user belongs to the multiple users;

[0032] The code generation module is specifically used for:

[0033] Fill the solution steps of the first problem and the target code knowledge into the target prompt template;

[0034] The target prompt template is input into the code generation model.

[0035] In some possible implementations, the device further includes: a knowledge updating module;

[0036] The acquisition module is further used to receive an update request for the code knowledge base sent by the terminal device;

[0037] The knowledge updating module is used to update the code knowledge base based on the update request.

[0038] In some possible implementations, the update request carries new code knowledge;

[0039] The knowledge updating module is used to add the new code knowledge carried in the update request to the code knowledge base.

[0040] In some possible implementations, the language type to which the code knowledge in the code knowledge base belongs includes any one or more of the following: C language, C++ language, C# language, Java language, Python language, JavaScript language, Visual Basic language, and Golang language.

[0041] In some possible implementations, the terminal device is installed with an IDE, and the code generation request is generated based on the first question by the IDE on the terminal device after receiving the first question and sent to the acquisition module.

[0042] According to a third aspect, a computing device cluster is provided, comprising a processor and a memory; the processor is used to execute instructions stored in the memory, so that the computing device cluster implements the method provided in the first aspect or any possible implementation of the first aspect.

[0043] According to a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions for implementing the method provided in the first aspect or any possible implementation of the first aspect.

[0044] In a fifth aspect, a computer program product is provided, comprising a computer program. When the computer program is read and executed by a computing device cluster, the computing device cluster executes the method provided in the first aspect or any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a structural diagram of a code generation system provided in an embodiment of the present application;

[0046] Figure 2 It is a schematic diagram of a code generation system provided by an embodiment of the present application providing a code generation cloud service to a user;

[0047] Figure 3 It is a flowchart of a code generation method provided in an embodiment of the present application;

[0048] Figure 4AIt is a schematic diagram of the training and reasoning process of a problem step decomposition model provided in an embodiment of the present application;

[0049] Figure 4B It is a schematic diagram of the training and reasoning process of a code generation model provided in an embodiment of the present application;

[0050] Figure 5 It is a flowchart of another code generation method provided in an embodiment of the present application;

[0051] Figure 6 It is a flowchart of another code generation method provided in an embodiment of the present application;

[0052] Figure 7 is a schematic diagram of a prompt template exemplarily shown in an embodiment of the present application;

[0053] Figure 8 It is a flowchart of another code generation method provided in an embodiment of the present application;

[0054] Fig. 9 is a schematic diagram of a prompt template filled with problem-solving steps and target code knowledge, exemplarily shown in an embodiment of the present application;

[0055] Fig.10 It is a structural schematic diagram of a code generation device provided in an embodiment of the present application;

[0056] Fig.11 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;

[0057] Fig.12 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

[0058] Fig.13 It is a structural diagram of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The technical solution provided by this application will be described below in conjunction with the accompanying drawings.

[0060] With the development of computer technology and the increasingly faster pace of people's work and life, enterprise developers manually write codes for program development on terminal devices such as personal computers (PCs), desktops, and laptops using software with code writing functions (such as IDE) on terminal devices, which can no longer meet the pursuit of high efficiency by enterprises and developers.

[0061] Therefore, the present application provides a code generation system and a code generation method, etc. In the code generation system and the code generation method provided by the present application, users (such as developers) only need to enter code-related questions on the terminal device to view the code automatically generated by the code generation system based on the questions entered by the user, thereby helping users improve code writing efficiency and helping enterprises improve program development efficiency. Moreover, the accuracy of the generated code is also relatively high.

[0062] The code generation system, method, etc. provided by the present application are described in detail below in conjunction with the corresponding drawings.

[0063] See also Figure 1 , Figure 1 is a schematic diagram of the structure of a code generation system provided in an embodiment of the present application, such as Figure 1 As shown, the system includes a terminal device 100 and a cloud computing platform 200. The terminal device 100 can communicate with the cloud computing platform 200 through a communication network of any communication mechanism / communication standard. The communication network can be a wide area network, a local area network, a point-to-point connection, or any combination thereof.

[0064] The user can operate the terminal device 100 to submit code-related questions to the cloud computing platform 200, and the cloud computing platform 200 generates code according to the code-related questions submitted by the user, and returns the generated code to the terminal device 100, which is presented to the user by the terminal device 100.

[0065] In a specific implementation, the terminal device 100 can be any computing device, such as a personal computer, a tablet computer, a mobile notebook, a smart phone, a handheld processing device, a virtual reality device, a wearable device, an integrated handheld device, a personal computer, a computer workstation, etc., and this application does not make any specific limitations.

[0066] The cloud computing platform 200 may be composed of one or more computing devices, which may be a personal computer, a general physical server, such as an X86 server or an ARM server, etc., or a virtual machine (VM), a container, etc., which is not specifically limited in this application. A virtual machine refers to a complete computer system with complete hardware system functions implemented by network function virtualization (NFV) technology and simulated by software, running in a completely isolated environment; a container refers to a group of processes that are isolated from each other and are subject to resource constraints.

[0067] The cloud computing platform 200 may be a central cloud data center of a cloud service provider, or an edge data center provided by the cloud service provider to users.

[0068] In some possible implementations, the cloud service provider may use the code generation service provided by the cloud computing platform 200 as a cloud service, such as Figure 2 As shown, the user can interact with the cloud computing platform 200 through the terminal device 100 to purchase the code generation cloud service. After the user purchases the cloud service, the user who has registered an account on the cloud computing platform 200 can use the cloud service to generate code. For example, the cloud computing platform 200 can provide a graphical user interface (GUI) to the user who purchases the cloud service, display the graphical user interface on the user's terminal device 100, and the user generates code in the graphical user interface. The method of purchasing the code generation cloud service may include: pre-charging first and then settling according to the actual use of the final resources, or settling according to the time of using the cloud service or according to the functions or resources of the purchased cloud service.

[0069] In some other possible implementations, all functions of the above code generation system may also be implemented by the terminal device 100. For example, the terminal device 100 implements the above code generation service to generate a code for its own user, or the terminal device 100 implements the above code generation service to generate a code for a user operating another terminal device.

[0070] It should be understood that Figure 1 The code generation system shown is only an example. For example, in actual applications, the code generation system may include any number of terminal devices 100 and cloud computing platforms 200. The code generation system may also include other or more components, such as a network device for forwarding communication data between the cloud computing platform 200 and the terminal device 100. Figure 1 It should not be considered as specifically limiting.

[0071] In order to better understand Figure 1 The specific process of the code generation system shown in the figure generates code according to the user's question. Figure 3 , Figure 5 , Figure 6 , Figure 8 The flowchart of several code generation methods shown in FIG. Figure 3 , Figure 5 , Figure 6 , Figure 8 In the example, the terminal device 100 and the cloud computing platform 200 are used to implement the code generation service. When the code generation service is implemented by the terminal device 100 alone, it is only necessary to Figure 3 , Figure 5 , Figure 6 , Figure 8In the code generation method shown, the interaction steps between the terminal device 100 and the cloud computing platform 200 are deleted, and the steps originally executed by the cloud computing platform 200 are handed over to the terminal device 100 for execution. For the sake of brevity of the specification, they are not elaborated.

[0072] like Figure 3 As shown, the method comprises the following steps:

[0073] S301: The terminal device 100 receives a first question input by a first user.

[0074] S302: The terminal device 100 generates a code generation request carrying a first question.

[0075] S303: The terminal device 100 sends a code generation request to the cloud computing platform 200. Correspondingly, the cloud computing platform 200 receives the code generation request carrying the first question sent by the terminal device 100.

[0076] S304: The cloud computing platform 200 decomposes the first problem carried in the code generation request to obtain steps for solving the first problem.

[0077] S305: The cloud computing platform 200 retrieves the code knowledge base based on each step in the solution steps of the first problem to obtain target code knowledge, where the target code knowledge includes code knowledge in the code knowledge base that matches each step in the solution steps of the first problem.

[0078] S306: The cloud computing platform 200 inputs the solution steps of the first problem and the target code knowledge into the code generation model, and uses the code output by the code generation model as the target code.

[0079] S307: The cloud computing platform 200 sends the target code to the terminal device 100.

[0080] S308: The terminal device 100 displays the target code.

[0081] Below Figure 3 Each step shown is described in detail.

[0082] In S301, the first user refers to the user of the terminal device 100; the first question refers to related questions for generating code, such as "write a crawler software to regularly visit professional papers on the large model direction of paper platform A every morning, and automatically generate paper abstracts", such as "help me complete the code and recommend some codes with similar functions and structures to the example code B", and "convert the example code B from C language to Java language and C++ language", etc. It should be understood that the above examples are for illustration, and this application does not specifically limit the first question.

[0083] Specifically, the first question may be a question described in natural language, and the first user may input the first question through the code generation application client on the terminal device 100. Optionally, the first user may also input voice data including the first question through the code generation application client, and the code generation client extracts the first question from the language data.

[0084] The code generation application client can be a separate software on the terminal device 100, or it can be integrated into existing software on the terminal device 100, such as software with code writing function (such as IDE) integrated into the terminal device 100 in the form of a plug-in, or run in a browser on the terminal device 100, such as a web page in the browser that can interact with the first user. This application does not make specific limitations on this.

[0085] In a possible embodiment, the code generation application client may display multiple code-related questions to the first user, and the first user may select one or more questions from the displayed multiple code-related questions as the first question input to the terminal device 100.

[0086] In S302, after receiving the first question input by the first user, the terminal device 100 may also receive an operation for generating a code performed by the first user on the terminal device 100, and then process the operation as a code generation request carrying the first question. For example, on the interface for the first user to input the first question displayed by the terminal device 100, a "code generation" button or a "confirm" button is also displayed. After the first user inputs the first question on the interface, the first user may click or touch the "code generation" button or the "confirm" button on the interface, thereby implementing the operation for inputting the code generation to the terminal device 100.

[0087] Specifically, the first user may input an operation for generating a code through the code generation application client on the terminal device 100 , and after receiving the operation of the first user, the code generation application client processes the operation into a code generation request.

[0088] In S303, the terminal device 100 may send a code generation request carrying the first question to the code generation server of the cloud computing platform 200 through the code generation application client. The code generation application server may be a separate software on the cloud computing platform 200, or may be integrated into existing software on the cloud computing platform 200, or may run in a browser on the cloud computing platform 200, which is not specifically limited in this application.

[0089] In S304, taking the first problem described in S301 "write a crawler software, regularly visit the professional papers in the large model direction of paper platform A every morning, and automatically generate paper abstracts" as an example, the solution steps obtained after decomposing the first problem can be: S1, crawler software depends on program library installation, S2, configure search keyword interface, S3, configure crawler interface, S4, interface for obtaining paper data of paper platform A, S5, configure summary generation function, S6, configure timing service interface, crawl paper list at a fixed time every day; taking the first problem described in S301 "help me complete the code, and recommend some codes with similar functions and structures to sample code B" as an example, the solution steps obtained after decomposing the first problem can be: S1, configure completion code interface, S2, configure code recommendation interface. It should be understood that the solution steps of the above first problem are only used as examples and should not be regarded as specific limitations.

[0090] In a possible embodiment, the cloud computing platform 200 may input the first problem into a problem step decomposition model, and use the solution steps output by the problem step decomposition model as the solution steps for the first problem, wherein the problem step decomposition model may be expressed as:

[0091] y1=f1(x1)

[0092] Among them, y1 is the solution step of the first problem, x1 is the first problem, and f1() is the mapping relationship between the solution step of the first problem and the first problem.

[0093] like Figure 4A As shown, the problem step decomposition model can be obtained by training the first AI model using a first training sample set including a large number of known problems and a large number of solutions to the known problems. After the problem step decomposition model is trained, the cloud computing platform 200 can use the problem step decomposition model to decompose the first problem to obtain the solution steps for the first problem. The first AI model may include but is not limited to decision trees, support vector machines (SVMs), deep learning models such as generative pre-trained transformer (GPT) models, etc., which are not specifically limited in this application. A large number of known problems can be historical problems accumulated in one or more language fields (such as C language, C++ language, C# language, Java language, Python language, JavaScript language, Visual Basic language, and Golang language), which are not specifically limited in this application.

[0094] Furthermore, the method of using the first training sample set to train the first AI model to obtain the problem step decomposition model may be:

[0095] Take the i-th known question in the first training sample set as the input data sample S i , take the solution step of the i-th known problem as the output data sample W i Through the above combination, a large number of input data samples and a large number of output data samples can be obtained, and there is a one-to-one correspondence between the large number of input data samples and the large number of output data samples.

[0096] After obtaining a large number of input data samples and a large number of output data samples, the large number of input data samples can be used as the input of the first AI model in turn, and the output data samples corresponding to each input data sample can be used as the reference of the output value of the first AI model, and the loss value between the output value of the first AI model and the above data output sample can be calculated using the loss function, and then the parameters of the first AI model can be adjusted according to the loss value. In a specific implementation, the first AI model can be iteratively trained using the above large number of input data samples and a large number of output data samples, and the parameters of the first AI model can be continuously adjusted until the first AI model can accurately output the same output value as the output data sample corresponding to the input data sample according to the input data sample, thereby obtaining a trained problem step decomposition model.

[0097] It should be understood that the process of obtaining the problem step decomposition model through the above training is only used as an example and should not be regarded as a specific limitation. For example, in a specific implementation, the training samples in the first training sample set can be classified first, such as being classified into C language domain problems, C++ language domain problems, Java language domain problems, etc. according to the language domains to which a large number of known problems belong, and then the first AI model is trained using a multi-task learning (MTL) method to obtain a problem step decomposition model that can achieve both the separate decomposition of multi-language domain problems and the decomposition of mixed language domain problems. Among them, mixed language domain problems refer to problems that are a combination of problems in multiple different language domains. For example, Problem 1 "Converting sample code B into C language" belongs to the C language domain problem, Problem 2 "Converting sample code B into Java language" belongs to the Java language domain problem, and Problem 3, a mixture of Problem 1 and Problem 2, is "Converting sample code B into C language and Java language".

[0098] Optionally, the cloud computing platform 200 can store a large number of steps described in text. After receiving the first question, the cloud computing platform 200 can extract keywords from the first question, and then query a large number of steps described in text according to the extracted keywords, and use the steps containing keywords as the solution steps for the first question. Taking the first question described in S301, "Help me complete the code and recommend some codes with similar functions and structures to sample code B", the cloud computing platform 200 can extract the following keywords "code completion" and "recommended code" from the first question, and then match the steps according to the extracted keywords "code completion" and "recommended code". Optionally, the cloud computing platform 200 can also store a large number of questions, the solution steps for each of the large number of questions, and the corresponding relationship between each question and its solution steps. After receiving the first question, the cloud computing platform 200 can query according to the first question to obtain the solution steps corresponding to the first question. This application does not limit the implementation method of the cloud computing platform 200 obtaining the solution steps for the first question.

[0099] In S305, the code knowledge base can be stored in the cloud computing platform 200 in the form of a data table or array, etc. The code knowledge base includes a large amount of code knowledge, each code knowledge includes code (such as a program library, an interface, a function, etc.) and its usage description, such as the usage description of the interface "paper_key_word" as an interface for retrieving keywords, such as the usage description of the interface "def crawl_papers(search_query)" as an interface for implementing a crawler function, such as the usage description of the function "add" as a function for implementing an addition function. A large amount of code knowledge may include code knowledge in multiple language fields, and the code knowledge in the code knowledge base may be knowledge classified according to language fields, and the present application does not make any specific limitations on this.

[0100] The code knowledge in the code knowledge base that matches each step in the solution steps of the first problem can be the code knowledge in the code knowledge base that has the highest matching degree with each step in the solution steps of the first problem. Specifically, the similarity (also referred to as matching degree) between each step and the usage description in each code knowledge in the code knowledge base can be calculated by a similarity algorithm, so as to obtain the code knowledge with the highest matching degree for each step. After obtaining the code knowledge with the highest matching degree for each step, the target code knowledge can be obtained by combining the code knowledge with the highest matching degree for multiple steps. Among them, the similarity algorithm may include but is not limited to the Euclidean distance algorithm, the Pearson correlation coefficient algorithm, the cosine similarity algorithm, the term frequency-inverse document frequency index (TF-IDF), etc., and this application does not make specific limitations.

[0101] Taking the first problem in S304 as "write a crawler software to regularly visit professional papers on the large model direction of paper platform A every morning and automatically generate paper abstracts", the solution steps of the first problem are "S1. The crawler software relies on the installation of the program library, S2. Configure the search keyword interface, S3. Configure the crawler interface, S4. Configure the interface for obtaining paper data from paper platform A, S5. Configure the summary generation function, S6. Configure the timing service interface to crawl the paper list at a fixed time every day". For example, the cloud computing platform 200 searches the code knowledge base based on the above 6 steps respectively to obtain the code knowledge that matches each step.

[0102] Taking S1 "Installation of Crawler Software Dependent Program Libraries" as an example, the matching code knowledge examples are: import requests, from bs4, import BeautifulSoup, import openai, where import requests, from bs4, import BeautifulSoup, and import openai are all crawler software dependent program libraries. Taking S2 "Configure Search Keyword Interface" as an example, the matching code knowledge examples are: paper_title, paper_abstract, paper_text, paper_key_word, where paper_title is an interface for searching whether there are keywords in the title of a paper, paper_abstract is an interface for searching whether there are keywords in the abstract of a paper, paper_text is an interface for searching whether there are keywords in the body of a paper, and paper_key_word is an interface for searching keywords. It should be understood that the solution steps for the first problem mentioned above and the code knowledge examples matching the solution steps for the first problem are merely examples and should not be regarded as specific limitations.

[0103] In S306, the code generation model can be expressed as:

[0104] y2=f2(x2)

[0105] Among them, y2 is the code generated based on the solution steps of the first problem and the target code knowledge, x2 is the solution steps of the first problem and the target code knowledge, and f2() is the mapping relationship between the solution steps of the first problem and the target code knowledge and the code.

[0106] like Figure 4B As shown, the code generation model can use a second training sample set including a large number of solution steps for known problems, code knowledge matching the solution steps for a large number of known problems, and codes for solving a large number of known problems to train the second AI model. After the code generation model is trained, the cloud computing platform 200 can use the code generation model to infer the solution steps for the first problem and the target code knowledge to obtain the code for solving the first problem. Among them, the solution steps for a large number of known problems in the second training sample set may be the solution steps for a large number of known problems in the first training sample set; the code for solving each known problem includes the code knowledge matching the solution steps for each known problem. In other words, the code for solving each known problem is written on the basis of the code knowledge matching the solution steps for each known problem; the second AI model may include but is not limited to decision trees, support vector machines, deep learning models such as GPT models, etc., and this application does not make specific limitations.

[0107] In a possible embodiment, the second AI model and the first AI model may be the same model, such as both are GPT models.

[0108] Furthermore, the method of using the second training sample set to train the second AI model to obtain the code generation model may be:

[0109] The solution steps of the i-th known problem in the second training sample set and its matching code knowledge are used as the input data sample S i , the code used to solve the i-th known problem is used as the output data sample W i Through the above combination, a large number of input data samples and a large number of output data samples can be obtained, and there is a one-to-one correspondence between the large number of input data samples and the large number of output data samples.

[0110] After obtaining a large number of input data samples and a large number of output data samples, the large number of input data samples can be used as the input of the second AI model in turn, and the output data samples corresponding to each input data sample can be used as the reference of the output value of the second AI model, and the loss value between the output value of the second AI model and the above data output sample can be calculated using the loss function, and then the parameters of the second AI model can be adjusted according to the loss value. In a specific implementation, the second AI model can be iteratively trained using the large number of input data samples and the large number of output data samples, and the parameters of the second AI model can be continuously adjusted until the second AI model can accurately output the same output value as the output data sample corresponding to the input data sample according to the input data sample, thereby obtaining a trained problem step decomposition model.

[0111] It should be understood that the above training process of obtaining the code generation model is only an example and should not be regarded as a specific limitation.

[0112] In S307 , the cloud computing platform 200 may send the target code to the code generation application client on the terminal device 100 through the code generation application server.

[0113] In S308 , the code generation application client on the terminal device 100 may display the target code to the first user for viewing.

[0114] It can be seen that the above Figure 3 In the illustrated embodiment, the user only needs to input code-related questions on the terminal device 100 to view the code automatically generated by the code generation system according to the questions input by the user. This can help the user improve the efficiency of code writing and further help the enterprise improve the efficiency of program development.

[0115] In addition, since the cloud computing platform 200 obtains the solution steps of the user problem by decomposing the user problem, searches the code knowledge base based on each step in the solution steps of the user problem, obtains the code knowledge matching each step, and then inputs each step and the code knowledge matching the step into the code generation model to generate code, it does not simply input the user problem into the model to output the code. Therefore, the code generated by the above solution has higher accuracy.

[0116] In a possible embodiment, in addition to including a large amount of code knowledge, the code knowledge base may also include the type of each code knowledge in the large amount of code knowledge, such as the language type, product line, and department to which each code knowledge belongs. See Table 1 and Table 2 for two exemplary code knowledge bases shown in this application. In Table 1, the code knowledge base includes the language type to which each code knowledge belongs, and in Table 2, the code knowledge base includes the product line to which each code knowledge belongs. It should be understood that the language type shown in Table 1 and the product line type shown in Table 2 are for illustration only and are not specifically limited in this application.

[0117] Table 1 Code knowledge base

[0118] Code knowledge Language Types of Code Knowledge Code knowledge 1 C Code Knowledge 2 C++ Code Knowledge 3 Java … …

[0119] Table 2 Code knowledge base

[0120] Code knowledge The product line to which the code knowledge belongs Code knowledge 1 wireless Code Knowledge 2 Data Communication Code Knowledge 3 calculate Code Knowledge 4 Cloud Core … …

[0121] For example, a code knowledge base includes a large amount of code knowledge and the language type to which each code knowledge belongs. Figure 1 For the specific process of the code generation system generating code based on user questions, see Figure 5 Steps shown.

[0122] S501: The terminal device 100 receives a first question input by a first user.

[0123] S502: The terminal device 100 obtains the desired code language type of the first user.

[0124] S503: The terminal device 100 generates a code generation request carrying the first question and the expected code language type.

[0125] S504: the terminal device 100 sends a code generation request to the cloud computing platform 200, and correspondingly, the cloud computing platform 200 receives the code generation request sent by the terminal device 100.

[0126] S505: The cloud computing platform 200 decomposes the first problem carried in the code generation request to obtain steps for solving the first problem.

[0127] S506: The cloud computing platform 200 retrieves the code knowledge base based on each step in the solution steps of the first problem and the expected code language type to obtain target code knowledge. The target code knowledge includes code knowledge in the code knowledge base whose language type is the same as the expected code language type, and code knowledge that matches each step in the solution steps of the first problem.

[0128] S507: The cloud computing platform 200 inputs the solution steps of the first problem and the target code knowledge into the code generation model, and uses the code output by the code generation model as the target code.

[0129] S508: The cloud computing platform 200 sends the target code to the terminal device 100.

[0130] S509: The terminal device 100 displays the target code.

[0131] S501 is the same as S301, the specific implementation process of S503 is similar to the specific implementation process of S302, S504 is the same as S303, S505 is the same as S304, the specific implementation process of S506 is similar to the specific implementation process of S305, S507 is the same as S306, S508 is the same as S307, S509 is the same as S308, please refer to Figure 3 For the sake of brevity of the specification, the descriptions of the corresponding steps are not elaborated any more.

[0132] Below Figure 5 The remaining step S502 shown is described in detail.

[0133] In S502, the expected code language type refers to the language type of the code that the first user expects to generate.

[0134] The terminal device 100 may obtain the desired code language type of the first user in the following manner 1 or manner 2:

[0135] Mode 1: The expected code language type is input by the first user into the terminal device 100. Specifically, the first user may input the expected code language type through the code generation application client on the terminal device 100.

[0136] For example, on the interface displayed on the terminal device 100 for the first user to input the first question, an "expected language type" input box is also displayed. When the first user inputs the first question on the interface, the first user can enter the expected code language type in the "expected language type" input box. For another example, on the interface displayed on the terminal device 100 for the first user to input the first question, an "expected language type" selection box is also displayed. The selectable language types include but are not limited to C language, C++ language, C# language, Java language, Python language, JavaScript language, Visual Basic language and Golang language. When the first user enters the first question on the interface, he can select one or more language types in the "expected language type" selection box as the expected code language type.

[0137] Mode 2: The expected code language type is automatically acquired by the terminal device 100, and the automatic acquisition method may be the following mode 2.1 or mode 2.2.

[0138] Mode 2.1: If the first user creates a code file on a software (such as an IDE) with a code writing function on the terminal device 100 and then enters the first question in the opened code file, the terminal device 100 can identify the language type of the code file based on the suffix of the code file to which the first question belongs before generating a code generation request, and use the language type of the code file as the expected code language type of the first user. For example, when the suffix of the code file is .c, the terminal device 100 identifies the language type as C language. For another example, when the suffix of the code file is .java, the terminal device 100 identifies the language type as Java language.

[0139] Method 2.2: If the first user creates a code file on software with code writing function (such as IDE) on the terminal device 100, writes code in the opened code file and enters the first question, the terminal device 100 can identify the language type of the code that the first user has written in the code file before generating a code request, and use the language type as the first user's expected code language type.

[0140] It should be understood that the above-mentioned method of automatically obtaining the first user's desired code language type by the terminal device 100 is only an example, and the present application does not specifically limit this. For example, since some IDEs allow users to configure the programming environment, including specifying the programming language to be used, the terminal device 100 can obtain the user's programming language preference by analyzing the user configuration information of the IDE, and use the user's preferred programming language type as the desired code language type.

[0141] Take the example of a code knowledge base that includes a large amount of code knowledge and the product line to which each piece of code knowledge belongs. Figure 1For the specific process of the code generation system generating code based on user questions, see Figure 6 Steps shown.

[0142] S601: The terminal device 100 receives a first question input by a first user.

[0143] S602: The terminal device 100 obtains the product line to which the first user belongs.

[0144] S603: The terminal device 100 generates a code generation request that carries the first question and the product line to which the first user belongs.

[0145] S604: the terminal device 100 sends a code generation request to the cloud computing platform 200, and correspondingly, the cloud computing platform 200 receives the code generation request sent by the terminal device 100.

[0146] S605: The cloud computing platform 200 decomposes the first problem carried in the code generation request to obtain steps for solving the first problem.

[0147] S606: The cloud computing platform 200 retrieves the code knowledge base based on each step in the solution to the first problem and the product line to which the first user belongs to obtain target code knowledge. The target code knowledge includes code knowledge in the code knowledge base that belongs to the same product line as the first user, and code knowledge that matches each step in the solution to the first problem.

[0148] S607: The cloud computing platform 200 inputs the solution steps of the first problem and the target code knowledge into the code generation model, and uses the code output by the code generation model as the target code.

[0149] S608: The cloud computing platform 200 sends the target code to the terminal device 100.

[0150] S609: The terminal device 100 displays the target code.

[0151] S601 is the same as S301, the specific implementation process of S603 is similar to the specific implementation process of S302, the specific implementation process of S604 is similar to the specific implementation process of S303, S605 is the same as S304, the specific implementation process of S606 is similar to the specific implementation process of S305, S607 is the same as S306, S608 is the same as S307, and the specific implementation process of S609 is the same as S308, please refer to Figure 3 For the sake of brevity of the specification, the descriptions of the corresponding steps are not elaborated any more.

[0152] Below Figure 6 The remaining step S602 shown is described in detail.

[0153] In S602, the terminal device 100 may obtain the product line to which the first user belongs in the following manner (1) or manner (2).

[0154] Mode (1), the product line to which the first user belongs is input by the first user into the terminal device 100. Specifically, the first user may input the product line to which the first user belongs through the code generation application client on the terminal device 100.

[0155] For example, on the interface displayed on the terminal device 100 for the first user to input the first question, a "product line type" input box is also displayed. When the first user inputs the first question on the interface, the first user can enter the product line to which the first user belongs in the "product line type" input box. For another example, on the interface displayed on the terminal device 100 for the first user to input the first question, a "product line type" selection box is also displayed. The selectable product line types may include but are not limited to wireless, data communication, cloud core, and computing. When the first user inputs the first question on the interface, the first user can select a product line type in the "product line type" selection box as the product line to which the first user belongs.

[0156] Method (2): the registration information filled in by the first user when registering on the cloud computing platform 200 may include the information of the first user, such as the first user's identifier (such as name, ID number, mobile phone number, email address, etc.), the product line to which the first user belongs, the department to which the first user belongs, etc. The cloud computing platform 200 will store the registration information. Before generating a code request, the terminal device 100 may send a product line acquisition request carrying the first user's identifier to the cloud computing platform 200, requesting to obtain the product line corresponding to the first user's identifier, and the product line is the product line to which the first user belongs.

[0157] It should be understood that the above-mentioned manner in which the terminal device 100 obtains the product line to which the first user belongs is merely an example, and this application does not make any specific limitation to this.

[0158] Optionally, S602 can obtain the identifier of the first user for the terminal device 100, and S603 can generate a code generation request carrying the first question and the identifier of the first user for the terminal device 100. After S604 and before S606, the cloud computing platform 200 can query the registration information described in the above method (2) based on the identifier of the first user carried in the code generation request to obtain the product line to which the first user belongs. In other words, the product line to which the first user belongs is not obtained by the terminal device 100 and sent to the cloud computing platform 200, but is obtained by the cloud computing platform 200 by querying the registration information of the first user based on the identifier of the first user sent by the terminal device 100. This application does not limit the implementation method of the cloud computing platform 200 obtaining the product line to which the first user belongs.

[0159] It can be seen that Figure 5 , Figure 6 The embodiment shown, compared to Figure 3 In the embodiment shown, when matching the code knowledge of the problem-solving step, the matched code knowledge is more detailed. Figure 5 The implementation examples are refined to specific language areas. Figure 6 The embodiments are refined to specific product lines, therefore, Figure 5 , Figure 6 In the embodiment shown, the code generation model generates code based on the finer-grained code knowledge matched to the problem solving step, so the granularity of the generated code will also be finer, such as in Figure 5 In the embodiment, the code generated by the code generation model will be refined to the user's expected code language field. Figure 6 In the embodiment, the code generated by the code generation model will be refined to the product line to which the user belongs, better meet the user's needs, and further optimize the user experience.

[0160] In another possible embodiment, the cloud computing platform 200 may store multiple user information, multiple prompt templates, and a first correspondence relationship, wherein the first correspondence relationship indicates the correspondence relationship between multiple user information and multiple prompt templates, wherein the first user belongs to multiple users, and the user information may include the user's name, ID number, mobile phone number, email address, department, product line, professional field, etc. The first correspondence relationship may be stored in the cloud computing platform 200 in the form of a data table or array, etc. Among them, the prompt template is used to help the model better understand the user's intention when the code generation model generates code, generate a reply that better meets the user's needs, and improve the reply quality of the model.

[0161] Refer to Table 3 for an exemplary first correspondence of this application. In Table 3, the user information is taken as the user name as an example.

[0162] See also Figure 7 , Figure 7 This is a schematic diagram of a prompt template exemplarily shown in the present application. In the prompt template, a task filling area 710 is included for filling in the problem-solving steps and the code knowledge matching the problem-solving steps. The {} in the prompt template is used to fill in the user's professional field. For example, when the first question input by the first user includes the keyword "Java", then {} is filled in with "Java development". For example, when the first question input by the first user includes the keyword "C++", then {} is filled in with "C++ development". It should be understood that Figure 7 The prompt template shown is for illustration only and is not specifically limited in this application.

[0163] Table 3 The first correspondence

[0164] Product Line prompt template wireless prompt template 1 Data Communication prompt template 2 calculate prompt template 3 Cloud Core prompt template 4 … …

[0165] In this embodiment, Figure 1 For the specific process of the code generation system generating code based on user questions, see Figure 8 Steps shown.

[0166] S801: The terminal device 100 receives a first question input by a first user.

[0167] S802: The terminal device 100 obtains the information of the first user.

[0168] S803: The terminal device 100 generates a code generation request carrying the first question and information of the first user.

[0169] S804: The terminal device 100 sends a code generation request to the cloud computing platform 200. Correspondingly, the cloud computing platform 200 receives the code generation request sent by the terminal device 100.

[0170] S805: The cloud computing platform 200 decomposes the first problem carried in the code generation request to obtain steps for solving the first problem.

[0171] S806: The cloud computing platform 200 retrieves the code knowledge base based on each step in the solution steps of the first problem to obtain target code knowledge, where the target code knowledge includes code knowledge in the code knowledge base that matches each step in the solution steps of the first problem.

[0172] S807: The cloud computing platform 200 searches for a first corresponding relationship based on the information of the first user carried in the code generation request, and uses a prompt template corresponding to the first user information among the multiple prompt templates as a target prompt template.

[0173] S808: The cloud computing platform 200 fills the solution steps of the first problem and the target code knowledge into the target prompt template.

[0174] S809: The cloud computing platform 200 inputs the target prompt template filled with the solution steps of the first problem and the target code knowledge into the code generation model, and uses the code output by the code generation model as the target code.

[0175] S810: The cloud computing platform 200 sends the target code to the terminal device 100.

[0176] S811: The terminal device 100 displays the target code.

[0177] S801 is the same as S301, the specific implementation process of S803 is similar to the specific implementation process of S302, the specific implementation process of S804 is similar to the specific implementation process of S303, S805 is the same as S304, the specific implementation process of S806 is similar to the specific implementation process of S305, S810 is the same as S307, and the specific implementation process of S811 is the same as S308. Please refer to Figure 3 For the sake of brevity of the specification, the descriptions of the corresponding steps are not elaborated any more.

[0178] Below Figure 8 The remaining steps S802, S807, S808, and S809 shown are described in detail.

[0179] In S802, the information of the first user may be input by the first user into the terminal device 100. Specifically, the first user may input the information of the first user through a code generation application client on the terminal device 100.

[0180] Taking the product line to which the user information belongs as an example, for example, on the interface displayed by the terminal device 100 for the first user to input the first question, a "product line type" input box is also displayed. When the first user inputs the first question on the interface, the first user can enter the product line to which the first user belongs in the "product line type" input box. For another example, on the interface displayed by the terminal device 100 for the first user to input the first question, a "product line type" selection box is also displayed. The selectable product line types may include but are not limited to wireless, data communication, cloud core, and computing. When the first user enters the first question on the interface, the first user can select a product line type in the "product line type" selection box as the product line to which the first user belongs.

[0181] Optionally, S802 can obtain the identifier of the first user for the terminal device 100, and S803 can generate a code generation request carrying the first question and the identifier of the first user for the terminal device 100. After S804 and before S807, the cloud computing platform 200 can query the registration information described in the method (2) in the aforementioned S602 based on the identifier of the first user carried in the code generation request to obtain the product line to which the first user belongs. In other words, the product line to which the first user belongs is not obtained by the terminal device 100 and sent to the cloud computing platform 200, but is obtained by the cloud computing platform 200 by querying the registration information of the first user based on the identifier of the first user sent by the terminal device 100. This application does not limit the implementation method of the cloud computing platform 200 obtaining the product line to which the first user belongs.

[0182] In S807 and S808, see Fig. 9 The prompt template shown as an example, Fig. 9The left side is a schematic diagram of the prompt template before the solution steps of the first problem and the target code knowledge are filled into the prompt template. For details about the prompt template, see Figure 7 Related description, Fig. 9 The right side is a schematic diagram of the prompt template after the solution steps of the first problem and the target code knowledge are filled into the prompt template. It should be understood that Fig. 9 This is for illustration only and is not intended to be limiting.

[0183] In S809, if the code generation model is to be implemented to infer and output code based on the target prompt template filled with the solution steps of the first problem and the target code knowledge, the second AI model can be trained to obtain the code generation model using the aforementioned second training sample set in the following manner: the solution steps of the i-th known problem in the second training sample set and the matching code knowledge are filled into the corresponding prompt template, the prompt template filled with the solution steps of the i-th known problem and the matching code knowledge is used as the input data sample Si, and the prompt template filled with the solution steps of the i-th known problem and the matching code knowledge and the code for solving the i-th known problem is used as the output data sample Wi. Through the above combination, a large number of input data samples and a large number of output data samples can be obtained, and there is a one-to-one correspondence between the large number of input data samples and the large number of output data samples. Then, the second AI model can be trained using the large number of input data samples and the large number of output data samples.

[0184] The solution steps for the above-mentioned i-th known problem and the prompt template corresponding to the matching code knowledge can be determined as follows:

[0185] Method ①: Taking the first corresponding relationship shown in Table 3 as an example, the prompt template corresponding to the same product line as the product line to which the i-th known problem belongs among the multiple prompt templates shown in Table 3 is the prompt template corresponding to the solution steps of the i-th known problem and its matching code knowledge.

[0186] Method ②, continuing with the first correspondence shown in Table 3 as an example, the prompt template corresponding to the product line in the multiple prompt templates shown in Table 3 and the product line to which the code knowledge matching the solution steps of the i-th known problem belongs is the prompt template corresponding to the solution steps of the i-th known problem and its matching code knowledge.

[0187] It should be noted that the above-mentioned methods ① and ② are only examples and should not be regarded as specific limitations. For example, if the first correspondence indicates the correspondence between the departments to which multiple users belong and multiple prompt templates, then the prompt template with the same department as the department to which the code knowledge matching the solution steps of the i-th known problem belongs in the multiple prompt templates can be used as the prompt template corresponding to the solution steps of the i-th known problem and its matching code knowledge.

[0188] It can be seen that Figure 8 The embodiment is Figure 3 An extension of the embodiment shown, in Figure 3 Based on the embodiment, a step of obtaining the first user information (i.e., S802) is added, and a step of querying the first corresponding relationship according to the first user's information to obtain the target prompt template (i.e., S807) is added, and a step of filling the solution step of the first problem and the target code knowledge into the target prompt template (i.e., S808) is added. Figure 3 The step of inputting the solution steps of the first problem and the target code knowledge into the code generation model in S306 is replaced by the step of inputting the target prompt template filled with the solution steps of the first problem and the target code knowledge into the code generation model in S809. Since the prompt template can help the code generation model better understand the user's intention, generate a response that better meets the user's needs, and improve the quality of the model's response, therefore, Figure 8 Example compared to Figure 3 In an embodiment, the cloud computing platform 200 can use the code generation model to generate code that better meets user needs and improve code quality.

[0189] According to the above ideas, it can be understood that Figure 5 / Figure 6 Based on the embodiment, the steps of obtaining the first user information, querying the first corresponding relationship according to the first user information to obtain the target prompt template, and filling the solution step of the first problem and the target code knowledge into the target prompt template are added. Figure 5 / Figure 6 In S507 / S607 shown, the step of inputting the solution steps of the first problem and the target code knowledge into the code generation model is replaced by inputting the target prompt template filled with the solution steps of the first problem and the target code knowledge into the code generation model. Since the prompt template can help the code generation model better understand the user's intention, generate a response that better meets the user's needs, and improve the response quality of the model, therefore, in Figure 5 / Figure 6 The above operation is performed based on the embodiment. Figure 5 / Figure 6In an embodiment, the cloud computing platform 200 can use the code generation model to generate code that better meets user needs and improve code quality.

[0190] It should be noted that the above-mentioned code knowledge base, multiple user information, multiple prompt templates, multiple language types, first correspondence, etc. are stored in the cloud computing platform 200 only as an example. In a specific implementation, the above-mentioned information can also be stored in one or more other storage devices independent of the cloud computing platform 200. When the cloud computing platform 200 needs to query the corresponding information, it can access the storage device that stores the corresponding information for query.

[0191] It is understandable that with the rapid development of computer technology and the passage of time, new code knowledge and outdated code knowledge will appear in various language fields. If the code generation model is not updated, the code generation model may face the problem of insufficient training data / outdated training data, resulting in low reasoning accuracy. If the code generation model is updated and trained, it will face the problem of long training cycle and high cost. In order to solve the above problems, the embodiments of the present application provide Figure 3 , Figure 5 , Figure 6 , Figure 8 The code generation method shown may also include the following steps:

[0192] In the first step, the terminal device 100 receives an update operation on the code knowledge base input by the first user, such as an operation of deleting expired code knowledge in the code knowledge base, an operation of correcting erroneous code knowledge in the code knowledge base, an operation of adding new code knowledge to the code knowledge base, etc.

[0193] In the second step, the terminal device 100 processes the above-mentioned update operation on the code knowledge base into an update request for the code knowledge base.

[0194] Step 3: The terminal device 100 sends an update request to the cloud computing platform 200.

[0195] In the fourth step, the cloud computing platform 200 updates the code knowledge base based on the update request, such as deleting expired code knowledge in the code knowledge base, correcting erroneous code knowledge in the code knowledge base, or adding new code knowledge to the code knowledge base.

[0196] In the case where the update request is used to request adding new code knowledge to the code knowledge base, the update request may carry the new code knowledge to be added.

[0197] It can be understood that since the code knowledge in the code knowledge base has been updated, when the cloud computing platform 200 subsequently receives a new user question and generates code based on the new user question, it can search in the updated code knowledge base based on the new user question. The retrieved matching code knowledge is updated, so that the code generation model can generate code based on the updated code knowledge, which helps to maintain the timeliness, adaptability and accuracy of the model.

[0198] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0199] The above describes in detail the code generation method provided in the embodiment of the present application. Based on the same inventive concept, the following further describes the code generation device and computing device cluster provided in the embodiment of the present application.

[0200] See also Fig.10 , Fig.10 is a schematic diagram of a code generating device 1000 provided in an embodiment of the present application. The code generating device 1000 can be applied to Figure 1 The code generation system shown can be applied to Figure 2 Computing devices in the cloud computing platform 200 are shown.

[0201] like Fig.10 As shown, the code generation device 1000 includes: an acquisition module 1010, a problem decomposition module 1020, a knowledge retrieval module 1030, a code generation module 1040 and a sending module 1050. The functions of the various modules of the code generation device 1000 are introduced exemplarily below. It should be understood that the functions of the various modules described below are only functions that the code generation device 1000 may have in some embodiments of the present application, and the present application does not limit the functions of the various modules.

[0202] The acquisition module 1010 is used to receive a code generation request carrying a first question sent by the terminal device 100.

[0203] The problem decomposition module 1020 is used to decompose the first problem to obtain solution steps for the first problem.

[0204] The knowledge retrieval module 1030 is used to retrieve the code knowledge base based on each step in the solution steps of the first problem to obtain target code knowledge, where the target code knowledge includes code knowledge in the code knowledge base that matches each step in the solution steps of the first problem.

[0205] The code generation module 1040 is used to input the solution steps of the first problem and the target code knowledge into the code generation model, and use the code output by the code generation model as the target code. The code generation model is obtained by using AI technology to train the solution steps of multiple known problems, the code knowledge matching the solution steps of multiple known problems, and the code used to solve the multiple known problems, wherein the code used to solve each known problem includes the code in the code knowledge matching the solution steps of each known problem.

[0206] The sending module 1050 is used to send the target code to the terminal device 100.

[0207] In some possible embodiments, the above-mentioned code knowledge base includes the language type to which each code knowledge in the code knowledge base belongs; the acquisition module 1010 is also used to obtain the expected code language type of the first user, and the first user is the user of the terminal device; the knowledge retrieval module 1030 is specifically used to: retrieve the code knowledge base based on each step in the solution steps of the first problem and the expected code language type to obtain target code knowledge, and the target code knowledge includes the code knowledge in the code knowledge base whose language type is the same as the expected code language type, and the code knowledge that matches each step in the solution steps of the first problem.

[0208] In some possible embodiments, the acquisition module 1010 is also used to obtain the information of the first user, and query the first corresponding relationship based on the information of the first user, and use the prompt template corresponding to the information of the first user in multiple prompt templates as the target prompt template, wherein the first corresponding relationship indicates the correspondence between multiple user information and multiple prompt templates, the first user is the user of the terminal device, and the first user belongs to multiple users; the code generation module 1040 is specifically used to: fill in the solution steps of the first problem and the target code knowledge into the target prompt template; and input the target prompt template into the code generation model.

[0209] In some possible embodiments, the apparatus 1000 further includes: a knowledge updating module 1060 ( Fig.10 not shown); the acquisition module 1010 is also used to receive an update request for the code knowledge base sent by the terminal device 100; the knowledge update module 1060 is used to update the code knowledge base based on the update request.

[0210] In some possible embodiments, the update request carries new code knowledge; the knowledge update module 1060 is used to add the new code knowledge carried by the update request to the code knowledge base.

[0211] In some possible embodiments, the language type to which the code knowledge in the above-mentioned code knowledge base belongs includes any one or more of the following: C language, C++ language, C# language, Java language, Python language, JavaScript language, VisualBasic language and Golang language.

[0212] In some possible embodiments, the terminal device 100 is installed with an IDE, and the code generation request is generated based on the first question and sent to the acquisition module 1010 by the IDE on the terminal device 100 after receiving the first question.

[0213] In some possible embodiments, the apparatus 1000 may further include a first model training module 1070 and a second model training module 1080 ( Fig.10 The first model training module 1070 is used to train and obtain the above-mentioned problem step decomposition model, and the second model training module 1080 is used to train and obtain the above-mentioned code generation model.

[0214] In a specific implementation, the acquisition module 1010, the problem decomposition module 1020, the knowledge retrieval module 1030, the code generation module 1040, the sending module 1050, the knowledge update module 1060, the first model training module 1070 and the second model training module 1080 can all be implemented by software, or can be implemented by hardware. Exemplarily, the implementation of the code generation module 1040 is introduced below, taking the code generation module 1040 as an example. Similarly, the implementation of the acquisition module 1010, the problem decomposition module 1020, the knowledge retrieval module 1030, the sending module 1050, the knowledge update module 1060, the first model training module 1070 and the second model training module 1080 can refer to the implementation of the code generation module 1040.

[0215] As an example of a software functional unit, the code generation module 1040 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the code generation module 1040 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.

[0216] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.

[0217] As an example of a hardware functional unit, the code generation module 1040 may include at least one computing device, such as a server, etc. Alternatively, the code generation module 1040 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0218] When the code generation module 1040 includes multiple computing devices, the multiple computing devices included can be distributed in the same region or in different regions. The multiple computing devices included in the code generation module 1040 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the code generation module 1040 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0219] It should be noted that, in other embodiments, the code generation module 1040 may be used to execute Figure 3 , Figure 5 , Figure 6 , Figure 8 In any step of the code generation method shown in FIG. 1 , the acquisition module 1010 can be used to perform Figure 3 , Figure 5 , Figure 6 , Figure 8 The knowledge retrieval module 1030 can be used to perform any step performed in the code generation method shown in FIG. Figure 3 , Figure 5 , Figure 6 , Figure 8 In any step of the code generation method shown in FIG. 1 , the problem decomposition module 1020 can be used to perform Figure 3 , Figure 5 , Figure 6 , Figure 8 For any step performed in the code generation method shown in FIG. Figure 3 , Figure 5 , Figure 6 , Figure 8 The knowledge updating module 1060 can be used to perform any step performed in the code generation method shown in FIG. Figure 3 , Figure 5 , Figure 6 , Figure 8 The first model training module 1070 can be used to perform any step performed in the code generation method shown in Figure 3 , Figure 5 , Figure 6 , Figure 8 The second model training module 1080 can be used to perform any step performed in the code generation method shown in Figure 3 , Figure 5 , Figure 6 , Figure 8 Any steps executed in the code generation method shown in the figure, the steps implemented by the acquisition module 1010, the problem decomposition module 1020, the knowledge retrieval module 1030, the code generation module 1040, the sending module 1050, the knowledge update module 1060, the first model training module 1070 and the second model training module 1080 can be specified as needed, and the steps implemented by the acquisition module 1010, the problem decomposition module 1020, the knowledge retrieval module 1030, the code generation module 1040, the sending module 1050, the knowledge update module 1060, the first model training module 1070 and the second model training module 1080 can be specified as needed. Figure 3 , Figure 5 , Figure 6 , Figure 8 The different steps in the code generation method shown are used to implement all functions of the code generation device 1000.

[0220] The present application embodiment also provides a computing device 1100, which can be deployed Fig.10 The operations and / or functions of the various modules in the code generating apparatus 1000 and the computing device 1100 are respectively to implement Figure 3 , Figure 5 , Figure 6 , Figure 8 The corresponding steps in the code generation method shown.

[0221] like Fig.11 As shown, the computing device 1100 includes: a processor 1110 , a memory 1120 , and a communication interface 1130 , wherein the processor 1110 , the memory 1120 , and the communication interface 1130 may be interconnected via a bus 1140 .

[0222] The processor 1110 can read the program code (including instructions) stored in the memory 1120, execute the program code stored in the memory 1120, and enable the computing device 1100 to execute Figure 3 , Figure 5 , Figure 6 , Figure 8 The code generation method shown, or enables the computing device 1100 to deploy the code generation apparatus 1000.

[0223] The processor 1110 may have a variety of specific implementation forms, such as a CPU, or a combination of a CPU and a hardware chip. The hardware chip may be an ASIC, a PLD, or a combination thereof. The PLD may be a CPLD, an FPGA, a GAL, or any combination thereof. The processor 1110 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 1120, which enables the computing device 1100 to provide a variety of services.

[0224] The memory 1120 is used to store program codes and is controlled and executed by the processor 1110. The program code may include one or more software modules, which may be Fig.10 The software modules provided in the embodiment include an acquisition module 1010, a problem decomposition module 1020, a knowledge retrieval module 1030, a code generation module 1040 and a sending module 1050. Optionally, the one or more software modules may also be Fig.10 The knowledge updating module 1060, the first model training module 1070 and the second model training module 1080 provided in the embodiment ( Fig.11 (not shown).

[0225] The memory 1120 may include a volatile memory, such as a random access memory (RAM); the memory 1120 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 1120 may also include a combination of the above types.

[0226] The communication interface 1130 may be a wired interface (e.g., an Ethernet interface, a fiber optic interface, or other types of interfaces (e.g., an infiniBand interface)) or a wireless interface (e.g., a cellular network interface or a wireless local area network interface) for communicating with other computing devices or apparatuses. The communication interface 1130 may use a protocol family above the transmission control protocol / internet protocol (TCP / IP), such as a remote function call (RFC) protocol, a simple object access protocol (SOAP) protocol, a simple network management protocol (SNMP) protocol, a common object request broker architecture (CORBA) protocol, and a distributed protocol, etc.

[0227] The bus 1140 may be a peripheral component interconnect express (PCIe) bus, an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a compute express link (CXL), a cache coherent interconnect for accelerators (CCIX), etc. The bus 1140 may be divided into an address bus, a data bus, a control bus, etc. In addition to the data bus, the bus 1140 may also include a power bus, a control bus, and a status signal bus, etc. However, for the sake of clarity, various buses are labeled as bus 1140 in the figure. For ease of representation, Fig.11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0228] The computing device 1100 is used to execute Figure 3 , Figure 5 , Figure 6 , Figure 8 The specific implementation process of the code generation method shown is detailed in the above method embodiment and will not be repeated here.

[0229] It should be understood that the computing device 1100 is only an example provided in the embodiment of the present application, and the computing device 1100 may have more Fig.11 The components shown may be more or less than the components, may be combined with two or more components, or may be implemented with a different configuration of components.

[0230] The present application also provides a computing device cluster 1200, which can be deployed Fig.10 The operations and / or functions of the various modules in the code generation apparatus 1000 and the computing device cluster 1200 are respectively to implement Figure 3 , Figure 5 , Figure 6 , Figure 8 The corresponding steps in the code generation method shown.

[0231] like Fig.12 As shown, the computing device cluster 1200 includes at least one computing device 1100. The memory 1120 in one or more computing devices 1100 in the computing device cluster may store the same Figure 3 , Figure 5 , Figure 6 , Figure 8 The computing device 1100 may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device 1100 may also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.

[0232] In some possible implementations, the memory 1120 of one or more computing devices 1100 in the computing device cluster 1200 may also store a program for executing Figure 3 , Figure 5 , Figure 6 , Figure 8 In other words, the combination of one or more computing devices 1100 can jointly execute instructions for executing Figure 3 , Figure 5 , Figure 6 , Figure 8 Instructions for the code generation method shown.

[0233] It should be noted that the memory 1120 in different computing devices 1100 in the computing device cluster 1200 may store different instructions, which are respectively used to execute part of the functions of the code generation apparatus 1000. That is, the instructions stored in the memory 1120 in different computing devices 1100 may implement the functions of one or more modules among the acquisition module 1010, the problem decomposition module 1020, the knowledge retrieval module 1030, the code generation module 1040 and the sending module 1050.

[0234] In some possible implementations, one or more computing devices 1100 in the computing device cluster 1200 may be connected via a network, which may be a wide area network or a local area network. Fig.13 A possible implementation is shown, such as Fig.13 As shown, two computing devices 1100A and 1100B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 1120 in the computing device 1100A stores instructions for executing the functions of the acquisition module 1010, the problem decomposition module 1020, and the sending module 1050. At the same time, the memory 1120 in the computing device 1100B stores instructions for executing the functions of the knowledge retrieval module 1030 and the code generation module 1040.

[0235] Fig.13 The connection method between the computing device cluster 1200 shown may be based on the fact that the code generation method provided in the embodiment of the present application needs to be retrieved in the code knowledge base based on the solution steps of a large number of problems, and code generation needs to be performed based on a large number of problems. Therefore, it is considered to hand over the functions implemented by the knowledge retrieval module 1030 and the code generation module 1040 to the computing device 1100B for execution.

[0236] It should be understood that Fig.13 The functions of the computing device 1100A shown in FIG. 1100A may also be completed by multiple computing devices 1100. Similarly, the functions of the computing device 1100B may also be completed by multiple computing devices 1100.

[0237] The present application also provides a computer program product containing instructions, which may be software or a program product containing instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes Figure 3 , Figure 5 , Figure 6 , Figure 8 The code generation method shown.

[0238] The present application also provides a computer-readable storage medium, which can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a high-density digital video disc (DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute Figure 3 , Figure 5 , Figure 6 , Figure 8 The code generation method shown.

[0239] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0240] In the above embodiments, it can be implemented in whole or in part by software, hardware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium, or a semiconductor medium, etc.

[0241] The above is only a specific implementation of the present application. Those skilled in the art may conceive of changes or substitutions based on the specific implementation provided by the present application, which should all be included in the protection scope of the present application.

Claims

1. A code generation method, characterized in that: Applied to a code generation system, the code generation system includes a cloud computing platform and a terminal device, and the method includes: The cloud computing platform receives a code generation request carrying a first question sent by the terminal device; The cloud computing platform decomposes the first problem to obtain steps for solving the first problem; The cloud computing platform retrieves a code knowledge base based on each step in the solution to the first problem to obtain target code knowledge, wherein the target code knowledge includes code knowledge in the code knowledge base that matches each step in the solution to the first problem; The cloud computing platform inputs the solution steps of the first problem and the target code knowledge into a code generation model, and uses the code output by the code generation model as the target code, wherein the code generation model is obtained by using artificial intelligence AI technology to train the solution steps of multiple known problems, the code knowledge matching the solution steps of the multiple known problems, and the code for solving the multiple known problems, wherein the code for solving each known problem includes the code in the code knowledge matching the solution steps of each known problem; The cloud computing platform sends the target code to the terminal device.

2. The method according to claim 1, characterized in that The code knowledge base includes the language type to which each code knowledge in the code knowledge base belongs; The method further comprises: The cloud computing platform obtains a desired code language type of a first user, where the first user is a user of the terminal device; The cloud computing platform retrieves a code knowledge base based on each step in the solution steps of the first problem to obtain target code knowledge, wherein the target code knowledge includes code knowledge matched by each step in the solution steps of the first problem, including: The cloud computing platform retrieves a code knowledge base based on each step in the solution steps of the first problem and the expected code language type to obtain target code knowledge, wherein the target code knowledge includes code knowledge in the code knowledge base that has the same language type as the expected code language type and that matches each step in the solution steps of the first problem.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: The cloud computing platform obtains information of a first user, queries a first corresponding relationship based on the information of the first user, and uses a prompt template corresponding to the information of the first user among multiple prompt templates as a target prompt template, wherein the first corresponding relationship indicates a corresponding relationship between multiple user information and the multiple prompt templates, the first user is a user of the terminal device, and the first user belongs to the multiple users; The cloud computing platform inputs the solution steps of the first problem and the target code knowledge into a code generation model, including: The cloud computing platform fills the solution steps of the first problem and the target code knowledge into the target prompt template; The cloud computing platform inputs the target prompt template into a code generation model.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: The cloud computing platform receives an update request for the code knowledge base sent by the terminal device; The cloud computing platform updates the code knowledge base based on the update request.

5. The method according to claim 4, characterized in that The update request carries new code knowledge; The cloud computing platform updates the code knowledge base based on the update request, including: The cloud computing platform adds the new code knowledge carried in the update request to the code knowledge base.

6. The method according to any one of claims 2 to 5, characterized in that: The language type to which the code knowledge in the code knowledge base belongs includes any one or more of the following: C language, C++ language, C# language, Java language, Python language, JavaScript language, Visual Basic language and Golang language.

7. The method according to any one of claims 1 to 6, characterized in that: The terminal device is installed with an integrated development environment IDE, and the code generation request is generated based on the first question by the IDE on the terminal device after receiving the first question and sent to the cloud computing platform.

8. A code generating device, characterized in that: Applied to a cloud computing platform, the cloud computing platform belongs to a code generation system, the code generation system also includes a terminal device, and the device includes: An acquisition module, configured to receive a code generation request carrying a first question sent by the terminal device; A problem decomposition module, used for decomposing the first problem to obtain solution steps for the first problem; A knowledge retrieval module, configured to retrieve a code knowledge base based on each step in the solution to the first problem to obtain target code knowledge, wherein the target code knowledge includes code knowledge in the code knowledge base that matches each step in the solution to the first problem; A code generation module, used for inputting the solution steps of the first problem and the target code knowledge into a code generation model, and taking the code output by the code generation model as the target code, wherein the code generation model is obtained by training the solution steps of multiple known problems, the code knowledge matching the solution steps of the multiple known problems, and the code for solving the multiple known problems using artificial intelligence AI technology, wherein the code for solving each known problem includes the code in the code knowledge matching the solution steps of each known problem; A sending module is used to send the target code to the terminal device.

9. The device according to claim 8, characterized in that The code knowledge base includes the language type to which each code knowledge in the code knowledge base belongs; The acquisition module is further used to acquire the desired code language type of a first user, where the first user is a user of the terminal device; The knowledge retrieval module is used to retrieve the code knowledge base based on each step in the solution steps of the first problem and the expected code language type to obtain target code knowledge, wherein the target code knowledge includes code knowledge in the code knowledge base that has the same language type as the expected code language type and matches each step in the solution steps of the first problem.

10. The device according to claim 8 or 9, characterized in that The acquisition module is further used to acquire information of a first user, and query a first corresponding relationship based on the information of the first user, and use a prompt template corresponding to the information of the first user among multiple prompt templates as a target prompt template, wherein the first corresponding relationship indicates a corresponding relationship between multiple user information and the multiple prompt templates, the first user is a user of the terminal device, and the first user belongs to the multiple users; The code generation module is specifically used for: Fill the solution steps of the first problem and the target code knowledge into the target prompt template; The target prompt template is input into the code generation model.

11. The device according to any one of claims 8 to 10, characterized in that The device also includes: a knowledge updating module; The acquisition module is further used to receive an update request for the code knowledge base sent by the terminal device; The knowledge updating module is used to update the code knowledge base based on the update request.

12. The device according to claim 11, characterized in that The update request carries new code knowledge; The knowledge updating module is used to add the new code knowledge carried in the update request to the code knowledge base.

13. The device according to any one of claims 8 to 12, characterized in that The language type to which the code knowledge in the code knowledge base belongs includes any one or more of the following: C language, C++ language, C# language, Java language, Python language, JavaScript language, Visual Basic language and Golang language.

14. The device according to any one of claims 8 to 13, characterized in that The terminal device is installed with an IDE, and the code generation request is generated based on the first question by the IDE on the terminal device after receiving the first question and sent to the acquisition module.

15. A computing device cluster, characterized in that: comprising at least one computing device, each computing device of the at least one computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Code generation method and device, equipment and medium

    CN121658503A

  • Code generation method, apparatus, and computer-readable storage medium

    EP4787150A1

  • Code generation method, apparatus, and computer-readable storage medium

    WO2025086764A1