Task interaction method and related apparatus, electronic device, and storage medium

By extracting the long-term memory graph and task structure graph of the target object, the target large model instruction is constructed, which solves the problem of insufficient response data accuracy of large language models in complex task scenarios and achieves higher generation accuracy and adaptability.

CN121902994BActive Publication Date: 2026-06-26IFLYTEK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
IFLYTEK CO LTD
Filing Date
2026-03-20
Publication Date
2026-06-26

Smart Images

  • Figure CN121902994B_ABST
    Figure CN121902994B_ABST
Patent Text Reader

Abstract

The application discloses a task interaction method and related device, electronic equipment and storage medium, comprising: based on the target object in the current interaction round input task execution request and the target object in the historical interaction round of historical interaction data feature extraction, get the state feature of the current interaction round; mapping the state feature to the task state space to obtain the target feature representing the task execution request reasoning path; based on the correlation between the target feature and the first graph feature of the long-term memory graph and the second graph feature of the task structure graph, extract the long-term memory sub-graph and the task structure sub-graph about the task execution request; based on the state feature, the long-term memory sub-graph and the task structure sub-graph, construct the target large model instruction; obtain the output data of the large language model responding to the target large model instruction as the response data of the task execution request. The above scheme can improve the generation accuracy of the task execution request response data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent interaction technology, and in particular to a task interaction method and related devices, electronic devices and storage media. Background Technology

[0002] With the continuous development of Large Language Model (LLM) technology, it has been widely used in many fields such as text generation, knowledge question answering, and office automation.

[0003] In existing technologies, to enable large language models to generate response data for task execution requests, it is necessary to construct large model instructions to guide the generation direction of the large language model. This is typically achieved by using a pre-built instruction template library, where task execution requests are directly populated into selected instruction templates. However, due to the fixed nature of the instruction template library, it is difficult to adapt to complex and ever-changing task scenarios, especially when facing novel or personalized task requests, where the accuracy of the generated response data fails to meet practical needs. Therefore, improving the accuracy of task execution request response data generation has become an urgent problem to be solved. Summary of the Invention

[0004] The main technical problem addressed by this application is to provide a task interaction method and related devices, electronic devices, and storage media that can improve the accuracy of generating task execution request and response data.

[0005] To address the aforementioned technical problems, the first aspect of this application provides a task interaction method, comprising: extracting features based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds to obtain the state features of the current interaction round, and acquiring the long-term memory graph and task structure graph of the target object; mapping the state features to the task state space to obtain target features representing the reasoning path of the task execution request; wherein, the task state space includes several task execution state vectors; extracting the long-term memory sub-graph and task structure sub-graph about the task execution request based on the correlation between the target features and the first graph feature of the long-term memory graph and the second graph feature of the task structure graph; constructing a target large model instruction based on the state features, the long-term memory sub-graph, and the task structure sub-graph; wherein, the target large model instruction is used to instruct the large language model to reference the state features, the long-term memory sub-graph, and the task structure sub-graph to generate response data for the task execution request; and acquiring the output data of the large language model in response to the target large model instruction as the response data for the task execution request.

[0006] To address the aforementioned technical problems, a second aspect of this application provides a task interaction device, comprising: an acquisition module, a reasoning module, an extraction module, a construction module, and an output module. The acquisition module is used to extract features based on the task execution request input by the target object in the current interaction round and the target object's historical interaction data from previous interaction rounds, obtaining the state features of the current interaction round, and acquiring the target object's long-term memory map and task structure map. The reasoning module is used to map the state features to a task state space to obtain target features representing the reasoning path of the task execution request; wherein the task state space includes several task execution state vectors. The extraction module is used to extract the long-term memory sub-graph and the task structure sub-graph for the task execution request based on the correlation between the target features and the first graph features of the long-term memory graph and the second graph features of the task structure graph, respectively. The construction module is used to construct the target large model instruction based on the state features, the long-term memory sub-graph, and the task structure sub-graph. The target large model instruction is used to instruct the large language model to refer to the state features, the long-term memory sub-graph, and the task structure sub-graph to generate response data for the task execution request. The output module is used to obtain the output data of the large language model in response to the target large model instruction, as the response data for the task execution request.

[0007] To address the aforementioned technical problems, a third aspect of this application provides an electronic device comprising at least a memory and a processor coupled to each other, wherein the memory stores at least program instructions, and the processor executes the program instructions to implement the task interaction method described in the first aspect.

[0008] To address the aforementioned technical problems, a fourth aspect of this application provides a computer-readable storage medium storing program instructions executable by a processor, the program instructions being used to implement the task interaction method of the first aspect described above.

[0009] The above scheme extracts features based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds to obtain the state features of the current interaction round. It also obtains the long-term memory graph and task structure graph of the target object and maps the state features to the task state space to obtain the target features representing the reasoning path of the task execution request. The task state space includes several task execution state vectors. Based on the correlation between the target features and the first graph features of the long-term memory graph and the second graph features of the task structure graph, the long-term memory sub-graph and task structure sub-graph of the task execution request are extracted. Based on the state features, long-term memory sub-graph, and task structure sub-graph, the target large model instruction is constructed. The target large model instruction is used to instruct the large language model to refer to the state features, long-term memory sub-graph, and task structure sub-graph to generate response data for the task execution request. The output data of the large language model in response to the target large model instruction is obtained as the response data for the task execution request. On the one hand, by utilizing the target object's long-term memory graph and task structure graph, combined with the state characteristics of the current interaction round, the target large-scale model instructions can be dynamically constructed. This helps to use the task structure regarding the task execution request and the target object's long-term memory of the task execution request as reference data, enabling personalized construction of the target large-scale model instructions. Furthermore, the graph-based reference data provides logically clear reference information for the construction of the target large-scale model instructions, improving their adaptability and accuracy, and consequently enhancing the accuracy of the response data output by the large language model. On the other hand, by mapping state features to the task state space and capturing the reasoning path of the task execution request, the target features representing the reasoning path can be used as the basis for association with the graph. This helps to refine the extraction logic of the sub-graphs based on the information provided by the reasoning path regarding sub-tasks and the processing logic between sub-tasks, improving the accuracy and completeness of extracting the long-term memory sub-graph and task structure sub-graph, further enhancing adaptability to complex task scenarios. Therefore, it can improve the accuracy of generating task execution request response data. Attached Figure Description

[0010] Figure 1 This is a flowchart illustrating an embodiment of the task interaction method of this application;

[0011] Figure 2 This is a schematic diagram of the framework of an embodiment of the task interaction device of this application;

[0012] Figure 3 This is a schematic diagram of the framework of an embodiment of the electronic device of this application;

[0013] Figure 4 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. Detailed Implementation

[0014] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0015] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0016] In this paper, the terms "system" and "network" are often used interchangeably. The term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Additionally, the slash " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this paper indicates two or more objects.

[0017] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0018] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the task interaction method of this application. It should be noted that the process operations in this embodiment can be performed by an electronic device with computing capabilities or related equipment containing electronic devices; no specific structure or type is limited herein. Specifically, this embodiment may include the following steps:

[0019] Step S11: Based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in the previous interaction rounds, feature extraction is performed to obtain the state features of the current interaction round, and the long-term memory map and task structure map of the target object are obtained.

[0020] In this embodiment, the form of the task execution request input by the target object in the current interaction round is not limited in this application. For example, it can be in the form of text, voice, or image. The language type involved in the task execution request is also not limited in this application. For example, it can be Chinese, English, or other languages. Historical interaction data includes, but is not limited to, the dialogue content, operation behavior, and related environmental parameters of the target object in past interactions.

[0021] In a specific implementation scenario, historical interaction data includes historical dialogue data and historical behavior data. Specifically, historical dialogue data can contain multi-turn dialogue records between the target object and the interaction system, including requests made by the target object and responses given by the interaction system. Historical behavior data can cover the specific operations performed by the target object during the interaction, such as clicks, selections, and input records.

[0022] In a specific implementation scenario, historical interaction data can be further expanded to include parameters related to the interaction environment of the historical interaction rounds, which are used to describe the background conditions when the interaction occurred, such as time, location, device type, or network status.

[0023] In a specific implementation scenario, interaction environment parameters for the current and historical interaction rounds can also be obtained, including network latency, user interface layout, and the target object's operational habits during the interaction rounds. Based on these interaction environment parameters, the task execution request input by the target object in the current interaction round, and historical interaction data from previous interaction rounds, feature extraction is performed to obtain the state features of the current interaction round. This approach can more comprehensively capture the target object's intent and needs, thus providing richer reference data for subsequent target feature generation.

[0024] In one implementation scenario, the long-term memory graph of a target object represents the knowledge and experience accumulated by the target object during historical interactions. This knowledge and experience is organized and stored in the form of a graph, facilitating reference and utilization in subsequent tasks. Specifically, the long-term memory graph contains multiple nodes and edges. Nodes represent key entities, concepts, or events involved in the target object's historical interactions, while edges represent the relationships between these nodes, such as causal relationships, temporal sequences, or logical dependencies.

[0025] In a specific implementation scenario, a long-term memory graph consists of several memory entities and the first logical relationships between them. Specifically, memory entities can be concrete things, abstract concepts, or actions mentioned by the target object in historical interactions, while the first logical relationships describe the connections between these memory entities. For example, if the target object indicates that they are good at cooking and mentions specific cuisines and dishes in an interaction, this information can be stored as a memory entity in the long-term memory graph, and the first logical relationships can reflect the target object's preference for these dishes or the frequency of cooking them. As another example, if the target object indicates that they prefer a "concise" writing style in an interaction, the long-term memory graph can record the target object's preference for text style and associate it with other relevant entities (such as task type or output requirements) through the first logical relationships.

[0026] In an implementation scenario, a task structure graph represents the modeling of the internal logic and processing flow of a task execution request. Its core lies in decomposing the task into multiple subtasks and clearly defining the dependencies and execution order between these subtasks.

[0027] In a specific implementation scenario, the task structure graph consists of several task structure entities and the secondary logical relationships between them. Specifically, task nodes represent specific subtasks or operation steps, while the secondary logical relationships are used to define the sequence, conditional dependencies, or parallel relationships between these subtasks. For example, in a complex task execution request, "completing step X" may be a prerequisite for "starting step Y," and this dependency will be represented as edges in the task structure graph.

[0028] In a specific implementation scenario, the long-term memory graph and task structure graph are stored in a callable long-term memory repository. The target object's long-term memory graph and task structure graph can be updated with each interaction round. Specifically, the construction of the long-term memory graph and task structure graph can be dynamically updated and optimized based on the target object's historical interaction data and task-related domain knowledge. For example, when the target object completes a new interaction task, the system can automatically analyze the key information in that task and integrate it into the long-term memory graph to enrich the target object's knowledge base. Simultaneously, the task structure graph can also be adjusted according to the characteristics of new tasks to ensure it accurately reflects the latest execution logic of the task.

[0029] In a specific implementation scenario, to further improve the practicality and accuracy of the knowledge graph, external knowledge sources can be introduced to supplement and correct it. For example, by accessing publicly available knowledge graphs or industry-specific databases, more comprehensive support can be provided for the long-term memory graph and task structure graph of the target object, thereby enhancing its adaptability in complex task scenarios.

[0030] Step S12: Map the state features to the task state space to obtain the target features that characterize the task execution request inference path.

[0031] In this embodiment, the task state space includes several task execution state vectors. Specifically, each task execution state vector represents the state of a task at a specific stage or under certain conditions. By mapping state features to the task state space, the reasoning path of the task execution request can be captured, and target features can be generated. The target features not only reflect the current state of the task but also contain correlation information with historical interaction data, thereby providing more accurate data support for subsequent task processing.

[0032] In a specific implementation scenario, the mapping process can be implemented using machine learning models, such as deep neural networks or graph neural networks, to process state features. These models can effectively transform high-dimensional state features into low-dimensional task execution state vectors while retaining key information. Furthermore, to improve mapping accuracy, attention mechanisms can be introduced, enabling the model to focus on the parts of the state features most relevant to the task execution request.

[0033] In one implementation scenario, a task state space with a target space dimension is constructed based on several task execution state vectors. State features are mapped to the task state space to obtain state space embeddings. Based on these embeddings, semantic targets, execution stages, and contextual dependencies related to the task execution request are modeled within the task state space. Finally, target features representing the reasoning path of the task execution request are constructed based on these semantic targets, execution stages, and contextual dependencies. Specifically, the task state space is constructed. Where k represents the spatial dimension of the task state space, based on the task mapping function. State characteristics Mapped to task state space , thus obtaining the state space embedding This is used to characterize the location of a task execution request in the task state space, and to model the semantic target, execution stage, and contextual dependency information of the task execution request in order to obtain target features. .

[0034] In a specific implementation scenario, the generation process of target features also includes aggregating multiple task execution state vectors in the task state space. Specifically, weighted averaging, max pooling, or other aggregation methods can be used to extract the most representative target features from multiple state vectors. This approach further enhances the expressive power of the target features, enabling them to better reflect the reasoning path of the task execution request.

[0035] In a specific implementation scenario, target features can also be dynamically adjusted based on contextual information. For example, in different interactive environments, target features may be affected by factors such as user operating habits, device type, or network status. By introducing a context-aware mechanism, target features can be made more closely aligned with the actual interactive scenario, thereby improving the flexibility and adaptability of task processing.

[0036] Step S13: Based on the correlation between the target features and the first graph features of the long-term memory graph and the second graph features of the task structure graph, extract the long-term memory sub-graph and the task structure sub-graph about the task execution request.

[0037] In one implementation scenario, the correlation between the target feature and the first graph feature of the long-term memory graph and the second graph feature of the task structure graph can be calculated based on algorithms such as cosine similarity. Graph nodes with a correlation of not less than the correlation threshold and related node logical relationships are selected to construct a sub-graph.

[0038] In a specific implementation scenario, the long-term memory map of the target object is represented as follows: The task structure diagram is represented as ,in, Representing long-term memory entities, Representing the first logical relation, Characterize the structural entities of the task. To represent the second logical relation, a memory feature extraction model, such as a graph neural network model, is used to embed and model the two graphs mentioned above to obtain the features of the first graph. Second spectral features , with target features As query criteria, joint similarity matching is performed to determine the relevant long-term memory subgraph and task structure subgraph.

[0039] In one implementation scenario, a long-term memory graph includes memory entities and first logical relationships between them, while a task structure graph includes task structure entities and second logical relationships between them. The first graph features include first entity features of the memory entities and first relation features of the first logical relationships. The second graph features include second entity features of the task structure entities and second relation features of the second logical relationships. Based on the first entity score and first similarity score for each memory entity, a first target score is obtained. Similarly, based on the second entity score and second similarity score for each task structure entity, a second target score is obtained. The first entity score represents the semantic association strength between the target feature and the first entity feature, and the first similarity score represents the feature similarity between the target feature and the first entity feature. The second entity score represents the semantic association strength between the target feature and the second entity feature, and the second similarity score represents the feature similarity between the target feature and the second entity feature. The first target score is then selected based on... The memory entities meeting the first association condition are used as target memory entities, and the task structure entities whose second target scores satisfy the second association condition are used as target task structure entities. The adjacent entity nodes of the target memory entity in the long-term memory graph are used as candidate memory entities. Based on the first relationship feature between the target memory entity and the candidate memory entities, and the first target score of the candidate memory entities, candidate memory entities satisfying the third association condition are used as new target memory entities. Similarly, the adjacent entity nodes of the target task structure entity in the task structure graph are used as candidate task structure entities. Based on the second relationship feature between the target task structure entity and the candidate task structure entities, and the second target score of the candidate task structure entities, candidate task structure entities satisfying the third association condition are used as new target task structure entities. Based on the target memory entities and the first logical relationship between them, a long-term memory sub-graph is obtained, and based on the target task structure entities and the second logical relationship between them, a task structure sub-graph is obtained. This scheme effectively extracts the long-term memory and task structure information most relevant to the task execution request, thus providing the most accurate data support for subsequent task processing. It can quickly locate key information in complex interaction scenarios and generate response strategies that better meet the needs of the target object based on this information.

[0040] In a specific implementation scenario, the first entity score characterizes the semantic association strength between the target feature and the first entity feature, while the first similarity score characterizes the feature similarity between the target feature and the first entity feature. Specifically, the semantic association strength represents the degree of semantic matching at the entity granularity level, reflecting the conceptual relevance between the target feature and the remembered entity. Feature similarity, on the other hand, measures the distance or similarity between the two from the perspective of vector space, ensuring that the extracted information is not only semantically relevant but also consistent in feature representation. This scheme, by combining these two scores, can leverage the structural characteristics of the graph to more comprehensively evaluate the association between the target feature and the remembered entity, thereby improving the accuracy of the selection.

[0041] In a specific implementation scenario, the second entity score represents the semantic association strength between the target feature and the second entity feature, while the second similarity score represents the feature similarity between the target feature and the second entity feature. Specifically, the calculation methods for the second entity score and the second similarity score are similar to those for the first entity score and the first similarity score, but they focus on task structure entities in the task structure graph. Semantic association strength measures the relevance between the target feature and the task structure entity at the task logic level, while feature similarity evaluates the degree of matching between the two from the perspective of vector space. By combining these two scores, task structure entities highly relevant to the task execution request can be selected more accurately, thus providing a reliable basis for subsequent task decomposition and execution.

[0042] In a specific implementation scenario, the first association condition is that the score of the first target exceeds a preset first threshold. This threshold can be dynamically adjusted according to the actual application scenario to ensure that the selected memory entities have sufficient relevance and importance. Similarly, the second association condition is that the score of the second target exceeds a preset second threshold. This threshold is designed to extract the task structure entity that best matches the current task execution request from the task structure graph, thereby improving the accuracy and efficiency of subsequent task processing.

[0043] In a specific implementation scenario, the third association condition is used to further filter candidate memory entities or candidate task structure entities. Its core lies in comprehensively considering the strength of the logical relationship between the target entity and the candidate entities, as well as the target score of the candidate entity itself. For example, in a long-term memory graph, a candidate memory entity needs to satisfy the following conditions: the strength of its first relational feature with the target memory entity must be higher than a certain preset value, and its first target score must also meet a specific standard to be considered a new target memory entity. This multi-dimensional filtering mechanism can effectively avoid interference from noisy data, ensuring that the extracted sub-graph information is more focused on the core requirements of the target task.

[0044] In a specific implementation scenario, the fourth association condition can introduce a time decay factor to measure the time sensitivity of historical interaction data. For example, for memory entities in a long-term memory graph, their primary objective score can be adjusted using time weighting, giving recently generated memory entities a higher priority during the screening process. Similarly, in a task structure graph, the time decay factor can be applied to the screening process of task structure entities to ensure that the extracted task structure sub-graphes reflect the latest task logic and execution requirements.

[0045] In a specific implementation scenario, the first similarity score and the second similarity score can be calculated based on algorithms such as cosine similarity. Specifically, the first similarity score measures the proximity of the target feature and the first entity feature of the memory entity in the vector space by calculating the cosine similarity between them. The second similarity score uses the same method to evaluate the similarity between the target feature and the second entity feature of the task structure entity. Furthermore, to further improve the robustness of similarity calculation, other distance metrics, such as Euclidean distance or Manhattan distance, can be combined to address the feature distribution characteristics under different scenarios. This approach not only ensures the accuracy of the screening results but also enhances the adaptability to diverse data.

[0046] In a specific implementation scenario, a first interaction matrix is ​​constructed based on the target features and the first entity feature matrix. The first entity matrix is ​​composed of each first entity feature. Based on the positive interaction values ​​of the memory entity in each feature dimension in the first interaction matrix, the first entity score of the memory entity is obtained, and the first similarity score between the target features and the first entity features of the memory entity is obtained. Based on the sum of the first entity score and the first similarity score, the first target score is obtained.

[0047] In a specific implementation scenario, the transpose of the matrix composed of each first entity feature is used as the first entity feature matrix. The target features are then expanded column-wise based on the number of memory entities to obtain the first feature expansion matrix. Element-wise multiplication of the first entity feature matrix and the first feature expansion matrix yields the first interaction matrix. This first interaction matrix includes the interaction values ​​between the target features and each first entity feature in each feature dimension. Negative interaction values ​​for the first entity features in each feature dimension are filtered out to obtain the positive interaction values ​​for the memory entities in each feature dimension within the first interaction matrix. The positive interaction values ​​in each feature dimension are then aggregated to obtain the first entity score for the memory entities. Specifically, the first target score can be calculated using the following formula:

[0048] ,

[0049] ,

[0050] In formulas (1) and (2), M represents the first interaction matrix, q represents the first feature expansion matrix, and E represents the matrix composed of each of the first entity features. The transpose of the matrix representing the features of each of the first entities. Characterizing the Hadamard volume, The first objective score is represented by d, and the feature dimension is represented by d. The element in the first row and k-th column of the first interaction matrix represents the element in the first interaction matrix. Linear unit functions characterizing negative interactive filtering. The first similarity score represents the character. The above scheme represents a balance coefficient. The calculation of the first objective score takes into account both local correlation and global similarity of the feature dimensions, which is more in line with the task semantics and can improve the accuracy of sub-graph extraction.

[0051] In a specific implementation scenario, a second interaction matrix is ​​constructed based on the target features and the second entity feature matrix. The second entity matrix is ​​composed of various second entity features. Based on the positive interaction values ​​of the task structure entity in the second interaction matrix on each feature dimension, the second entity score of the task structure entity is obtained, and the second similarity score between the target features and the second entity features of the task structure entity is obtained. Based on the sum of the second entity score and the second similarity score, the second target score is obtained.

[0052] In a specific implementation scenario, the transpose of the matrix composed of each second entity feature is used as the second entity feature matrix. The target features are then expanded column-wise based on the number of task structure entities to obtain the second feature expansion matrix. Element-wise multiplication of the second entity feature matrix and the second feature expansion matrix yields the second interaction matrix. This second interaction matrix includes the interaction values ​​between the target features and each second entity feature in each feature dimension. Negative interaction values ​​for the second entity features in each feature dimension are filtered to obtain the positive interaction values ​​for the task structure entities in each feature dimension within the second interaction matrix. The positive interaction values ​​in each feature dimension are then aggregated to obtain the second entity score of the task structure entity. For details, please refer to the aforementioned formula for calculating the first target score; for simplicity, it will not be elaborated upon here.

[0053] In a specific implementation scenario, the selection of candidate memory entities and candidate task structure entities starts from the target memory entity or target task structure entity and spreads along the graph relationship edges. Specifically, the selection of candidate memory entities can be achieved by traversing the neighboring nodes of the target memory entity in the long-term memory graph; these neighboring nodes are the candidate memory entities. Similarly, the selection of candidate task structure entities is based on the neighboring nodes of the target task structure entity in the task structure graph. To further improve the accuracy of the screening, a relationship weight mechanism can be introduced, assigning a corresponding weight value to each relationship edge to reflect its importance or relevance in the graph. For example, in the long-term memory graph, neighboring nodes with high relationship weights with the target memory entity can be selected as candidate memory entities; in the task structure graph, neighboring nodes with high relationship weights with the target task structure entity are given priority as candidate task structure entities. This diffusion method based on relationship weights can effectively reduce the interference of irrelevant nodes and ensure the quality and relevance of candidate entities.

[0054] In a specific implementation scenario, to enhance the flexibility of sub-graph extraction, a dynamic threshold adjustment strategy can be incorporated. Specifically, the screening threshold can be dynamically adjusted based on the interaction strength between the target feature and candidate entities. For example, when the interaction value between the target feature and candidate memory entities is high, the threshold of the first association condition can be appropriately lowered to include more potentially relevant memory entities; conversely, the threshold can be increased to filter out low-relevance candidate entities. Similarly, in task structure graphs, the threshold of the second association condition can be dynamically adjusted based on the interaction value between the target feature and candidate task structure entities to achieve more refined screening. This dynamic adjustment mechanism can flexibly adapt to different task scenarios, further improving the accuracy and robustness of sub-graph extraction.

[0055] In a specific implementation scenario, a multi-round iterative optimization strategy can be combined to gradually improve the construction process of the subgraph. For example, after extracting preliminary target memory entities and target task structure entities in the initial stage, the subgraph can be continuously expanded and optimized through multiple rounds of iteration. In each iteration, the interaction values ​​between target features and newly added candidate entities can be recalculated, and the screening conditions can be dynamically adjusted based on the updated interaction values, thereby gradually incorporating more highly relevant entities and their logical relationships. In this way, the final generated long-term memory subgraph and task structure subgraph will be more comprehensive and accurate, better serving the needs of subsequent task processing.

[0056] In a specific scenario, during the multi-round iterative construction of the subgraph, the weight value assigned to each relation edge is decayed, and the decay coefficient is gradually increased as the number of rounds increases to avoid excessive diffusion of the graph.

[0057] In one implementation scenario, after obtaining a long-term memory sub-graph based on the target memory entities and the first logical relationships between them, and a task structure sub-graph based on the target task structure entities and the second logical relationships between them, the first information entropy of each target memory entity in the long-term memory sub-graph is obtained based on its first entity features, and the second information entropy of each target task structure entity in the task structure sub-graph is obtained based on its second entity features. Based on the first information entropy sorted from smallest to largest, target memory entities are sequentially selected for removal, and the long-term memory before removal is calculated. The system calculates the first mutual information between the long-term memory subgraph and the task execution request, the second mutual information between the long-term memory subgraph and the task execution request after removal, and the third and fourth mutual information between the task structure subgraph and the task execution request before and after removal, based on the second information entropy sorted from smallest to largest. Selected target task structure entities are retained if the difference between the first and second mutual information is not less than a first contribution threshold, and if the difference between the third and fourth mutual information is not less than a second contribution threshold. By calculating information entropy and mutual information, the importance of target memory entities and target task structure entities to the task execution request can be quantified. Specifically, the first information entropy reflects the uncertainty of the feature distribution of target memory entities in the long-term memory subgraph, while the second information entropy reflects the uncertainty of the feature distribution of target task structure entities in the task structure subgraph. By sorting the information entropy and removing entities sequentially, the contribution of each entity to the correlation between the subgraph and the task execution request can be progressively evaluated. When a target memory entity is removed, if the mutual information between the long-term memory subgraph and the task execution request decreases significantly, it indicates that the entity has high value for task processing and should be retained. Conversely, if the change in mutual information is not significant, the entity can be considered to have low relevance to the current task and can be removed from the subgraph. Similarly, in the task structure subgraph, by comparing the changes in mutual information before and after removal, target task structure entities with strong support for task logic can be selected. This approach not only optimizes the conciseness of the subgraph but also ensures that the retained entities have high task relevance and contribution, thereby providing more focused data support for subsequent task decomposition and execution.

[0058] In a specific implementation scenario, during the subgraph optimization phase, pruning algorithms can be used to post-process the extraction results. For example, by setting a global pruning threshold, entities that contribute little to the overall subgraph and their associated logical relationships can be removed. This allows for further simplification of the subgraph's size while maintaining its integrity. Furthermore, the mutual information changes between the subgraph and the task execution request can be reassessed after each removal operation, and the pruning strategy can be dynamically adjusted based on the assessment results.

[0059] Step S14: Construct the target large model instruction based on state features, long-term memory subgraph, and task structure subgraph.

[0060] In this embodiment, the target large model instruction is used to instruct the large language model to reference state features, long-term memory subgraphs, and task structure subgraphs to generate response data for the task execution request. Specifically, the large model instruction is a structured input format that effectively integrates key information from the state features, long-term memory subgraphs, and task structure subgraphs. In practical applications, the design of the target large model instruction needs to fully consider the input constraints and processing capabilities of the large language model to ensure that the instruction can be accurately parsed and executed. For example, the target memory entity and its first logical relationship in the long-term memory subgraph, and the target task structure entity and its second logical relationship in the task structure subgraph can be embedded into the instruction in the form of serialization or graph structure, respectively. Simultaneously, the state features, as supplementary contextual information for the task execution request, can be appended to the instruction through feature vectors or text descriptions, thereby providing the large language model with more comprehensive task background support.

[0061] In a specific implementation scenario, a multimodal information fusion mechanism can also be introduced. For example, when constructing instructions, images, audio, or other non-textual data can be combined as auxiliary inputs to enhance the understanding and processing capabilities of complex task scenarios. Furthermore, specialized encoding strategies can be designed for different types of subgraph information, enabling large language models to extract and utilize key features more efficiently. For instance, for the long-term memory subgraph, an attention-based encoding method can be used to highlight the contribution of important memory entities; for the task structure subgraph, a path search algorithm can be used to extract key task logical links and transform them into a structured representation that is easy for the model to understand.

[0062] In one implementation scenario, a structured instruction topology is generated based on the state features, the long-term memory subgraph, and the task structure subgraph. This structured instruction topology includes several instruction units and their logical dependencies. Rendering is then performed based on these instruction units and their logical dependencies to obtain an unstructured description of the target large-scale model instructions. This approach, by transforming the structured instruction topology into an unstructured description, better adapts to the input requirements of large language models while preserving the core information of the task logic.

[0063] In a specific implementation scenario, the rendering process can incorporate natural language generation techniques to transform instruction units and their logical dependencies into fluent textual expressions. For example, for instruction units with a sequential order, their execution order can be clarified using time adverbs or conjunctions; for instruction units with parallel relationships, enumeration or parallel sentence structures can be used for description. Furthermore, to enhance the readability and execution efficiency of the target large model's instructions, context optimization strategies can be introduced during the rendering process to streamline redundant information and highlight key task elements. These solutions not only improve the expressiveness of instructions but also lay the foundation for subsequent task decomposition and execution.

[0064] In a specific implementation scenario, after generating the target large model instructions, it is also necessary to verify and optimize them. For example, the actual effect of the instructions can be tested by simulating the operation, and the content or structure of the instructions can be adjusted based on the feedback results.

[0065] Step S15: Obtain the output data of the large language model in response to the target large model instruction, and use it as the response data for the task execution request.

[0066] In one implementation scenario, the output data of a large language model responding to a target large model instruction is acquired as the response data for a task execution request. On one hand, by utilizing the target object's long-term memory graph and task structure graph, combined with the state features of the current interaction round, the target large model instruction is dynamically constructed. This helps to use the task structure regarding the task execution request and the target object's long-term memory of the task execution request as reference data, enabling personalized construction of the target large model instruction. Furthermore, the graph-based reference data provides logically clear reference information for the construction of the target large model instruction, improving its adaptability and accuracy, and thus enhancing the accuracy of the response data output by the large language model. On the other hand, by mapping state features to the task state space and capturing the reasoning path of the task execution request, the target features representing the reasoning path can be used as the basis for association with the graph. This helps to refine the extraction logic of sub-graphs based on the information provided by the reasoning path regarding sub-tasks and the processing logic between sub-tasks, improving the accuracy and completeness of extracting long-term memory sub-graphs and task structure sub-graphs, further enhancing adaptability to complex task scenarios. Therefore, it can improve the accuracy of generating task execution request response data.

[0067] In one implementation scenario, target features are generated by a task inference model, first-level graph features are generated by a memory feature extraction model, and target large-scale model instructions are generated by an instruction construction model. After acquiring the output data of the large language model responding to the target large-scale model instructions as response data for the task execution request, the generation quality score of the response data, the task execution request, the target large-scale model instructions, and the response data of the task execution request are combined to form sample feedback data. Based on the sample feedback data accumulated in each interaction round, a sample feedback dataset is obtained. Based on the sample feedback dataset, the network parameters of at least one of the task inference model, memory feature extraction model, and instruction construction model are adjusted. This scheme, through a continuous feedback loop mechanism, can gradually optimize the performance of the task inference model, memory feature extraction model, and instruction construction model.

[0068] In a specific implementation scenario, a hierarchical training strategy is introduced to dynamically adjust the model's learning rate or loss function weights based on the data characteristics of different interaction rounds. For example, in the initial interaction rounds, priority is given to optimizing the path generation capability of the task inference model to ensure the accuracy of the target features; while in later rounds, the focus is on improving the synergistic effect of the memory feature extraction model and the instruction construction model, thereby achieving higher-quality target large model instruction generation.

[0069] In a specific implementation scenario, transfer learning techniques can also be combined to transfer knowledge learned from previous tasks to new tasks, thereby accelerating the model's convergence process and improving its generalization ability.

[0070] In a specific implementation scenario, based on sample feedback data, the types of parameters to be updated are determined. These parameters include mapping function parameters in the task inference model, memory graph parameters in the memory feature extraction model, and instruction topology weights in the instruction construction model. The update magnitude is calculated based on the difference between the generated quality score and a preset quality threshold. Based on the update magnitude and the types of parameters to be updated, the network parameters of at least one of the task inference model, memory feature extraction model, and instruction construction model are adjusted. Specifically, when the generated quality score is significantly lower than the preset threshold, the update magnitude can be increased to accelerate model optimization; conversely, the update magnitude is decreased to avoid performance fluctuations caused by over-adjustment. After determining the update magnitude, and considering the types of parameters to be updated, targeted adjustments are made to the mapping function parameters in the task inference model, the memory graph parameters in the memory feature extraction model, and the instruction topology weights in the instruction construction model. For example, the memory graph parameters in the memory feature extraction model can be updated using the following formula:

[0071] ,

[0072] In formula (3) To memorize the spectral parameters, For the update range, To generate a quality score, the update formulas for the mapping function parameters in the task reasoning model and the instruction topology weights in the instruction construction model can also be found in the above formula (3). For the sake of brevity, they will not be repeated here.

[0073] In a specific implementation scenario, regularization constraints can be introduced during parameter tuning to prevent overfitting or getting trapped in local optima. For example, by imposing smoothness constraints on the mapping function parameters, the generalization ability of the target features under different task scenarios can be ensured; or sparsity constraints can be added when updating memory graph parameters to highlight the importance of key memory nodes and reduce noise interference. Simultaneously, adjustments to instruction topology weights can be made by combining the logical dependencies of subgraphs, prioritizing the optimization of weights that contribute significantly to the generation of task execution request-response data, thereby further improving the construction quality of the target large model instructions.

[0074] In a specific implementation scenario, the above parameter adjustment process can also be combined with a multi-round iterative optimization strategy to gradually improve model performance. For example, in each iteration, the quality score is re-evaluated based on the latest sample feedback data, and the update magnitude and parameter types are dynamically adjusted.

[0075] In a specific implementation scenario, the generated quality score includes explicit behavioral feedback score, implicit behavioral feedback score, and preset evaluation index score. The generated quality score is obtained by weighted summation of the explicit behavioral feedback score, implicit behavioral feedback score, and preset evaluation index score.

[0076] The above scheme extracts features based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds to obtain the state features of the current interaction round. It also obtains the long-term memory graph and task structure graph of the target object and maps the state features to the task state space to obtain the target features representing the reasoning path of the task execution request. The task state space includes several task execution state vectors. Based on the correlation between the target features and the first graph features of the long-term memory graph and the second graph features of the task structure graph, the long-term memory sub-graph and task structure sub-graph of the task execution request are extracted. Based on the state features, long-term memory sub-graph, and task structure sub-graph, the target large model instruction is constructed. The target large model instruction is used to instruct the large language model to refer to the state features, long-term memory sub-graph, and task structure sub-graph to generate response data for the task execution request. The output data of the large language model in response to the target large model instruction is obtained as the response data for the task execution request. On the one hand, by utilizing the target object's long-term memory graph and task structure graph, combined with the state characteristics of the current interaction round, the target large-scale model instructions can be dynamically constructed. This helps to use the task structure regarding the task execution request and the target object's long-term memory of the task execution request as reference data, enabling personalized construction of the target large-scale model instructions. Furthermore, the graph-based reference data provides logically clear reference information for the construction of the target large-scale model instructions, improving their adaptability and accuracy, and consequently enhancing the accuracy of the response data output by the large language model. On the other hand, by mapping state features to the task state space and capturing the reasoning path of the task execution request, the target features representing the reasoning path can be used as the basis for association with the graph. This helps to refine the extraction logic of the sub-graphs based on the information provided by the reasoning path regarding sub-tasks and the processing logic between sub-tasks, improving the accuracy and completeness of extracting the long-term memory sub-graph and task structure sub-graph, further enhancing adaptability to complex task scenarios. Therefore, it can improve the accuracy of generating task execution request response data.

[0077] Please see Figure 2 , Figure 2This is a schematic diagram of the framework of an embodiment of the task interaction device of this application. The task interaction device 20 includes: an acquisition module 21, a reasoning module 22, an extraction module 23, a construction module 24, and an output module 25. The acquisition module 21 is used to extract features based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds, to obtain the state features of the current interaction round, and to obtain the long-term memory map and task structure map of the target object; the reasoning module 22 is used to map the state features to the task state space to obtain the target features representing the reasoning path of the task execution request; wherein, the task state space includes several task execution state vectors; the extraction module 23 is used to... Based on the correlation between the target features and the first feature of the long-term memory graph and the second feature of the task structure graph, respectively, the long-term memory sub-graph and the task structure sub-graph of the task execution request are extracted. The construction module 24 is used to construct the target large model instruction based on the state features, the long-term memory sub-graph, and the task structure sub-graph. The target large model instruction is used to instruct the large language model to refer to the state features, the long-term memory sub-graph, and the task structure sub-graph to generate response data for the task execution request. The output module 25 is used to obtain the output data of the large language model in response to the target large model instruction, as the response data for the task execution request.

[0078] In the above scheme, the task interaction device 20 extracts features based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds to obtain the state features of the current interaction round. It also obtains the long-term memory graph and task structure graph of the target object, maps the state features to the task state space, and obtains the target features representing the reasoning path of the task execution request. The task state space includes several task execution state vectors. Based on the correlation between the target features and the first graph features of the long-term memory graph and the second graph features of the task structure graph, the long-term memory sub-graph and task structure sub-graph of the task execution request are extracted. Based on the state features, the long-term memory sub-graph, and the task structure sub-graph, a target large model instruction is constructed. The target large model instruction is used to instruct the large language model to refer to the state features, the long-term memory sub-graph, and the task structure sub-graph to generate response data for the task execution request. The output data of the large language model in response to the target large model instruction is obtained as the response data for the task execution request. On the one hand, by utilizing the target object's long-term memory graph and task structure graph, combined with the state characteristics of the current interaction round, the target large-scale model instructions can be dynamically constructed. This helps to use the task structure regarding the task execution request and the target object's long-term memory of the task execution request as reference data, enabling personalized construction of the target large-scale model instructions. Furthermore, the graph-based reference data provides logically clear reference information for the construction of the target large-scale model instructions, improving their adaptability and accuracy, and consequently enhancing the accuracy of the response data output by the large language model. On the other hand, by mapping state features to the task state space and capturing the reasoning path of the task execution request, the target features representing the reasoning path can be used as the basis for association with the graph. This helps to refine the extraction logic of the sub-graphs based on the information provided by the reasoning path regarding sub-tasks and the processing logic between sub-tasks, improving the accuracy and completeness of extracting the long-term memory sub-graph and task structure sub-graph, further enhancing adaptability to complex task scenarios. Therefore, it can improve the accuracy of generating task execution request response data.

[0079] In some disclosed embodiments, the inference module 22 further includes a space construction module (not shown) for constructing a task state space of target space dimension based on several task execution state vectors; the inference module 22 further includes a space embedding module (not shown) for mapping state features to the task state space to obtain state space embedding; the inference module 22 further includes a request modeling module (not shown) for modeling semantic targets, execution stages, and contextual dependency information about task execution requests in the task state space based on state space embedding; the inference module 22 further includes a path construction module (not shown) for constructing target features representing the inference path of task execution requests based on semantic targets, execution stages, and contextual dependency information.

[0080] In some disclosed embodiments, the long-term memory graph includes memory entities and first logical relationships between memory entities, the task structure graph includes task structure entities and second logical relationships between task structure entities, the first graph features include first entity features of memory entities and first relationship features of the first logical relationships, the second graph features include second entity features of task structure entities and second relationship features of the second logical relationships, the extraction module 23 further includes a score calculation module (not shown), used to obtain a first target score of the memory entity based on the first entity score and the first similarity score of each memory entity, and to obtain a second target score of the task structure entity based on the second entity score and the second similarity score of each task structure entity; wherein, the first entity score represents the semantic association strength between the target feature and the first entity feature, the first similarity score represents the feature similarity between the target feature and the first entity feature, the second entity score represents the semantic association strength between the target feature and the second entity feature, and the second similarity score represents the feature similarity between the target feature and the second entity feature; the extraction module 23 further includes an entity filtering module (not shown), used to filter entities with a first target score of 100%. The extraction module 23 further includes a node expansion module (not shown), which is used to select the target memory entity as the target memory entity and the task structure entity that meets the second objective score as the target task structure entity. The node expansion module is used to select the adjacent entity nodes of the target memory entity in the long-term memory graph as candidate memory entities, and select the candidate memory entity that meets the third objective score as the new target memory entity based on the first relational feature between the target memory entity and the candidate memory entity and the first objective score of the candidate memory entity. The node expansion module is used to select the adjacent entity nodes of the target task structure entity in the task structure graph as candidate task structure entities, and select the candidate task structure entity that meets the third objective score as the new target task structure entity based on the second relational feature between the target task structure entity and the candidate task structure entity and the second objective score of the candidate task structure entity. The extraction module 23 further includes a subgraph construction module (not shown), which is used to obtain the long-term memory subgraph based on the target memory entity and the first logical relationship between the target memory entities, and to obtain the task structure subgraph based on the target task structure entity and the second logical relationship between the target task structure entities.

[0081] In some disclosed embodiments, the score calculation module (not shown) further includes a first interaction matrix construction module (not shown), used to construct a first interaction matrix based on the target feature and the first entity feature matrix; wherein, the first entity matrix is ​​composed of each first entity feature; the score calculation module (not shown) further includes a first score calculation module (not shown), used to obtain a first entity score of the memory entity based on the positive interaction values ​​of the memory entity in each feature dimension in the first interaction matrix, and to obtain a first similarity score between the target feature and the first entity feature of the memory entity; the score calculation module (not shown) further includes a first target score generation module (not shown), used to obtain a first target score based on the sum of the first entity score and the first similarity score. The scoring module (not shown) also includes a second interaction matrix construction module (not shown), used to construct a second interaction matrix based on the target feature and the second entity feature matrix; wherein, the second entity matrix is ​​composed of various second entity features; the scoring module (not shown) also includes a second score calculation module (not shown), used to obtain the second entity score of the task structure entity based on the positive interaction values ​​of the task structure entity in the second interaction matrix on each feature dimension, and to obtain the second similarity score between the target feature and the second entity feature of the task structure entity; the scoring module (not shown) also includes a second target score generation module (not shown), used to obtain the second target score based on the sum of the second entity score and the second similarity score.

[0082] In some disclosed embodiments, the first interaction matrix construction module (not shown) further includes a first matrix processing module (not shown), used to transpose the matrix composed of each first entity feature as the first entity feature matrix, and to perform column expansion on the target features based on the number of memory entities to obtain a first feature expansion matrix; the first interaction matrix construction module (not shown) further includes a first element processing module (not shown), used to perform element-wise multiplication of the first entity feature matrix and the first feature expansion matrix to obtain a first interaction matrix; wherein, the first interaction matrix includes the interaction values ​​between the target features and each first entity feature in each feature dimension; the first score calculation module (not shown) further includes a first interaction value filtering module (not shown), used to filter negative interaction values ​​of the first entity features in each feature dimension to obtain positive interaction values ​​of the memory entities in each feature dimension in the first interaction matrix; the first score calculation module (not shown) further includes a first interaction value aggregation module (not shown), used to aggregate the positive interaction values ​​in each feature dimension to obtain the first entity score of the memory entities. The second interaction matrix construction module (not shown) also includes a second matrix processing module (not shown), used to transpose the matrix composed of each second entity feature as the second entity feature matrix, and to expand the target features based on the number of task structure entities to obtain a second feature expansion matrix; the second interaction matrix construction module (not shown) also includes a second element processing module (not shown), used to perform element-wise multiplication between the second entity feature matrix and the second feature expansion matrix to obtain a second interaction matrix; wherein, the second interaction matrix includes the interaction values ​​between the target features and each second entity feature in each feature dimension; the second score calculation module (not shown) also includes a second interaction value filtering module (not shown), used to filter the negative interaction values ​​of the second entity features in each feature dimension to obtain the positive interaction values ​​of the task structure entities in each feature dimension in the second interaction matrix; the second score calculation module (not shown) also includes a second interaction value aggregation module (not shown), used to aggregate the positive interaction values ​​in each feature dimension to obtain the second entity score of the task structure entity.

[0083] In some disclosed embodiments, after obtaining a long-term memory sub-graph based on the target memory entities and the first logical relationship between them, and obtaining a task structure sub-graph based on the target task structure entities and the second logical relationship between them, the task interaction device 20 further includes an information entropy module (not shown), used to obtain the first information entropy of the target memory entities based on the first entity features of each target memory entity in the long-term memory sub-graph, and to obtain the second information entropy of the target task structure entities based on the second entity features of each target task structure entity in the task structure sub-graph; the task interaction device 20 also includes a mutual information module (not shown), used to sort the target memory entities from smallest to largest based on the first information entropy, sequentially select and remove target memory entities, and calculate the target... The task interaction device 20 further includes an entity removal selection module (not shown), which is used to retain the selected target memory entity in response to the difference between the first mutual information and the second mutual information not being less than a first contribution threshold, and to retain the selected target task structure entity in response to the difference between the third mutual information and the fourth mutual information not being less than a second contribution threshold.

[0084] In some disclosed embodiments, the construction module 24 further includes a topology generation module (not shown) for generating a structured instruction topology based on state features, long-term memory subgraphs, and task structure subgraphs; wherein the structured instruction topology includes several instruction units and logical dependencies between instruction units; the construction module 24 further includes a topology rendering module (not shown) for rendering based on several instruction units in the structured instruction topology and logical dependencies between instruction units to obtain unstructured descriptions of the target large model instruction.

[0085] In some disclosed embodiments, the target features are generated by a task inference model, the first atlas features are generated by a memory feature extraction model, and the target large model instruction is generated by an instruction construction model. After obtaining the output data of the large language model responding to the target large model instruction as the response data for the task execution request, the task interaction device 20 further includes a feedback data acquisition module (not shown), used to combine the generation quality score of the response data, the task execution request, the target large model instruction, and the response data of the task execution request as sample feedback data; the task interaction device 20 also includes a dataset construction module (not shown), used to obtain a sample feedback dataset based on the sample feedback data accumulated in each interaction round; the task interaction device 20 also includes a parameter adjustment module (not shown), used to adjust the network parameters of at least one of the task inference model, the memory feature extraction model, and the instruction construction model based on the sample feedback dataset.

[0086] In some disclosed embodiments, the parameter adjustment module (not shown) further includes a parameter type determination module (not shown), used to determine the parameter type to be updated based on sample feedback data; wherein, the parameter type includes mapping function parameters in the task inference model, memory graph parameters in the memory feature extraction model, and instruction topology weights in the instruction construction model; the parameter adjustment module (not shown) further includes an update magnitude calculation module (not shown), used to calculate the update magnitude based on the difference between the generated quality score and the preset quality threshold; the parameter adjustment module (not shown) further includes an adjustment submodule (not shown), used to adjust the network parameters of at least one of the task inference model, memory feature extraction model, and instruction construction model based on the update magnitude and the parameter type to be updated.

[0087] In some disclosed embodiments, the historical interaction data in the task interaction device 20 includes historical interaction dialogue data and historical interaction behavior data; and / or, the historical interaction data also includes interaction environment parameters; and / or, the generated quality score includes explicit behavior feedback score, implicit behavior feedback score and preset evaluation index score, and the generated quality score is obtained by weighted summation of explicit behavior feedback score, implicit behavior feedback score and preset evaluation index score.

[0088] Please see Figure 3 , Figure 3 This is a schematic diagram of a framework of an embodiment of the electronic device of this application. The electronic device 30 includes at least a memory 31 and a processor 32 coupled to each other. The memory 31 stores at least program instructions, and the processor 32 is used to execute the program instructions to implement the steps in any of the above-described task interaction method embodiments. For details, please refer to the foregoing disclosed embodiments, which will not be repeated here. Exemplarily, the electronic device 30 may include, but is not limited to, smartphones, tablet computers, etc., and the specific type of the electronic device 30 is not limited here.

[0089] Specifically, processor 32 controls itself and memory 31 to implement the steps in any of the above-described task interaction method embodiments. Processor 32 can also be referred to as a CPU (Central Processing Unit). Processor 32 may be an integrated circuit chip with signal processing capabilities. Processor 32 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 32 can be implemented using integrated circuit chips.

[0090] In the above scheme, the electronic device 30 extracts features based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds to obtain the state features of the current interaction round. It also obtains the long-term memory map and task structure map of the target object, maps the state features to the task state space to obtain the target features representing the reasoning path of the task execution request. The task state space includes several task execution state vectors. Based on the correlation between the target features and the first map feature of the long-term memory map and the second map feature of the task structure map, the long-term memory sub-map and task structure sub-map of the task execution request are extracted. Based on the state features, the long-term memory sub-map, and the task structure sub-map, a target large model instruction is constructed. The target large model instruction is used to instruct the large language model to refer to the state features, the long-term memory sub-map, and the task structure sub-map to generate response data for the task execution request. The output data of the large language model in response to the target large model instruction is obtained as the response data for the task execution request. On the one hand, by utilizing the target object's long-term memory graph and task structure graph, combined with the state characteristics of the current interaction round, the target large-scale model instructions can be dynamically constructed. This helps to use the task structure regarding the task execution request and the target object's long-term memory of the task execution request as reference data, enabling personalized construction of the target large-scale model instructions. Furthermore, the graph-based reference data provides logically clear reference information for the construction of the target large-scale model instructions, improving their adaptability and accuracy, and consequently enhancing the accuracy of the response data output by the large language model. On the other hand, by mapping state features to the task state space and capturing the reasoning path of the task execution request, the target features representing the reasoning path can be used as the basis for association with the graph. This helps to refine the extraction logic of the sub-graphs based on the information provided by the reasoning path regarding sub-tasks and the processing logic between sub-tasks, improving the accuracy and completeness of extracting the long-term memory sub-graph and task structure sub-graph, further enhancing adaptability to complex task scenarios. Therefore, it can improve the accuracy of generating task execution request response data.

[0091] Please see Figure 4 , Figure 4 This is a schematic diagram of a framework of an embodiment of the computer-readable storage medium of this application. The computer-readable storage medium 40 stores program instructions 41 that can be executed by a processor. The program instructions 41 are used to implement the steps in any of the above-described task interaction method embodiments.

[0092] In the above scheme, the computer-readable storage medium 40 extracts features based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds to obtain the state features of the current interaction round. It also obtains the long-term memory graph and task structure graph of the target object, maps the state features to the task state space, and obtains the target features representing the reasoning path of the task execution request. The task state space includes several task execution state vectors. Based on the correlation between the target features and the first graph features of the long-term memory graph and the second graph features of the task structure graph, the long-term memory sub-graph and task structure sub-graph of the task execution request are extracted. Based on the state features, the long-term memory sub-graph, and the task structure sub-graph, a target large model instruction is constructed. The target large model instruction is used to instruct the large language model to refer to the state features, the long-term memory sub-graph, and the task structure sub-graph to generate response data for the task execution request. The output data of the large language model in response to the target large model instruction is obtained as the response data for the task execution request. On the one hand, by utilizing the target object's long-term memory graph and task structure graph, combined with the state characteristics of the current interaction round, the target large-scale model instructions can be dynamically constructed. This helps to use the task structure regarding the task execution request and the target object's long-term memory of the task execution request as reference data, enabling personalized construction of the target large-scale model instructions. Furthermore, the graph-based reference data provides logically clear reference information for the construction of the target large-scale model instructions, improving their adaptability and accuracy, and consequently enhancing the accuracy of the response data output by the large language model. On the other hand, by mapping state features to the task state space and capturing the reasoning path of the task execution request, the target features representing the reasoning path can be used as the basis for association with the graph. This helps to refine the extraction logic of the sub-graphs based on the information provided by the reasoning path regarding sub-tasks and the processing logic between sub-tasks, improving the accuracy and completeness of extracting the long-term memory sub-graph and task structure sub-graph, further enhancing adaptability to complex task scenarios. Therefore, it can improve the accuracy of generating task execution request response data.

[0093] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0094] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0095] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0096] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0097] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0098] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A task interaction method, characterized in that, include: Based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds, feature extraction is performed to obtain the state features of the current interaction round, and the long-term memory map and task structure map of the target object are obtained; wherein, the data form of the task execution request includes voice, text and image; The state features are mapped to the task state space to obtain target features that characterize the reasoning path of the task execution request; wherein, the task state space includes several task execution state vectors; Based on the correlation between the target features and the first graph features of the long-term memory graph and the second graph features of the task structure graph, respectively, a long-term memory sub-graph and a task structure sub-graph about the task execution request are extracted; Based on the state features, the long-term memory subgraph, and the task structure subgraph, a target large model instruction is constructed; wherein, the target large model instruction is used to instruct the large language model to refer to the state features, the long-term memory subgraph, and the task structure subgraph to generate response data for the task execution request; The output data of the large language model in response to the instruction of the target large model is obtained and used as the response data of the task execution request.

2. The method according to claim 1, characterized in that, The step of mapping the state features to the task state space to obtain target features characterizing the reasoning path of the task execution request includes: Based on several task execution state vectors, a task state space with a target space dimension is constructed; The state features are mapped to the task state space to obtain the state space embedding; Based on the state space embedding, semantic goals, execution stages, and contextual dependency information regarding the task execution request are modeled in the task state space. Based on the semantic target, the execution stage, and the contextual dependency information, a target feature representing the reasoning path of the task execution request is constructed.

3. The method according to claim 1, characterized in that, The long-term memory graph includes memory entities and a first logical relationship between the memory entities. The task structure graph includes task structure entities and a second logical relationship between the task structure entities. The first graph features include a first entity feature of the memory entity and a first relationship feature of the first logical relationship. The second graph features include a second entity feature of the task structure entity and a second relationship feature of the second logical relationship. Extracting a long-term memory sub-graph and a task structure sub-graph about the task execution request based on the correlation between the target feature and the first graph feature of the long-term memory graph and the second graph feature of the task structure graph includes: A first target score for each memory entity is obtained based on a first entity score and a first similarity score, and a second target score for each task structure entity is obtained based on a second entity score and a second similarity score; wherein, the first entity score characterizes the semantic association strength between the target feature and the first entity feature, the first similarity score characterizes the feature similarity between the target feature and the first entity feature, the second entity score characterizes the semantic association strength between the target feature and the second entity feature, and the second similarity score characterizes the feature similarity between the target feature and the second entity feature; The memory entities whose first target scores satisfy the first association condition are selected as target memory entities, and the task structure entities whose second target scores satisfy the second association condition are selected as target task structure entities. The adjacent entity nodes of the target memory entity in the long-term memory graph are used as candidate memory entities. Based on the first relationship feature between the target memory entity and the candidate memory entities and the first target score of the candidate memory entities, the candidate memory entities that satisfy the third association condition are used as new target memory entities. Similarly, the adjacent entity nodes of the target task structure entity in the task structure graph are used as candidate task structure entities. Based on the second relationship feature between the target task structure entity and the candidate task structure entities and the second target score of the candidate task structure entities, the candidate task structure entities that satisfy the third association condition are used as new target task structure entities. Based on the target memory entity and the first logical relationship between the target memory entities, a long-term memory sub-graph is obtained, and based on the target task structure entity and the second logical relationship between the target task structure entities, a task structure sub-graph is obtained.

4. The method according to claim 3, characterized in that, The process of obtaining the first target score of each memory entity based on the first entity score and the first similarity score of each memory entity includes: Based on the target features and the first entity feature matrix, a first interaction matrix is ​​constructed; wherein, the first entity matrix is ​​composed of each of the first entity features; Based on the positive interaction values ​​of the memory entity in each feature dimension in the first interaction matrix, the first entity score of the memory entity is obtained, and the first similarity score between the target feature and the first entity feature of the memory entity is obtained. The first target score is obtained based on the sum of the first entity score and the first similarity score; The process of obtaining the second target score for each task structure entity based on the second entity score and the second similarity score includes: Based on the target features and the second entity feature matrix, a second interaction matrix is ​​constructed; wherein, the second entity matrix is ​​composed of each of the second entity features; Based on the positive interaction values ​​of the task structure entity in each feature dimension in the second interaction matrix, the second entity score of the task structure entity is obtained, and the second similarity score between the target feature and the second entity feature of the task structure entity is obtained. The second target score is obtained based on the sum of the second entity score and the second similarity score.

5. The method according to claim 4, characterized in that, The step of constructing the first interaction matrix based on the target features and the first entity feature matrix includes: The transpose of the matrix composed of each of the first entity features is used as the first entity feature matrix, and the target features are column-extended based on the number of memory entities to obtain the first feature extension matrix; The first interaction matrix is ​​obtained by multiplying the first entity feature matrix and the first feature expansion matrix element by element; wherein the first interaction matrix includes the interaction values ​​between the target feature and each of the first entity features in each feature dimension. The step of obtaining the first entity score of the memory entity based on the positive interaction values ​​of the memory entity in each feature dimension of the first interaction matrix includes: Filter out the negative interaction values ​​of the first entity feature in each feature dimension to obtain the positive interaction values ​​of the memory entity in each feature dimension in the first interaction matrix; By aggregating the positive interaction values ​​across each feature dimension, the first entity score of the memory entity is obtained; The construction of the second interaction matrix based on the target features and the second entity feature matrix includes: The transpose of the matrix composed of each of the second entity features is used as the second entity feature matrix, and the target features are column-extended based on the number of the task structure entities to obtain the second feature extension matrix; The second interaction matrix is ​​obtained by multiplying the second entity feature matrix and the second feature expansion matrix element by element; wherein the second interaction matrix includes the interaction values ​​between the target feature and each of the second entity features in each feature dimension. The second entity score of the task structure entity is obtained based on the positive interaction values ​​of the task structure entity in each feature dimension of the second interaction matrix, including: Filter out the negative interaction values ​​of the second entity features in each feature dimension to obtain the positive interaction values ​​of the task structure entity in each feature dimension in the second interaction matrix; By aggregating the positive interaction values ​​across each feature dimension, the second entity score of the task structure entity is obtained.

6. The method according to claim 3, characterized in that, After obtaining a long-term memory sub-graph based on the target memory entity and the first logical relationship between the target memory entities, and obtaining a task structure sub-graph based on the target task structure entity and the second logical relationship between the target task structure entities, the method further includes: Based on the first entity features of each target memory entity in the long-term memory subgraph, the first information entropy of the target memory entity is obtained, and based on the second entity features of each target task structure entity in the task structure subgraph, the second information entropy of the target task structure entity is obtained. Based on the first information entropy sorted from smallest to largest, the target memory entities are selected to be removed in sequence, and the first mutual information between the long-term memory subgraph and the task execution request before the removal of the target memory entity is calculated, and the second mutual information between the long-term memory subgraph and the task execution request after removal is calculated. Based on the second information entropy sorted from smallest to largest, the target task structure entities are selected to be removed in sequence, and the third mutual information between the task structure subgraph and the task execution request before the removal of the target task structure entity is calculated, and the fourth mutual information between the task structure subgraph and the task execution request after removal is calculated. In response to the difference between the first mutual information and the second mutual information being not less than a first contribution threshold, the selected target memory entity is retained; and in response to the difference between the third mutual information and the fourth mutual information being not less than a second contribution threshold, the selected target task structure entity is retained.

7. The method according to claim 1, characterized in that, The instructions for constructing the target large model based on the state features, the long-term memory subgraph, and the task structure subgraph include: Based on the state features, the long-term memory subgraph, and the task structure subgraph, a structured instruction topology is generated; wherein, the structured instruction topology includes several instruction units and the logical dependencies between the instruction units; Rendering is performed based on several instruction units in the structured instruction topology and the logical dependencies between the instruction units to obtain a target large model instruction with an unstructured description.

8. The method according to claim 1, characterized in that, The target feature is generated by a task inference model, the first atlas feature is generated by a memory feature extraction model, and the target large model instruction is generated by an instruction construction model. After obtaining the output data of the large language model responding to the target large model instruction as the response data of the task execution request, the method further includes: The sample feedback data is a combination of the quality score generated from the response data, the task execution request, the target large model instruction, and the response data to the task execution request. Based on the sample feedback data accumulated in each round of interaction, a sample feedback dataset is obtained; Based on the sample feedback dataset, adjust the network parameters of at least one of the task inference model, the memory feature extraction model, and the instruction construction model.

9. The method according to claim 8, characterized in that, The step of adjusting the network parameters of at least one of the task inference model, the memory feature extraction model, and the instruction construction model based on the sample feedback dataset includes: Based on the sample feedback data, the parameter types to be updated are determined; wherein, the parameter types include the mapping function parameters in the task inference model, the memory graph parameters in the memory feature extraction model, and the instruction topology weights in the instruction construction model; The update magnitude is calculated based on the difference between the generated quality score and the preset quality threshold; Based on the update magnitude and the type of parameter to be updated, adjust the network parameters of at least one of the task inference model, the memory feature extraction model, and the instruction construction model.

10. The method according to claim 8, characterized in that, The generated quality score includes explicit behavioral feedback score, implicit behavioral feedback score, and preset evaluation index score. The generated quality score is obtained by weighted summation of the explicit behavioral feedback score, the implicit behavioral feedback score, and the preset evaluation index score.

11. The method according to any one of claims 1 to 10, characterized in that, The historical interaction data includes historical interaction dialogue data and historical interaction behavior data; And / or, the historical interaction data may also include interaction environment parameters.

12. A task interaction device, characterized in that, include: The acquisition module is used to extract features based on the task execution request input by the target object in the current interaction round and the historical interaction data of the target object in previous interaction rounds, to obtain the state features of the current interaction round, and to obtain the long-term memory map and task structure map of the target object; wherein, the data form of the task execution request includes voice, text, and image; The reasoning module is used to map the state features to the task state space to obtain target features that characterize the reasoning path of the task execution request; wherein, the task state space includes several task execution state vectors. The extraction module is used to extract the long-term memory sub-graph and the task structure sub-graph about the task execution request based on the correlation between the target features and the first graph features of the long-term memory graph and the second graph features of the task structure graph, respectively. A construction module is used to construct a target large model instruction based on the state features, the long-term memory subgraph, and the task structure subgraph; wherein, the target large model instruction is used to instruct the large language model to generate response data for the task execution request by referring to the state features, the long-term memory subgraph, and the task structure subgraph; The output module is used to obtain the output data of the large language model in response to the instruction of the target large model, and use it as the response data of the task execution request.

13. An electronic device, characterized in that, It includes at least a memory and a processor coupled to each other, wherein the memory stores at least program instructions, and the processor is used to execute the program instructions to implement the task interaction method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The system stores program instructions that can be executed by a processor, the program instructions being used to implement the task interaction method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Complex task intelligent planning execution method and device, electronic equipment and storage medium

    CN119645662A

  • Large model memory processing method and device, equipment, storage medium and product

    CN121144976A