An application generation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202610733965.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-08-18
AI Technical Summary
然而,这种应用生成方式仅能满足简单场景下的应用生成需求
[0016] This application identifies application generation nodes from multiple functional nodes that can meet the various generation and processing stages of the application to be generated, based on the first application requirement. These functional nodes flexibly adapt to different types and complexities of application generation needs. Simultaneously, the first generation processing result generated by the application generation node is detected by a detection node in the functional node set to ensure that the generation processing result meets preset conditions. If the generation processing result does not meet the preset conditions, iterative correction is performed based on preset update rules. Compared to the fixed workflow mode application generation in related technologies, the application generation method provided in this application solves the error repair problem in the application generation process through a closed-loop mechanism of generation processing results, detection results, and preset update rules. This avoids process interruptions caused by errors or applications that do not meet user needs, improving application generation efficiency and reliability.
Smart Images

Figure CN122593756A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to an application generation method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence technology, intelligent application generation technology has been widely applied in software development, enterprise services, and other fields. Among related technologies, template-based generation patterns and fixed workflow architectures are used to generate various applications. However, this application generation method can only meet the needs of simple scenarios. When code errors or logical deviations occur at a certain node in the workflow, the lack of a dynamic adjustment mechanism makes it impossible to respond and fix the fault in a timely manner, often resulting in the final generated application not meeting user requirements. Therefore, how to achieve reliable application generation in dynamic scenarios is a current focus. Summary of the Invention
[0003] This application provides an application generation method, apparatus, electronic device, and storage medium to achieve reliable application generation in dynamic scenarios.
[0004] This application provides an application generation method, the method comprising: In response to input commands from the user terminal, the input commands are parsed to determine the first application requirement for the application to be generated; Based on the first application requirement, a set of functional nodes is determined from multiple pre-built functional nodes; the set of functional nodes includes at least one application generation node and at least one detection node; all application generation nodes correspond one-to-one with each generation processing stage of the application to be generated, and are used to output the generation processing results of the corresponding generation processing stage; each detection node is used to detect the generation processing results of the corresponding application generation node. In the current generation and processing stage, a first generation and processing result is generated based on the first application generation node, wherein the first application generation node is the application generation node in the functional node set that corresponds to the current generation and processing stage; When the first application generation node has a corresponding first detection node in the functional node set, the first generation processing result is detected based on the first detection node to obtain the first detection result. When the first detection result indicates that the first generation processing result does not meet the first preset condition, the first detection result is updated according to the preset update rule to obtain a second detection result that meets the first preset condition; Based on the second generation processing result corresponding to the second detection result, the final generation processing result of the current generation processing stage is determined, and the process proceeds to the next generation processing stage until the application to be generated is generated.
[0005] In one possible implementation, the method also includes: Determine the repair node corresponding to each detection node in the functional node set from a pre-built set of multiple repair nodes; Based on the logical relationship between each generation process stage of the application to be generated, the first execution order among the application generation nodes in the functional node set is determined. Based on the first execution order, the first correspondence, and the second correspondence, a directed state graph corresponding to the input instruction is constructed. The first correspondence is the correspondence between the detection node and the application generation node in the functional node set, and the second correspondence is the correspondence between the detection node and the repair node in the functional node set.
[0006] In one possible implementation, the method also includes: Obtain the execution state of each node in the directed state graph; The execution status of each node is fed back to the user terminal.
[0007] In one possible implementation, when the first detection result indicates that the first generation processing result does not meet the first preset condition, the first detection result is updated according to a preset update rule to obtain a second detection result that meets the first preset condition, including: The first repair node corresponding to the first detection node is determined from a pre-built set of repair nodes; In the current repair round, the first generated processing result is repaired based on the first repair node to obtain a new generated processing result; The newly generated processing result is detected based on the first detection node to obtain the updated detection result; When the updated detection result does not meet the first preset condition, the next repair round is entered to repair the new generation processing result based on the first repair node, until the second preset condition is met and the second detection result is obtained.
[0008] In one possible implementation, when the first detection result indicates that the first generation processing result does not meet the first preset condition, the first detection result is updated according to a preset update rule to obtain a second detection result that meets the first preset condition, including: According to the first preset number of cycles, the first generated processing result is detected based on the first detection node in each cycle, and the detection result corresponding to the first generated processing result in each cycle is obtained. In all loops, among the detection results corresponding to the first generation processing result, determine the number of detection results that satisfy the first preset condition; If the number is greater than the preset number, then all detection results that meet the first preset condition in all loops are determined as the second detection result.
[0009] In one possible implementation, when the first detection result indicates that the first generation processing result does not meet the first preset condition, the first detection result is updated according to a preset update rule to obtain a second detection result that meets the first preset condition, including: According to the second preset number of cycles, in each cycle, based on the first application generation node, the generation processing result corresponding to each cycle is generated; Based on the first detection node, the generation and processing results corresponding to each loop are detected to obtain the detection results corresponding to each loop. If at least one of the detection results of the generated processing results corresponding to each loop satisfies the first preset condition, then the detection result of the generated processing result corresponding to the loop that satisfies the first preset condition is determined as the second detection result.
[0010] In one possible implementation, in response to input commands from the user terminal, the input commands are parsed to determine the first application requirements for the application to be generated, including: Input the input command into the pre-built first inference model to obtain the second application requirement corresponding to the input command, and the confidence level corresponding to the second application requirement; Based on confidence level and second application requirements, the first application requirement is determined.
[0011] In one possible implementation, based on the first application requirement, a set of functional nodes is determined from a pre-built set of functional nodes, including: Obtain the current status information of the application to be generated, wherein the current status information is used to indicate whether the application to be generated has the functions corresponding to the requirements of the first application; Based on the current status information and the primary application requirements, a set of functional nodes is determined from multiple functional nodes.
[0012] This application also provides an application generation apparatus, the apparatus comprising: The parsing module is used to respond to input commands from the user terminal, parse the input commands, and determine the first application requirement of the application to be generated. The first determining module is used to determine a set of functional nodes from a pre-built set of functional nodes based on the first application requirements. The set of functional nodes includes at least one application generation node and at least one detection node. All application generation nodes correspond one-to-one with each generation processing stage of the application to be generated and are used to output the generation processing results of the corresponding generation processing stage. Each detection node is used to detect the generation processing results of the corresponding application generation node. The generation module is used to generate a first generation processing result based on the first application generation node in the current generation processing stage, wherein the first application generation node is the application generation node in the functional node set that corresponds to the current generation processing stage; The detection module is used to detect the first generation processing result based on the first detection node when the first application generation node has a corresponding first detection node in the functional node set, and obtain the first detection result. The update module is used to update the first detection result according to the preset update rules when the first detection result indicates that the first generation processing result does not meet the first preset condition, so as to obtain a second detection result that meets the first preset condition; The second determining module is used to determine the final generation processing result of the current generation processing stage based on the second generation processing result corresponding to the second detection result, and then proceed to the next generation processing stage until the application to be generated is generated.
[0013] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described application generation methods.
[0014] This application also provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-described application generation methods.
[0015] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described application generation methods.
[0016] This application identifies application generation nodes from multiple functional nodes that can meet the various generation and processing stages of the application to be generated, based on the first application requirement. These functional nodes flexibly adapt to different types and complexities of application generation needs. Simultaneously, the first generation processing result generated by the application generation node is detected by a detection node in the functional node set to ensure that the generation processing result meets preset conditions. If the generation processing result does not meet the preset conditions, iterative correction is performed based on preset update rules. Compared to the fixed workflow mode application generation in related technologies, the application generation method provided in this application solves the error repair problem in the application generation process through a closed-loop mechanism of generation processing results, detection results, and preset update rules. This avoids process interruptions caused by errors or applications that do not meet user needs, improving application generation efficiency and reliability. Attached Figure Description
[0017] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating an application generation method provided in this application embodiment; Figure 2 This is a schematic diagram of the structure of an application generation system provided in an embodiment of this application; Figure 3 This is a schematic diagram of the architecture of an application generation system provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an application generation device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0020] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0021] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0022] According to an embodiment of the present invention, an application generation method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0023] Figure 1 This is a flowchart of an application generation method provided according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes: S101 responds to the input command from the user terminal, parses the input command, and determines the first application requirement of the application to be generated.
[0024] Specifically, user terminal input commands can generate application requests initiated by users through natural language, text, etc. The first application requirement is the output result after preliminary parsing of the user input command, including but not limited to application type, core functions, and target scenarios. For example, natural language processing technology is used to parse the user's natural language command to obtain the first application requirement.
[0025] S102, based on the first application requirement, determine the set of functional nodes from the pre-built set of functional nodes.
[0026] The set of functional nodes includes at least one application generation node and at least one detection node; each application generation node corresponds one-to-one with each generation process stage of the application to be generated, and is used to output the generation process results of the corresponding generation process stage; each detection node is used to detect the generation process results of the corresponding application generation node.
[0027] Specifically, multiple functional nodes are pre-built modular units with independent functions, serving as fundamental components in the application generation process. These functional nodes include application generation nodes and detection nodes. Application generation nodes complete tasks for a specific stage of the application's generation process; each node corresponds to a generation stage and outputs the processing results for that stage. For example, the UI node is responsible for outputting the application's homepage and other interface layout code. Detection nodes verify whether the generation results of their corresponding application generation nodes meet the requirements, ensuring the quality of the generated results.
[0028] For example, the generation process of the application to be generated can be the interface design stage, the function development stage, the database construction stage, etc.
[0029] For example, based on the functional description corresponding to each functional node, such as core functions and application types, keyword matching or semantic matching is performed with the first application requirements to determine the set of functional nodes.
[0030] S103, In the current generation and processing stage, the first generation and processing result is generated based on the first application generation node.
[0031] The first application generation node is the application generation node in the set of functional nodes that corresponds to the current generation and processing stage.
[0032] Specifically, the first generation result is the initial result output by the first application generation node corresponding to the current generation node after execution. For example, the UI layout code output by the UI generation node.
[0033] S104, when the first application generation node has a corresponding first detection node in the functional node set, the first generation processing result is detected based on the first detection node to obtain the first detection result.
[0034] Specifically, the first detection result is used to indicate whether the first generation process result meets the generation requirements. For example, the first detection node detects the interface layout code output by the UI generation node, and the first detection result obtained is that the output interface of the interface layout code does not meet the preset condition of interface integrity.
[0035] In one possible implementation, the generated processing result is parsed to extract key information corresponding to the current generation processing stage; based on the first detection node and the key information, the generated processing result is detected to obtain the detection result.
[0036] For example, the generated processing results are cleaned to extract key information such as component information, page information, configuration files, file paths, and file structures. Furthermore, the component information is checked for validity, the reference relationships in the configuration files are examined, and the validity of the file paths is verified.
[0037] S105, when the first detection result indicates that the first generation processing result does not meet the first preset condition, the first detection result is updated according to the preset update rule to obtain a second detection result that meets the first preset condition.
[0038] Specifically, the first preset condition is used to detect whether the first generation process result meets the quality, functional, and other requirements of that stage. Taking the first detection node for detecting functional completeness as an example, the first preset condition can cover all the core functions of the corresponding generation process stage, with no core functions missing.
[0039] The preset update rules are optimization rules for detection results when the initial detection result does not meet the requirements. These rules include, but are not limited to, error correction and feature addition logic. For example, if a core function is detected as missing, the corresponding code to supplement the core function will be called. Similarly, if a syntax error exists, an automatic code repair algorithm will be used to correct the error.
[0040] S106, based on the second generation processing result corresponding to the second detection result, determine the final generation processing result of the current generation processing stage, and enter the next generation processing stage until the application to be generated is generated.
[0041] Specifically, after the current generation and processing stage has obtained the final generation and processing result through detection and optimization, it enters the next generation and processing stage. After going through all generation and processing stages, the complete application is finally generated.
[0042] For example, the second generation processing result corresponding to the second detection result is determined as the final generation processing result.
[0043] For example, the second generation results corresponding to the second detection results are filtered, and the filtered second generation results are determined as the final generation results. For instance, based on the code size of the second generation results, each second generation result is filtered to obtain the final generation result.
[0044] In this embodiment, an application generation node is determined from multiple functional nodes based on the first application requirement, which can satisfy the various generation processing stages of the application to be generated. This allows for flexible adaptation to different types and complexities of application generation requirements. Simultaneously, the first generation processing result generated by the application generation node is detected by a detection node in the functional node set to ensure that the generation processing result meets preset conditions. If the generation processing result does not meet the preset conditions, iterative correction is performed based on preset update rules. Compared to the fixed workflow mode application generation in related technologies, the application generation method provided in this embodiment solves the error repair problem in the application generation process through a closed-loop mechanism of generation processing result, detection result, and preset update rules. This avoids process interruptions caused by errors or the generated application not meeting user needs, thereby improving application generation efficiency and reliability.
[0045] In some embodiments, based on the foregoing embodiments, in response to input instructions from a user terminal, the input instructions are parsed to determine the first application requirement for the application to be generated, specifically including the following method steps: a1 inputs the input instruction into the pre-built first inference model to obtain the second application requirement corresponding to the input instruction, and the confidence level corresponding to the second application requirement.
[0046] Specifically, the first inference module can be a large language model such as the GPT model, or a deep learning model.
[0047] The confidence score is an evaluation metric representing the accuracy of the first inference model in predicting the second application requirement, reflecting the degree of match between the first application requirement and the user's intent. For example, the confidence score ranges from 0 to 1; the closer the confidence score is to 1, the higher the credibility of the second application requirement generated by the first inference model.
[0048] a2, based on confidence level and second application requirements, determine the first application requirement.
[0049] In one possible implementation, the first application requirement is determined based on the confidence level and the second application requirement, specifically including the following: When the confidence level is greater than the preset confidence threshold, the second application requirement is determined as the first application requirement.
[0050] When the confidence level is greater than the preset confidence threshold, it indicates that the second application requirement has high credibility and can reflect the user's real application needs. At this time, the second application requirement is determined as the first application requirement, so as to achieve the filtering of subsequent application generation nodes.
[0051] In another possible implementation, the first application requirement is determined based on the confidence level and the second application requirement, specifically including the following steps: First, when the confidence level is less than or equal to a preset confidence threshold, the inference chain output by the first inference model corresponding to the second application requirement is obtained.
[0052] Specifically, the reasoning chain is the logical reasoning process of the first reasoning model when parsing input instructions, which includes key steps such as keyword extraction, intent recognition, and function decomposition.
[0053] Then, the input instructions and inference chain are fed into the pre-built second inference model to obtain the first application requirements.
[0054] Specifically, the second inference model analyzes logical gaps and inaccuracies in the inference chain, and optimizes the application requirements by combining input instructions, making the obtained first application requirements more accurate and complete. For example, the second inference model can be a BERT derivative model, a reinforcement learning model, etc.
[0055] Thus, if the confidence level is less than or equal to the preset confidence threshold, it indicates that the reasoning accuracy of the first reasoning model is insufficient. Therefore, the reasoning logic of the first reasoning model is restored by using the reasoning chain output by the first reasoning model, providing an optimization basis for the second reasoning model. In this embodiment, the combination of the first reasoning model and the second reasoning model makes up for the defects of single model parsing, ensuring that the first application requirement can accurately express the user's actual intention.
[0056] In this embodiment, the input instructions of the user terminal are parsed through the first inference model. While outputting the second application requirement, the confidence level of the second application requirement is also output. Furthermore, the first application requirement is finally determined based on the confidence level and the second application requirement, which effectively avoids the problem of requirement misunderstanding. This enables the final first application requirement to accurately identify the user's true intention and provides a reliable foundation for subsequent function node selection and application generation.
[0057] In some embodiments, based on any of the foregoing embodiments, a set of functional nodes is determined from a pre-built set of functional nodes based on a first application requirement, specifically including the following: First, obtain the current state information of the application to be generated.
[0058] The current status information is used to indicate whether the application to be generated has the functionality corresponding to the requirements of the first application.
[0059] Specifically, the current status information refers to the functional status and development progress of the application to be generated at the time of requirements analysis, reflecting the degree of matching between the current application to be generated and the requirements of the first application. For example, if the first application requirement is a completely new requirement and the current application to be generated does not have a corresponding function, a complete functional module needs to be built. Or, if the current application to be generated already has the function corresponding to the first application requirement, further optimization is needed based on the current function.
[0060] Then, based on the current status information and the primary application requirements, a set of functional nodes is determined from multiple functional nodes.
[0061] For example, if the user inputs a command to add a button to a game project, and there is already a game project in the application to be generated, then the application generation node in the function node set will be the game enhancement node; if there is no game project, then it will be identified as a new application requirement, and the corresponding application generation node in the function node set will be the new game node.
[0062] In this embodiment, based on the current state information of the application to be generated and the requirements of the first application, the missing functions of the application to be generated are accurately identified, avoiding the problem of repeated generation and achieving accurate selection of functional nodes.
[0063] In some embodiments, based on any of the foregoing embodiments, when the first detection result indicates that the first generation processing result does not meet the first preset condition, the first detection result is updated according to a preset update rule to obtain a second detection result that meets the first preset condition, specifically including the following: First, the first repair node corresponding to the first detection node is determined from multiple pre-built repair nodes.
[0064] Specifically, a repair node is a modular unit with certain error correction capabilities. It corresponds to a detection node and can perform repair operations for different types of detected errors, such as code syntax errors, missing functions, and logical conflicts. For example, the repair node corresponding to the code syntax detection node is the Python syntax error repair node.
[0065] The first repair node is a repair node that precisely matches the first detection node currently performing the detection, and is used to handle the errors identified by the first detection node. Taking the first detection node as a code logic detection node as an example, if the first detection result is an abnormal loop condition, then the corresponding first repair node is a code logic optimization repair node, which is used to repair the abnormal loop condition.
[0066] Then, in the current repair round, the first generated processing result is repaired based on the first repair node to obtain a new generated processing result.
[0067] Next, the newly generated processing result is detected based on the first detection node to obtain the updated detection result.
[0068] Specifically, the new generated processing result is the intermediate result after the first repair node performs repair operations on the first generated processing result in the current repair round. The updated detection result is the output of the first detection node after re-detecting the new generated processing result, indicating whether the repair effect of the current repair round meets the preset conditions. For example, for code with a certain syntax error, the updated detection result is that there is still an uncorrected syntax error, and the first preset condition is not met.
[0069] Finally, when the updated detection result does not meet the first preset condition, the next repair round is entered to repair the new generation processing result again based on the first repair node, until the second preset condition is met and the second detection result is obtained.
[0070] Specifically, the second preset condition is the termination condition for iterative repair. For example, the second preset condition can be the first preset condition, i.e., terminating iterative repair when the detection result meets the standard. The second preset condition can also be that the number of repair rounds reaches a preset repair count threshold.
[0071] In this embodiment of the application, iterative repair ensures that errors can be completely corrected, guarantees the quality of the generated processing results, and provides a reliable basis for the smooth progress of subsequent generation stages.
[0072] In some embodiments, when the first detection result indicates that the first generation processing result does not meet the first preset condition, the first detection result is updated according to a preset update rule to obtain a second detection result that meets the first preset condition, specifically including the following: First, according to the first preset number of cycles, the first generated processing result is detected based on the first detection node in each cycle, so as to obtain the detection result corresponding to the first generated processing result in each cycle.
[0073] Specifically, the first preset number of loops refers to the number of times the first generated processing result is repeatedly tested. In this embodiment, by testing the first generated processing result multiple times, the stability of the test result is ensured, and the random deviation of a single test is avoided. For example, for code syntax testing, the first preset number of loops is 5 times. For functional integrity testing, the first preset number of loops is set to 3 times.
[0074] Then, among the detection results corresponding to the first generation processing result in all loops, determine the number of detection results that meet the first preset condition.
[0075] Finally, if the number is greater than the preset number, then all detection results that meet the first preset condition in all loops are determined as the second detection results.
[0076] In this embodiment, the first generated processing result is repeatedly tested multiple times based on a first preset number of cycles, and the second detection result is determined by comparing the number with the preset number. This avoids environmental interference and random errors in a single detection, and ensures the quality stability and reliability of the generated processing result.
[0077] In some embodiments, based on any of the foregoing embodiments, when the first detection result indicates that the first generation processing result does not meet the first preset condition, the first detection result is updated according to a preset update rule to obtain a second detection result that meets the first preset condition, specifically including the following: First, according to the second preset number of loops, in each loop, based on the first application generation node, the corresponding generation processing result is generated.
[0078] Specifically, the second preset number of cycles is the number of times the first application generation node repeatedly outputs the generation processing result. In this embodiment, diverse generation processing results are obtained through multiple rounds of independent generation, avoiding the limitations of a single generation.
[0079] The generation and processing results corresponding to each loop refer to the results independently output by the first application generation node based on the same first application requirements in each round of the second preset loop. The generation and processing results of different loops may exhibit diversity due to model parameter fine-tuning, random seed differences, etc.
[0080] For example, in code generation scenarios, the second preset number of loops is set to 5, covering different code logic through multiple rounds of generation. For instance, in the login function code generation scenario, the second preset number of loops is 3. Loop 1 generates login code based on account and password combined with SMS verification, loop 2 generates login code based on account and password combined with facial recognition, and loop 3 generates code for login based on account and password only.
[0081] For example, in a UI design scenario, the second preset number of loops is set to 8 to obtain diverse UI layout schemes.
[0082] Then, based on the first detection node, the generation and processing results corresponding to each loop are detected to obtain the detection results corresponding to each loop.
[0083] Specifically, the detection result corresponding to the generation and processing result in each loop is obtained by the first detection node after detecting the generation and processing result of each loop one by one. Each detection result corresponds to the generation and processing result of one loop and is used to determine whether the generation and processing result of that loop meets the quality requirements.
[0084] Finally, if at least one of the detection results of the generated processing results corresponding to each loop satisfies the first preset condition, then the detection result of the generated processing result corresponding to the loop that satisfies the first preset condition is determined as the second detection result.
[0085] In this way, by obtaining diverse generation and processing results through multiple rounds of iteration, the probability of the generation and processing results meeting the standards is increased, and process blockage caused by defects in the generation and processing results of a single generation is avoided.
[0086] In some embodiments, after determining the set of functional nodes from a pre-built set of functional nodes based on a first application requirement, the method provided in this application embodiment further includes the following: First, the repair nodes corresponding to each detection node in the functional node set are determined from the pre-built multiple repair nodes.
[0087] Then, based on the logical relationship between each generation process stage of the application to be generated, the first execution order among the application generation nodes in the functional node set is determined.
[0088] Specifically, the logical relationships between the various generation and processing stages refer to the sequential dependencies and causal relationships between the generation and processing nodes. For example, in a certain application, the logical relationships between the various generation and processing stages could be UI design - database setup - feature development - database integration.
[0089] Next, based on the first execution order, the first correspondence, and the second correspondence, a directed state graph corresponding to the input instruction is constructed.
[0090] The first correspondence is the correspondence between the detection nodes and the application generation nodes in the functional node set, and the second correspondence is the correspondence between the detection nodes and the repair nodes in the functional node set.
[0091] Specifically, a directed state graph refers to a visualized directed graph that presents the entire process of application generation and state transition. The nodes in the graph represent application generation nodes, detection nodes, and repair nodes, and the directed edges represent the execution order and correspondence between the nodes.
[0092] Furthermore, the execution status of each node in the directed state graph is acquired and stored to achieve flexible workflow state management. Simultaneously, the execution status of each node is fed back to the user terminal.
[0093] The execution status of a node refers to the real-time running status of each node (including application generation nodes, detection nodes, and repair nodes) in the directed state graph during the application generation process. It is a comprehensive description of the node's current stage, execution result, resource consumption, and other information, reflecting the progress of the application generation process. For example, the execution status can be pending execution, executing, execution successful, execution failed, retrying, detection in progress, detection completed, repairing, or repair completed.
[0094] In some embodiments, based on any of the foregoing embodiments, after generating the application, the method provided in this application embodiment further includes the following: Acquire various data during the application's generation process, such as input commands, execution status of each node, execution count, and execution order, to provide a reference for the generation of other applications in the future.
[0095] In some embodiments, based on any of the foregoing embodiments, the method provided in this application further includes the following: In the first generation processing stage, if the second generation processing result generated by the second application generation node still does not meet the preset conditions after the above-mentioned iterative repair and iterative detection methods, then the process returns to the previous generation processing stage, regenerates the generation processing result of the previous generation processing stage, and then re-enters the first generation processing stage. Here, the first generation processing stage is one of the generation processing stages in the application to be generated, and the second application generation node is the application generation node corresponding to the first generation processing stage.
[0096] In this way, by reverting to the previous generation process stage and regenerating, cross-stage correlation defects are resolved from the source, avoiding the waste of resources caused by ineffective iterative repairs and ensuring the correlation between each generation process stage.
[0097] Figure 2 This is a schematic diagram of an application generation system. The system includes an application requirement identification module, an application generation state management module, an intelligent routing decision module, a streaming application generation module, and a code quality assurance module.
[0098] The application requirement identification module is used to parse user input commands based on a large language model to obtain the first application requirement and realize multi-level application intent classification.
[0099] The application generated state management module is based on LangGraph's state graph management and supports application generated state persistence, rollback, and recovery.
[0100] The intelligent routing decision module dynamically selects routes based on application type, functional requirements, context, and system status.
[0101] The streaming application generation module pushes processing results and status updates to the user terminal in real time, supporting SSE streaming response and asynchronous message distribution.
[0102] The code quality assurance module includes a code error detection mechanism, an adaptive retry mechanism, and a state rollback and recovery mechanism.
[0103] Figure 3 This is a system architecture diagram for an application generation system. The diagram includes a front-end user interface layer, an Application Programming Interface (API) gateway layer, a core processing layer, a function execution layer, and a data storage layer. Users input commands through the chat UI in the front-end user interface layer. These commands are transmitted via a WebSocket network communication protocol to the API gateway layer and the core processing layer. Finally, the directed state graph engine in the core processing layer drives the intent recognition nodes, routing decision nodes, and task execution nodes, scheduling the application generator, code optimizer, question-answering processor, and command executor modules in the function execution layer to complete the generation task. The results are then fed back to the user in the form of a stream by the streaming processor in the API gateway layer. Users can also initiate Hypertext Transfer Protocol (HTTP) requests containing input commands through the Web UI in the front-end user interface layer. These requests are then transmitted to the routing controller in the API gateway layer, which forwards them to the core processing layer. The intent recognition nodes and routing decision nodes then drive the function execution layer to complete the application generation. In addition, users can also establish a connection with the status manager of the API gateway layer through the status visualization interface (Status UI) in the front-end interface layer to receive the execution status of each node in the core processing layer and the task in the function execution layer in real time, so as to realize the visualization monitoring of the generation progress.
[0104] The data storage layer includes a session store (MemorySaver), a state store (such as SQLite), and a file store. The session store saves user dialogue context and historical interaction records, ensuring contextual continuity in multi-round application generation requirement communication. The state store stores the execution status, task progress, and generation results of each node in the directed state graph, supporting process backtracking and state verification. The file store persists generated application code, configuration files, resource files, etc., ensuring reliable retention and subsequent use of the generation results.
[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0106] This application also provides an application generation apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0107] This embodiment provides an application generation apparatus, a control device applied to an application generation system, the system further including a mobile platform, and a lidar and at least one camera mounted on the mobile platform, such as... Figure 4 As shown, it includes: The parsing module 401 is used to respond to the input command of the user terminal, parse the input command, and determine the first application requirement of the application to be generated. The first determining module 402 is used to determine a set of functional nodes from a pre-built set of functional nodes based on the first application requirements. The set of functional nodes includes at least one application generation node and at least one detection node. All application generation nodes correspond one-to-one with each generation processing stage of the application to be generated and are used to output the generation processing results of the corresponding generation processing stage. Each detection node is used to detect the generation processing results of the corresponding application generation node. The generation module 403 is used to generate a first generation processing result based on the first application generation node in the current generation processing stage, wherein the first application generation node is the application generation node in the functional node set that corresponds to the current generation processing stage; The detection module 404 is used to detect the first generation processing result based on the first detection node when the first application generation node has a corresponding first detection node in the functional node set, and obtain the first detection result. The update module 405 is used to update the first detection result according to the preset update rule when the first detection result indicates that the first generation processing result does not meet the first preset condition, so as to obtain a second detection result that meets the first preset condition. The second determining module 406 is used to determine the final generation processing result of the current generation processing stage based on the second generation processing result corresponding to the second detection result, and then proceed to the next generation processing stage until the application to be generated is generated.
[0108] In one possible implementation, the device further includes a construction module for determining, from a plurality of pre-built repair nodes, a repair node corresponding to each detection node in the set of functional nodes; Based on the logical relationship between each generation process stage of the application to be generated, the first execution order among the application generation nodes in the functional node set is determined. Based on the first execution order, the first correspondence, and the second correspondence, a directed state graph corresponding to the input instruction is constructed. The first correspondence is the correspondence between the detection node and the application generation node in the functional node set, and the second correspondence is the correspondence between the detection node and the repair node in the functional node set.
[0109] In one possible implementation, the device further includes a feedback module for obtaining the execution state of each node in the directed state graph; The execution status of each node is fed back to the user terminal.
[0110] In one possible implementation, update module 405 is specifically used to determine the first repair node corresponding to the first detection node from a plurality of pre-built repair nodes; In the current repair round, the first generated processing result is repaired based on the first repair node to obtain a new generated processing result; The newly generated processing result is detected based on the first detection node to obtain the updated detection result; When the updated detection result does not meet the first preset condition, the next repair round is entered to repair the new generation processing result based on the first repair node, until the second preset condition is met and the second detection result is obtained.
[0111] In one possible implementation, the update module 405 is specifically used to detect the first generated processing result based on the first detection node in each loop according to the first preset number of loops, so as to obtain the detection result corresponding to the first generated processing result in each loop. In all loops, among the detection results corresponding to the first generation processing result, determine the number of detection results that satisfy the first preset condition; If the number is greater than the preset number, then all detection results that meet the first preset condition in all loops are determined as the second detection result.
[0112] In one possible implementation, the update module 405 is specifically used to generate the generation processing result corresponding to each cycle based on the first application generation node, according to the second preset number of cycles. Based on the first detection node, the generation and processing results corresponding to each loop are detected to obtain the detection results corresponding to each loop. If at least one of the detection results of the generated processing results corresponding to each loop satisfies the first preset condition, then the detection result of the generated processing result corresponding to the loop that satisfies the first preset condition is determined as the second detection result.
[0113] In one possible implementation, the parsing module is specifically used to input the input instruction into a pre-built first inference model to obtain a second application requirement corresponding to the input instruction, and a confidence level corresponding to the second application requirement. Based on confidence level and second application requirements, the first application requirement is determined.
[0114] In one possible implementation, the first determining module 402 is used to obtain the current state information of the application to be generated, wherein the current state information is used to indicate whether the application to be generated has functions corresponding to the requirements of the first application. Based on the current status information and the primary application requirements, a set of functional nodes is determined from multiple functional nodes.
[0115] For a description of the features in the embodiment corresponding to the application generation device, please refer to the relevant description of the embodiment corresponding to the application generation method, which will not be repeated here.
[0116] Embodiments of this application also provide an electronic device, such as... Figure 5 As shown, it includes a memory 10 and a processor 20. The memory 10 stores a computer program, and the processor 20 is configured to run the computer program to perform the steps in any of the above-described application generation method embodiments.
[0117] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described application generation method embodiments at runtime.
[0118] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0119] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described application generation method embodiments.
[0120] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described application generation method embodiments.
[0121] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0122] The foregoing has provided a detailed description of an application generation method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. An application generation method, characterized in that, The method includes: In response to input commands from the user terminal, the input commands are parsed to determine the first application requirement for the application to be generated; Based on the first application requirement, a set of functional nodes is determined from a pre-built set of functional nodes; the set of functional nodes includes at least one application generation node and at least one detection node; all the application generation nodes correspond one-to-one with each generation processing stage of the application to be generated, and are used to output the generation processing results of the corresponding generation processing stage; each detection node is used to detect the generation processing results of the corresponding application generation node. In the current generation process stage, a first generation process result is generated based on the first application generation node, wherein the first application generation node is the application generation node in the set of functional nodes that corresponds to the current generation process stage; When the first application generation node has a corresponding first detection node in the set of functional nodes, the first generation processing result is detected based on the first detection node to obtain the first detection result. When the first detection result indicates that the first generated processing result does not meet the first preset condition, the first detection result is updated according to the preset update rule to obtain a second detection result that meets the first preset condition; Based on the second generation processing result corresponding to the second detection result, the final generation processing result of the current generation processing stage is determined, and the process proceeds to the next generation processing stage until the application to be generated is generated.
2. The method according to claim 1, characterized in that, The method further includes: Determine the repair node corresponding to each detection node in the set of functional nodes from a pre-built set of repair nodes; Based on the logical relationship between each generation process stage of the application to be generated, the first execution order among the application generation nodes in the functional node set is determined; Based on the first execution order, the first correspondence, and the second correspondence, a directed state graph corresponding to the input instruction is constructed, wherein the first correspondence is the correspondence between the detection node and the application generation node in the functional node set, and the second correspondence is the correspondence between the detection node and the repair node in the functional node set.
3. The method according to claim 2, characterized in that, The method further includes: Obtain the execution state of each node in the directed state graph; The execution status of each node is fed back to the user terminal.
4. The method according to any one of claims 1-3, characterized in that, When the first detection result indicates that the first generated processing result does not meet the first preset condition, updating the first detection result according to a preset update rule to obtain a second detection result that meets the first preset condition includes: The first repair node corresponding to the first detection node is determined from a plurality of pre-built repair nodes; In the current repair round, the first generated processing result is repaired based on the first repair node to obtain a new generated processing result; Based on the first detection node, the new generated processing result is detected to obtain an updated detection result; When the updated detection result does not meet the first preset condition, the next repair round is entered to repair the new generation processing result again based on the first repair node, until the second preset condition is met and the second detection result is obtained.
5. The method according to any one of claims 1-3, characterized in that, When the first detection result indicates that the first generated processing result does not meet the first preset condition, updating the first detection result according to a preset update rule to obtain a second detection result that meets the first preset condition includes: According to the first preset number of cycles, the first generated processing result is detected based on the first detection node in each cycle, so as to obtain the detection result corresponding to the first generated processing result in each cycle. In all loops, among the detection results corresponding to the first generated processing result, determine the number of detection results that satisfy the first preset condition; If the number is greater than the preset number, then all detection results that satisfy the first preset condition within the loop are determined as the second detection result.
6. The method according to any one of claims 1-3, characterized in that, When the first detection result indicates that the first generated processing result does not meet the first preset condition, updating the first detection result according to a preset update rule to obtain a second detection result that meets the first preset condition includes: According to the second preset number of cycles, in each cycle, based on the first application generation node, the generation processing result corresponding to each cycle is generated; Based on the first detection node, the generation and processing results corresponding to each loop are detected to obtain the detection results corresponding to each loop. If at least one of the detection results of the generated processing results corresponding to each loop satisfies the first preset condition, then the detection result of the generated processing result corresponding to the loop that satisfies the first preset condition is determined as the second detection result.
7. The method according to any one of claims 1-3, characterized in that, The step of responding to an input command from a user terminal, parsing the input command, and determining the first application requirement for the application to be generated includes: The input instruction is input into a pre-built first inference model to obtain a second application requirement corresponding to the input instruction, and a confidence level corresponding to the second application requirement; Based on the confidence level and the second application requirement, the first application requirement is determined.
8. The method according to any one of claims 1-3, characterized in that, The step of determining a set of functional nodes from a pre-built set of functional nodes based on the first application requirement includes: Obtain the current status information of the application to be generated, wherein the current status information is used to indicate whether the application to be generated has a function corresponding to the requirements of the first application; Based on the current status information and the first application requirement, the set of functional nodes is determined from the plurality of functional nodes.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the application generation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the application generation method as described in any one of claims 1-7.