Search

CN-121597447-B - Data processing method and device

CN121597447BCN 121597447 BCN121597447 BCN 121597447BCN-121597447-B

Abstract

The embodiment of the specification provides a data processing method and device, wherein the method comprises the steps of converting a target event into an initial event intermediate representation of a preset event structure, determining an event processing pipeline according to a task type corresponding to the target event, performing transformation processing on the initial event intermediate representation according to a plurality of transformation processing stages to generate a candidate event intermediate representation, determining a target model according to the candidate event intermediate representation, determining a rendering processing stage according to the candidate event intermediate representation and model configuration of the target model, and performing rendering processing on the candidate event intermediate representation according to the rendering processing stage to generate a target event intermediate representation with a target model input format matched. By the context construction method with layering, configurability and dynamic adaptation, the problem of low context generation quality caused by the differences of model capability, long-range dependence loss, complex tool call and insufficient control constraint is solved, and the adaptability, reliability and execution efficiency of a complex intelligent system are improved.

Inventors

  • ZHU YUCONG

Assignees

  • 阿里云飞天(杭州)云计算技术有限公司

Dates

Publication Date
20260512
Application Date
20260129

Claims (16)

  1. 1. A data processing method, comprising: converting the target event into an initial event intermediate representation of a preset event structure; Determining an event processing pipeline according to the task type corresponding to the target event, wherein the event processing pipeline comprises a plurality of transformation processing stages which are sequentially connected; Performing transformation processing on the initial event intermediate representation and a historical initial event intermediate representation corresponding to a historical event according to the transformation processing stages to generate a candidate event intermediate representation, wherein the historical event is a past event which occurs earlier than the target event in the same agent dialogue session with the target event; determining a target model according to the candidate event intermediate representation, and determining a rendering stage according to the candidate event intermediate representation and a model configuration of the target model; And rendering the candidate event intermediate representation according to the rendering stage to generate a target event intermediate representation, wherein the target event intermediate representation is matched with the input format of the target model.
  2. 2. The data processing method according to claim 1, said converting the target event into an initial event intermediate representation of a preset event structure, comprising: Determining the target event, wherein the target event is an event of inputting an agent by a user or a feedback event of an intermediate execution stage of the agent; mapping the target event into an event structure body of a preset event structure, wherein the event structure body comprises the target event and event types of the target event; And carrying out structural processing on the target event according to the event type of the target event to obtain an initial event intermediate representation of the target event.
  3. 3. The data processing method according to claim 1, wherein before determining the event processing pipeline according to the task type corresponding to the target event, the method further comprises: analyzing the initial event intermediate representation and a historical initial event intermediate representation corresponding to a historical event, and determining a task type corresponding to the target event, wherein the historical event is an event which occurs before the target event in the same agent session with the target event.
  4. 4. The data processing method of claim 1, the plurality of transformation processing stages corresponding to a plurality of different transformation logics; the transforming, according to the multiple transforming stages, the initial event intermediate representation and a historical initial event intermediate representation corresponding to a historical event, to generate a candidate event intermediate representation, including: And sequentially executing a plurality of different transformation logics corresponding to the transformation processing stages, and carrying out transformation processing on the initial event intermediate representation and the historical initial event intermediate representation corresponding to the historical event to generate candidate event intermediate representations.
  5. 5. The data processing method of claim 4, the plurality of transformation processing stages comprising an annotation stage, a task structuring stage, a model adaptation stage; The sequentially executing the plurality of different transformation logics corresponding to the plurality of transformation processing stages performs transformation processing on the initial event intermediate representation and the historical initial event intermediate representation corresponding to the historical event to generate candidate event intermediate representations, and includes: Executing label supplementing and adjusting logic corresponding to the labeling stage, and carrying out label supplementing and adjusting on the initial event intermediate representation and the historical initial event intermediate representation corresponding to the historical event to obtain a first candidate event intermediate representation and a first historical candidate event intermediate representation; Executing structure adjustment logic corresponding to the task structuring stage, and performing structure adjustment on the first candidate event intermediate representation and the first history candidate event intermediate representation to obtain a second candidate event intermediate representation; And executing the adaptation conversion logic corresponding to the model adaptation stage, and carrying out format conversion on the second candidate event intermediate representation according to the interface specification of the adaptation model interface to generate a candidate event intermediate representation.
  6. 6. The data processing method of claim 5, further comprising, prior to generating the candidate event intermediate representation: according to the long-term memory extraction logic, extracting information from the first candidate event intermediate representation and/or the second candidate event intermediate representation to generate a memory intermediate representation; And according to detection analysis extraction logic, performing index and event extraction on the first candidate event intermediate representation and/or the second candidate event intermediate representation to generate a detection intermediate representation.
  7. 7. The data processing method of claim 5, further comprising, prior to generating the candidate event intermediate representation: Executing summary generation logic under the condition that the first candidate event intermediate representation contains a first content event, extracting key information of the first content event, and generating a first summary intermediate representation of the first candidate event intermediate representation, wherein the first content event is an event of which the event length meets a preset length threshold value; And/or And executing the abstract generating logic to extract key information of the second content event under the condition that the second candidate event intermediate representation is determined to contain the second content event, and generating a second abstract intermediate representation of the second candidate event intermediate representation, wherein the second content event is an event of which the event length meets the preset length threshold value.
  8. 8. The data processing method of claim 1, the determining a rendering processing stage according to the candidate event intermediate representation and a model configuration of the target model, comprising: analyzing the candidate event intermediate representation and the model configuration of the target model to obtain target characteristics of the candidate event intermediate representation and target model parameters of the target model; And determining a rendering processing stage comprising abstract replacing logic, clipping logic and/or content supplementing logic according to the target characteristics and the target model parameters.
  9. 9. The data processing method according to any one of claims 1-8, the generating a target event intermediate representation, wherein after the target event intermediate representation matches an input format of the target model, further comprising: Inputting the intermediate representation of the target event into the target model to obtain an event processing result output by the target model; under the condition that the event processing result is determined to be a tool calling instruction, analyzing the tool calling instruction to obtain an analysis result of the tool calling instruction; under the condition that the analysis of the tool calling instruction fails according to the analysis result, generating an error feedback intermediate representation, and adding the error feedback intermediate representation to an event log corresponding to the target event; and under the condition that the analysis result determines that the analysis of the tool calling instruction is successful, generating a tool calling intermediate representation, adding the tool calling intermediate representation to the event log, and executing a target tool corresponding to the tool calling instruction to obtain a tool execution result returned by the target tool.
  10. 10. The data processing method according to claim 9, wherein the step of adding the error feedback intermediate representation to the event log corresponding to the target event further comprises: executing retry decision logic by using a state machine according to the error feedback intermediate representation and the historical event intermediate representation of the event log to obtain a retry decision result; generating a state transition intermediate representation under the condition that the error retry is allowed according to the retry decision result; a step of generating a candidate event intermediate representation by using the error feedback intermediate representation and the state transition intermediate representation as the initial event intermediate representation and continuing to perform the transformation processing on the initial event intermediate representation according to the plurality of transformation processing stages; Or alternatively Generating a refused call intermediate representation under the condition that the error retry is not allowed according to the retry decision result; and continuing to execute the transformation processing on the initial event intermediate representation according to the plurality of transformation processing stages to generate candidate event intermediate representations by taking the error feedback intermediate representation and the refused call intermediate representation as the initial event intermediate representation.
  11. 11. The data processing method according to claim 9, further comprising, after the obtaining the tool execution result returned by the target tool: And under the condition that the tool execution result meets the preset limiting condition, distributing a corresponding target variable for the tool execution result, generating a tool execution intermediate representation according to the target variable and the tool execution result, and adding the tool execution intermediate representation to the event log.
  12. 12. The data processing method according to claim 9, wherein the inputting the target event intermediate representation into the target model, after obtaining the event processing result output by the target model, further comprises: Re-executing the processing process of the target event by using different rendering strategies to obtain a plurality of updated event processing results, wherein the rendering strategies comprise processing configuration of a plurality of transformation processing stages in the event processing pipeline and rendering configuration of the rendering processing stages; And adjusting the processing configuration of a plurality of transformation processing stages and/or the rendering configuration of the rendering processing stages in the event processing pipeline according to the plurality of updated event processing results.
  13. 13. A data processing apparatus comprising: The event conversion module is configured to convert the target event into an initial event intermediate representation of a preset event structure; The processing pipeline determining module is configured to determine an event processing pipeline according to the task type corresponding to the target event, wherein the event processing pipeline comprises a plurality of transformation processing stages which are connected in sequence; The transformation processing module is configured to perform transformation processing on the initial event intermediate representation and a historical initial event intermediate representation corresponding to a historical event according to the transformation processing stages to generate a candidate event intermediate representation, wherein the historical event is a past event which occurs earlier than the target event in the same agent dialogue session with the target event; A rendering module configured to determine a target model from the candidate event intermediate representation and determine a rendering processing stage from the candidate event intermediate representation and a model configuration of the target model; And the context generation module is configured to perform rendering processing on the candidate event intermediate representation according to the rendering processing stage and generate a target event intermediate representation, wherein the target event intermediate representation is matched with the input format of the target model.
  14. 14. A computing device, comprising: the device comprises a memory and a processor, wherein the memory and the processor are connected through a bus; The memory is adapted to store a computer program/instruction, the processor being adapted to execute the computer program/instruction, which when executed by the processor, implements the steps of the data processing method according to any of claims 1-12.
  15. 15. A computer readable storage medium storing a computer program/instruction which, when executed by a processor, carries out the steps of the data processing method of any one of claims 1 to 12.
  16. 16. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the data processing method of any of claims 1 to 12.

Description

Data processing method and device Technical Field The embodiment of the specification relates to the technical field of intelligent agents, in particular to a data processing method and device. Background Most current large language model-based agent systems are generally considered as simple concatenation and truncation of string segments when building model input contexts. In light of the diversity of model capabilities, long-range task dependencies, complex tool calls, and security rule constraints, the system level may provide dialogue history storage, tool encapsulation, and partial prompt word templates, but lacks abstraction and modeling of the context construction process itself, and it is difficult to generate an accurate, efficient, and reliable context. The technical problems of model understanding deviation, tool calling error, key information loss, uncontrollable behavior and the like are caused, and the performance and reliability of the complex intelligent body system are severely restricted. Disclosure of Invention In view of the foregoing, one or more embodiments of the present disclosure relate to a data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, which solve the technical drawbacks of the related art. According to a first aspect of embodiments of the present specification, there is provided a data processing method, including: converting the target event into an initial event intermediate representation of a preset event structure; Determining an event processing pipeline according to the task type corresponding to the target event, wherein the event processing pipeline comprises a plurality of transformation processing stages which are sequentially connected; performing transformation processing on the initial event intermediate representation according to the transformation processing stages to generate candidate event intermediate representations; determining a target model according to the candidate event intermediate representation, and determining a rendering stage according to the candidate event intermediate representation and a model configuration of the target model; And rendering the candidate event intermediate representation according to the rendering stage to generate a target event intermediate representation, wherein the target event intermediate representation is matched with the input format of the target model. According to a second aspect of embodiments of the present specification, there is provided a data processing apparatus comprising: The event conversion module is configured to convert the target event into an initial event intermediate representation of a preset event structure; The processing pipeline determining module is configured to determine an event processing pipeline according to the task type corresponding to the target event, wherein the event processing pipeline comprises a plurality of transformation processing stages which are connected in sequence; A transformation processing module configured to transform the initial event intermediate representation according to the plurality of transformation processing stages, generating candidate event intermediate representations; A rendering module configured to determine a target model from the candidate event intermediate representation and determine a rendering processing stage from the candidate event intermediate representation and a model configuration of the target model; And the context generation module is configured to perform rendering processing on the candidate event intermediate representation according to the rendering processing stage and generate a target event intermediate representation, wherein the target event intermediate representation is matched with the input format of the target model. According to a third aspect of embodiments of the present specification, there is provided a computing device comprising: A memory and a processor; Wherein the memory is adapted to store computer programs/instructions and the processor is adapted to execute the computer programs/instructions, which when executed by the processor, implement the steps of the data processing method described above. According to a fourth aspect of embodiments of the present specification, there is provided a computer readable storage medium storing a computer program/instruction which, when executed by a processor, implements the steps of the data processing method described above. According to a fifth aspect of embodiments of the present specification, there is provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the data processing method described above. One embodiment of the present specification implements a data processing method by first converting an original target event into a normalized initial event intermediate representation, and determining an event processi