Code generation method and system, electronic equipment and storage medium

Through collaborative work on the client and server, program code for application workflows is generated, which solves the problem that large-model generation code needs to be further processed in the existing technology, and realizes the convenience of creating application workflows without the need for code development capabilities.

CN120179253APending Publication Date: 2025-06-20ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510120857.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

In the prior art, the code generated by the large model requires further code processing and conversion to connect with the application system, resulting in limited application development objects and required code development capabilities.

Method used

It provides a code generation method, which responds to application workflow orchestration operations through the collaborative work of the client and the server, displays application workflow through the connected component configuration window in the application editing interface, obtains configuration information of functional components, and generates program code corresponding to functional components based on this.

Benefits of technology

It realizes that users can create application workflows without having program code development capabilities, expands the scope of applicable objects for application development, simplifies user operations, and improves the user convenience of code generation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179253A_ABST
    Figure CN120179253A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a code generation method, a code generation system, electronic equipment, a storage medium and a computer program product. The method comprises the steps that a client side responds to an application workflow arrangement operation, an application workflow is displayed on an application editing interface through component configuration windows connected in sequence, and the component configuration windows are used for configuring functional components corresponding to corresponding code nodes in the application workflow; in response to a configuration operation executed on the corresponding functional component in the component configuration window, obtaining configuration information of the functional component; and in response to a code generation operation triggered for the functional component, generating a program code corresponding to the functional component based on the configuration information through the server. According to the method, the user only needs to fill in the input parameters, the output result and the function description, the code generation system can automatically generate the corresponding executable code according to the requirement of the user, the code development capability requirement for the application development object is effectively lowered, and the applicable object range of application development is expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and particularly to a code generation method, a code generation system, an electronic device, a storage medium, and a computer program product. Background Art

[0002] With the development of large model technology, there are more and more application scenarios for using large models to generate code. However, in the prior art, the code generated by large models is usually code for atomic functions. When applying the code for atomic functions generated by large models to solve problems in specific application scenarios, software development operations such as code post-processing and code integration still need to be performed by personnel with code development capabilities. That is, in actual applications, the code generated by large models still needs further code processing and conversion to interface with the application system. However, operations such as code processing and conversion, and interfacing with the application system require the user to have code development capabilities, resulting in limited application development objects. Summary of the Invention

[0003] An embodiment of the present application provides a code generation method, which can expand the scope of applicable objects for application development and can generate program code more conveniently.

[0004] Correspondingly, an embodiment of the present application also provides a code generation system, an electronic device, a storage medium, and a computer program product to ensure the implementation and application of the above code generation method.

[0005] To solve the above problems, an embodiment of the present application discloses a code generation method, which is applied to a client, and the method includes:

[0006] In response to an application workflow orchestration operation, display an application workflow in an application editing interface through a component configuration window connected in sequence, where the component configuration window is used to configure function components corresponding to corresponding code nodes in the application workflow;

[0007] In response to a configuration operation performed on the corresponding function component in the component configuration window, obtain the configuration information of the function component;

[0008] In response to a code generation operation triggered for the function component, generate program code corresponding to the function component based on the configuration information.

[0009] An embodiment of the present application discloses a code generation method, which is applied to a server, and the method includes:

[0010] In response to receiving a code generation request sent by a client, obtain the configuration information carried in the code generation request;

[0011] Iteratively call a preset large language model based on the configuration information to generate the program code corresponding to the functional component.

[0012] An embodiment of the present application discloses a code generation system, including: a client and a server, where

[0013] The client is used to respond to an application workflow orchestration operation and display the application workflow in an application editing interface through a component configuration window connected in sequence. Among them, the component configuration window is used to configure the functional components corresponding to the corresponding code nodes in the application workflow;

[0014] The client is further used to respond to a configuration operation performed on the corresponding functional component in the component configuration window, and obtain the configuration information of the functional component;

[0015] The client is further used to respond to a code generation operation triggered for the functional component, generate a code generation request based on the configuration information, and send the code generation request to the server;

[0016] The server is used to respond to receiving the code generation request sent by the client, and obtain the configuration information carried by the code generation request;

[0017] The server is further used to iteratively call a preset large language model based on the configuration information to generate the program code corresponding to the functional component.

[0018] An embodiment of the present application also discloses a computer-readable storage medium, in which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, they are used to implement the method as described in the embodiment of the present application.

[0019] An embodiment of the present application also discloses a computer program product, including a computer program / computer executable instruction, characterized in that when the computer program / computer executable instruction is executed by a processor in an electronic device, it implements the method as described in the embodiment of the present application.

[0020] Compared with the prior art, the embodiments of the present application include the following advantages:

[0021] By providing a simplified and structured intelligent code generation interaction interface on the client side, the client responds to the application workflow orchestration operation and displays the application workflow in the application editing interface through successively connected component configuration windows. Among them, the component configuration window is used to configure the functional components corresponding to the corresponding code nodes in the application workflow; in response to the configuration operation performed on the corresponding functional component within the component configuration window, obtain the configuration information of the functional component; in response to the code generation operation triggered for the functional component, generate the program code corresponding to the functional component based on the configuration information, realizing that the user only needs to fill in the input parameters, output results, and functional descriptions, and the code generation system can automatically generate the corresponding executable code according to the user's needs, enabling users without program code development capabilities to easily create application workflows, effectively reducing the code development capability requirements for application development objects, expanding the scope of applicable objects for application development, and greatly simplifying user operations, enhancing the user convenience of the code generation system. Description of the Drawings

[0022] Figure 1 is one of the step flowcharts of the code generation method disclosed in the embodiments of the present application;

[0023] Figure 2 is a schematic diagram of an application workflow orchestration scenario in the code generation method disclosed in the embodiments of the present application;

[0024] Figure 3 is the process schematic of the steps of generating program code and test cases in the code generation method disclosed in the embodiments of the present application;

[0025] Figure 4 is the second step flowchart of the code generation method disclosed in the embodiments of the present application;

[0026] Figure 5 is the third step flowchart of the code generation method disclosed in the embodiments of the present application;

[0027] Figure 6 is the fourth step flowchart of the code generation method disclosed in the embodiments of the present application;

[0028] Figure 7 is the fifth step flowchart of the code generation method disclosed in the embodiments of the present application;

[0029] Figure 8 is the sixth step flowchart of the code generation method disclosed in the embodiments of the present application;

[0030] Figure 9 is the interaction schematic diagram of the code generation system disclosed in the embodiments of the present application;

[0031] Figure 10It is a schematic structural diagram of an exemplary device provided by an embodiment of the present application. Detailed implementation manners

[0032] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below with reference to the accompanying drawings and specific implementation manners.

[0033] Refer to Figure 1 , the code generation method disclosed in the embodiments of the present application is applied to the client of a code generation system, and the method includes: Step 102 to Step 106.

[0034] Step 102, in response to an application workflow orchestration operation, display an application workflow in an application editing interface through a component configuration window connected in sequence, where the component configuration window is used to configure function components corresponding to corresponding code nodes in the application workflow.

[0035] The code generation method disclosed in the embodiments of the present application can be applied to a code generation system for generating executable codes, test cases, etc. of an application program. Among them, the executable code of the application program can be linked based on the program codes of multiple function components. In some alternative embodiments, an application workflow composed of workflow nodes corresponding to function components can be obtained by orchestrating function components.

[0036] In some alternative embodiments, the code generation system can pre-create multiple function components and define configurable parameters for each function component. The function component is a visual plugin in the application workflow for implementing different requirements, and integrates a rich variety of tools for users to choose from. Users can create a new application through the application editing interface of the client of the code generation system, then drag and drop function components, insert them into the application workflow and configure them, so as to automatically generate application codes.

[0037] In some alternative embodiments, the function components pre-created in the code generation system include, but are not limited to, one or more of the following general function components: start function component, end function component, large model generation component, knowledge base retrieval component, selector component, intent classification component; and also include: intelligent code component. Among them, the general function component is used to execute specific functions when the application workflow runs; the intelligent code component is used to execute corresponding functions according to the function description of the intelligent code component.

[0038] The functions of various function components will be introduced separately below.

[0039] (1) Start function component

[0040] The start function component can serve as the start node of the application workflow and is used to set the information required to start the application workflow. In the embodiments of the present application, the start function component does not require parameter configuration. When the start function component is called, the code generation system automatically brings in the globally variables set by default into the application workflow.

[0041] (2) End function component

[0042] The end function component can serve as the end node of the application workflow and is used to return the result information after the application workflow runs. When creating the workflow node corresponding to the end function component, the parameters that need to be configured include: output parameters, where the output parameters include but are not limited to one or more of the following: parameter name, parameter description, data type, parameter assignment method, etc. Among them, the parameter assignment method can be configured as one or more of the following: reference the information of the upstream node.

[0043] (3) Large model generation component

[0044] The large model generation component is used to call the large language model and generate a response according to the input and the prompt words.

[0045] When creating the application workflow node corresponding to the large model generation component, the parameters that need to be configured include but are not limited to one or more of the following: input parameters, output parameters, the large language model called, prompt words, etc. Among them, the input parameters include but are not limited to: parameter name, parameter description, data type, parameter assignment method, etc. The output parameters include but are not limited to: parameter name, parameter description, and data type, etc.

[0046] (4) Knowledge base retrieval component

[0047] The knowledge base retrieval component is used to recall the most matching information in the configured documents or tables according to the input variables within the selected knowledge scope.

[0048] When creating the application workflow node corresponding to the knowledge base retrieval component, the parameters that need to be configured include but are not limited to one or more of the following: input parameters, output parameters, knowledge base, etc. Among them, the input parameters include but are not limited to: parameter name, parameter description, data type, parameter assignment method, etc. The output parameters include: parameter name, parameter description, data type. The configured knowledge base includes but is not limited to: knowledge base type, maximum number of recalled information, minimum matching degree information, etc. Among them, the knowledge base type includes but is not limited to: documents, tables. Further, the document type knowledge base further includes multiple subtypes of knowledge bases (such as local documents, cloud documents, etc.), and the table type knowledge base further includes multiple subtypes of knowledge bases (such as Excel tables). Each type of knowledge base further needs to be configured with one or more of the following information: knowledge base serial number, knowledge base name, knowledge base type, etc.

[0049] (V) Selector Component

[0050] The selector component is used for conditional judgment and performs a workflow with relatively complex logic. Each judgment of the selector component supports setting the intersection or union of multiple conditions. The selector component can connect multiple downstream branches. If the set condition is satisfied, it immediately runs its corresponding "if" branch; otherwise, it runs the "else" branch.

[0051] When creating the application workflow node corresponding to the selector component, multiple judgment branches can be configured for each selector component. Further, the parameters that need to be configured for each judgment branch include, but are not limited to, one or more of the following: input parameters, judgment conditions, etc.

[0052] (VI) Intent Classification Component

[0053] The intent classification component is used for classification according to the set intent. The intent classification component classifies the intent based on the input parameters and outputs the intent classification result. In the application workflow, the workflow node corresponding to the intent classification component can determine the development direction of the subsequent conversation according to the intent classification result.

[0054] In the embodiments of the present application, multiple recommended intents can be established in advance. When creating the workflow node corresponding to the intent classification component, it is necessary to configure the input parameters, output parameters, and the intent of the intent classification component to be created. Among them, the input parameters include, but are not limited to: parameter name, parameter type, reference, etc. The output parameters include, but are not limited to: parameter name, parameter description, data type. When configuring the intent classification component to be created, you can select the recommended intents built into the system or add intents manually.

[0055] (VII) Intelligent Code Component

[0056] In the embodiments of the present application, the intelligent code component is automatically generated by the code generation system according to the user configuration. The intelligent code component is used to process the input parameters according to the function description configured by the user and return the value of the output parameters, so as to realize the diversified processing of the input information. For example, the intelligent code components pre-created by the code generation system may include one or more of the following: e-commerce content creation and optimization component, e-commerce translation service component, e-commerce image processing component, e-commerce image generation component, etc. intelligent code components.

[0057] In the embodiments of the present application, when creating an intelligent code component, the parameters that need to be configured include, but are not limited to, one or more of the following: input parameters, output parameters, function descriptions, etc. Among them, the input parameters include, but are not limited to: parameter name, parameter description, data type, parameter assignment method, etc. The output parameters include: parameter name, parameter description, data type.

[0058] In some alternative embodiments, by orchestrating an application workflow, these functional components are added to the application, thereby enriching the application capabilities. For example, using an e-commerce translation service functional component, an application for implementing a product translation function can be created.

[0059] In some alternative embodiments, the application workflow orchestration operation includes: a workflow node creation operation. In response to the application workflow orchestration operation, the application workflow is displayed in the application editing interface through sequentially connected component configuration windows, including: in response to the workflow node creation operation, the component configuration window corresponding to the functional component of the currently orchestrated application workflow is displayed in the application editing interface, where the workflow node creation operation includes: an operation of dragging the component icon displayed in the functional component list to the application editing interface, or a click operation on the component icon displayed in the functional component list.

[0060] Take Figure 2 the client interface of the code generation system shown as an example. The client interface displays a functional component list 202, and the functional component list 202 displays the icons of various types of functional components preset by the code generation system. The user can select the functional component corresponding to the icon by selecting the icon of the functional component in the functional component list 202 according to the function of the functional component, and display the component configuration window of the selected functional component in the application editing interface 204 to perform the operation of creating a new functional component.

[0061] Optionally, the user can select to create a new functional component by dragging the icon of the functional component in the functional component list 202 to the application editing interface 204, or by clicking the icon of the functional component in the functional component list 202.

[0062] In some alternative embodiments, the application workflow orchestration operation further includes: a workflow node connection operation. In response to the application workflow orchestration operation, the application workflow is displayed in the application editing interface through sequentially connected component configuration windows, including: in response to the workflow node connection operation, obtaining the reference relationship of the functional components corresponding to the component configuration windows connected by the workflow node connection operation; displaying the workflow line connecting the corresponding component configuration windows, and updating the configuration information of the downstream functional components according to the reference relationship.

[0063] Optionally, the reference relationship is used to indicate the upstream functional component that the downstream functional component in the workflow established by the workflow node connection operation depends on. Updating the configuration information of the downstream functional component according to the reference relationship includes: updating the input parameters and reference information of the downstream functional component according to the output parameters of the upstream functional component.

[0064] Take the newly created application of removing modal particles in audio content created by the user as an example. Figure 2 As shown, after the user selects the functional component corresponding to the start node, the functional component corresponding to the end node, and the functional component corresponding to the audio content processing node (such as the smart code component), the client displays the component configuration window 2041 of the functional components corresponding to the start node, the end node, and the audio content processing node in the application editing interface 204, and then, according to the workflow node connection operation performed by the user on each component configuration window 2041 displayed in the application editing interface 204, a workflow line 2042 is established between the component configuration windows connected by the user operation to display the reference relationship between the functional components corresponding to the component configuration windows in the application workflow.

[0065] Optionally, the workflow node connection operation may be: an operation of connecting the component configuration window through a workflow line in the code generation system. The functional component corresponding to the component configuration window connected to the starting point of the workflow line is the upstream functional component in the workflow, and the functional component corresponding to the component configuration window connected to the end point of the workflow line is the downstream functional component in the workflow. The downstream functional component has a reference relationship with the upstream functional component. That is, the input parameter of the downstream functional component is selected from the output parameter of the upstream functional component.

[0066] In some optional embodiments, the user can remove the reference relationship between functional components by deleting the workflow connection. For example, when the user deletes the workflow connection between the upstream functional component A and the downstream functional component B, the reference relationship of the downstream functional component B to the upstream functional component A will be automatically removed, and the reference of the downstream functional component B to the output parameter of the upstream functional component A will be automatically deleted. For another example, when the user adjusts the workflow connection between the functional component A and the functional component B so that the functional component A is connected to the functional component C, the reference relationship of the downstream functional component B to the upstream functional component A will be automatically removed, and the reference of the downstream functional component B to the output parameter of the upstream functional component A will be automatically deleted. At the same time, the client will automatically establish a reference relationship between the downstream functional component C and the upstream functional component A.

[0067] After obtaining the application workflow, the user can configure the function components corresponding to each workflow node in the application workflow displayed on the application editing interface 204, and trigger the code generation system to automatically generate the program code of the application corresponding to the application workflow.

[0068] Step 104, in response to a configuration operation performed on the corresponding function component within the component configuration window, obtain the configuration information of the function component.

[0069] In some optional embodiments, the obtaining the configuration information of the function component in response to a configuration operation performed on the corresponding function component within the component configuration window includes: in response to a component parameter configuration operation performed on the corresponding function component within the component configuration window, obtaining the configuration information of the function component, where the configuration information includes one or more of the following: input parameters, output parameters, and function descriptions.

[0070] Optionally, the input parameters include, but are not limited to, one or more of the following: parameter name, parameter description, data type, assignment, and reference relationship, etc.

[0071] In some optional embodiments, the code generation system pre-sets default configuration information for components of each component type, and when initializing the component configuration window of this type of component, displays the default configuration information. Among them, the parameter name and parameter type can adopt the parameter names pre-set by the system; the function description is used to describe the function of the function component in natural language text, and the function description is input by the user. In the embodiments of the present application, no restrictions are imposed on the specific values of configuration information such as parameter names, parameter descriptions, and data types.

[0072] For example, when creating an application workflow for removing filler words in audio content, in response to the application workflow orchestration operation, the component configuration windows of the function components corresponding to the start node, the function components corresponding to the audio content processing node, and the function components corresponding to the end node that are connected in sequence are displayed on the application editing interface. Among them, the function component corresponding to the audio content processing node is an intelligent code component built into the code generation system, and the intelligent code component can automatically generate program code based on the configuration information.

[0073] In some optional embodiments, the function component corresponding to the start node of the application workflow can adopt the default configuration information of the system. The function components corresponding to other workflow nodes need to be manually configured according to the functions that each function component needs to implement.

[0074] For example, the user can perform component parameter configuration operations on the functional components corresponding to the audio content processing nodes (i.e., intelligent code components) through the component configuration window of the functional components corresponding to the audio content processing nodes. Still taking Figure 2 the application editing interface 204 shown in

[0075] as an example, the user can configure the input parameters of the functional components corresponding to the audio content processing nodes through the application editing interface 204. The configuration information input by the user may include, for example: the parameter name of the input parameter (such as "answer"), the parameter description of the input parameter (such as "the text for real-time conversion in the meeting"), the data type of the input parameter (such as "string"), the parameter name of the output parameter (such as "result"), the parameter description of the output parameter (such as "the result obtained by filtering out Chinese modal particles from the input of the text for real-time conversion in the meeting"), the data type of the output parameter (such as "string"), and the functional description of the functional component (such as "filter out Chinese modal particles from the input of the text for real-time conversion in the meeting to improve the reading fluency of the text").

[0076] Optionally, after the user inputs the above configuration information through the component configuration window, the client obtains the configuration information input by the user in each input box within the component configuration window through the component configuration window.

[0077] Step 106, in response to a code generation operation triggered for the functional component, generate program code corresponding to the functional component based on the configuration information.

[0078] Among them, the program code corresponding to the functional component includes, but is not limited to: the executable program code of the component, the test case code of the component.

[0079] In some alternative embodiments, the step of generating program code corresponding to the functional component based on the configuration information in response to a code generation operation triggered for the functional component includes: in response to a code generation operation triggered for the functional component, generating a code generation request based on the configuration information; sending the code generation request to the server, so that the server performs the following code generation operation: iteratively call a preset large language model based on the configuration information to generate program code corresponding to the functional component.

[0080] After completing the configuration of the functional component, the user can click the buttons set in the component configuration window respectively to trigger the code generation system to automatically generate the program code of the functional component corresponding to the component configuration window. For example, the user clicks the button for triggering code generation set in the component configuration window of the functional component corresponding to the audio content processing node (i.e., the intelligent code component), triggering the client to execute the code generation operation.

[0081] After the client detects the code generation operation triggered by the user, it obtains the configuration information of the functional component corresponding to the current component configuration window, and generates a code generation request based on this configuration information. Optionally, one or more of the following information is carried in the code generation request: client information, the component identifier of the functional component corresponding to the current component configuration window, and the component type. Then, the client sends the code generation request to the server of the code generation system, and the server generates the program code and test cases of the corresponding functional component according to the configuration information and request parameters carried in the code generation request.

[0082] In some alternative embodiments, the generating the program code corresponding to the functional component by iteratively invoking a preset large language model based on the configuration information includes: obtaining an initial input for performing the code generation operation based on the configuration information; generating a program code to be tested and test cases by iteratively invoking a preset large language model based on the initial input; testing the program code to be tested by executing the test cases to obtain test results; and obtaining the program code of the functional component based on the test results and the program code to be tested.

[0083] For example, the input parameter names, data types, output parameter names, data types, and the functional description of the intelligent code component configured by the user can be used as the initial input. Then, based on the initial input, the method of iteratively invoking a preset large language model in multiple rounds is adopted to generate the program code to be tested and test cases.

[0084] In some alternative embodiments, the generating the program code to be tested and test cases by iteratively invoking a preset large language model based on the initial input includes: invoking a preset large language model based on the initial input to generate the program code to be tested; in the case where the program code to be tested is successfully generated, invoking a preset large language model based on the program code to be tested to generate the test cases of the program code to be tested; in the case where the program code to be tested fails to be generated, or the test cases fail to be generated, upgrading the preset large language model and / or updating the initial input based on the output of the preset large language model, and then jumping to execute the step of invoking a preset large language model based on the initial input to generate the program code to be tested.

[0085] As Figure 3 shown, based on the initial input, by iteratively calling a preset large language model, test program code and test cases to be generated may include: steps 301 to 306.

[0086] Step 301, based on the initial input, call a preset large language model to generate test program code.

[0087] Optionally, the preset large language model may be an existing large language model in the prior art. In the embodiments of the present application, multiple large language models with different numbers of parameters are pre-integrated in the code generation system. Among them, the large language model with fewer parameters occupies less system resources and has a faster running speed, while the large language model with more parameters occupies more system resources but has a stronger code generation ability. In the process of calling a preset large language model based on the initial input to generate test program code, the large language model with fewer parameters is preferentially selected. In the case where the program code generated by the large language model with fewer parameters cannot meet the requirements, it is gradually upgraded to call the large language model with more parameters, so as to effectively balance the system resource occupation and the code generation ability of the program code.

[0088] In some alternative embodiments, a prompt for prompting the large language model to generate program code may be generated according to a preset prompt template based on the configuration information as the initial input. In the prompt template, input parameters and function descriptions are used as dynamic input data.

[0089] For the specific implementation of generating a prompt based on the configuration information, reference may be made to the prior art, and it will not be elaborated in the embodiments of the present application.

[0090] Then, according to the preset model call order, based on the generated prompt, call the preset large language model and obtain the program code generated by the large language model as the test program code to be tested.

[0091] Step 302, determine whether the test program code to be tested is successfully generated. If so, execute step 303; otherwise, jump to execute step 304.

[0092] Step 303, based on the test program code to be tested, call a preset large language model to generate test cases for the test program code to be tested.

[0093] In the case where the test program code to be tested is successfully generated, based on the test program code to be tested, call a preset large language model to generate test cases for the test program code to be tested.

[0094] In some alternative embodiments, calling a preset large language model based on the program code to be tested to generate test cases for the program code to be tested includes: generating updated inputs based on the program code to be tested; and calling the preset large language model based on the updated inputs to generate test cases for the program code to be tested.

[0095] For example, the server generates a prompt based on the program code to be tested and uses the generated prompt as the input for calling the large language model, triggering the large language model to generate test cases for the program code to be tested.

[0096] Optionally, the large language models called when generating the program code to be tested and the test cases can be the same or different.

[0097] For another example, the server can generate a prompt based on the program code to be tested and the initial inputs, and use the generated prompt as the input for calling the large language model, triggering the large language model to generate test cases for the program code to be tested according to configuration parameters such as input parameters and output parameters of functional components in the initial inputs.

[0098] Next, step 305 is executed.

[0099] Step 304: Upgrade the preset large language model and / or update the initial inputs based on the output of the preset large language model, and then jump to step 301.

[0100] In the case where the generation of the program code to be tested fails, the preset large language model will output the reason for the failure of the generation of the code to be tested. Next, the preset large language model can regenerate the updated initial inputs using the reason for the failure of the generation of the code to be tested and the initial inputs. At the same time, the preset large language model is upgraded. After that, jump to step 301, and based on the updated initial inputs and the upgraded preset large language model, re-execute the step of calling the preset large language model based on the initial inputs to generate the program code to be tested. Or, next, only the preset large language model can be upgraded, and based on the upgraded preset large language model, re-execute the step of calling the preset large language model based on the initial inputs to generate the program code to be tested.

[0101] Among them, the model parameters of the upgraded preset large language model are more than those of the preset large language model before the upgrade.

[0102] Step 305: Determine whether the test cases are successfully generated. If so, end the current round of code generation operation; otherwise, jump to execute step 306.

[0103] Step 306: Upgrade the preset large language model and jump to step 301.

[0104] In the case where the test case generation is successful, return the program code to be tested and the test case generated in the current round of iteration, and end the code generation operation in the current round. In the case where the test case generation fails, the preset large language model will output the reason for the failure of the test case generation. Next, the preset large language model can output the reason for the failure of the test case generation and the initial input to regenerate the updated initial input. At the same time, upgrade the preset large language model. After that, jump to step 301, and based on the updated initial input and the upgraded preset large language model, re-execute the step of calling the preset large language model based on the initial input to generate the program code to be tested. Alternatively, next, only upgrade the preset large language model, and based on the upgraded preset large language model, re-execute the step of calling the preset large language model based on the initial input to generate the program code to be tested.

[0105] Next, execute the test case generated in the current round to test the program code to be tested generated in the current round, and obtain the test result.

[0106] In some alternative embodiments, when the program code to be tested and the test case are successfully generated, the test case can be used to test the program code to obtain the test result; when the program code to be tested or the test case cannot be successfully generated after a specified number of iterations, the user can be prompted to reconfigure the functional components.

[0107] Optionally, a test case generation status monitoring task can be set on the server side. After the task detects that the test case generation is successful, the built-in test task of the code generation system can be called to execute the test case and call the program code to be tested based on the test case, so as to obtain the test result. Among them, the test result includes: a test result indicating that the program code execution is successful, an error code indicating that the program code execution fails, and / or a failure reason.

[0108] For the specific implementation of executing the test case generated in the current round to test the program code to be tested generated in the current round and obtaining the test result, refer to the prior art and will not be elaborated in the embodiments of the present application.

[0109] Then, based on the test result and the program code to be tested, obtain the program code of the functional component.

[0110] In some alternative embodiments, obtaining the program code of the functional component based on the test result and the program code to be tested includes: when the test result indicates that the test case is executed successfully, using the program code to be tested as the program code of the functional component; when the test result indicates that the test case is executed failed, upgrading the preset large language model, updating the initial input according to the configuration information and / or the test result, and jumping to execute the step of generating the program code to be tested and the test case based on the initial input by iteratively calling the preset large language model.

[0111] If the test case generated in the current round is executed successfully, use the program code to be tested generated in the current round as the program code of the functional component. If the test case generated in the current round is executed failed, the test result includes, for example, program code execution error codes, failure reasons, etc. Further, the server generates the initial input for the next round of code generation operations based on the configuration information input by the user and information such as error codes, and uses a large language model with more model parameters to repeatedly execute the foregoing steps of generating the program code to be tested and the test case of the functional component to improve the quality of the generated program code until the test is successful or the number of repeated rounds reaches the preset number.

[0112] In some alternative embodiments, after sending the code generation request to the server, the method further includes: displaying an execution status card for instructing the server to perform the code intelligent generation operation. After the server finishes performing the code intelligent generation operation, the client switches to display a completion status card for instructing the server to perform the code intelligent generation operation, informing the user that the workflow node corresponding to the functional component has been constructed and can directly orchestrate downstream functional components in the workflow.

[0113] In some alternative embodiments, after generating the program code corresponding to the functional component based on the configuration information in response to the code generation operation triggered for the functional component, as Figure 4 shown, the method further includes: steps 108 to 112.

[0114] Step 108, in response to a code query operation for the functional component, send a code query request to the server, and the component identifier of the functional component is carried in the code query request.

[0115] Step 110, obtain the program code corresponding to the component identifier feedback by the server.

[0116] Step 112, create a code display window, and display the obtained program code in the code display window.

[0117] For example, the client can set a button in the component configuration window for triggering the program code of the query function component. After the user triggers this button, the client generates a code query request according to the component identifier of the function component. Then, the client sends the code query request to the server of the code generation system. After receiving the code query request sent by the client, the server obtains the component identifier in the code query request and obtains the pre-generated program code of the corresponding function component according to the component identifier. Then, the obtained program code is returned to the client.

[0118] After the client obtains the program code returned by the server, it creates a code display window in the application editing interface 204 and displays the obtained program code in the code display window for the user to query.

[0119] In some alternative embodiments, after generating the program code corresponding to the function component based on the configuration information in response to the code generation operation triggered for the function component, as Figure 4 shown, the method further includes: steps 108 to 112.

[0120] In some alternative embodiments, as Figure 5 shown, after generating the program code corresponding to the function component based on the configuration information in response to the code generation operation triggered for the function component, the method further includes: steps 114 to 120.

[0121] Step 114, in response to the test operation on the program code of the function component, display an execution parameter configuration window.

[0122] Step 116, obtain the input parameter value of the function component input by the user in the execution parameter configuration window.

[0123] Step 118, in response to the program execution operation triggered by the user in the execution parameter configuration window, execute the program code of the function component based on the input parameter value and obtain a test result.

[0124] Step 120, display a test result prompt message.

[0125] In some alternative embodiments, a button for triggering the test function component is set in the component configuration window. By clicking this button, the user can trigger the test operation on the function component corresponding to the component configuration window. After the client detects the click operation of this button through the component configuration window, it obtains the configurable input parameters and component identifier of the function component corresponding to this component configuration window. Then, the client displays an execution parameter configuration window in the application editing interface. The user can input the value of the input parameter of the function component, that is, the input parameter value, through the execution parameter configuration window.

[0126] In some alternative embodiments, an execution button is provided in the execution parameter configuration window. By clicking the execution button, the user triggers the execution of the program code of the functional component.

[0127] Optionally, in response to the user triggering a program execution operation in the execution parameter configuration window, the program code of the functional component is executed based on the input parameter value, and a test result is obtained, including: generating a code execution request based on the input parameter value and the component identifier of the functional component; sending the code execution request to the server, so that the server obtains the program code of the functional component that matches the component identifier based on the code execution request, and executes the program code based on the input parameter value to obtain a test result.

[0128] For example, after the client detects a click operation of the execution button through the execution parameter configuration window, a code execution request is generated with the component identifier of the functional component and the input parameter value configured by the user through the execution parameter configuration window as request parameters. Then, the code execution request is sent to the server of the code generation system. After receiving the code execution request, the server obtains the component identifier and input parameter value of the functional component to be executed by parsing the request parameters. Then, the server searches for the pre-generated functional component based on the component identifier and obtains the program code of the found functional component. Next, the server calls the obtained program code based on the input parameter value to execute the program code of the functional component and obtain a test result.

[0129] In some other alternative embodiments, a program code editing box for the functional component and a button for triggering the test of the functional component are provided in the component configuration window. The user can edit the program code of the functional component in the program code editing box. By clicking the button, the user triggers a test operation on the program code edited in the program code editing box in the component configuration window. After the client detects the click operation of the button through the component configuration window, the currently edited program code of the functional component in the program code editing box in the component configuration window is obtained. Then, the client displays the execution parameter configuration window corresponding to the functional component of the component configuration window in the application editing interface. The user can input the value of the input parameter of the functional component, that is, the input parameter value, through the execution parameter configuration window.

[0130] In some alternative embodiments, an execution button is provided in the execution parameter configuration window. By clicking the execution button, the user triggers the execution of the program code of the functional component.

[0131] Optionally, in response to the user triggering a program execution operation in the execution parameter configuration window, the program code of the functional component is executed based on the input parameter value, and a test result is obtained, including: generating a code execution request based on the input parameter value and the program code of the functional component; sending the code execution request to the server, so that the server executes the program code based on the input parameter value and obtains a test result.

[0132] For example, after the client detects a click operation on the execution button through the execution parameter configuration window, a code execution request is generated with the currently edited program code of the functional component and the input parameter value configured by the user through the execution parameter configuration window as request parameters. Then, the code execution request is sent to the server of the code generation system. After receiving the code execution request, the server obtains the program code of the functional component to be executed and the input parameter value by parsing the request parameters. Next, the server calls the obtained program code based on the input parameter value to execute the currently edited program code of the functional component and obtains a test result.

[0133] Optionally, after starting to execute the program code of the functional component, the execution parameter configuration window can be closed.

[0134] In some other alternative embodiments, other methods may also be used to execute the program code of the functional component based on the input parameter value, which will not be enumerated one by one in the embodiments of the present application.

[0135] After the program code of the functional component is successfully executed, the client can prompt the user that the functional component is successfully executed by way of popping up a prompt window. At the same time, the server associates and stores the test result and the component identifier of the functional component as the test log of the functional component. On the other hand, after the program code of the functional component fails to execute, the client can prompt the user that the functional component fails to execute by way of popping up a prompt window.

[0136] In some alternative embodiments, the server can store the program execution results separately for each program code execution operation for subsequent query.

[0137] The code generation method disclosed in the embodiments of the present application integrates code generation, test case generation, and code testing into one process. After generating the initial code of the functional component, corresponding test cases will be automatically generated and executed, and the program code will be optimized according to the code execution results. Through multiple rounds of iteration, the quality of the program code is continuously improved, and finally the program code that meets the user's requirements is generated.

[0138] In some alternative embodiments, such as Figure 6As shown, after presenting the test result prompt message, the method further includes: step 122.

[0139] Step 122, in response to a query operation on the test result of the functional component, present the execution result of the program code.

[0140] In some alternative embodiments, presenting the execution result of the program code in response to a query operation on the test result of the functional component includes: in response to a query operation on the test result of the functional component, display a code execution result display interface on the application editing interface; present the execution information of the program code of the functional component on the code execution result display interface, where the execution information includes: the output of the functional component after executing the program code based on the input parameter value, and / or, the input parameter value.

[0141] Optionally, the prompt window presenting the test result prompt message popped up by the client can be automatically destroyed after presenting for a specified duration. On the other hand, optionally, the client can be provided with a button for triggering the presentation of the test result in the component configuration window, and the user clicks the button to trigger the client to present the test result of the functional component corresponding to the component configuration window. For example, after the client detects that the button for triggering the presentation of the test result is clicked through the component configuration window, obtain the component identifier of the functional component corresponding to the component configuration window. Then, the client generates a test result acquisition request based on the component identifier and displays an execution parameter configuration window on the application editing interface. The user can input the value of the input parameter of the functional component, that is, the input parameter value, through the execution parameter configuration window.

[0142] In some alternative embodiments, an execution button is provided in the execution parameter configuration window, and the user clicks the execution button to trigger the execution of the program code of the functional component. After the client detects the click operation of the execution button through the execution parameter configuration window, assign the input parameter value to the input parameter of the functional component, and then execute the program code of the functional component. At the same time, the client closes the execution parameter configuration window.

[0143] In some alternative embodiments, as Figure 7 shown, after generating the program code corresponding to the functional component based on the configuration information in response to the code generation operation triggered for the functional component, the method further includes: steps 124 to 128.

[0144] Step 124, in response to a test case generation operation for the target program code, generate a test case generation request based on the program code, where the target program code includes: the program code, or, an adapted code of the program code.

[0145] Step 126: Send the test case generation request to the server, so that the server generates test cases based on the program code.

[0146] Step 128: Obtain the test cases generated by the server.

[0147] Optionally, the client is provided with a program code editing window, and the user can edit the program code of the functional component in the program code editing window. For example, after generating the program code of a certain functional component, the user triggers a key set on the client for starting the program code editing process, triggering the client to display the program code editing window, and displaying the program code of the functional component in the program code editing window. Then, the client updates the program code displayed in the program code editing window in real time in response to the user's editing operation on the displayed program code in the program code editing window to implement the program code editing function.

[0148] On the other hand, a key for triggering the generation of test cases is also set in the program code editing window. After the client detects that the key is triggered, it obtains the latest program code in the program code editing window, and uses the obtained program code as a request parameter to generate a test case generation request. Then, the client sends the test case generation request to the server of the code generation system (i.e., the server). After receiving the test case generation request sent by the client, the server parses the test case generation request to obtain the program code, and then the server generates test cases based on the program code.

[0149] In some alternative embodiments, the server generates test cases based on the program code, including: the server invokes a preset large language model based on the program code to generate test cases for the program code.

[0150] For the specific implementation of the server invoking a preset large language model based on the program code to generate test cases for the program code, refer to the specific implementation of the server invoking a preset large language model based on the program code to be tested to generate test cases for the program code to be tested in the foregoing embodiments, which will not be elaborated here.

[0151] After the server successfully generates test cases, it feeds back the generated test cases to the client, and the client displays them to the user for the user to select and use.

[0152] In summary, in the code generation method disclosed in the embodiments of the present application, by providing a simplified and structured intelligent code generation interaction interface on the client side, the client responds to the application workflow orchestration operation, and displays the application workflow through a component configuration window connected in sequence in the application editing interface, where the component configuration window is used to configure the functional components corresponding to the corresponding code nodes in the application workflow; in response to the configuration operation performed on the corresponding functional component in the component configuration window, obtain the configuration information of the functional component; in response to the code generation operation triggered for the functional component, generate the program code corresponding to the functional component based on the configuration information, realizing that the user only needs to fill in the input parameters, output results, and function descriptions, and the code generation system can automatically generate the corresponding executable code according to the user's needs, enabling users without the ability to develop program code to easily create application workflows, effectively reducing the requirements for the code development ability of application development objects, expanding the scope of applicable objects for application development, and greatly simplifying the user operation and improving the user convenience of the code generation system.

[0153] Taking the creation of an application workflow including workflow nodes corresponding to two functional modules through a code generation system as an example, in the prior art, program code needs to be manually written to convert parameters between the workflow node corresponding to the first functional module and the workflow node corresponding to the second functional module that are executed successively. However, by using the code generation method disclosed in the embodiments of the present application, only a workflow node corresponding to an intelligent code module needs to be inserted between the workflow nodes corresponding to the first functional module and the second functional module of the application workflow, and by configuring the input parameters and output parameters of the intelligent code module and the function description for parameter conversion, the program code of the intelligent code module can be automatically generated, so that the generated program code automatically converts the parameters output by the first functional module into input parameters adapted to the second functional module.

[0154] On the other hand, in the code generation method disclosed in the embodiments of the present application, by providing an online code debugging and editing function, the user does not need to install a development environment locally, directly writes and executes code in the workflow node of the code generation system, and views the code execution result in real time, enabling non-technical personnel to easily orchestrate the application process and greatly reducing the threshold for application development.

[0155] Correspondingly, as Figure 8 shown, the embodiments of the present application also disclose a code generation method, which is applied to a server, and the method includes: step 802 and step 804.

[0156] Step 802, in response to receiving a code generation request sent by the client, obtain the configuration information carried in the code generation request.

[0157] Step 804: Iteratively call a preset large language model based on the configuration information to generate the program code corresponding to the functional component.

[0158] Optionally, the configuration information includes one or more of the following information of the functional component: input parameters, output parameters, and functional description.

[0159] Among them, the code generation request is generated by the following method: The client responds to the application workflow orchestration operation and displays the application workflow in the application editing interface through a component configuration window connected in sequence. The component configuration window is used to configure the functional component corresponding to the corresponding code node in the application workflow; in response to the configuration operation performed on the corresponding functional component in the component configuration window, obtain the configuration information of the functional component; in response to the code generation operation triggered for the functional component, generate a code generation request based on the configuration information.

[0160] Optionally, the iteratively calling a preset large language model based on the configuration information to generate the program code corresponding to the functional component includes: based on the configuration information, obtain the initial input for performing the code generation operation; based on the initial input, iteratively call a preset large language model to generate the program code to be tested and test cases; test the program code to be tested by executing the test cases to obtain the test results; based on the test results and the program code to be tested, obtain the program code of the functional component.

[0161] For the specific implementation of the server iteratively calling a preset large language model based on the configuration information to generate the program code corresponding to the functional component, refer to the relevant descriptions in the previous embodiments, which will not be elaborated here.

[0162] In summary, for the code generation method disclosed in the embodiments of the present application, the client responds to the application workflow orchestration operation and displays the application workflow in the application editing interface through a component configuration window connected in sequence. Among them, the component configuration window is used to configure the functional components corresponding to the corresponding code nodes in the application workflow; in response to the configuration operation performed on the corresponding functional component in the component configuration window, obtain the configuration information of the functional component; in response to the code generation operation triggered for the functional component, generate a code generation request based on the configuration information, and send the code generation request to the server; afterwards, the server responds to receiving the code generation request sent by the client, obtains the configuration information carried in the code generation request, and iteratively invokes a preset large language model based on the configuration information to generate the program code corresponding to the functional component. This method provides a simplified and structured intelligent code generation interaction interface on the client side. Users only need to fill in input parameters, output results, and functional descriptions, and the code generation system can automatically generate corresponding executable code according to the user's needs, enabling users without the ability to develop program code to easily create application workflows, effectively reducing the code development ability requirements for application development objects, expanding the scope of applicable objects for application development, and greatly simplifying user operations, improving the user convenience of the code generation system.

[0163] To implement the above embodiments, the embodiments of the present application also disclose a code generation system, as Figure 9 shown, the code generation system includes: a client 902 and a server 904. The implementation manner of the code generation system will be described below in combination with Figure 9 this.

[0164] The client 902 is configured to respond to the application workflow orchestration operation and display the application workflow in the application editing interface through a component configuration window connected in sequence. Among them, the component configuration window is used to configure the functional components corresponding to the corresponding code nodes in the application workflow;

[0165] The client 902 is further configured to, in response to the configuration operation performed on the corresponding functional component in the component configuration window, obtain the configuration information of the functional component;

[0166] The client 902 is further configured to, in response to the code generation operation triggered for the functional component, generate a code generation request based on the configuration information, and send the code generation request to the server 904;

[0167] The server 904 is configured to, in response to receiving the code generation request sent by the client 902, obtain the configuration information carried in the code generation request;

[0168] The server 904 is further configured to iteratively call a preset large language model based on the configuration information to generate program code corresponding to the functional component.

[0169] Optionally, the server 904 is further configured to feedback the program code generation result to the client 902.

[0170] The client 902 is further configured to display a program code generation result prompt message.

[0171] Optionally, the client 902 is further configured to, in response to a code query operation for the functional component, send a code query request to the server 904, where the component identifier of the functional component is carried in the code query request; then, obtain the program code corresponding to the component identifier feedback by the server 904; and create a code display window and display the obtained program code in the code display window.

[0172] Optionally, the client 902 is further configured to, in response to a test operation on the program code of the functional component, display an execution parameter configuration window; and obtain the input parameter value of the functional component input by the user in the execution parameter configuration window; and,

[0173] In response to the user triggering a program execution operation in the execution parameter configuration window, execute the program code of the functional component based on the input parameter value, obtain a test result, and display a test result prompt message.

[0174] Optionally, the client 902 is further configured to, in response to a query operation on the test result of the functional component, display the execution result of the program code.

[0175] Optionally, the client 902 is further configured to, in response to a test case generation operation for the target program code, generate a test case generation request based on the program code, where the target program code includes: the program code, or an adapted code of the program code, and send the test case generation request to the server 904, so that the server 904 generates test cases based on the program code, and obtain the test cases generated by the server 904.

[0176] For the specific implementation manners of the above steps executed by the client 902 and the server 904, refer to the relevant descriptions in the foregoing embodiments, and details are not described herein again.

[0177] In summary, the code generation system disclosed in the embodiments of the present application provides a simplified and structured intelligent code generation interaction interface on the client side. Users only need to fill in input parameters, output results, and function descriptions, and the code generation system can automatically generate corresponding executable code according to the user's needs. This enables users without programming code development capabilities to easily create application workflows, effectively reducing the requirements for the code development capabilities of application development objects, expanding the scope of applicable objects for application development, and greatly simplifying user operations, thereby enhancing the user convenience of the code generation system.

[0178] It should be noted that for method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the embodiments of the present application are not limited by the described action sequences, because according to the embodiments of the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present application.

[0179] Based on the above embodiments, this embodiment further provides a code generation device, which is applied to the client side. The device includes:

[0180] A workflow display module, configured to respond to an application workflow orchestration operation and display the application workflow in an application editing interface through component configuration windows connected in sequence, where the component configuration windows are used to configure function components corresponding to corresponding code nodes in the application workflow;

[0181] A function component configuration information acquisition module, configured to respond to a configuration operation performed on the corresponding function component in the component configuration window and acquire the configuration information of the function component;

[0182] A program code generation module, configured to respond to a code generation operation triggered for the function component and generate program code corresponding to the function component based on the configuration information.

[0183] Optionally, the function component configuration information acquisition module is further configured to:

[0184] Respond to a component parameter configuration operation performed on the corresponding function component in the component configuration window and acquire the configuration information of the function component, where the configuration information includes one or more of the following: input parameters, output parameters, and function descriptions.

[0185] Optionally, the program code generation module is further configured to:

[0186] Respond to a code generation operation triggered for the function component and generate a code generation request based on the configuration information;

[0187] Send the code generation request to the server, so that the server performs the following code generation operations: iteratively call a preset large language model based on the configuration information to generate the program code corresponding to the functional component.

[0188] Optionally, the iteratively calling a preset large language model based on the configuration information to generate the program code corresponding to the functional component includes:

[0189] Based on the configuration information, obtain the initial input for performing the code generation operation;

[0190] Based on the initial input, generate the program code to be tested and test cases by iteratively calling a preset large language model;

[0191] Test the program code to be tested by executing the test cases to obtain the test results;

[0192] Based on the test results and the program code to be tested, obtain the program code of the functional component.

[0193] Optionally, the generating the program code to be tested and test cases by iteratively calling a preset large language model based on the initial input includes:

[0194] Call a preset large language model based on the initial input to generate the program code to be tested;

[0195] When the generation of the program code to be tested is successful, based on the program code to be tested, call a preset large language model to generate the test cases for the program code to be tested;

[0196] When the generation of the program code to be tested fails, or the generation of the test cases fails, upgrade the preset large language model and / or update the initial input based on the output of the preset large language model, and then jump to execute the step of calling a preset large language model based on the initial input to generate the program code to be tested.

[0197] Optionally, the generating the test cases for the program code to be tested by calling a preset large language model based on the program code to be tested includes:

[0198] Based on the program code to be tested, generate an updated input;

[0199] Call a preset large language model based on the updated input to generate the test cases for the program code to be tested.

[0200] Optionally, the obtaining the program code of the functional component based on the test results and the program code to be tested includes:

[0201] When the test result indicates that the test case is executed successfully, use the program code to be tested as the program code of the functional component;

[0202] When the test result indicates that the test case execution fails, upgrade the preset large language model, update the initial input according to the configuration information and / or the test result, and jump to execute the step of generating the program code to be tested and the test case by iteratively calling the preset large language model based on the initial input.

[0203] Optionally, the device further includes: a code query module;

[0204] The code query module is configured to, in response to a code query operation for the functional component, send a code query request to the server, where the component identifier of the functional component is carried in the code query request; and obtain the program code corresponding to the component identifier fed back by the server;

[0205] The code query module is further configured to create a code display window and display the obtained program code in the code display window.

[0206] Optionally, the device further includes: a code test module;

[0207] The code test module is configured to, in response to a test operation on the program code of the functional component, display an execution parameter configuration window; and obtain the input parameter value of the functional component input by the user in the execution parameter configuration window;

[0208] The code test module is further configured to, in response to a program execution operation triggered by the user in the execution parameter configuration window, execute the program code of the functional component based on the input parameter value, obtain a test result; and display a test result prompt message.

[0209] Optionally, after displaying the test result prompt message, the device further includes:

[0210] An execution result display module, configured to, in response to a query operation on the test result of the functional component, display the execution result of the program code.

[0211] Optionally, the device further includes: a test case generation module;

[0212] The test case generation module is used to respond to a test case generation operation for target program code, generate a test case generation request based on the program code, where the target program code includes: the program code, or an adapted code of the program code; and send the test case generation request to the server, so that the server generates test cases based on the program code;

[0213] The test case generation module is further used to obtain the test cases generated by the server.

[0214] Optionally, the application workflow orchestration operation includes: a workflow node creation operation. Responding to the application workflow orchestration operation, the application workflow is displayed in the application editing interface through sequentially connected component configuration windows, including:

[0215] Responding to the workflow node creation operation, a component configuration window corresponding to the functional component of the currently orchestrated application workflow is displayed in the application editing interface, where the workflow node creation operation includes: an operation of dragging the component icon displayed in the functional component list to the application editing interface, or a click operation on the component icon displayed in the functional component list.

[0216] Optionally, the application workflow orchestration operation further includes: a workflow node connection operation. Responding to the application workflow orchestration operation, the application workflow is displayed in the application editing interface through sequentially connected component configuration windows, including:

[0217] Responding to the workflow node connection operation, obtain the reference relationship of the functional components corresponding to the component configuration windows connected by the workflow node connection operation;

[0218] Display the workflow line connecting the corresponding component configuration windows, and update the configuration information of the downstream functional components according to the reference relationship.

[0219] Based on the above embodiments, this embodiment further provides a code generation device, which is applied to the server. The device includes:

[0220] The configuration information acquisition module is used to respond to receiving a code generation request sent by the client and obtain the configuration information carried in the code generation request;

[0221] The program code generation module is used to iteratively call a preset large language model based on the configuration information to generate the program code corresponding to the functional components.

[0222] The code generation device disclosed in the embodiments of the present application is used to implement the above code generation method. For the specific implementation manners of the modules of the device, refer to the specific implementation manners of the corresponding steps in the foregoing method embodiments, which will not be elaborated here.

[0223] In summary, for the code generation device disclosed in the embodiments of the present application, in response to an application workflow orchestration operation by the client, the application workflow is displayed in the application editing interface through a component configuration window connected in sequence. Among them, the component configuration window is used to configure the functional components corresponding to the corresponding code nodes in the application workflow; in response to a configuration operation performed on the corresponding functional component within the component configuration window, the configuration information of the functional component is obtained; in response to a code generation operation triggered for the functional component, a code generation request is generated based on the configuration information, and the code generation request is sent to the server; subsequently, in response to receiving the code generation request sent by the client, the server obtains the configuration information carried by the code generation request, and iteratively invokes a preset large language model based on the configuration information to generate the program code corresponding to the functional component. This device only provides a simplified and structured intelligent code generation interaction interface on the client side. Users only need to fill in input parameters, output results, and functional descriptions, and the code generation system can automatically generate corresponding executable code according to the user's needs, enabling users without program code development capabilities to easily create application workflows, effectively reducing the code development capabilities required for application development objects, expanding the scope of applicable objects for application development, and greatly simplifying user operations, thereby enhancing the user convenience of the code generation system.

[0224] The embodiments of the present application also provide a non-volatile readable storage medium, in which one or more modules (programs) are stored. When the one or more modules are applied to a device, the device can be caused to execute instructions (instructions) for each method step in the embodiments of the present application.

[0225] The embodiments of the present application also provide a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method as described in the embodiments of the present application.

[0226] The embodiments of the present application also provide an electronic device, including: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method as described in the embodiments of the present application. In the embodiments of the present application, the electronic device includes devices such as servers and terminal devices.

[0227] The embodiments of the present application also disclose a computer program product, including a computer program / computer-executable instructions, characterized in that when the computer program / computer-executable instructions are executed by a processor in an electronic device, they implement the method as described in the embodiments of the present application.

[0228] Embodiments of the present disclosure can be implemented as a device configured as desired using any suitable hardware, firmware, software, or any combination thereof. The device may include electronic devices such as servers (clusters), terminals, etc. Figure 10 Exemplary device 1000 that can be used to implement the various embodiments described in the present application is schematically shown.

[0229] For one embodiment, Figure 10 Exemplary device 1000 is shown, which has one or more processors 1002, a control module (chipset) 1004 coupled to at least one of the (one or more) processors 1002, a memory 1006 coupled to the control module 1004, a non-volatile memory (NVM) / storage device 1008 coupled to the control module 1004, one or more input / output devices 1010 coupled to the control module 1004, and a network interface 1012 coupled to the control module 1004.

[0230] Processor 1002 may include one or more single-core or multi-core processors, and processor 1002 may include any combination of general-purpose processors or dedicated processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, device 1000 is capable of acting as devices such as the server, terminal, etc. described in the embodiments of the present application.

[0231] In some embodiments, device 1000 may include one or more computer-readable media (such as memory 1006 or NVM / storage device 1008) having instructions 1014 and one or more processors 1002 combined with the one or more computer-readable media and configured to execute the instructions 1014 to implement modules to perform the actions described in the present disclosure.

[0232] For one embodiment, control module 1004 may include any suitable interface controller to provide any suitable interface to at least one of the (one or more) processors 1002 and / or any suitable device or component communicating with control module 1004.

[0233] Control module 1004 may include a memory controller module to provide an interface to memory 1006. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0234] Memory 1006 can be used to, for example, load and store data and / or instructions 1014 for device 1000. For one embodiment, memory 1006 may include any suitable volatile memory, such as appropriate DRAM. In some embodiments, memory 1006 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0235] For one embodiment, the control module 1004 may include one or more input / output controllers to provide an interface to the NVM / storage device 1008 and the input / output device(s) 1010.

[0236] For example, the NVM / storage device 1008 may be used to store data and / or instructions 1014. The NVM / storage device 1008 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact discs (CDs) drives, and / or one or more digital versatile discs (DVDs) drives).

[0237] The NVM / storage device 1008 may include storage resources that are part of a device installed on the apparatus 1000, or it may be accessible by the apparatus without being part of the apparatus. For example, the NVM / storage device 1008 may be accessed via the input / output device(s) 1010 over a network.

[0238] The input / output device(s) 1010 may provide an interface for the apparatus 1000 to communicate with any other suitable device, and the input / output device 1010 may include a communication component, an audio component, a sensor component, etc. The network interface 1012 may provide an interface for the apparatus 1000 to communicate over one or more networks, and the apparatus 1000 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, such as accessing a wireless network based on a communication standard, such as Bluetooth, WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.

[0239] For one embodiment, at least one of the processor(s) 1002 may be logically encapsulated with one or more controllers (e.g., a memory controller module) of the control module 1004. For one embodiment, at least one of the processor(s) 1002 may be logically encapsulated with one or more controllers of the control module 1004 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 1002 may be logically integrated on the same die with one or more controllers of the control module 1004. For one embodiment, at least one of the processor(s) 1002 may be logically integrated on the same die with one or more controllers of the control module 1004 to form a system-on-chip (SoC).

[0240] In various embodiments, the device 1000 can be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 1000 may have more or fewer components and / or a different architecture. For example, in some embodiments, the device 1000 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application specific integrated circuit (ASIC), and a speaker.

[0241] Among them, a main control chip can be used as a processor or a control module in the detection device, sensor data, location information, etc. are stored in a memory or an NVM / storage device, the sensor group can be used as an input / output device, and the communication interface can include a network interface.

[0242] Embodiments of the present application also provide an electronic device, including: a processor; and a memory having executable code stored thereon, which when executed, causes the processor to execute one or more of the methods as in the embodiments of the present application. In the embodiments of the present application, various data can be stored in the memory, such as target files, file and application association data, and other various data, and can also include user behavior data, etc., thereby providing a data basis for various processes.

[0243] Embodiments of the present application also provide one or more machine-readable media having executable code stored thereon, which when executed, causes a processor to execute one or more of the methods as in the embodiments of the present application.

[0244] For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the related parts, refer to the partial description of the method embodiments.

[0245] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, refer to each other.

[0246] Embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate for implementation in the process Figure 1One or more processes and / or blocks Figure 1 Means for the functions specified in one or more blocks.

[0247] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction means that implements the functions in the process Figure 1 One or more processes and / or blocks Figure 1 Specified in one or more blocks.

[0248] These computer program instructions may also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in the process Figure 1 One or more processes and / or blocks Figure 1 Specified in one or more blocks.

[0249] Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0250] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or terminal device including the said element.

[0251] The above has introduced in detail a code generation method, a code generation system, an electronic device, a storage medium, and a computer program product provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation on the present application.

Claims

1. A code generation method, applied to a client, characterized in that: The method comprises: In response to the application workflow orchestration operation, the application workflow is displayed in the application editing interface through component configuration windows connected in sequence, wherein the component configuration window is used to configure the functional components corresponding to the corresponding code nodes in the application workflow; In response to a configuration operation performed on the corresponding functional component in the component configuration window, acquiring configuration information of the functional component; In response to a code generation operation triggered for the functional component, a program code corresponding to the functional component is generated based on the configuration information.

2. The method according to claim 1, characterized in that The acquiring, in response to the configuration operation performed on the corresponding functional component in the component configuration window, the configuration information of the functional component comprises: In response to a component parameter configuration operation performed on the corresponding functional component in the component configuration window, configuration information of the functional component is acquired, wherein the configuration information includes one or more of the following: input parameters, output parameters, and function description.

3. The method according to claim 1, characterized in that The step of generating a program code corresponding to the functional component based on the configuration information in response to the code generation operation triggered for the functional component includes: In response to a code generation operation triggered for the functional component, generating a code generation request based on the configuration information; The code generation request is sent to the server, so that the server performs the following code generation operation: iteratively calling a preset large language model based on the configuration information to generate a program code corresponding to the functional component.

4. The method according to claim 3, characterized in that The iterative calling of the preset large language model based on the configuration information to generate the program code corresponding to the functional component includes: Based on the configuration information, obtaining initial input for performing the code generation operation; Based on the initial input, generating program code and test cases to be tested by iteratively calling a preset large language model; Testing the program code to be tested by executing the test case to obtain a test result; Based on the test result and the program code to be tested, the program code of the functional component is obtained.

5. The method according to claim 4, characterized in that Based on the initial input, the program code to be tested and the test case are generated by iteratively calling the preset large language model, including: Based on the initial input, a preset large language model is called to generate a program code to be tested; In the case where the program code to be tested is generated successfully, based on the program code to be tested, calling a preset large language model to generate a test case for the program code to be tested; In case the generation of the program code to be tested fails, or the generation of the test case fails, the preset large language model is upgraded and / or the initial input is updated based on the output of the preset large language model, and then the process jumps to the step of calling the preset large language model based on the initial input to generate the program code to be tested.

6. The method according to claim 5, characterized in that The method of calling a preset large language model based on the program code to be tested to generate a test case for the program code to be tested includes: Based on the program code to be tested, generating an update input; A preset large language model is called based on the updated input to generate a test case for the program code to be tested.

7. The method according to claim 4, characterized in that The acquiring the program code of the functional component based on the test result and the program code to be tested comprises: When the test result indicates that the test case is successfully executed, using the program code to be tested as the program code of the functional component; When the test result indicates that the test case execution fails, the preset large language model is upgraded, the initial input is updated according to the configuration information and / or the test result, and the process jumps to the step of generating the program code and test case to be tested by iteratively calling the preset large language model based on the initial input.

8. The method according to claim 1, characterized in that After the code generation operation triggered for the functional component is generated based on the configuration information, the method further includes: In response to a code query operation for the functional component, sending a code query request to a server, wherein the code query request carries a component identifier of the functional component; Obtaining the program code corresponding to the component identifier fed back by the server; A new code display window is created, and the obtained program code is displayed in the code display window.

9. The method according to claim 1, characterized in that: After the code generation operation triggered for the functional component is generated based on the configuration information, the method further includes: In response to a test operation on the program code of the functional component, displaying an execution parameter configuration window; Acquire the input parameter value of the functional component input by the user in the execution parameter configuration window; In response to a user triggering a program execution operation in the execution parameter configuration window, executing the program code of the functional component based on the input parameter value to obtain a test result; Displays the test result prompt information.

10. The method according to claim 9, characterized in that After displaying the test result prompt information, the method further includes: In response to a query operation on the test result of the functional component, the execution result of the program code is displayed.

11. The method according to claim 1, characterized in that: After the code generation operation triggered for the functional component is generated based on the configuration information, the method further includes: In response to a test case generation operation for a target program code, a test case generation request is generated based on the program code, wherein the target program code includes: the program code, or an adapted code for the program code; Sending the test case generation request to a server, so that the server generates a test case based on the program code; Obtain the test case generated by the server.

12. The method according to claim 1, characterized in that The application workflow arrangement operation includes: a workflow node creation operation, and in response to the application workflow arrangement operation, the application workflow is displayed in the application editing interface through sequentially connected component configuration windows, including: In response to the workflow node creation operation, a component configuration window corresponding to the functional component of the currently arranged application workflow is displayed on the application editing interface, wherein the workflow node creation operation includes: dragging the component icon displayed in the functional component list to the application editing interface, or clicking the component icon displayed in the functional component list.

13. The method according to claim 1, characterized in that The application workflow arrangement operation further includes: a workflow node connection operation, wherein in response to the application workflow arrangement operation, the application workflow is displayed in the application editing interface through sequentially connected component configuration windows, including: In response to the workflow node connection operation, obtaining a reference relationship of a functional component corresponding to the component configuration window connected by the workflow node connection operation; Display workflow lines connecting corresponding component configuration windows, and update the configuration information of downstream functional components according to the reference relationship.

14. A code generation method, applied to a server, characterized in that: Said include: In response to receiving a code generation request sent by a client, obtaining configuration information carried in the code generation request; The preset large language model is iteratively called based on the configuration information to generate program codes corresponding to the functional components.

15. A code generation system, characterized in that: The system comprises: a client and a server, wherein: The client is used to respond to the application workflow orchestration operation and display the application workflow in the application editing interface through component configuration windows connected in sequence, wherein the component configuration window is used to configure the functional components corresponding to the corresponding code nodes in the application workflow; The client is further configured to obtain configuration information of the functional component in response to a configuration operation performed on the corresponding functional component in the component configuration window; The client is further configured to generate a code generation request based on the configuration information in response to a code generation operation triggered for the functional component, and send the code generation request to the server; The server is configured to, in response to receiving a code generation request sent by the client, obtain configuration information carried in the code generation request; The server is also used to iteratively call a preset large language model based on the configuration information to generate program codes corresponding to the functional components.

16. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 14.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 14 when executed by a processor.

18. A computer program product comprising a computer program / computer executable instructions, characterized in that: When the computer program / computer executable instructions are executed by a processor in an electronic device, the method according to any one of claims 1 to 14 is implemented.