Component generation method and device, equipment, storage medium and program product
By using multi-turn dialogue and automated compilation verification of large language model intelligent agents, the problem of users needing to provide a complete description of requirements at once in low-code platforms is solved, achieving efficient, accurate and stable component generation, reducing interaction costs and improving code quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-10
AI Technical Summary
Low-code platforms require users to provide a complete description of component requirements at once when generating components, which can lead to misunderstandings of complex requirements. Users need to repeatedly adjust their input, increasing interaction costs. Furthermore, the generated code lacks an automatic compilation and error checking mechanism, affecting the usability and stability of the components.
By introducing a large language model intelligent agent, the system enables the decomposition of requirements and contextual understanding in multi-turn dialogues, provides an intelligent guidance mechanism, supports users to gradually optimize component descriptions, and ensures code quality through automated processes for compilation verification and iterative correction of the generated code.
It reduces user interaction costs, improves the accuracy and usability of component generation, ensures high quality and reliability of generated code, and solves the shortcomings of traditional low-code platforms in understanding complex requirements and ensuring code quality.
Smart Images

Figure CN121832899A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular, to a component generation method and device, equipment, storage medium and program product. BACKGROUND
[0002] In related technologies, a low-code platform usually relies on a natural language processing (NLP) model to convert a natural language description input by a user into a structured configuration of a component.
[0003] However, the above scheme has the following limitations: the user needs to provide a complete component requirement description at one time, and the system can only generate a component based on a single input, which leads to a deviation in understanding complex requirements, and the user needs to repeatedly adjust the input to meet the generation conditions, increasing the interaction cost.
[0004] To sum up, how to achieve a deep understanding of user requirements, reduce user interaction cost, and ensure the availability and stability of the component is a technical problem that needs to be solved at present. SUMMARY
[0005] The embodiments of the present application provide a component generation method, device, equipment, storage medium and program product, which can achieve a deep understanding of user requirements, reduce user interaction cost, and ensure the availability and stability of the component.
[0006] In a first aspect, the embodiments of the present application provide a component generation method, comprising:
[0007] receiving requirement description information input by a user, determining a key requirement feature according to the semantics of the requirement description information, the key requirement feature including a target component type;
[0008] obtaining historical dialogue context information, determining the semantic association between the key requirement feature and the historical dialogue context information, and outputting prompt information for guiding the user to update the above requirement description information according to the semantic association;
[0009] disassembling the updated requirement description information, and generating component description information according to the disassembly result;
[0010] generating a component initial code based on the component description information;
[0011] compiling and verifying the component initial code and iteratively correcting it, and generating a component meeting the user's requirements based on the component code after the compiling and verifying and the iterative correction.
[0012] In a possible implementation, the above determining a key requirement feature according to the semantics of the requirement description information comprises:
[0013] According to the requirement description information, a component type keyword is identified and extracted;
[0014] The component type keyword is matched with a pre-established component type list;
[0015] If the component type keyword is successfully matched with the component type list, a target component type meeting the user requirement is determined according to the component type keyword.
[0016] In a possible implementation, the prompt information for guiding the user to update the requirement description information includes:
[0017] It is determined whether the requirement description information has an association relationship with the target component type;
[0018] When the requirement description information does not have the association relationship with the target component type, first prompt information is generated, and the first prompt information is used to prompt the user to re-input the requirement description information.
[0019] In a possible implementation, the prompt information for guiding the user to update the requirement description information includes:
[0020] It is determined whether a component attribute field corresponding to the target component type exists in the requirement description information;
[0021] When the component attribute field corresponding to the target component type does not exist in the requirement description information, second prompt information is generated, and the second prompt information is used to prompt the user to supplement the component attribute field corresponding to the target component type.
[0022] In a possible implementation, the generating of the component initial code based on the component description information includes:
[0023] The component description information is disassembled, and code generation prompt information is generated according to a disassembly result;
[0024] The component initial code is generated according to the code generation prompt information.
[0025] In a possible implementation, the compiling verification and iterative correction of the component initial code include:
[0026] Key error information is extracted by analyzing a compiling error log;
[0027] Correction code is generated according to the key error information;
[0028] The component initial code is corrected based on the correction code.
[0029] In a second aspect, an embodiment of the present application provides a component generation device, including:
[0030] The requirements analysis module is used to receive user input requirements description information and determine key requirements features based on the semantics of the requirements description information. These key requirements features include the target component type.
[0031] The prompt module is used to obtain historical dialogue context information, determine the semantic correlation between key requirement features and historical dialogue context information, and output prompt information to guide users to update requirement description information based on semantic correlation.
[0032] The component analysis module is used to break down the updated requirement description information and generate component description information based on the breakdown results.
[0033] The code generation module is used to generate the initial code for a component based on its description information.
[0034] The component generation module is used to compile, verify, and iteratively correct the initial component code, and generate components that meet user requirements based on the compiled, verified, and iteratively corrected component code.
[0035] In one possible implementation, the above-mentioned requirements analysis module is used for:
[0036] Based on the requirements description, identify and extract component type keywords;
[0037] Match component type keywords with a pre-built list of component types;
[0038] If the component type keyword matches the component type list, the target component type that meets the user's needs is determined based on the component type keyword.
[0039] In one possible implementation, the above-mentioned requirements analysis module is specifically used for:
[0040] Determine whether the requirements description information is related to the target component type;
[0041] When there is no correlation between the requirement description information and the target component type, a first prompt message is generated to prompt the user to re-enter the requirement description information.
[0042] In one possible implementation, the above-mentioned requirements analysis module is specifically used for:
[0043] Determine whether the requirement description information contains a component attribute field corresponding to the target component type;
[0044] If the component attribute field corresponding to the target component type does not exist in the requirement description information, a second prompt message is generated to prompt the user to supplement the component attribute field corresponding to the target component type.
[0045] In one possible implementation, the code generation module described above is specifically used for:
[0046] The component description information is broken down, and code is generated to produce prompts based on the breakdown results;
[0047] Generate the initial code for the component based on the code generation prompts.
[0048] In one possible implementation, the component generation module described above is specifically used for:
[0049] Analyze the compilation error log and extract key error information;
[0050] Generate correction code based on key error information;
[0051] The initial code of the component was corrected based on the corrected code.
[0052] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0053] The memory stores the instructions that the computer executes;
[0054] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0055] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0056] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0057] The component generation method, apparatus, device, storage medium, and program product provided in this application, by introducing the multi-turn dialogue capability of a large language model intelligent agent, realize the dynamic decomposition and contextual understanding of user needs, gradually optimize component descriptions, and solve the problem of requirement ambiguity caused by single-turn dialogue in traditional low-code platforms; by automating the compilation, verification, and iterative correction of the generated code, the code quality and generation reliability can be improved, making up for the lack of code quality assurance in traditional solutions. Attached Figure Description
[0058] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0059] Figure 1 This is a flowchart illustrating a component generation method provided in an embodiment of this application;
[0060] Figure 2 This is a schematic diagram of the architecture of a low-code platform based on a large language model intelligent agent provided in the embodiments of this application;
[0061] Figure 3 This is a schematic diagram of the structure of a component generation device provided in an embodiment of this application;
[0062] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0063] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0064] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0065] The collection, storage, use, processing, transmission, provision, and disclosure of data or user data and other information involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0066] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0067] The technical solutions involved in this application can be applied to scenarios that combine low-code development platforms with large language models (LLMs), and are especially suitable for software development scenarios that require the rapid construction of complex business components.
[0068] For example, in enterprise application development, users may need to quickly generate front-end components (such as forms, data display modules, interactive controls, etc.) through natural language descriptions, or accurately define component requirements through multiple rounds of dialogue during the development process involving users with non-technical backgrounds (such as business analysts and product managers).
[0069] Furthermore, this solution is also suitable for scenarios requiring dynamic adjustment of component logic and support for multi-round interaction optimization, such as the development of backend management systems for e-commerce platforms and customized business process configurations. By introducing a large language model agent, the platform can achieve a deep understanding of user needs and, combined with an automatic compilation error detection mechanism, ensure the high quality and executability of the generated code, thereby significantly reducing the development threshold and improving development efficiency.
[0070] In related technologies, low-code platforms typically rely on NLP models (such as BERT, Transformer, etc.) to convert user-input natural language descriptions into structured configurations of components (such as JSON schema).
[0071] The specific process includes: user input of natural language description, word segmentation and vectorization of the description, encoding and generating semantic representation through a pre-trained model, decoding into component configuration information, and platform rendering to generate the component.
[0072] However, such solutions have the following limitations:
[0073] Single-turn dialogue interaction: Users need to provide a complete description of component requirements at once. The system can only generate components based on a single input and cannot gradually refine the requirements through multiple rounds of dialogue, which leads to misunderstandings of complex requirements.
[0074] Lack of intelligent guidance mechanism: The system cannot proactively prompt users to supplement key information or correct vague descriptions based on the context of the dialogue. Users need to repeatedly adjust their input to meet the generation conditions, which increases the interaction cost.
[0075] Code quality depends on model output: The generated code lacks automatic compilation and error checking, and potential syntax errors or logical defects may be exposed in subsequent development, affecting the usability and stability of the components.
[0076] To address the aforementioned technical problems, this application provides a component generation method that can solve the following technical issues:
[0077] I. How to achieve requirement decomposition and context understanding in multi-turn dialogues
[0078] Existing solutions only support single-turn dialogues, making it difficult to handle complex or ambiguous user needs. This application aims to use a large language model agent to dynamically capture logical relationships in multi-turn dialogues, progressively refine component requirement descriptions, and provide guiding suggestions based on historical dialogues.
[0079] II. How to build an intelligent guidance mechanism to optimize user interaction experience
[0080] Existing solutions lack real-time verification of the legality and completeness of user input, requiring users to correct their input multiple times. This application requires the design of component type determination, legality verification, and prompt message optimization functions to ensure that user input is consistent with the component's generation goals and to proactively prompt users to supplement key information.
[0081] III. How to achieve automatic code compilation, error detection, and quality assurance
[0082] Existing solutions generate code that lacks a verification mechanism, potentially containing syntax errors or runtime exceptions. This application proposes to integrate compilation tools through a plug-in design to automate the compilation, error location, and iterative correction of the generated code, ensuring its executability and stability.
[0083] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0084] Reference Figure 1 , Figure 1 This is a flowchart illustrating a component generation method provided in an embodiment of this application.
[0085] In some embodiments, the above component generation method includes:
[0086] S101. Receive user input of requirement description information, and determine key requirement features based on the semantics of the requirement description information.
[0087] In some implementations, users can describe component requirements in natural language, such as "create a data table component that supports multi-condition filtering".
[0088] In some implementations, NLP models can be used to perform semantic parsing on the requirement text and extract key requirement features.
[0089] Optional, key requirements features include, but are not limited to:
[0090] Target component type, such as user interface (UI) components, service modules, database models, etc.
[0091] Functional requirements, such as data storage and user interaction.
[0092] Non-functional requirements, such as performance, security, and compatibility.
[0093] S102. Obtain historical dialogue context information, determine the semantic correlation between key requirement features and historical dialogue context information, and output prompt information to guide users to update requirement description information based on the semantic correlation.
[0094] In some implementations, a context-aware model can be used to vectorize historical dialogues. The semantic relevance between key requirement features and the historical context (such as cosine similarity and attention weights) is calculated. If the relevance is below a threshold, a prompt is generated to guide the user to supplement or clarify their requirements (e.g., "Please clarify whether mobile adaptation is required").
[0095] In some implementations, the semantics of the requirement description information are analyzed, and combined with historical dialogue context information, it is determined whether the component type described in the requirement description information is related to the target component type. If they are related, the component type described in the requirement description information is determined; if they are not related, the user is prompted to supplement or correct the above requirement description information.
[0096] In some implementations, the semantics of the requirement description information are analyzed, and combined with historical dialogue context information, it is determined whether the requirement description information entered by the user is related to the target component type. If it is not related, the corresponding prompt information is output to prompt the user to supplement or correct the above requirement description information.
[0097] In some implementations, the semantics of the requirement description information are analyzed, and combined with historical dialogue context information, it is determined whether the requirement description information entered by the user is missing key information. If so, corresponding prompts are output to prompt the user to supplement the aforementioned key information.
[0098] In the above implementation, multi-turn dialogue and context analysis can reduce the ambiguity of single user input, ensuring the completeness and accuracy of component requirement descriptions. Furthermore, the intelligent guidance mechanism (through outputting prompts) can reduce repetitive user input and lower interaction costs.
[0099] S103. Decompose the updated requirement description information and generate component description information based on the decomposition results.
[0100] In some implementations, the updated requirements description information is broken down to determine the functional modules of the components to be generated, such as user login module, personal information management module, and management module.
[0101] Furthermore, based on the breakdown results, component description information is generated. For example, for the user login module, the following component description information can be generated:
[0102] Function: Collect user information (username, email, password) and complete registration.
[0103] Input: Username (uniqueness verification), Email (format verification), Password (encrypted transmission).
[0104] Output: Redirect to the homepage and display a welcome message. Alternatively, display the message "Username already exists" or "Email format incorrect".
[0105] S104. Generate the initial code of the component based on the component description information.
[0106] In some implementations, component description information can be passed to the code generation agent. This agent, combined with a large model plugin, code checking service, and code converter, can automatically invoke the large model to generate initial code based on the description of the development task.
[0107] In some implementations, the component description information can be decomposed, and code can be generated to generate prompt information based on the decomposition results; the component initial code can be generated based on the code to generate prompt information.
[0108] S105. Compile, verify, and iteratively correct the initial code of the component, and generate a component that meets the user's requirements based on the component code that has been compiled, verified, and iteratively corrected.
[0109] In some implementations, compilation error logs can be parsed and key error information can be extracted; correction code can be generated based on the key error information; and the initial code of the component can be corrected based on the correction code.
[0110] The component generation method provided in this application introduces the multi-turn dialogue capability of a large language model agent to achieve dynamic decomposition and contextual understanding of user needs, gradually optimize component descriptions, and solve the problem of requirement ambiguity caused by single-turn dialogue in traditional low-code platforms. By automating the compilation, verification and iterative correction of the generated code, the code quality and generation reliability can be improved, making up for the lack of code quality assurance in traditional solutions.
[0111] In some implementations, component type keywords can be identified and extracted based on the requirement description information; the component type keywords can be matched with a pre-established list of component types; if the component type keywords match the list of component types successfully, the target component type that meets the user's requirements can be determined based on the component type keywords.
[0112] In some implementations, it can be determined whether the requirement description information is associated with the target component type; when the requirement description information is not associated with the target component type, a first prompt message is generated to prompt the user to re-enter the requirement description information.
[0113] In some implementations, it can be determined whether there is a component attribute field corresponding to the target component type in the requirement description information; if there is no component attribute field corresponding to the target component type in the requirement description information, a second prompt message is generated to prompt the user to supplement the component attribute field corresponding to the target component type.
[0114] For example, refer to Figure 2 , Figure 2 This is a schematic diagram of the architecture of a low-code platform based on a large language model intelligent agent provided in the embodiments of this application.
[0115] In some embodiments, the low-code platform 20 based on a large language model agent includes a requirement decomposition agent 201 and a code generation agent 202.
[0116] The aforementioned low-code platform 20 based on a large language model agent can utilize demand-based decomposition of agent 201 and code-generating agent 202 to generate components.
[0117] In some implementations, the requirement decomposition agent 201 is used to parse and decompose the requirement description information input by the user, which can transform complex business requirements into clear, executable component descriptions and instructions.
[0118] The requirement decomposition intelligent agent 201 can work collaboratively through multiple sub-functional units to ensure that the requirement description information input by the user can be accurately understood and transformed into effective component description information.
[0119] Optionally, the demand decomposition intelligent agent 201 includes a component type judgment unit 2011, a component description legality judgment unit 2012, a component description completeness judgment unit 2013, and a component description prompt information optimization function unit 2014.
[0120] The component type determination unit 2011 is used to identify the component type from the user-input requirement description information to ensure that the input matches the expected component type.
[0121] Specifically, large models can be used to perform natural language processing on the input requirement description information to identify and extract component type keywords.
[0122] In some implementations, a list of component types can be pre-built for comparison with extracted component type keywords. If the comparison is successful, it is confirmed that the input matches the expected component type; otherwise, a message is displayed indicating that no relevant component was found.
[0123] The component description validity judgment unit 2012 is used to determine whether the message sent by the user is related to the topic generated by the component, that is, whether the description contains irrelevant questions.
[0124] Specifically, a large model can be used to perform semantic analysis on the user's input requirement description to determine the relevance between the user input and the component type. If there is no relevance, that is, the requirement description is unrelated to the component type, a prompt message such as "Your requirement was not identified. Please describe the component requirement again" can be returned. If the relevance is high, the next step of completeness judgment can be performed.
[0125] The component description completeness judgment unit 2013 is used to check whether the user-input requirement description information is sufficient and whether it contains all the necessary key information.
[0126] Specifically, a large model can be used to extract key information from the user's input requirement description and compare it with the platform's predefined component attribute fields. If key information is missing, a prompt message "Please enter key information xxx" is returned. If the amount of information is insufficient, a prompt message "To ensure the quality of component generation, please provide more component requirements" is returned.
[0127] After the user completes the supplementary information, a prompt message will be returned to the user to guide them in adding more component requirements. If all key information exists, the next step is to optimize the description prompt message.
[0128] Users complete component descriptions through multi-turn dialogues with the large model. The component description prompt information optimization function unit 2014 can understand the context based on the multi-turn descriptions and perform historical backtracking, extract key information, organize it into fluent description statements through the large model, and generate standardized prompt information instructions to guide subsequent code generation.
[0129] In some implementations, the requirement decomposition agent 201 can further decompose the user requirement description to obtain qualified component description information, and then pass the component description information to the code generation agent 202.
[0130] In some implementations, the code generation agent 202 can combine a large model plugin, a code checking service, and a code converter to automatically call the code of the large model generation component based on the description information of the development task.
[0131] In some implementations, the component code generated by the code generation agent 202 can be compiled and run online through a code debugging service. After verification, the code is compiled and verified again. Finally, the code is exported to a low-code development platform to generate components.
[0132] In some implementations, the code generation agent 202 includes a code generation unit 2021, a code compilation and error detection unit 2022, and a plugin call code conversion unit 2023.
[0133] In some implementations, the demand decomposition agent 201 decomposes the component description and generates prompt information containing rich descriptive details. The code generation unit 2021 sends the generated result to the large model, which then generates component code that meets the user's needs and requirements based on the descriptive information.
[0134] The code compilation error checking unit 2022 is used to check whether the generated component code has syntax errors, nesting timeouts, or other problems.
[0135] Optionally, the code compilation error checking unit 2022 can be configured via an intelligent agent plugin, such as by calling other compilation software. If the online compilation and execution are error-free, the generated code can be determined to be error-free, and the component code is automatically saved. Otherwise, the error information and error code are returned to the large model, and new code is regenerated.
[0136] The plugin's code conversion unit 2023 converts component code into a specified format suitable for secondary development, and then directly compiles the generated code to verify for errors. If errors are found during compilation, detailed error logs are returned to pinpoint the problem, and the code conversion is re-executed. If no errors are found during compilation, the component is generated, and a success message is returned.
[0137] The component generation method provided in the above embodiments supports users to conduct multi-turn dialogues with a large model to complete the description of the component. The low-code platform based on the large language model agent can not only understand the information in a single-turn dialogue, but also capture the logical relationship between dialogues from multiple turns of dialogue, and provide subsequent suggestions based on the current dialogue state to guide the user to gradually complete the description of the component.
[0138] Furthermore, the above method also supports configuring plugins to call compilation tools for automatic compilation and error checking of the code generated from large models. The plugin design allows users to configure different compilation tool plugins as needed to meet the requirements of different programming languages or projects. Once the component code is generated from the large model, the compilation process is automatically triggered, calling the configured compilation tools to compile the code.
[0139] The component generation method provided in this application embodiment can achieve the following beneficial effects:
[0140] (1) To generate complex component tasks based on user descriptions, the platform has task understanding capabilities. Based on the large model task decomposition capability, it can understand and analyze user descriptions in accordance with business scenarios, thereby decomposing tasks according to task scenarios and generating corresponding component logic.
[0141] (2) The generation and display of components involve the interaction of different systems and large models. Intelligent agents are needed as an intermediate layer to coordinate these systems. The intelligent agents can automatically execute corresponding tasks based on the decisions and instructions generated by the model, thereby completing the generation and transformation of components.
[0142] (3) During the component generation process, the generated results may not meet expectations. The intelligent agent dialogue provides multi-turn interaction capabilities, continuously adjusting and optimizing the generated components through multiple interactions with the user until the requirements are met.
[0143] (4) Users can flexibly select and configure different compilation tool plugins according to project needs or personal preferences. By automatically triggering the compilation process and providing error reports, problems in the generated code can be discovered in a timely manner, and problems can be quickly located and corrected.
[0144] Figure 3 This is a schematic diagram of the structure of a component generation device provided in an embodiment of this application, such as... Figure 3 As shown, the component generation apparatus 30 provided in this embodiment includes:
[0145] The requirements analysis module 301 is used to receive the requirements description information input by the user, and determine the key requirements features based on the semantics of the requirements description information. The key requirements features include the target component type.
[0146] The prompt module 302 is used to obtain historical dialogue context information, determine the semantic correlation between key requirement features and historical dialogue context information, and output prompt information to guide users to update requirement description information based on semantic correlation.
[0147] The component analysis module 303 is used to decompose the updated requirement description information and generate component description information based on the decomposition results.
[0148] Code generation module 304 is used to generate initial code for a component based on its description information.
[0149] The component generation module 305 is used to compile, verify, and iteratively correct the initial component code, and generate a component that meets the user's requirements based on the compiled, verified, and iteratively corrected component code.
[0150] In one possible implementation, the requirements analysis module 301 described above is used for:
[0151] Based on the requirements description, identify and extract component type keywords;
[0152] Match component type keywords with a pre-built list of component types;
[0153] If the component type keyword matches the component type list, the target component type that meets the user's needs is determined based on the component type keyword.
[0154] In one possible implementation, the above-mentioned prompting module 302 is specifically used for:
[0155] Determine whether the requirements description information is related to the target component type;
[0156] When there is no correlation between the requirement description information and the target component type, a first prompt message is generated to prompt the user to re-enter the requirement description information.
[0157] In one possible implementation, the above-mentioned prompting module 302 is specifically used for:
[0158] Determine whether the requirement description information contains a component attribute field corresponding to the target component type;
[0159] If the component attribute field corresponding to the target component type does not exist in the requirement description information, a second prompt message is generated to prompt the user to supplement the component attribute field corresponding to the target component type.
[0160] In one possible implementation, the code generation module 304 is specifically used for:
[0161] The component description information is broken down, and code is generated to produce prompts based on the breakdown results;
[0162] Generate the initial code for the component based on the code generation prompts.
[0163] In one possible implementation, the component generation module 305 is specifically used for:
[0164] Analyze the compilation error log and extract key error information;
[0165] Generate correction code based on key error information;
[0166] The initial code of the component was corrected based on the corrected code.
[0167] The component generation apparatus provided in this embodiment can execute the component generation method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0168] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4As shown, the electronic device 40 provided in this embodiment includes at least one processor 401 and a memory 402. Optionally, the electronic device 40 further includes a communication component 403. The processor 401, memory 402, and communication component 403 are connected via a bus.
[0169] In a specific implementation, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to execute the component generation method provided in the above embodiments.
[0170] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0171] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0172] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0173] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0174] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the component generation method provided in the above embodiments.
[0175] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the component generation method provided in the above embodiments.
[0176] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0177] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an application-specific integrated circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0178] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0179] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0180] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0181] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0182] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0183] Finally, it should be noted that other embodiments of this application will readily conceive of by those skilled in the art upon consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A component generation method, characterized in that, include: Receive user input of requirement description information, and determine key requirement features based on the semantics of the requirement description information, wherein the key requirement features include target component type; Obtain historical dialogue context information, determine the semantic correlation between the key requirement features and the historical dialogue context information, and output prompt information to guide the user to update the requirement description information based on the semantic correlation. The updated requirement description information is broken down, and component description information is generated based on the breakdown results; Based on the component description information, generate the component's initial code; The initial code of the component is compiled, verified, and iteratively corrected. Based on the compiled, verified, and iteratively corrected component code, a component that meets the user's requirements is generated.
2. The method according to claim 1, characterized in that, The step of determining key requirement features based on the semantics of the requirement description information includes: Based on the aforementioned requirement description information, identify and extract component type keywords; Match the component type keywords with a pre-established list of component types; If the component type keyword matches the component type list, then the target component type that meets the user's needs is determined based on the component type keyword.
3. The method according to claim 2, characterized in that, The output includes prompts to guide the user in updating the requirement description information, including: Determine whether the requirement description information is associated with the target component type; When there is no association between the requirement description information and the target component type, a first prompt message is generated, which prompts the user to re-enter the requirement description information.
4. The method according to claim 2, characterized in that, The output includes prompts to guide the user in updating the requirement description information, including: Determine whether the requirement description information contains a component attribute field corresponding to the target component type; If the component attribute field corresponding to the target component type does not exist in the requirement description information, a second prompt message is generated. The second prompt message is used to prompt the user to supplement the component attribute field corresponding to the target component type.
5. The method according to claim 1, characterized in that, The step of generating initial component code based on the component description information includes: The component description information is decomposed, and based on the decomposition results, code is generated to generate prompt information; Based on the code, generate prompt information and generate the initial code for the component.
6. The method according to claim 1, characterized in that, The process of compiling, verifying, and iteratively correcting the initial code of the component includes: Analyze the compilation error log and extract key error information; Generate correction code based on the key error information; The initial code of the component is corrected based on the corrected code.
7. A component generation apparatus, characterized in that, include: The requirements analysis module is used to receive user input requirements description information and determine key requirements features based on the semantics of the requirements description information. The key requirements features include target component types. The prompting module is used to obtain historical dialogue context information, determine the semantic correlation between the key requirement features and the historical dialogue context information, and output prompt information to guide the user to update the requirement description information based on the semantic correlation. The component analysis module is used to break down the updated requirement description information and generate component description information based on the breakdown results. The code generation module is used to generate initial code for the component based on the component description information; The component generation module is used to compile, verify, and iteratively correct the initial code of the component, and generate a component that meets the user's requirements based on the compiled, verified, and iteratively corrected component code.
8. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the component generation method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the component generation method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the component generation method as described in any one of claims 1-6.