Generation method of intelligent agent recognizable structured language

By generating structured text from a large model to guide intelligent agent devices in performing tasks, the problems of high accuracy and cost in intelligent agent task planning in dynamic environments are solved, and more efficient task execution is achieved.

CN121145798AActive Publication Date: 2025-12-16HUAZHONG UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511130761.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2025-12-16
Estimated Expiration
2045-08-13

AI Technical Summary

Technical Problem

Existing intelligent agent task planning techniques struggle to accurately plan user natural language needs tasks. Traditional methods are unstable in dynamic environments, and data-driven models suffer from high training costs, insufficient generalization, and poor interpretability.

Method used

A method for generating structured language that can be recognized by intelligent agents is adopted. By concatenating the requirements of natural language tasks with external environmental state parameters through a large model, and using prompt word module, decomposition planning agent module, modification and rewriting agent module, atomic event classifier and atomic event extraction module, structured text is generated to guide intelligent agent devices to perform tasks.

Benefits of technology

It improves the accuracy and flexibility of task planning, enabling better execution of user-required tasks in dynamic environments, and reduces the error rate and training cost of large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121145798A_ABST
    Figure CN121145798A_ABST
Patent Text Reader

Abstract

The invention discloses a method for generating an intelligent agent recognizable structured language, and belongs to the technical field of intelligent agent control. According to the method, a natural language task requirement input by a current user and external environment state parameters collected by an external environment detection module and related to the natural language task requirement are input into a large model; and finally, obtaining a structured text for intelligent agent equipment corresponding to the natural language task demand to read and execute a corresponding user demand task. According to the generation method of the intelligent agent recognizable structured language, cue word module splicing and context learning are fully utilized, a mode of combining a language large model and event extraction is adopted, an atomic event sequence is generated and automatically modified, intelligent task planning is effectively achieved, and the planning accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of agent control, and more particularly relates to a method for generating an agent recognizable structured language. BACKGROUND

[0002] With the rapid development of artificial intelligence and large language models, agents (such as autonomous robots, drones, intelligent vehicles, etc.) are increasingly widely used in industrial automation, smart logistics, smart cities, and other fields. The core capability of an agent relies on efficient and flexible task planning technology, which aims to achieve autonomous task execution under multiple objectives and multiple constraints through dynamic environment perception, resource allocation, and decision optimization. However, as application scenarios become more complex and large-scale, traditional task planning methods face significant challenges in real-time performance, robustness, and collaborative efficiency, and technological innovation is urgently needed to break through existing bottlenecks.

[0003] Currently, agent task planning technology is mainly based on two types of methods: traditional rule-driven algorithms and data-driven models.

[0004] Traditional methods such as state machines and heuristic search plan task steps through path optimization search, which require reliance on artificial preset rules. Although they perform stably in structured environments, they are difficult to adapt to dynamic open scenarios, such as sudden obstacles and changes in task objectives, and have poor handling of continuous value, ultimately leading to inaccurate task planning. Data-driven models have environmental adaptation capabilities through deep learning and reinforcement learning, but they have high training costs, insufficient generalization, and poor interpretability, which also lead to low planning accuracy. SUMMARY

[0005] To address the above deficiencies or improvements of prior art, the present application provides a method for generating an agent recognizable structured language, which aims to solve the technical problem that existing agent task planning technology cannot accurately plan user natural language task requirements.

[0006] To achieve the above-mentioned purpose, according to one aspect of the present application, a method for generating an agent recognizable structured language is provided, comprising: inputting a current user input natural language task requirement and an external environment state parameter related to the natural language task requirement collected by an external environment detection module into a large model; The large model comprises, connected in sequence: a prompt word splicing module, a decomposition planning agent module, a modification rewriting agent module, an atomic event classifier, and an atomic event extraction module; wherein: The prompt word splicing module is configured to splice the built-in decomposition prompt word template with the natural language task requirement and the external environment state parameter to obtain an initial task prompt word; The decomposition planning agent module is configured to parse the initial task prompt word to obtain an initial atomic event sequence; The modification rewriting agent module is configured to adjust the initial atomic event sequence according to a built-in modification prompt word template to obtain a rewritten atomic event sequence, and determine whether the rewritten atomic event sequence meets preset requirements; if not, continue to adjust the rewritten atomic event sequence according to the modification prompt word template until a final atomic event sequence meeting the preset requirements is obtained; The atomic event classifier is configured to classify the final atomic event sequence to obtain a classification result; The atomic event extraction module is configured to extract corresponding event parameters from each atomic event in the final atomic event sequence according to an event template matched by the classification result, and convert the event parameters into structured text, so as to be read by an intelligent agent device corresponding to the natural language task requirement and execute a corresponding user demand task.

[0007] In one of the embodiments, the prompt word splicing module is configured to splice the received natural language task requirement and the external environment state parameter transmitted by the external environment detection module into corresponding blank parts of the decomposition prompt word template respectively to obtain the initial task prompt word.

[0008] In one of the embodiments, the decomposition planning agent module is configured to perform task decomposition and planning on the initial task prompt word to obtain a candidate atomic event sequence with a number of samples meeting a preset requirement, and verify and select a plurality of initial atomic events from the candidate atomic event sequence to construct the initial atomic event sequence.

[0009] In one of the embodiments, the requirements of the final atomic event sequence include: an atomic event type and parameters meeting the requirements of a task decomposition prompt word, a natural language description requirement of the atomic event meeting the requirements of the task decomposition prompt word, a trigger condition of the atomic event meeting the requirements of the task decomposition prompt word, and a requirement of meeting a shortest planning path to complete a user demand or a user task meeting the requirements of the decomposition prompt word.

[0010] In one of the embodiments, the final atomic event sequence includes a series of atomic events {E1, E2, E3, E4…En}. n The atomic event classifier includes a Bert-based encoding layer and a Softmax-based linear classification layer; Each event E i is input into the Bert-based encoding layer to encode each token in E i (i=1, 2, …, n), and the obtained encoding result is input into the linear classifier layer to obtain the classification result {C1, C2, C3, C4…Cn}. n}.

[0011] In one embodiment, the atomic event extraction module is configured to match the classification results {C1, C2, C3, C4…C n} with corresponding event templates {S1, S2, S3, S4…S n}, each event template S i including a template corresponding event category C i and a parameter sequence P i ; each atomic event E i in the event sequence and the corresponding event template S i are input into the atomic event extraction module; the event template S i can expose the event category, parameter number and type of the atomic event E i , thereby extracting the corresponding event parameters from the atomic event E i and converting them into structured text.

[0012] In one embodiment, the event parameters include continuous parameters and discrete parameters; The continuous parameters are parameters with continuous value ranges, which are converted into pure numbers and unified units by a cn2an library; the discrete parameters are parameters with discrete value ranges, which have a limited number of values, and the discrete parameters are classified and quantified by a Bert encoder plus a linear classifier.

[0013] According to another aspect of the present application, a user demand task execution method is provided, comprising: generating structured text using the intelligent agent recognizable structured language generation method; inputting the structured text into an intelligent agent device corresponding to a natural language task demand, so that the corresponding user demand task is read and executed.

[0014] According to another aspect of the present application, an electronic device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the intelligent agent recognizable structured language generation method when executing the computer program.

[0015] According to another aspect of the present application, a computer readable storage medium is provided, which stores a computer program, and the computer program implements the steps of the intelligent agent recognizable structured language generation method when executed by a processor.

[0016] Overall, the above technical solutions conceived by the present application can achieve the following beneficial effects compared with the prior art: (1) The application provides a method for generating a structured language recognizable by an intelligent agent, which inputs the natural language task requirement input by the current user and the external environment state parameter related to the natural language task requirement collected by the external environment detection module into a large model, and finally obtains a structured text, so that the intelligent agent device corresponding to the natural language task requirement reads and executes the corresponding user demand task. It fully utilizes the prompt word module splicing and context learning, adopts the combination of large language model and event extraction, generates atomic event sequence and automatically modifies, effectively realizes intelligent task planning, and improves the accuracy of task planning.

[0017] (2) The prompt word splicing module of the present scheme splices the received natural language task requirement and the external environment state parameter into the corresponding blank part of the decomposition prompt word template, which takes into account different external environment conditions and different execution step sequences for the same task. The advantage is that the current external environment status can be more flexibly referenced, and more accurate decomposition results can be given in combination with the user's natural language task.

[0018] (3) The decomposition planning agent module of the present scheme decomposes and converts the initial task prompt word to obtain a candidate atomic event sequence with a number of samples conforming to the preset sampling number, and verifies and selects the initial atomic event sequence from the candidate atomic event sequence. This design takes into account the "illusion" problem of the large model, and the task decomposition result of single inference processing often has many mistakes. The advantage is that multiple inference results can be considered comprehensively, so that the generated initial atomic event sequence has fewer errors, and the burden of subsequent modification and rewriting process can be reduced.

[0019] (4) The requirements of the final atomic event sequence of the present scheme include multiple requirements. This design takes into account the "illusion" problem and long context problem of the large model, which makes the large model unable to well consider various considerations, especially the considerations not mentioned in the prompt word. The large model basically cannot consider it. The advantage is that the task requirements and considerations can be clearly specified, so that the large model has fewer errors in the modification and rewriting process.

[0020] (5) The atomic event classifier of the present scheme includes a Bert-based encoding layer and a Softmax-based linear classification layer. This design takes into account that this is the most commonly used and effective classification method, and the advantage is that it reduces the complexity of task decomposition planning.

[0021] (6) The present scheme inputs each atomic event E i and the corresponding event template S i into the atomic event extraction module; the event template S i can expose the event category, parameter number and type of the atomic event E i , so that the atomic event Ei The corresponding event parameters are extracted and converted into structured text; this design considers improving the accuracy of extracting atomic event parameters, and the advantage is that the event type of the exposed atomic event is matched with the event template in advance, which can improve the accuracy of extracting parameters.

[0022] (7) The present scheme is converted into pure numbers and unified units through the cn2an library; the discrete parameter is a parameter with a discrete value range, and the number of values is limited, and the discrete parameter is classified and quantified through the Bert encoder plus linear classifier; this design considers that the processing methods of continuous parameters and discrete parameters are different, and the advantage is that continuous parameters only need to be extracted and converted into pure numbers, and do not need to be classified, and the processing cost is lower. BRIEF DESCRIPTION OF DRAWINGS

[0023] Figure 1 is a logic diagram of a method for generating a structured language recognizable by an intelligent agent provided by embodiment 1 of the present application. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical scheme and advantages of the present application clearer and more apparent, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0025] Embodiment 1 The embodiment provides a method for generating a structured language recognizable by an agent, including: inputting a natural language task requirement input by a current user and an external environment state parameter related to the natural language task requirement collected by an external environment detection module into a large model. The large model includes a prompt word splicing module, a decomposition planning agent module, a modification rewriting agent module, an atomic event classifier and an atomic event extraction module connected in sequence. The prompt word splicing module is used for splicing a built-in decomposition prompt word template with the natural language task requirement and the external environment state parameter to obtain an initial task prompt word. The decomposition planning agent module is used for analyzing the initial task prompt word to obtain an initial atomic event sequence. The modification rewriting agent module is used for adjusting the initial atomic event sequence according to a built-in modification prompt word template to obtain a rewritten atomic event sequence, and judging whether the rewritten atomic event sequence meets a preset requirement. If not, the modification rewriting agent module continues to adjust the rewritten atomic event sequence according to the modification prompt word template until a final atomic event sequence meeting the preset requirement is obtained. The atomic event classifier is used for classifying the final atomic event sequence to obtain a classification result. The atomic event extraction module is used for extracting corresponding event parameters from each atomic event in the final atomic event sequence according to an event template matched by the classification result and converting the event parameters into structured text, so as to be read by an agent device corresponding to the natural language task requirement and to execute a corresponding user demand task.

[0026] For example, taking the aforementioned intelligent device as a cooking machine, the corresponding natural language task requirement input by the current user could be "Please make scrambled eggs with tomatoes." The external environment state parameters collected by the external environment detection module could be "Current location: kitchen, ingredients: tomatoes, eggs, equipment: pot, bowl...". The prompt word concatenation module concatenates the built-in decomposed prompt word template with the natural language task requirement and the external environment state parameters to obtain the initial task prompt word, specifically referring to "You are a cooking machine, the recipes you can make are... the precautions for making these dishes are... the current external environment state is... the current user requirement is: Please make scrambled eggs with tomatoes." The decomposed planning proxy module parses the initial task prompt word to obtain the initial atomic event sequence, specifically referring to "1. Wash tomatoes 2. Cut tomatoes 3. Beat eggs 4. Heat oil in a pan 5. Add tomatoes 6. Add eggs 7. Stir-fry 8. Add salt 9. Remove from heat." The modification and rewriting proxy module specifically works by iteratively checking the initial atomic event sequence and performing operations such as insertion, modification, deletion, reordering, and rewriting. The atomic event classifier classifies the final atomic event sequence to obtain a classification result; specifically, it classifies each step of the final atomic event sequence, such as: washing a certain type, putting into a certain type, etc. The atomic event extraction module specifically works by extracting parameters for each atomic event. For example, the classification result of "1. Washing tomatoes" is "washing a certain type" event, and the corresponding event template is matched as "Event category: washing a certain type, parameter: thing". By inputting the atomic event template and atomic event into the atomic event extraction module, the parameters can be extracted, that is, "1. Washing tomatoes" is transformed into "Event category: washing a certain type, thing: tomato".

[0027] For example, the intelligent device can also be a household robot. The corresponding natural language task requirement input by the current user could be "Please wash the dirty clothes." The external environment detection module can collect external environment state parameters such as "Washing machine status: off, clothes status: dirty, clothes location: sofa, your location: coffee table...". The prompt word concatenation module concatenates the built-in decomposed prompt word template with the natural language task requirement and external environment state parameters to obtain the initial task prompt word, specifically "You are a household robot, and the chores you can do are... The precautions for doing these chores are... The current external environment state is... The current user requirement is: Please wash the dirty clothes." The decomposed planning agent module parses the initial task prompt word to obtain the initial atomic event sequence, specifically "1. Move to the sofa 2. Pick up the dirty clothes 3. Move to the washing machine 4. Put down the dirty clothes 5. Move the washing machine 6. Wait for the washing machine to finish 7. Pick up the clean clothes 8. Move to the balcony 9. Hang the clothes to dry." The modification and rewriting agent module specifically works by iteratively checking the initial atomic event sequence and performing operations such as insertion, modification, deletion, reordering, and rewriting. The atomic event classifier classifies the final atomic event sequence to obtain classification results; specifically, it classifies each step of the final atomic event sequence, such as moving to a certain location, picking up a certain type, etc. The atomic event extraction module's specific working process includes extracting parameters for each atomic event. For example, the classification result of "1. Move to the sofa" is "Move to a certain location" event, and the corresponding event template is matched as "Event Category: Move to a certain location, Parameter: Location". By inputting the atomic event template and atomic event into the atomic event extraction module, the parameters can be extracted, thus transforming "1. Move to the sofa" into "Event Category: Move to a certain location, Location: Sofa".

[0028] Figure 1 A flowchart illustrating a method for generating structured language recognizable by an intelligent agent, provided in an embodiment of the present invention. (See also...) Figure 1 The method for generating structured language that can be recognized by intelligent agents includes the following operations: concatenation of prompt words - generation of initial atomic event sequences - rewriting of atomic event sequences - extraction of events to generate structured text.

[0029] In a preferred embodiment, the prompt word splicing module is used to splice the received natural language task requirements and the external environment status parameters transmitted by the external environment detection module into the corresponding empty parts of the decomposed prompt word template to obtain the initial task prompt word.

[0030] In the cue word concatenation operation, the cue word mainly consists of five parts: instruction, global information, initial observation, in-context examples, and user task.

[0031] The guidance information provides an overall description of the scope and domains involved in the planning task, enabling better utilization of the inherent knowledge of the large model. To better generate atomic event sequences, the guidance information specifies the categories of generated atomic events and their matching with the classification categories of subsequent atomic event classifiers. Global information describes the template for each type of atomic event, reducing the diversity of descriptions for the same event and improving the accuracy of subsequent atomic event classification and parameter extraction. In the atomic event template, the position of parameters is marked with "<>", and the text within the brackets describes the parameter type, facilitating the large model to fill in the corresponding parameters when generating atomic events using the event template. Following the atomic event template, the value range of each type of parameter is described. For discrete parameters, parameter options are listed; for continuous parameters, the value range is specified. In addition, the global information describes the triggering conditions for each type of atomic event, especially for atomic events with sequential execution requirements, further reducing the randomness of the large model's generation of atomic event sequences and improving the accuracy of the initial atomic event sequence. The initial environmental state represents the initial external environmental information. Information collected by an external perception module is converted into a dictionary for model task planning, generating atomic event sequences adapted to the external environment. Contextual learning examples demonstrate the application of all atomic event templates through practical cases. By providing different user task examples and the optimal atomic event sequence (Golden Plan), contextual learning examples effectively enable the large model to learn the key points mentioned earlier, including generating atomic events with natural language descriptions using atomic event templates, filling in the required parameters for atomic events with content from user tasks, and the triggering conditions and precautions for each type of atomic event. User tasks are marked with "Task:", and the generated steps are marked with sequence numbers.

[0032] It's worth noting that the context learning examples are also the optimal plan for providing example tasks under a specific initial environmental state. To maintain input simplicity, the initial environmental state of the context learning examples will be consistent with the aforementioned initial environmental state section. The user task will be directly concatenated from the user input. To fully leverage the advantages of context learning, the input user task will be directly concatenated after the new "Task:", facilitating the large model's direct output of the initial atomic event sequence, reducing the generation of other irrelevant content, and improving output simplicity.

[0033] In a preferred embodiment, the decomposition planning agent module is used to decompose the initial task prompt words and transform them into a sequence of candidate atomic events with a number that meets the preset number of samples, and to verify and select multiple initial atomic events from the candidate atomic event sequences to construct the initial atomic event sequence.

[0034] In the initial atomic event sequence generation operation, a decomposition programming proxy module is formed by selecting a base language model and setting its temperature, top-p kernel sampling, and number of samples (N). The proxy model takes the concatenated prompt words as input, outputs N candidate atomic event sequences, and selects the best sequence as the initial atomic event sequence.

[0035] The choice of the base language model affects the knowledge contained in the model itself, which in turn affects the accuracy of subsequent task decomposition and planning. In this method, the GPT-4o model developed by OpenAI is used as the base language model.

[0036] The temperature parameter controls the randomness and creativity of the text. At low temperatures (0.1~0.5), the model generates more conservative and deterministic results, suitable for scenarios requiring factual accuracy and rigorous structure. At high temperatures (0.7~1.0), the model generates more random and creative results, suitable for scenarios requiring creativity. Since the task has been thoroughly described in the prompt word concatenation process, reducing the illusion phenomenon of the proxy model, and considering the possibility of unclear user task parameter descriptions requiring the proxy model to fill in default parameters, the temperature parameter is set to 0.8 in this method.

[0037] Kernel sampling is used to dynamically control the range of subsequent words, balancing diversity and rationality. By setting a probability threshold p, the model samples only from the smallest set of words with a cumulative probability exceeding p, avoiding irrelevant words with low probabilities while preserving diversity. In this method, kernel sampling is set to 0.95.

[0038] The number of samples is used to control the number of times the surrogate model outputs for a single input. By generating and integrating outputs through multiple iterations, the randomness and illusion problems of a single output can be effectively reduced, resulting in a more accurate sequence of initial atomic events. In this method, the number of samples is set to 25, i.e., N=25.

[0039] After configuring the proxy model parameters, the proxy model generates N candidate sequences of initial atomic task sequences by inputting the concatenated prompt words. Since each candidate atomic sequence only meets the requirements to a certain extent—namely, meeting the atomic event types and parameters specified by the task decomposition prompt words, the natural language description requirements for atomic events specified by the task decomposition prompt words, the triggering conditions for atomic events specified by the task decomposition prompt words, and the requirement to complete the user's needs or tasks by following the shortest planning path specified by the task decomposition prompt words—to obtain the optimal sequence by combining the compliant parts of the N candidate atomic sequences, the N candidate atomic sequences are integrated using a multi-way tree, with identical steps at the same level represented by the same node. The proxy model then selects the optimal path from the integrated multi-way tree, which becomes the initial atomic event sequence L0.

[0040] As a preferred implementation, the requirements for the final atomic event sequence include: conforming to the atomic event types and parameters specified in the task decomposition prompts, conforming to the natural language description requirements for atomic events specified in the task decomposition prompts, conforming to the triggering conditions for atomic events specified in the task decomposition prompts, and conforming to the requirement of completing user needs or user tasks by satisfying the shortest planning path specified in the decomposition prompts.

[0041] In the atomic event sequence rewriting operation, the initial atomic event sequence L0 is input into the modification and rewriting agent module. Task sequence modification prompts guide the agent model to modify and rewrite, resulting in a rewritten atomic event sequence. This process is repeated iteratively to obtain new rewritten atomic event sequences until a termination condition is met: either the agent model deems further rewriting unnecessary, or the iteration count reaches a preset value, at which point iteration stops. The last generated rewritten atomic event sequence is taken as the final atomic event sequence L1. The task sequence modification prompts refer to the aforementioned task decomposition prompts and consist of guidance information, global information, initial environment state, user task, and initial atomic sequence. Due to different tasks, the guidance and global information portions of the task sequence modification prompts are modified compared to the task decomposition prompts. The parameter settings of the atomic event modification agent model are consistent with those of the aforementioned decomposition planning agent module.

[0042] In a preferred embodiment, the final atomic event sequence includes a series of atomic events {E1, E2, E3, E4…E...} n The atomic event classifier consists of a BERT-based encoding layer and a Softmax-based linear classification layer. Each event E... i The input is fed into a BERT-based coding layer to make it responsive to E. i Each token in (i=1,2,…,n) is encoded, and the encoded result is input into a linear classifier layer to obtain the classification result {C1,C2,C3,C4…C…}. nFurthermore, the atomic event extraction module is used to extract data from the classification results {C1, C2, C3, C4…C…}. n Match the corresponding event template {S1, S2, S3, S4…S} n}, each event template S i Including the event category C corresponding to the template i and parameter sequence P i Each atomic event E in the event sequence i and the corresponding event template S i Input into the atomic event extraction module. Event template S i Able to expose atomic events E i The event category, number of parameters, and type, thus from the atomic event E i Extract the corresponding event parameters and convert them into structured text.

[0043] In the process of extracting events to generate structured text, the final atomic event sequence L1 includes a series of events {E1, E2, E3, E4…E… n The input is fed into the atomic event classifier to obtain the classification result sequence {C1, C2, C3, C4…C…}. n Then, through the classification result sequence {C1, C2, C3, C4…C…} n Match the corresponding event template sequence {S1, S2, S3, S4…S} n}, and combine (E) i ,S i The data is input into the atomic event extraction module, and the output is structured, resulting in the final result R, which includes the event classification result and extraction parameters. i Let i = 1, 2, ..., n. The final result is the structured atomic event types and parameter sequence {R1, R2, R3, R4…R...}. n The atomic event classifier consists of a BERT-based text encoding module and a Softmax-based classification layer, fine-tuned and trained using a training set. The BERT encoder converts the text sequence E of atomic events into... i ={x1…x n Encode it into a context representation vector H, and take the vector h at the [CLS] position. [CLS] As a sentence representation, it is then input into the Softmax classification layer to calculate the category probability distribution, i.e. The category with the highest probability is selected as the classification result C. i , i=1,2,…,n.

[0044] The atomic event extraction module is based on the UIE model fine-tuned after training, and extracts (E) events. i , S iThe UIE uses a structured pattern hint mechanism to first present the event type and its parameter structure S. i Convert to a linearized suggestion template and append it to the input text E i The preceding text serves as the context for the decoder, explicitly guiding the decoding process and improving the accuracy and generalization ability of event parameter extraction.

[0045] The structuring of the extracted results is determined by the properties of the parameters. For continuous parameters, the cn2an library converts them into pure numbers and standardizes the units. For discrete parameters, a BERT encoder combined with a linear classifier is used for classification and quantization. The final result is structured text that the agent can recognize.

[0046] In a preferred implementation, the event parameters include continuous parameters and discrete parameters. Continuous parameters are parameters with a continuous value range, which are converted into pure numbers and standardized in units using the cn2an library. Discrete parameters are parameters with a discrete value range and a finite number of values, which are classified and quantified using a BERT encoder and a linear classifier.

[0047] Example 2 This embodiment provides a method for executing a user-required task, including: generating structured text using the method for generating structured language recognizable by an agent in Embodiment 1; and inputting the structured text into an agent device corresponding to the natural language task requirement, so that the agent device can read and execute the corresponding user-required task.

[0048] Example 3 This embodiment provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the method for generating intelligent agent-recognizable structured language in Embodiment 1.

[0049] Example 4 This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the method for generating an agent-recognizable structured language in Embodiment 1.

[0050] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for generating structured language that an intelligent agent can recognize, characterized in that, include: Input the current user's input of the natural language task requirements and the external environment state parameters related to the natural language task requirements collected by the external environment detection module into the large model; The large model comprises, in sequence: a prompt word concatenation module, a decomposition and planning proxy module, a modification and rewriting proxy module, an atomic event classifier, and an atomic event extraction module; wherein: The prompt word splicing module is used to splice the built-in decomposed prompt word template with the natural language task requirements and the external environment state parameters to obtain the initial task prompt word; The decomposition planning agent module is used to parse the initial task prompt words to obtain the initial atomic event sequence; The modification and rewrite proxy module is used to adjust the initial atomic event sequence according to the built-in modification prompt word template to obtain the rewritten atomic event sequence, and to determine whether the rewritten atomic event sequence meets the preset requirements. If it does not meet the preset requirements, the module continues to adjust the rewritten atomic event sequence according to the modification prompt word template until the final atomic event sequence that meets the preset requirements is obtained. The atomic event classifier is used to classify the final atomic event sequence to obtain a classification result; The atomic event extraction module is used to extract corresponding event parameters from each atomic event in the final atomic event sequence according to the event template matched by the classification result and convert them into structured text, so that the intelligent agent device corresponding to the natural language task requirement can read and execute the corresponding user requirement task.

2. The method for generating intelligent agent-recognizable structured language as described in claim 1, characterized in that, The prompt word splicing module is used to splice the received natural language task requirements and the external environment status parameters transmitted by the external environment detection module into the corresponding empty parts of the decomposed prompt word template to obtain the initial task prompt word.

3. The method for generating intelligent agent-recognizable structured language as described in claim 1, characterized in that, The decomposition planning agent module is used to decompose the initial task prompt words into a task and plan a sequence of candidate atomic events with a number that meets the preset sampling number, and to verify and select multiple initial atomic events from the candidate atomic event sequences to construct the initial atomic event sequence.

4. The method for generating intelligent agent-recognizable structured language as described in claim 3, characterized in that, The preset requirements corresponding to the final atomic event sequence include: conforming to the atomic event types and parameters specified by the task decomposition prompts, conforming to the natural language description requirements for atomic events specified by the task decomposition prompts, conforming to the triggering conditions for atomic events specified by the task decomposition prompts, and conforming to the requirement of completing user needs or user tasks by satisfying the shortest planning path specified by the decomposition prompts.

5. The method for generating intelligent agent-recognizable structured language as described in claim 1, characterized in that, The final atomic event sequence includes a series of atomic events {E1, E2, E3, E4…E}. n The atomic event classifier includes a BERT-based encoding layer and a Softmax-based linear classification layer. Each atomic event E i The input is fed into a BERT-based coding layer to make it responsive to atomic events E. i Each token in the algorithm is encoded, and the encoded result is input into the linear classifier layer to obtain the classification result {C1, C2, C3, C4…C}. n } 6. The method for generating intelligent agent-recognizable structured language as described in claim 5, characterized in that, The atomic event extraction module is used to extract data from the classification results {C1, C2, C3, C4…C…}. n Match the corresponding event template {S1, S2, S3, S4…S} n }, each event template S i Including event category C corresponding to the event template i and parameter sequence P i ; Each atomic event E in the event sequence i and the corresponding event template S i The event template S is input into the atomic event extraction module. i Able to expose atomic events E i The event category, number of parameters, and type, thus from the atomic event E i Extract the corresponding event parameters and convert them into structured text.

7. The method for generating intelligent agent-recognizable structured language as described in claim 6, characterized in that, The event parameters include continuous parameters and discrete parameters; The continuous parameters are parameters with continuous values, which are converted into pure numbers and have unified units using the cn2an library; the discrete parameters are parameters with discrete values ​​and a finite number of values, which are classified and quantified using a Bert encoder and a linear classifier.

8. A method for executing a user-required task, characterized in that, include: Structured text is generated using the method for generating intelligent agent-recognizable structured language as described in any one of claims 1-7; The structured text is input into the intelligent agent device corresponding to the natural language task requirements, so that it can read and execute the corresponding user-required task.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for generating an agent-recognizable structured language according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for generating an agent-recognizable structured language according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Text structuring method and system based on large language model

    CN117349275A

  • Method and device for training biological language model

    CN118898270A

  • Complex task disassembling, classifying and optimizing method and system

    CN120068985A

  • Question answering processing method and system, device and storage medium

    WO2025146589A1