A closed-loop human activity program generation method and system
By combining task planning models and program correction models, active programs are generated and dynamically corrected, solving the problem that closed-loop generated active programs cannot automatically correct errors in existing technologies, and improving the executability and reliability of active programs.
Patent Information
- Application Number
- CN202411453347.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-10-17
AI Technical Summary
In existing technologies, closed-loop generation methods for active programs cannot achieve automatic error correction, causing the program to fail to continue once an error occurs, thus failing to meet the requirement of high executability.
An initial activity program is generated through a task planning model, and dynamic error correction is performed during execution using verification code and program correction model. The contextual capabilities of a large language model are combined to perform self-correction, generating a closed-loop human activity program.
It enables dynamic correction of activity procedures during execution, significantly improving the executability and reliability of activity procedures.
Smart Images

Figure CN119473246B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer graphics, and in particular to a closed-loop human activity program generation method and system. BACKGROUND
[0002] With the popularity and development of virtual universe and embodied intelligence, people are eager to build a virtual digital world similar to the real world. As a mapping of human in the digital world, digital human plays an important role in interacting with the virtual environment. In order to achieve different interactive tasks, it is necessary to design corresponding activity programs for digital human. At present, many game companies design various activity programs for different virtual characters in order to make the game more realistic and natural and improve the user's sense of immersion. However, designing the activities of these digital humans requires designers to have rich design experience and professional basis, which brings huge economic and time cost. Therefore, how to reduce the generation cost of human activity program and automatically generate activity program in a user-friendly way has become an important problem.
[0003] Some recent works use trained models or large language models to generate human activity programs in an open-loop manner, but the executability of these activity programs is not high. Moreover, since it is in an open-loop form, once an instruction in the activity program is executed incorrectly, the activity ends and there is no way to correct it subsequently.
[0004] The existing systems for generating activity programs in a closed-loop manner mainly have three categories, the first category is the work of human activity program generation task, the second category is the related work of completing the task in a closed-loop manner, and the third category is the work of using code as memory. Past human activity program generation tasks mainly fall into two categories, the first category is to use trained models to generate activity programs, learning a large number of activity instruction-activity program pairs, and the second category is to use pre-trained large language models to directly generate activity programs through prompt engineering. This method combines the advantages of trained models and large language models by fine-tuning the large language model. However, these methods are in an open-loop mode, once the program is generated, it cannot be changed, and during execution, if a certain action fails, the entire task fails.
[0005] Therefore, the prior art still needs to be improved. SUMMARY
[0006] The technical problem to be solved by the present application is that, in view of the defects of the prior art, the present application provides a closed-loop human activity program generation method and system to solve the problem that the existing method for generating activity programs in a closed-loop manner cannot realize automatic correction.
[0007] The technical scheme adopted by the present application to solve the technical problem is as follows:
[0008] In a first aspect, the present application provides a closed-loop human activity program generation method, comprising:
[0009] inputting initial scene information and activity description, and generating an initial activity program through a task planning model;
[0010] checking a verification code of a corresponding action of the activity program, if it is judged that the current action is executable, sending it to a simulator for execution, if it is judged that the current action is not executable, modifying the activity program using the verification code; wherein the verification code is a code summarized according to error correction experience of the corresponding action in the model training process;
[0011] checking the execution state of the activity program, if the corresponding action can be successfully executed in the simulation environment, obtaining the state returned by the simulation environment after execution, if the corresponding action fails to execute, according to the error information returned by the simulation environment, using a program correction model to modify the activity program again;
[0012] outputting the final modified activity program.
[0013] In an implementation mode, the checking of the verification code of the corresponding action of the activity program, if it is judged that the current action is executable, sending it to the simulator for execution, if it is judged that the current action is not executable, modifying the activity program using the verification code, comprises:
[0014] finding the verification code of the corresponding action of the activity program from the program memory;
[0015] judging whether the current action is executable according to the found verification code, if it is judged that the current action is not executable, generating a code update scheme, and modifying the activity program using the verification code; if it is judged that the current action is executable, sending it to the simulator for execution.
[0016] In an implementation mode, the checking of the execution state of the activity program, if the corresponding action can be successfully executed in the simulation environment, obtaining the state returned by the simulation environment after execution, if the corresponding action fails to execute, according to the error information returned by the simulation environment, using a program correction model to modify the activity program again, comprises:
[0017] checking the execution state of the activity program, judging whether the corresponding action of the activity program can be successfully executed in the simulation environment;
[0018] if successfully executed in the simulation environment, obtaining the state change information of the simulation environment;
[0019] If the execution in the simulation environment fails, error information of the execution of the active program in the simulation environment is acquired, and the active program is modified again using the program correction model according to the error information.
[0020] In an implementation manner, the modifying the active program again using the program correction model according to the error information includes:
[0021] Within a range of a set maximum number of error correction times after execution, a correction scheme is generated using the program correction model according to the error information of the execution of the active program in the simulation environment, and the active program is corrected according to the correction scheme to obtain an updated active program, and the corresponding action instruction is executed from the error position after the update.
[0022] It is judged whether the corrected action is executed successfully.
[0023] If the execution is successful, the next instruction in the active program is executed until all instructions in the active program are executed or the number of error correction times after execution reaches an upper limit.
[0024] In an implementation manner, the method further includes:
[0025] After each training, an action verification code corresponding to an action instruction that is executed with an error in the simulation environment is acquired to obtain an old action verification code with defects.
[0026] Experience information successfully corrected in a training process is acquired from error correction history information.
[0027] According to the old action verification code with defects and the experience information successfully corrected, an experience summary model is used to output a new optimized action verification code.
[0028] In an implementation manner, the acquiring experience information successfully corrected in the reasoning process from the error correction history information includes:
[0029] Execution information of an action instruction from an execution error to a re-executed success or a skipped execution is acquired to obtain the experience information successfully corrected.
[0030] In a second aspect, the application provides a closed-loop human activity program generation system, including:
[0031] A task planning module is configured to input initial scene information and activity description, and generate an initial activity program through a task planning model.
[0032] An execution-before-correction module is configured to check a verification code of the action corresponding to the active program, and if it is determined that the current action is executable, the active program is sent to the simulator for execution, and if it is determined that the current action is not executable, the active program is modified using the verification code; wherein the verification code is a code summarized according to the correction experience of the action corresponding to the active program in the model training process;
[0033] An execution-after-correction module is configured to check the execution state of the active program, and if the action corresponding to the active program is successfully executed in the simulation environment, the state after execution returned by the simulation environment is obtained, and if the action corresponding to the active program fails to be executed, the active program is modified again using the program correction model according to the error information returned by the simulation environment;
[0034] A correction experience summarization module is configured to summarize the experience of the action corresponding to the active program from an execution error to a successful execution again in the training process, and generate a check code of the action corresponding to the active program, so as to be used for the execution-before-correction in the reasoning process.
[0035] In a third aspect, the present application provides a terminal, comprising a processor and a memory, wherein the memory stores a closed-loop human activity program generation program, and the closed-loop human activity program generation program is used to implement the operations of the closed-loop human activity program generation method according to the first aspect when executed by the processor.
[0036] In a fourth aspect, the present application further provides a medium, which is a computer readable storage medium, and the medium stores a closed-loop human activity program generation program, and the closed-loop human activity program generation program is used to implement the operations of the closed-loop human activity program generation method according to the first aspect when executed by a processor.
[0037] The technical scheme of the present application has the following effects:
[0038] The present application generates an initial active program through a task planning model, checks a verification code of an action corresponding to the active program, and sends the active program to a simulator for execution when the current action is executable, or modifies the active program using the verification code when the current action is not executable; and when the action corresponding to the active program is successfully executed, the state after execution returned by the simulation environment is obtained, or when the action corresponding to the active program fails to be executed, the active program is modified again using the program correction model according to the error information returned by the simulation environment, and the finally modified active program is output; the present application provides a method for automatically generating an active program in a closed loop according to an activity description input by a user, and the active program can be dynamically corrected during execution, thereby greatly improving the executability of the active program. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from the structures shown in the drawings without creative labor.
[0040] Figure 1 is a flow chart of the closed-loop human activity program generation method in the present application.
[0041] Figure 2 is a closed-loop human activity program generation schematic diagram in the present application.
[0042] Figure 3 is a reasoning process schematic diagram in the present application.
[0043] Figure 4 is a learning process schematic diagram in the present application.
[0044] Figure 5 is a test result schematic diagram in the present application.
[0045] Figure 6 is a functional principle diagram of a terminal in an implementation manner of the present application.
[0046] The purposes, functional features and advantages of the present application will be further described with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] In order to make the purposes, technical solutions and advantages of the present application clearer and more explicit, the present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.
[0048] Exemplary method
[0049] The existing closed-loop activity program generation system mainly has three types, the first type is the human activity program generation task, the second type is the related work of completing the task using a closed-loop method, and the third type is the work of using code as memory. The past human activity program generation task mainly has two types, the first type is to generate an activity program using a training model, and a large number of activity instruction-activity program pairs are learned, and the second type is to use a pre-trained large language model to directly generate an activity program by relying on a prompt engineering. This method combines the advantages of training models and large language models by fine-tuning the large language model. Therefore, the existing human activity program generation method is generated in an open-loop manner, which makes the program end when a certain instruction in the program executes incorrectly, and has no self-correction ability.
[0050] To solve the above technical problems, the embodiment of the present application provides a closed-loop human activity program generation method, which generates an initial activity program through a task planning model, checks a verification code of a corresponding action of the activity program, inputs the activity program into a simulator for execution when the current action is executable, or modifies the activity program using the verification code when the current action is not executable; and when the corresponding action is successfully executed, acquires a state returned by the simulator after execution, or when the corresponding action fails to be executed, modifies the activity program again using a program correction model according to error information returned by the simulator, and outputs a final modified activity program; the embodiment of the present application provides a method for automatically generating an activity program in a closed-loop manner according to a user input activity description, which can dynamically correct the activity program during execution, and greatly improves the executability of the activity program.
[0051] As shown in Figure 1 The embodiment of the present application provides a closed-loop human activity program generation method, which includes the following steps:
[0052] Step S100, input initial scene information and activity description, and generate an initial activity program through a task planning model.
[0053] In the embodiment, the problem of human activity program generation is solved. The task of the embodiment is to hope that a digital human (i.e., a virtual human) can generate a reasonable and executable activity program according to a high-level description (for example, an activity description of “surfing the Internet”) given by a human and the states of objects and roles in a scene; the activity program can be composed of a plurality of action instructions, and the instructions contain actions and objects to be operated, for example, [WALK] <chair>(walk-chair), [SIT] <chair>(SIT-DOWN-CHAIR), [SWITCH ON] <computer>(Open-computer) action instruction.
[0054] Based on the above task description, the method provided in this embodiment builds a system for inputting activity instructions to generate activity programs in a closed loop, and summarizes the experience of successful error correction in the form of code to realize the function of automatically generating activity programs in a closed loop.
[0055] The system in this embodiment provides a closed-loop framework based on a training model combined with a large language model to solve the problem of human activity program generation. The framework uses the training model to output an initial result with good performance, and then uses the context ability of the large language model to correct errors in the execution. From generating an initial activity program from the input activity description to executing and self-correcting one by one using the instructions in the activity program, the system in this embodiment designs a complete solution process. Therefore, the method in this embodiment uses the large language model to automatically correct errors in the activity program based on scene execution feedback information, and can summarize the experience of error correction into general, action-level code for storage for self-correction before execution.
[0056] In this embodiment, the human activity program generation task requires inputting an initial scene S0 and activity description D, and then outputting an activity program P = {I i |i∈N}. Wherein an activity program contains N instructions, each instruction I i = [A i , O i1 , O i2 , K i ], including action A i , object O, and identifier K i determining whether to skip the instruction. If K i is 0, the instruction will be executed, and if K i is 1, the instruction will be skipped.
[0057] Three models are used in this embodiment, namely the task planning model, the program correction model, and the experience summary model.
[0058] As an example, the Scene aware APG (scene-aware model) trained in this embodiment is used as the task planning model, which is responsible for generating an initial activity program according to the initial scene and activity description. GPT3.5turbo is used as the program correction model, which is responsible for inputting error feedback and historical execution information and outputting activity program correction schemes. GPT4o is used as the experience summary model, which is responsible for inputting error correction history information and old defective action verification code and outputting a new optimized action verification code.
[0059] As Figure 2 shown, Figure 2 The overall process of closed-loop human activity program generation is shown in the figure. First, the scene information S0 and the activity description D need to be input in the initial stage of the task, and an initial activity program P = Planner(S0, D) is generated using the task planning model. Then, the instructions in the program are executed one by one in order. During this execution process, the context ability of the large language model is used to correct the errors in the execution, realizing the generation of an initial activity program from the input activity description, and the execution and self-correction of the instructions in the activity program one by one.
[0060] As Figure 1 shown, the embodiment of the present application provides a closed-loop human activity program generation method, comprising the following steps:
[0061] Step S200, check the verification code of the action corresponding to the activity program, if it is judged that the current action is executable, send it to the simulator for execution, if it is judged that the current action is not executable, modify the activity program using the verification code; wherein the verification code is a code summarized according to the error correction experience of the corresponding action in the model training process.
[0062] In this embodiment, after generating the initial activity program through the task planning model, in order to ensure that the activity program can run in the preset virtual environment, pre-execution error correction is needed, that is, first use the error correction code to check whether the instruction can be executed, if the execution fails, pre-correction will be performed to avoid errors.
[0063] Specifically, in one implementation manner of the embodiment, step S200 comprises the following steps:
[0064] Step S201, find the verification code of the action corresponding to the activity program from the program memory;
[0065] Step S202, according to the found verification code, judge whether the current action is executable, if it is judged that the current action is not executable, generate a code update scheme, and modify the activity program using the verification code; if it is judged that the current action is executable, send it to the simulator for execution.
[0066] In this embodiment, as Figure 3 shown, Figure 3 The detailed reasoning process of the embodiment method is shown in the figure, which contains three key stages: initialization, pre-execution error correction, and post-execution error correction.
[0067] In the initial stage of the task, an initial activity program P = Planner(S0, D) is generated using a task planning model, and then the instructions in the program are executed one by one in sequence. Before the execution of each instruction, pre-execution error correction is performed, that is, according to the action A i in the instruction, the corresponding verification code is found in the procedural memory to determine whether error correction is needed. If error correction is needed, the activity program is updated according to the error correction logic of the verification code, that is, the current action instruction is skipped; if error correction is not needed, it is directly sent to the simulation environment for execution.
[0068] As an example, the pre-execution error correction process in the embodiment is as follows:
[0069] If the verification code determines that the instruction will be executed incorrectly, a code update scheme ΔP i = V(S i , I i ) is generated first, and then the activity program is updated using the code update scheme and is sent to the simulation environment for execution. As shown in the example in Figure 2 , the action instruction of the activity program is to turn on the light, and the digital human intends to turn on the light. However, the verification code detects that the light is already on, so the pre-execution error correction process is performed on the instruction to turn on the light, that is, a skip flag is added to the instruction to turn on the light. Subsequently, the instruction is skipped and the execution continues.
[0070] In the embodiment, in the process of pre-execution error correction, if the verification code does not find an error in the instruction, the initial activity program is directly put into the simulation environment for execution; wherein the simulation environment is a virtual environment simulated based on initial scene information, for example, an indoor scene (a bedroom scene, a living room scene), an outdoor scene, or other work activity scenes.
[0071] In the embodiment, in the process of putting the activity program into the simulation environment for execution, if the execution in the simulation environment is successful, the state change information of the simulation environment is obtained, and if the instruction is executed incorrectly in the simulation environment, an error feedback information F is provided by the simulation environment to facilitate subsequent modification of the activity program.
[0072] As shown in Figure 1 , the embodiment of the present application provides a closed-loop human activity program generation method, which includes the following steps:
[0073] Step S300, check the execution state of the activity program. If the corresponding action can be successfully executed in the simulation environment, the state after execution returned by the simulation environment is obtained, and if the execution of the corresponding action fails, the activity program is modified again using a program correction model according to the error information returned by the simulation environment;
[0074] Step S400, output the final modified activity program.
[0075] Therefore, the method provided by the embodiment generates the activity program in a closed loop manner. During the execution of the activity program, if the execution in the simulation environment is successful, the state change information of the simulation environment is obtained, and if an instruction execution error occurs, the activity program is updated by using a large language model (i.e., a GPT3.5 turbo program correction model) to correct the error. In addition, a code-based memory model is provided in the embodiment. Once the error correction is successful, the error correction logic is recorded, so that the activity program can be continuously optimized according to the recorded error correction information in the future.
[0076] Specifically, in an implementation manner of the embodiment, step S300 includes the following steps.
[0077] Step S301, check the execution state of the activity program, and determine whether the corresponding action of the activity program can be successfully executed in the simulation environment.
[0078] Step S302, if the execution in the simulation environment is successful, the state change information of the simulation environment is obtained.
[0079] Step S303, if the execution in the simulation environment fails, the error information of the execution of the activity program in the simulation environment is obtained, and the activity program is modified again by using the program correction model according to the error information.
[0080] Specifically, in an implementation manner of the embodiment, the modification of the activity program by using the program correction model according to the error information in step S303 includes the following steps.
[0081] Step S303a, within the range of the set maximum number of error correction times after execution, a correction scheme is generated by using the program correction model according to the error information of the execution of the activity program in the simulation environment, the activity program is corrected according to the correction scheme, an updated activity program is obtained, and the corresponding action instruction is executed from the error position after the update.
[0082] Step S303b, determine whether the corrected action is successfully executed.
[0083] Step S303c, if the execution is successful, the next instruction in the activity program is executed until all instructions in the activity program are executed or the number of error correction times after execution reaches the upper limit.
[0084] In this embodiment, in a simulation environment, if the activity instruction execution fails, according to the information of the execution error, a large language model is used as a corrector to output a correction scheme of the executed activity program, and the activity program is updated with the correction scheme to correct the error. If the execution is successful, the next instruction in the program is executed. Until all instructions in the activity program are executed or the number of error corrections after execution reaches the upper limit, the activity ends.
[0085] In this embodiment, the reason for the execution error is mainly caused by the mismatch between the action and the scene state. For example, if the role is already in a standing state, the execution of [STANDUP] (stand up) will fail. For example, an apple is in a closed container, and if the execution of [GRAB] <apple>The error correction method in this embodiment is to skip the current redundant instructions (for example, if the character is already standing, the standing instruction should be skipped), or to insert some additional instructions before the incorrect instruction so that the original incorrect instruction can be successfully executed (for example, before the instruction to grab an object in a closed container, insert an instruction to open the container).
[0086] As an example, the post-execution error correction process in this embodiment is as follows:
[0087] If the verification code does not find any instruction errors, it is directly put into the simulation environment for execution. During the execution of the active program, this embodiment uses the program correction model, inputs the historical execution information, and outputs a modification plan ΔP for the active program. i =Corrector(S0,D,[I0,F0],...[I i ,F i ]), and then use the modification plan to update the active program, and then continue to execute from the error location. Figure 3 As shown, in Figure 3 In the example above, the digital human attempted to grab a toy from a drawer, but the drawer was closed, causing an error. The program then corrected the model by inserting an instruction to open the drawer, allowing the human to continue executing successfully.
[0088] In one implementation of this embodiment, the present invention provides a closed-loop human activity program generation method, further comprising the following steps:
[0089] Step S501: After each training session, obtain the action verification code corresponding to the action instruction executed with error in the simulation environment to obtain the old action verification code with defects;
[0090] Step S502, obtaining experience information of successful error correction during the training process from the error correction history information;
[0091] Specifically, in one implementation of this embodiment, the experience information of successful error correction in the reasoning process is obtained from the error correction history information, including: obtaining the execution information of the action instruction from the execution error to the successful re-execution or skipping, and obtaining the experience information of successful error correction.
[0092] Step S503 : Outputting a new optimized motion verification code using an experience summary model based on the old motion verification code with defects and the experience information of successful error correction.
[0093] In this embodiment, if Figure 4 As shown, Figure 4 An example of the learning process of the method provided in this embodiment is shown in FIG.
[0094] After each training session, if an error occurs during the execution of a command in the simulation environment, it means that the action verification code corresponding to the command is defective and the error has not been discovered and corrected. Initially, for each action, the experience of successful error correction during the training process is collected (error correction experience refers to the process from an action execution error to the action being successfully re-executed / skipped). The experience summary model is used to optimize the action verification code V. new =Summarizer(S j ,D,[I j ,F j ],...[I i ,F i ],V old ). In this way, the method provided in this embodiment has the ability to learn autonomously and can continuously optimize the verification code to update the program before the execution error occurs to avoid errors, thereby greatly improving execution efficiency.
[0095] like Figure 3 As shown, Figure 3 The example provided in shows that the code for verifying the grasping action did not have the logic to verify whether the object to be grasped was placed in a closed container, which led to execution failure. After the failure, the program corrected the model's reasoning and inserted the instruction to open the container. The subsequent re-execution of the grasping instruction was successful. Figure 4 As shown, Figure 4 This error correction experience is input into the experience summary model to optimize the action verification code so that it has the logic to verify whether the object is placed in a closed container and has corresponding error correction measures.
[0096] The experiment in this embodiment is divided into a training phase and a testing phase. The training phase allows learning after inference, while the testing phase does not. In the training phase, 100 samples are randomly selected from the training set, and inference and learning are performed on these 100 samples.
[0097] The method in this embodiment was experimented on a virtual home simulation environment. The main evaluation indicators of the task were the rationality and executability of the activity program. Rationality refers to the relevance between the activity program and the activity description at the semantic level, while executability indicates whether the activity program can be successfully executed in the target scenario instance.
[0098] This example randomly selects 100 samples from the original training set for learning and tests them on the complete 2415 samples in the test set. Figure 5 As shown, the test results prove that the executability can be improved from 0.767 to 0.993 and the completion degree can be improved from 0.573 to 0.756 based on the best method Scene aware APG and the method in the embodiment, and the error correction ability is significantly improved.
[0099] It is worth mentioning that the task planning module in the embodiment can have different network implementations. In the embodiment, Scene aware APG is used as the network. In other implementation manners, it can be replaced with some other network, such as RAG or GPT4. The program correction module and the experience summary module can also be replaced with other large language models, such as GPT3, GPT4, and other versions. These replacement schemes based on the embodiment should belong to the protection scope of the embodiment.
[0100] The technical solution of the embodiment achieves the following technical effects:
[0101] The embodiment generates an initial activity program through a task planning model, checks verification code of a corresponding action of the activity program, and sends the activity program to a simulator for execution when the current action is executable or modifies the activity program using the verification code when the current action is not executable. When the corresponding action is successfully executed, the state after execution returned by the simulation environment is obtained, or when the corresponding action fails, the activity program is modified again using a program correction model according to error information returned by the simulation environment, and the finally modified activity program is output. The embodiment provides a method for automatically generating an activity program in a closed-loop manner according to a user input activity description, which can dynamically correct the activity program during execution and greatly improve the executability of the activity program.
[0102] Exemplary device
[0103] A task planning module is configured to input initial scene information and an activity description, and generate an initial activity program through a task planning model.
[0104] A pre-execution error correction module is configured to check verification code of a corresponding action of the activity program, and send the activity program to a simulator for execution when the current action is executable or modify the activity program using the verification code when the current action is not executable. The verification code is a code summarized according to error correction experience of the corresponding action during model training.
[0105] A post-execution error correction module is configured to check an execution state of the activity program, and obtain a state after execution returned by a simulation environment when the corresponding action is successfully executed in the simulation environment or modify the activity program again using a program correction model according to error information returned by the simulation environment when the corresponding action fails.
[0106] The error correction experience summary module is configured to summarize the experience of the corresponding action from the execution error to the successful re-execution in the training process, and generate the check code of the corresponding action for the pre-execution error correction in the reasoning process.
[0107] The embodiment achieves the following technical effects through the above technical solutions:
[0108] The embodiment generates the initial activity program through the task planning model, checks the check code of the corresponding action of the activity program, and inputs the activity program into the simulator for execution when the current action is executable, or modifies the activity program using the check code when the current action is not executable; and when the corresponding action is successfully executed, the state after execution returned by the simulation environment is obtained, or when the corresponding action fails to be executed, the activity program is modified again using the program correction model according to the error information returned by the simulation environment, and the final modified activity program is output; the embodiment provides a method for automatically generating an activity program in a closed loop manner according to the activity description input by a user, which can dynamically correct the activity program during the execution process, and greatly improves the executability of the activity program.
[0109] Based on the above embodiment, the application further provides a terminal, and a principle block diagram of the terminal can be as shown in Figure 6 .
[0110] The terminal includes a processor, a memory, an interface, a display screen and a communication module connected through a system bus; wherein the processor of the terminal is configured to provide computing and control capabilities; the memory of the terminal includes a storage medium and an internal memory; the storage medium stores an operating system and a computer program; the internal memory provides an environment for the operation of the operating system and the computer program in the storage medium; the interface is configured to connect external devices; the display screen is configured to display corresponding information; and the communication module is configured to communicate with a cloud server or other devices.
[0111] The computer program is executed by the processor to implement the operations of the closed loop human activity program generation method.
[0112] Those skilled in the art can understand that, Figure 6 The principle block diagram shown in the above embodiment is only a block diagram of part of the structure related to the application scheme, and does not constitute a limitation on the terminal to which the application scheme is applied, and the specific terminal can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0113] In one embodiment, a terminal is provided, which includes a processor and a memory, and the memory stores a closed loop human activity program generation program, and the closed loop human activity program generation program is executed by the processor to implement the operations of the above closed loop human activity program generation method.
[0114] In one embodiment, a storage medium is provided, wherein the storage medium stores a closed-loop human activity program generation program, and the closed-loop human activity program generation program, when executed by a processor, is configured to implement the operations of the above closed-loop human activity program generation method.
[0115] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in the embodiments of the present application can include non-volatile and volatile memory.
[0116] In summary, the present application provides a closed-loop human activity program generation method and system, including: inputting initial scene information and activity description, generating an initial activity program through a task planning model; checking the verification code of the action corresponding to the activity program, if it is judged that the current action is executable, it is sent to the simulator for execution, if it is judged that the current action is not executable, the activity program is modified using the verification code; checking the execution state of the activity program, if the corresponding action can be successfully executed in the simulation environment, the state after execution returned by the simulation environment is obtained, if the corresponding action fails to execute, according to the error information returned by the simulation environment, the activity program is modified again using the program correction model; outputting the final modified activity program. The present application provides a method for automatically generating an activity program in a closed-loop manner according to the activity description input by the user, which can dynamically correct the activity program during execution, and greatly improves the executability of the activity program.
[0117] It should be understood that the application of the present application is not limited to the above examples, and those skilled in the art can make improvements or changes according to the above description, and all these improvements and changes shall belong to the protection scope of the appended claims of the present application.< / apple> < / computer> < / chair> < / chair>
Claims
1. A closed loop human activity program generation method, characterized by, The method comprises the following steps: input initial scene information and activity description, and generate an initial activity program through a task planning model; check a verification code of a corresponding action of the activity program, if it is judged that the current action is executable, send it to a simulator for execution, if it is judged that the current action is not executable, modify the activity program using the verification code; wherein the verification code is a code summarized according to error correction experience of the corresponding action in the model training process; check the execution state of the activity program, if the corresponding action can be successfully executed in the simulation environment, obtain the state returned by the simulation environment after execution, if the corresponding action fails to execute, according to the error information returned by the simulation environment, use a program correction model to modify the activity program again; output the final modified activity program; the step of checking the execution state of the activity program, if the corresponding action can be successfully executed in the simulation environment, obtaining the state returned by the simulation environment after execution, if the corresponding action fails to execute, according to the error information returned by the simulation environment, using a program correction model to modify the activity program again, comprises: check the execution state of the activity program, and judge whether the corresponding action of the activity program can be successfully executed in the simulation environment; if successfully executed in the simulation environment, obtain the state change information of the simulation environment; if the execution fails in the simulation environment, obtain the error information of the activity program in the simulation environment, and according to the error information, use the program correction model to modify the activity program again; the step of using the program correction model to modify the activity program again according to the error information, comprises: within the range of the set maximum execution error correction times, according to the error information of the activity program in the simulation environment, using the program correction model to generate a correction scheme, and correcting the activity program according to the correction scheme, obtaining an updated activity program, and continuing to execute the corresponding action instruction from the error position after updating; judge whether the corrected action is successfully executed; if successfully executed, continue to execute the next instruction in the activity program until all instructions in the activity program are executed or the error correction times after execution reach the upper limit; the method further comprises: after each training, obtain the action verification code corresponding to the action instruction that has executed an error in the simulation environment, to obtain the old action verification code with defects; obtain experience information successfully corrected in the training process from the error correction history information; according to the old action verification code with defects and the experience information successfully corrected, output a new optimized action verification code using an experience summary model.
2. The closed loop human movement program generation method of claim 1, wherein, the step of checking the verification code of the corresponding action of the activity program, if it is judged that the current action is executable, sending it to the simulator for execution, if it is judged that the current action is not executable, modifying the activity program using the verification code, comprises: find the verification code of the corresponding action of the activity program from the program memory; According to the found check code, it is judged whether the current action is executable, if the current action is judged to be not executable, a code updating scheme is generated, and the active program is modified using the check code; if the current action is judged to be executable, it is sent to the simulator for execution.
3. The closed loop human movement program generation method of claim 1, wherein, The experience information of successful error correction in the training process is obtained from the error correction history information, including: The execution information of the action instruction from the execution error to the re-execution success or skipping is obtained, and the experience information of successful error correction is obtained.
4. A closed loop human movement program generation system for implementing the closed loop human movement program generation method according to any one of claims 1 to 3, characterized by Including: A task planning module is configured to input initial scene information and activity description, and generate an initial activity program through a task planning model; An execution pre-correction module is configured to check a check code of the action corresponding to the activity program, if the current action is judged to be executable, it is sent to the simulator for execution, if the current action is judged to be not executable, the activity program is modified using the check code; wherein the check code is a code summarized according to the error correction experience of the corresponding action in the model training process; An execution post-correction module is configured to check the execution state of the activity program, if the corresponding action can be successfully executed in the simulation environment, the state after execution returned by the simulation environment is obtained, if the corresponding action fails to execute, the activity program is modified again using a program correction model according to the error information returned by the simulation environment; An error correction experience summary module is configured to summarize the experience of the corresponding action from the execution error to the re-execution success in the training process, and generate a check code of the corresponding action, which is used for the execution pre-correction in the reasoning process.
5. A terminal, characterized by comprising: Including: A processor and a memory, the memory stores a closed-loop human activity program generation program, the closed-loop human activity program generation program is executed by the processor to realize the operation of the closed-loop human activity program generation method in any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a closed-loop human activity program generation program, the closed-loop human activity program generation program is executed by the processor to realize the operation of the closed-loop human activity program generation method in any one of claims 1-3.
Citation Information
Patent Citations
Code testing method and device, all-in-one machine and computer program product
CN117215962A
RPA process execution code generation method and device based on AI and AI Agent
CN118444894A