An agent runtime state cross-domain migration and continuation running method, device, medium and program product
By performing pre-migration state convergence processing and generating task runtime encapsulation objects on the source side, the problem of state inconsistency during agent cross-boundary migration is solved, ensuring that the task continues to run stably, safely, and compliantly on the target side, thus improving the continuity and controllability of the task.
Patent Information
- Application Number
- CN202611666245.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-27
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies struggle to maintain consistency between task state and operational constraints when agents migrate across boundaries, making it difficult for tasks to continue running stably, safely, and compliantly. This results in issues such as state drift, duplicate execution, loss of control over permissions or budgets, and the cross-boundary diffusion of sensitive data.
During runtime on the source side, the agent task is processed for state convergence before migration, generating a task runtime encapsulation object, including task execution state, external resource association state, tool call state, and runtime constraint state. On the target side, cross-domain migration admission and state reconstruction are performed to ensure that the consistency conditions are met before cross-domain migration is carried out.
It enables intelligent agent tasks to maintain a consistent correspondence between task execution progress, external resource association, tool call status, and running constraints when migrating across devices, business domains, or organizational boundaries. This reduces the risks of state drift, repeated execution, and running constraint mismatch after migration, and improves the continuity, stability, and controllability of tasks.
Smart Images

Figure CN123157397A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, device, medium, and program product for cross-domain migration and continuation of runtime state of an intelligent agent. Background Technology
[0002] With the development of large language models and intelligent agent technology, intelligent agents are increasingly being used for long-cycle, multi-step, and cross-system orchestration tasks. Existing intelligent agent tasks typically run within specific sessions, devices, or nodes. However, in scenarios such as long document generation, customer service quality inspection, supply chain collaboration, and enterprise process automation, intelligent agent tasks may need to continuously advance across different operating environments due to device switching, node failures, changes in business domains, or organizational collaboration.
[0003] In existing technologies, methods such as session history synchronization, task log saving, checkpoint recovery, file synchronization, or process snapshots are commonly used to restore task context or maintain runtime state. While these methods can restore text context, intermediate results, or partial runtime state to some extent, they still struggle to maintain consistent correspondences between task execution progress, external resource references, tool call states, and permissions, budgets, and compliance constraints when migrating to ongoing agent tasks across devices, business domains, or organizational boundaries. This can easily lead to the inability to stably resume execution from the original task logic point after migration, and may result in issues such as state drift, duplicate execution, loss of permission or budget control, and the cross-boundary diffusion of sensitive data.
[0004] Therefore, existing technologies urgently need a runtime processing method that can maintain the consistency of task state, external resource state, and permissions, budget, and compliance constraints during the cross-boundary migration of intelligent agents, in order to improve the stability, security, and compliance of continuous execution of intelligent agent tasks. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this application provides a method, device, medium, and program product for cross-domain migration and continuation of intelligent agent runtime state, which at least solves the problem that the task state and runtime constraints are difficult to maintain in a consistent manner when intelligent agents migrate across boundaries, resulting in the difficulty of stable, safe, and compliant task continuation.
[0006] To achieve the above objectives and other advantages, some embodiments of this application provide the following aspects: In a first aspect, some embodiments of this application provide a method for cross-domain migration and continuation of runtime state of an intelligent agent, including: In response to the cross-domain migration triggering condition of the agent task, the agent task is subjected to pre-migration state convergence processing during source-side runtime to obtain the source-side runtime state that satisfies the migration consistency condition. Based on the source-side running status, a task running state encapsulation object is generated. The task running state encapsulation object includes the task execution status, external resource association status, tool invocation status, and running constraint status required for the agent task to continue running on the target side. Based on the aforementioned operational constraints and the target-side operational environment, cross-domain migration admission processing is performed on the task runtime encapsulated object, and if the task runtime encapsulated object meets the cross-domain migration admission requirements, the task runtime encapsulated object is transmitted to the target-side runtime environment. When the target side is running, based on the task running state encapsulation object and the target side running environment, the target side state of the agent task is reconstructed and the target side running constraints are determined to obtain the target side runnable state; Based on the target-side continueable state, the agent task can continue running from the task execution breakpoint corresponding to the source-side running state when the target-side is running.
[0007] Secondly, some embodiments of this application also provide an electronic device, the electronic device comprising: One or more processors; and a memory storing computer program instructions, which, when executed, cause the processors to perform the agent runtime state cross-domain migration and continuation method as described above.
[0008] Thirdly, some embodiments of this application also provide a computer-readable storage medium storing a computer program and / or instructions thereon, wherein when the computer program and / or instructions are executed by a processor, they implement the intelligent agent runtime state cross-domain migration and continuation method as described above.
[0009] Fourthly, some embodiments of this application also provide a computer program product, including a computer program and / or instructions, which, when executed by a processor, implement the intelligent agent runtime state cross-domain migration and continuation method as described above.
[0010] Compared with existing technologies, the solution provided in this application, when an agent task undergoes cross-domain migration, firstly, performs pre-migration state convergence processing on the source side to ensure that the source side running state meets the migration consistency conditions. Then, based on the source side running state, it generates a task running state encapsulation object including task execution state, external resource association state, tool invocation state, and running constraint state. Finally, it combines the running constraint state and the target side running environment to perform cross-domain migration admission, target side state reconstruction, and target side running constraint determination. Therefore, this application enables agent tasks to maintain a consistent correspondence between task execution progress, external resource association, tool invocation state, and running constraints when migrating across devices, business domains, or organizational boundaries. This reduces the risk of post-migration state drift, repeated execution, resource association failure, or running constraint mismatch, allowing agent tasks to continue running from the task execution breakpoint corresponding to the source side running state on the target side. This improves the continuity, stability, and controllability of agent task cross-domain migration continuation. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other implementation methods can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is one of the flowcharts illustrating a method for cross-domain migration and continuation of runtime state of an intelligent agent provided in an embodiment of this application; Figure 2 This is a second flowchart illustrating a method for cross-domain migration and continuation of runtime state of an intelligent agent, provided in an embodiment of this application. Figure 3 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0014] Some embodiments of this application relate to a method for cross-domain migration and continuation of agent runtime states. This method can be applied to scenarios where agent tasks need to continue execution after migration across devices, nodes, business domains, or organizational boundaries. In some embodiments, this method can be deployed in an agent runtime framework and executed collaboratively by a source-side runtime, a migration gateway, and a target-side runtime. The source-side runtime can be understood as the runtime environment in which the agent task resides before cross-domain migration, used to carry out the execution, state management, tool invocation, and constraint control of the agent task, and to perform pre-migration state convergence processing and generate a task runtime encapsulation object. The migration gateway can be used to combine the runtime constraint state in the task runtime encapsulation object and the target-side runtime environment to perform cross-domain migration admission and transmission control. The target-side runtime can be understood as the runtime environment used for continued execution of the agent task after cross-domain migration, used to reconstruct the target-side state, determine the target-side runtime constraints, and schedule continuation of the task runtime encapsulation object.
[0015] Furthermore, this method can also be implemented by combining one or more of the following: edge nodes, domain-level control plane, organization-level policy center, trusted signature service, and audit ledger. Edge nodes can be used to support the runtime of intelligent agents located near the device or business site; the domain-level control plane and organization-level policy center can provide the resources, permissions, compliance, or policy controls required for cross-domain migration; the trusted signature service can support the integrity processing of the task runtime encapsulated object; and the audit ledger can record key events during cross-domain migration and continuation. Through the above methods, this embodiment of the application can achieve consistent convergence and runtime encapsulation of the source-side runtime state when an intelligent agent task undergoes cross-domain migration, and form a continueable state during runtime on the target side, enabling the intelligent agent task to continue running from the task execution breakpoint corresponding to the source-side runtime state.
[0016] Reference Figure 1 , Figure 2 As shown, this application may include the following steps: Step S1: In response to the cross-domain migration triggering condition of the agent task, perform pre-migration state convergence processing on the agent task during source-side runtime to obtain the source-side runtime state that satisfies the migration consistency condition.
[0017] In some embodiments, cross-domain migration triggering conditions may include at least one of the following: device switching, node failure, business domain switching, organizational boundary switching, target-side computing resource adjustment, budget shortage, task scheduling policy change, or manual migration command. The source-side runtime can be the runtime environment in which the agent task resides before the migration occurs. This runtime environment can be used to carry out task scheduling, context management, tool invocation, external resource access, and runtime constraint control for the agent task.
[0018] Upon detecting a cross-domain migration trigger condition, the source-side runtime does not immediately package and transmit the agent task's state. Instead, it first enters a pre-migration state convergence process. This process establishes a stable pre-migration consistency boundary on the source side, ensuring that the agent task's execution progress, external resource associations, tool invocation state, and runtime constraint state are fixed at the same migrateable state point before generating the task runtime encapsulation object. This avoids external writes, tool returns, budget deductions, or resource reference changes occurring during the state encapsulation process, thereby reducing the risk of post-migration state drift, duplicate execution, or constraint mismatch.
[0019] In a preferred embodiment, step S1, which involves performing pre-transfer state convergence processing on the agent task during source-side runtime to obtain a source-side runtime state that satisfies the transfer consistency condition, specifically includes: Step S101: Establish a state convergence window during source-side runtime, and pause agent tasks to initiate new external state change operations within the state convergence window, allowing initiated read operations or computation operations that do not change the external state to continue execution.
[0020] In some embodiments, the state convergence window can be understood as a freeze window or consistency convergence window established by the source-side runtime for the agent task before migration. Within the state convergence window, the source-side runtime pauses or suspends external state change operations of the agent task. External state change operations may include operations that change the state of external systems, such as submitting a work order, sending an email, writing to a database, creating an order, modifying a remote file, calling a procurement interface, calling a payment interface, or submitting a write request to a third-party system. For the above operations, if they have not yet been initiated, they are no longer allowed to be initiated within the state convergence window; if they have already been initiated, the source-side runtime may wait for them to return a confirmation result, or mark them as compensable, retryable, non-replayable, or pending manual confirmation.
[0021] Meanwhile, the state convergence window does not require the immediate interruption of all execution processes of the agent's task. Operations already initiated, such as read operations, query operations, local inference, summary generation, state organization, cache computation, and rule judgment, which do not change the state of the external system, can be allowed to continue execution until a safe termination point. This avoids abruptly terminating the agent's task and causing state loss, and also prevents the generation of new external side effects before migration.
[0022] In a specific example, an agent task is executing an enterprise process automation task. It has already read customer data, generated approval opinions, and is preparing to submit the processing result to the work order system. When it is detected that the task needs to be migrated from the source business domain to the target business domain, the source-side runtime can establish a state convergence window. Within this window, the source-side runtime suspends the agent from submitting new work order write requests, but allows it to complete the reading of existing data, the organization of approval opinions, and local state calculations. If a request has already been submitted to the work order system before the window is established, the source-side runtime can wait for the work order system to return a confirmation result, or record the external interaction result as pending confirmation or compensable.
[0023] Step S102: Perform convergence processing on the task execution state, external resource association state, tool call state, and running constraint state related to task continuation in the agent task.
[0024] In this embodiment, the task execution state may include at least one of the following: target identifier, plan stack, current execution position, program count, local variables, pending task queue, checkpoint chain, retry count, and pending tool events. Convergence processing of the task execution state may include fixing the current execution progress to an execution point that can be identified and resumed by the target side, and recording the context, plan structure, and task unit to be executed corresponding to that execution point. In this way, after reconstructing the target-side execution context based on the task execution state, the target-side runtime can determine from which task breakpoint the agent task should continue running, rather than simply re-inferring the execution progress based on text history.
[0025] External resource association states can include the association states of resources such as working memory, vector memory, file objects, database records, object storage entries, external knowledge base results, remote task objects, or third-party system objects. Convergence processing of external resource association states can include converting resource references that directly depend on the source-side local environment into portable resource association information, such as content-addressed references, controlled references, access tickets, resource digests, resource domain information, or expiration information. For resources unsuitable for direct cross-domain resolution, they can be processed as digest replacements, delayed resolution, or restricted references to prevent the target side from being unable to identify the source-side local resource path or to access the original data in compliance with regulations.
[0026] Tool invocation status can include at least one of the following: tool identifier, tool version, invocation stage, tool session alias, invocation parameter summary, external return status, idempotency flag, proxy strategy, reconstruction strategy, and pending invocation status. Convergence processing of tool invocation status can include confirming the return result of an initiated tool invocation, converting local tool handles, browser sessions, database cursors, remote job references, or external API sessions into portable tool invocation descriptions, and recording the tool invocation's status on the target side as natively rebindable, proxyable, replaceable, or requiring suspension. For tool invocations with external side effects, such as email sending, work order submission, and purchase order placement, their completion confirmation status or anti-duplicate execution flag can also be recorded to reduce the risk of duplicate invocations after migration.
[0027] Operational constraint states can include at least one of the following: permission scope, budget status, compliance tags, data classification, tenant boundaries, residency region, purpose restrictions, retention period, outbound restrictions, audit level, and risk limit. Convergence processing of operational constraint states can include locking the current budget deduction status on the source side, recording the consumed and remaining budget, and fixing the permissions, budget, and compliance constraints related to the agent's task into constraint states that can be recognized by the target side. In this way, during subsequent target-side reconstruction, the target-side permission scope, target-side budget status, and continuation constraints can be determined based on the aforementioned operational constraint states, rather than re-executing the task without constraints on the target side.
[0028] In a specific example, before the agent task migration, it had already invoked a database query tool, an email draft tool, and a ticket submission tool. The source-side runtime can convert the external resource association state corresponding to the database query results into a controlled resource reference, convert the session state of the email draft tool into a migrated tool call description, record the unconfirmed return of the ticket submission tool as an external interaction result, and write the token budget, call count budget, and corresponding data category labels consumed by the task into the runtime constraint state. Through the above processing, the source-side runtime can converge the states that were originally scattered in the task execution engine, tool system, storage system, and policy system into a runtime state that the target side can continue to process.
[0029] Step S103: If the task execution state, external resource association state, tool call state, running constraint state, and initiated external state change operations all meet the migration consistency conditions after convergence processing, the source-side running state after convergence processing is determined as the source-side running state that meets the migration consistency conditions.
[0030] In this embodiment, migration consistency conditions can be used to determine whether the source-side runtime state has reached a state where a task runtime encapsulation object can be generated. Specifically, a task execution state satisfying migration consistency conditions can include the task execution state being able to locate a consistent execution point, and this consistent execution point being able to be used by the target side to restore the task execution context. An external resource association state satisfying migration consistency conditions can include the external resource association state being converted into portable resource association information, or being marked as digest replacement, delayed resolution, or non-portable removal. A tool call state satisfying migration consistency conditions can include the tool call state being converted into a portable tool call description, or being marked as rebuildable, proxied, replaceable, or suspended. A runtime constraint state satisfying migration consistency conditions can include permissions, budgets, and compliance tags being locked or written into portable constraint information.
[0031] For an initiated external state change operation, meeting the migration consistency conditions can include: the external state change operation has returned a confirmation result; or although it has not yet returned a final result, it already has a compensable processing status, a retryable status, a non-replay flag, or a manual confirmation flag; or it has been determined that migration is not allowed and has triggered migration rejection or migration postponement. This avoids duplicate submissions of the same external state change operation before and after migration, and also prevents the target side from continuing to execute high-risk operations without knowing the execution result from the source side.
[0032] During the judgment process, the source-side runtime can generate migration consistency judgment results based on the convergence results of various states. If the task execution state cannot yet locate a consistent execution point, or critical logs have not been solidified, or tool calls still have unconfirmed and uncompensable external side effects, or the runtime constraint state has not been locked, the source-side runtime can reject this migration, postpone the migration, revert to the previous security checkpoint, or enter the compensation convergence branch. If all of the above states meet the migration consistency conditions, the source-side runtime will determine the converged source-side runtime state as the source-side runtime state that meets the migration consistency conditions, and use this source-side runtime state as the basis for subsequently generating task runtime encapsulation objects.
[0033] In the solution provided in this embodiment, through steps S101 to S103, a state convergence window is established before the agent task migration, new external state change operations are paused, and read operations or computational operations that do not change the external state are allowed to continue to finish. This allows the source-side runtime to limit the generation of new external side effects without abruptly terminating the agent task. By performing convergence processing on the task execution state, external resource association state, tool call state, and runtime constraint state, and after the above states and initiated external state change operations satisfy the migration consistency condition, the source-side runtime state that meets the migration consistency condition is determined. This transforms the source-side runtime from a continuously changing state into an encapsulated, verifiable, and recoverable state. Therefore, the risks of repeated execution, state drift, resource association failure, inconsistent tool call results, and runtime constraint mismatch after migration can be reduced, providing a reliable foundation for the subsequent generation of task runtime encapsulation objects and target-side breakpoint continuation.
[0034] In a preferred embodiment, the pre-migration state convergence process employs a phased freezing mechanism, which includes a first freezing phase and a second freezing phase executed sequentially within the same state convergence window, and is specifically implemented in the following manner: In response to the agent's task entering the transition state, a freeze period identifier corresponding to the state convergence window is created. The freeze period identifier is used to associate and record the state convergence results generated within the state convergence window. In the first freeze phase, new external state change operations initiated by the agent task are suspended, while read operations or computational operations that do not change the external state are allowed to continue to be executed. The execution records and external interaction results generated by the agent task before the migration are consistent and solidified. In the second freezing phase, the task execution state is sealed, the external resource association state is converted into a portable reference, the tool call state is converted into a portable tool call description, and the running constraint state is locked.
[0035] Specifically, in response to the agent's task entering the transition state, the source-side runtime creates a freeze period identifier corresponding to the state convergence window. The freeze period identifier can be used to identify the current state convergence window and associate the state convergence results generated within that window. For example, the source-side runtime can associate the freeze period identifier with execution records, external interaction results, task execution state sealing results, external resource association state transition results, tool call state transition results, and runtime constraint state locking results, so that these results are identified as belonging to the same pre-transition state convergence process, thereby avoiding the mixing of state records before, during, and after freezing.
[0036] During the first freeze phase, the source-side runtime suspends the agent task from initiating new external state change operations. The source-side runtime can intercept, suspend, or refuse scheduling these operations through the task scheduling layer, tool invocation layer, or external interface proxy layer, ensuring that the agent task does not generate new external side effects within the state convergence window. Simultaneously, computational operations that have already been initiated and do not change the external state can be allowed to continue execution until a safe termination point. Therefore, the first freeze phase does not directly terminate the agent task, but rather, while preventing new external state changes from occurring, allows operations that do not cause external state changes to complete the necessary termination.
[0037] During the first freeze phase, the source-side runtime also performs consistency solidification on the execution records and initiated external interaction results of the agent tasks generated before migration. Execution records may include at least one of the following: task planning records, model call records, tool call records, critical logs, checkpoint indexes, retry counts, and failure contexts. External interaction results may include external tool return results, remote system confirmation results, asynchronous interface callback results, external write confirmation results, or pending confirmation results of external state change operations. For external state change operations that have been initiated but not yet confirmed, the source-side runtime can wait for their confirmation results; if confirmation cannot be obtained within a predetermined time, they can be marked as pending confirmation, compensable processing, non-replayable, or delayed migration. Through this consistency solidification process, the source-side runtime can clearly identify which external interactions have been completed, which have not yet been completed, and which can be compensated or retried, thereby reducing the risk of duplicate or missed executions during target-side continuation.
[0038] After the first freeze phase is completed, the source-side runtime enters the second freeze phase. In the second freeze phase, the source-side runtime archives the task execution state. Archived task execution state can include generating a snapshot of the task execution state and fixing the current execution progress of the agent's task to a consistent execution point that can be recognized and restored by the target-side runtime. Therefore, after reconstructing the target-side execution context based on the task execution state, the target-side runtime can determine from which task execution breakpoint the agent's task should continue running, rather than simply re-inferring the execution progress based on text history.
[0039] During the second freeze phase, the source-side runtime performs a portable reference transformation on the associated state of external resources. This transformation can include converting source-side local paths, local cached objects, or temporary resource handles into content-addressed references, controlled references, access tickets, resource digests, resource domain information, or expiration information. For highly sensitive data or data unsuitable for direct cross-domain copying, the original data can be written to a resource reference that can be resolved by the target side when permissions and compliance conditions are met, instead of writing it into the subsequent task runtime encapsulation object. For resources that cannot be resolved across domains, they can also be marked as digest replacement, deferred resolution, or non-portable removal.
[0040] During the second freeze phase, the source-side runtime performs a portable tool call description transformation on the tool call state. For tool states that cannot be directly copied to the target side, such as local tool sessions, browser sessions, database cursors, remote job references, or external API sessions, the source-side runtime can transform them into portable tool call descriptions that the target side can recognize. For tool calls with external side effects, they can also be associated with the external interaction results solidified in the first freeze phase to prevent the target side from making repeated calls when it cannot confirm the execution results on the source side.
[0041] During the second freezing phase, the source-side runtime also locks the runtime constraint state. Locking the runtime constraint state can include recording the source-side consumed budget, remaining budget, locked budget, current permission scope, and data compliance tags related to the agent task. This ensures that the above constraint states can be inherited, verified, or remapped during subsequent cross-domain migration and target-side reconstruction. This prevents unauthorized execution, budget mismanagement, or constraint mismatch that could occur after agent task migration due to asynchronous permissions, budgets, or compliance constraints.
[0042] In some embodiments, after the first and second freezing phases are completed, the source-side runtime can determine whether to allow the generation of the final task runtime encapsulated object based on the pre-migration freeze protocol. That is, the migration does not occur immediately after the cross-domain migration condition is triggered, but rather the generation process of the task runtime encapsulated object is only allowed after the source-side runtime state satisfies the consistency constraints. For example, the freeze readiness determination can be made according to the following formula: in, Indicates time The freeze-ready result; Indicates an indicator function, symbol " The parentheses indicate a logical AND operation, meaning the value is 1 if all conditions within the parentheses are met, and 0 otherwise. Indicates whether there are still unconfirmed external state change operations within the state convergence window; Indicates whether critical logs have been flushed before the migration; Indicates whether the tool invocation status has been converted from a local tool handle to a portable tool invocation description; This indicates whether the budget deduction status has been locked on the source side.
[0043] In this embodiment, if If so, it means that the source-side runtime state meets the freeze-ready condition, and the source-side runtime can generate a task runtime encapsulation object based on this source-side runtime state; if If the condition is met, it indicates that the source-side runtime state has not yet met the freeze readiness conditions. The source-side runtime can continue to perform state convergence processing, wait for confirmation of external state change operations, flush critical logs, continue to change tool call states, lock the budget state, or reject this migration. This avoids premature migration when external side effects are not confirmed, critical logs are not flushed, tool handles are not changed, or budget deductions are not locked, reducing the risk of repeated execution, state drift, log gaps, and budget inconsistencies after migration.
[0044] In some embodiments, based on meeting the freeze readiness condition, the source-side runtime can further calculate a freeze score based on the state convergence results generated within the state convergence window. The freeze score can be used to characterize the degree to which the source-side runtime state after convergence satisfies the migration consistency condition. For example, the freeze score can be determined according to the following formula: in, Indicates time The corresponding frozen score; This indicates the degree of consistency between the task execution status and the log records; Indicates the degree to which the external resource association state has completed a transferable reference conversion; Indicates the degree to which the tool call state has completed the transition of the migrateable tool call description; Indicates the degree to which the running constraint state is locked; Indicates the degree of drift of newly added states within the state convergence window; , , , and These represent the weight coefficients of the corresponding scoring items.
[0045] In some embodiments, , , , and These can be normalized to values between 0 and 1. The larger the value, the more consistent the task execution status is with the log records; The larger the value, the more fully the external resource association state completes the transferable reference conversion; The larger the value, the more fully the tool invocation state completes the transition to a transferable tool invocation description; The larger the value of , the more fully the running constraint state is locked; The larger the value of , the more significant the drift of newly added states during the freeze period. Therefore, It is included in the frozen score calculation as a negative scoring item.
[0046] In some embodiments, if If the score is greater than or equal to the preset freeze score threshold, and the initiated external state change operation has reached the confirmed state or the compensable processing state, then the source-side runtime can determine that the source-side runtime state after convergence processing meets the migration consistency condition. If the score is below the preset freeze threshold, the source-side runtime can continue state convergence processing, postpone migration, enter the compensation freeze branch, or reject the migration based on the unmet score items. For example, if the external resource association state has not completed the migrateable reference conversion, resource reference conversion, summary replacement, or removal processing can continue; if the tool call state has not completed the migrateable tool call description conversion, the corresponding tool call state can be marked as rebuildable, proxied, replaceable, or suspended; if the runtime constraint state has not completed the locking, the budget state and compliance label can continue to be locked; if there are still new state drifts within the state convergence window, the state convergence window can be extended or the migration can be rejected.
[0047] In the solution provided in this embodiment, the first and second freezing phases are executed sequentially within the same state convergence window through the aforementioned phased freezing mechanism. The freezing period identifier is used to associate the state convergence results, which reduces consistency judgment errors caused by the mixing of state records at different freezing points. The first freezing phase is used to suspend new external state change operations and allow safe operations to continue to complete. The second freezing phase is used to seal, transform, and lock the task execution state, external resource association state, tool invocation state, and runtime constraint state, so that the source-side runtime state converges to an encapsulated, verifiable, and recoverable state. Therefore, the source-side runtime state can be converged to a verifiable consistency boundary, avoiding premature migration before the execution state, resource reference, tool invocation state, or runtime constraints have fully converged.
[0048] Step S2: Generate a task runtime encapsulation object based on the source-side running status. The task runtime encapsulation object includes the task execution status, external resource association status, tool invocation status, and running constraint status required for the agent task to continue running on the target side.
[0049] In some embodiments, the task runtime encapsulation object can be understood as an encapsulation object used to carry the runtime information required for the continuation of agent tasks during cross-domain migration. This task runtime encapsulation object does not merely store the text session content or task logs of the agent task, but rather organizes the task execution progress, external resource associations, tool call status, and runtime constraint status of the agent task during runtime on the source side into a data object that can be verified, parsed, reconstructed, and rescheduled during runtime on the target side.
[0050] Once the source-side runtime state meets the migration consistency conditions, the source-side runtime can generate a task runtime encapsulation object based on that source-side runtime state. Since the source-side runtime state has already undergone pre-migration state convergence processing, the task execution state, external resource association state, tool invocation state, and runtime constraint state used when generating the task runtime encapsulation object belong to the same migration consistency boundary. This reduces the inconsistency issues caused by mixing runtime states from different points in time into the same encapsulation object.
[0051] In a preferred embodiment, step S2, which involves generating a task runtime encapsulation object based on the source-side runtime state, specifically includes: Step S201: Based on the source-side running state, determine the set of states required for the target-side continuation of the agent's task.
[0052] In some embodiments, the source-side runtime can determine from the source-side runtime state the set of states required for the agent task to continue running on the target side. This set of states may include a task execution state for restoring the task execution context, an external resource association state for accessing or resolving external resources on the target side, a tool invocation state for rebuilding or adapting the tool invocation process on the target side, and a runtime constraint state for determining permissions, budget, and compliance restrictions on the target side.
[0053] In some embodiments, the state set required for target-side continuation may exclude temporary caches unrelated to target-side continuation, expired intermediate results, redundant text content, or original sensitive data that is not allowed to be copied across domains. In other words, the source-side runtime can determine the state content to be written to the task runtime encapsulation object based on the task breakpoints required for target-side continuation, the units of tasks to be executed, external resource references, tool call chains, and runtime constraints, thereby avoiding directly writing unnecessary or unsuitable data for cross-domain migration into the encapsulation object.
[0054] Step S202: Perform reference processing on the external resource associated states in the state set to obtain portable resource references, and perform descriptive processing on the tool call states in the state set to obtain portable tool call descriptions.
[0055] In some embodiments, for external resource-associated states in a state set, the source-side runtime may perform referencing processing to obtain portable resource references. Referencing processing may include converting source-side local paths, local cached objects, database record identifiers, external object identifiers, vector retrieval results, or remote resource handles into resource reference forms that the target-side runtime can recognize or subsequently resolve. Portable resource references may include at least one of content-addressed references, controlled references, access tickets, resource digests, resource domain information, validity information, and necessary metadata.
[0056] In some embodiments, for data involving sensitive data, restricted data, or data unsuitable for direct cross-domain replication, the source-side runtime may not directly write the original external resource data into the task runtime encapsulation object, but instead write it into a portable resource reference. During subsequent reconstruction, the target-side runtime can resolve this portable resource reference if permissions and compliance conditions are met; for resources that cannot be resolved across domains, digest replacement, delayed resolution, or removal can be used. Thus, the task runtime encapsulation object can both preserve the resource relationships required for continued execution on the target side and reduce the risk of original sensitive data spreading across boundaries.
[0057] For tool invocation states in the state set, the source-side runtime can perform descriptive processing to obtain a portable tool invocation description. Descriptive processing may include converting local tool sessions, browser sessions, database cursors, remote job references, external API sessions, or other tool states that depend on the source-side environment into portable tool invocation descriptions that the target-side runtime can recognize.
[0058] For example, when an agent task has already invoked a remote job tool on the source side, the source-side runtime can avoid directly copying the source-side tool session itself. Instead, it can convert the tool invocation state into a transferable tool invocation description that includes the remote job identifier, invocation stage, return status, idempotency flag, and reconstruction strategy. The target-side runtime can then use this transferable tool invocation description to perform native rebinding, proxy access, alternative tool adaptation, or suspension processing on the corresponding tool invocation state, thereby preventing the task from failing to continue due to the inability to directly transfer the source-side local tool handle.
[0059] Step S203: According to the predetermined field rules, the task execution status, portable resource reference, portable tool call description and running constraint status in the status set are standardized and encapsulated to obtain standardized encapsulated data.
[0060] In some embodiments, the source-side runtime can standardize and encapsulate the set of states required for continued execution on the target side according to predetermined field rules. These predetermined field rules can be used to define the field order, field name, field version, field type, encoding method, and dependencies of various states in the task runtime encapsulation object, enabling the task runtime encapsulation objects generated by different source-side runtimes to be parsed by the target-side runtime according to unified rules.
[0061] In some embodiments, normalized encapsulated data can be organized using a unified encapsulation model. For ease of explanation, time can be used as a reference. The corresponding task runtime encapsulation object is represented as: in, Indicates time The corresponding task runtime encapsulation object; The encapsulation header can include at least one of the following: encapsulation object identifier, field rule version, source-side runtime identifier, source domain identifier, creation time, expiration time, and migration random number. Indicates the task execution status; This represents the set of migrateable resource references corresponding to the external resource association status; This indicates the portable tool call description corresponding to the tool call status; Indicates the budget status; Indicates compliance label; This represents the permission chain and authorization proof; Indicates a field for proof of integrity; This indicates the candidate migration path and the target-side reconstruction preference.
[0062] In this embodiment, , , , , and Each can correspond to the task execution status, portable resource references, portable tool call descriptions, and runtime constraint status required for continued running on the target side. It can be used to identify the runtime encapsulated object of a task and the version of its field rules; It can be used as a proof reserved field in step S203, and the summary, signature or verification information can be written in the integrity processing of the subsequent step S204; It can be used to record candidate migration paths, target-side reconstruction preferences, or migration route constraints for subsequent cross-domain migration admission and target-side state reconstruction.
[0063] During the normalization encapsulation process, the source-side runtime can uniformly encode, sort, and populate the task execution status, portable resource references, portable tool call descriptions, and runtime constraint status according to the aforementioned unified encapsulation model, resulting in normalized encapsulated data. In other words, the source-side runtime does not simply copy the entire source-side runtime state into the task runtime encapsulation object; instead, it organizes the execution progress, resource associations, tool calls, budgets, compliance, permissions, and rebuild preferences required for continued execution on the target side according to predetermined field rules. This allows the task runtime encapsulation object to form a stable field structure, enabling the target-side runtime to parse, verify, rebuild the state, and schedule continued execution based on the same field rules. Furthermore, it allows subsequent integrity processing to perform digest calculations and signature processing on the stable normalized encapsulated data.
[0064] Step S204: Perform integrity processing on the normalized encapsulated data, including digest calculation and signature processing, to obtain a task runtime encapsulated object carrying integrity proof information.
[0065] In some embodiments, after obtaining the normalized encapsulated data, the source-side runtime can perform integrity processing on the normalized encapsulated data to generate a task runtime encapsulated object carrying integrity proof information. Integrity processing may include digest calculation and signature processing. Through this integrity processing, the target-side runtime, upon receiving the task runtime encapsulated object, can determine whether the task runtime encapsulated object was generated by a trusted source-side runtime, whether it has been tampered with during cross-domain transmission, whether it is still valid, and whether it belongs to the current valid migration process.
[0066] In some embodiments, the source-side runtime may first perform normalized serialization processing on the normalized encapsulated data before digest calculation. Normalized serialization processing is used to convert the field-encapsulated data formed in step S203 into a stable digest input. For example, the normalized serialization result can be determined according to the following formula: in, Indicates time Corresponding standardized capsule data; This represents a normalization processing function used to stably serialize input fields according to a predetermined field order, predetermined encoding method, and predetermined field rules; Indicates the package header; Indicates the task execution status; Represents a set of portable resource references; This represents a set of portable tool call descriptions; Indicates the budget status; Indicates compliance label; This represents the permission chain and authorization proof; This indicates the candidate migration path and the target-side reconstruction preference; This indicates that the items in the set are sorted according to a predetermined sorting rule.
[0067] In the above-mentioned normalized serialization process, for and Sorting is necessary because the set of portable resource references and the set of portable tool call descriptions typically contain multiple entries, and different runtime environments or concurrent execution processes may result in different original collection orders of these entries. Sorting prevents the same set of resource references or tool call descriptions from obtaining different normalized serialization results due to different entry order. (Integrity verification field) It can be excluded from normalized serialization input, or treated as an empty field or proof placeholder field during digest computation, to avoid self-referencing issues caused by incorporating subsequently generated digests or signatures back into the digest input.
[0068] After obtaining the normalized capsule data, the source-side runtime can calculate the encapsulation digest based on the normalized capsule data, policy version, migration random number, and expiration time. For example, the encapsulation digest can be determined according to the following formula: in, Indicates time Corresponding package summary; Represents a hash function; Represents normalized capsule data; Indicates the strategy version applicable when generating the task runtime encapsulation object; Represents the migration random number; This indicates the expiration time of the encapsulated object during task runtime. By incorporating the policy version, migration random number, and expiration time into the digest calculation, the target runtime can simultaneously verify the applicable policy version, migration uniqueness, and validity period of the encapsulated object during signature verification.
[0069] In some embodiments, the source-side runtime can sign the encapsulation digest based on the source-side key or a trusted signature service to obtain a signature proof. The signature proof may include at least one of the following: signature value, signature subject identifier, signature time, signature certificate chain, trusted signature service identifier, and signature algorithm identifier. The source-side runtime can write the encapsulation digest, signature proof, policy version, migration random number, expiration time, and source-side runtime identifier into integrity proof information, and then fill the integrity proof information into the proof field of the task runtime encapsulation object to obtain a task runtime encapsulation object carrying integrity proof information.
[0070] In some embodiments, the source-side runtime can also encrypt the normalized encapsulated data or the task runtime encapsulated object, and write the encryption parameters, key identifier, or encryption policy identifier into the integrity proof information or the encapsulation header field. For cross-organizational or high-security domain migration scenarios, the integrity proof information can also be associated with a freeze period identifier, migration log reference, or audit record identifier, enabling the target-side runtime to associate the task runtime encapsulated object with the source-side freeze, encapsulation, and migration process.
[0071] Through the above processing, the source-side runtime can convert normalized encapsulated data into a task runtime encapsulated object carrying integrity proof information. After receiving this task runtime encapsulated object, the target-side runtime can perform digest verification, signature verification, validity period verification, policy version verification, and migration random number verification based on the integrity proof information, thereby reducing the risk of the encapsulated object being tampered with, forged, reused, or the chain of responsibility becoming untraceable.
[0072] In the solution provided in this embodiment, through steps S201 to S204, the set of states required for continued execution on the target side is determined based on the source side's running state. Then, external resource-related states are referenced, and tool call states are described. These are then standardized and encapsulated according to predetermined field rules, ensuring completeness. This makes the task runtime encapsulated object not simply a text snapshot or task log, but a portable and verifiable encapsulated object capable of carrying task execution state, resource associations, tool calls, and runtime constraints. This reduces the compatibility and compliance risks associated with directly copying original resources or local tool handles across domains, improves the target side's ability to parse, verify, and reconstruct the task runtime encapsulated object, and provides a reliable data foundation for subsequent cross-domain migration access, target side state reconstruction, and breakpoint resumption.
[0073] Step S3: Based on the running constraint state and the target side running environment, perform cross-domain migration admission processing on the task running state encapsulated object, and if the task running state encapsulated object meets the cross-domain migration admission requirements, transfer the task running state encapsulated object to the target side runtime.
[0074] In some embodiments, after the task runtime encapsulated object completes encapsulation and integrity processing on the source side, it is not directly transmitted to the target runtime. Instead, it first undergoes cross-domain migration admission processing. This cross-domain migration admission processing can be jointly executed by the migration gateway, compliance and permission engine, budget and quota module, and the target runtime environment. It is used to determine whether the task runtime encapsulated object is allowed to migrate from the source runtime environment to the target runtime environment, and what migration path should be used for transmission. The source runtime environment and the target runtime environment may differ from at least one of the following: device, node, business system, tenant domain, permission domain, policy domain, or organizational management boundary. Accordingly, cross-domain migration can include at least one of cross-device migration, cross-business domain migration, and cross-organizational boundary migration. Cross-device migration can refer to the migration of an agent task from a source device, source node, or source runtime instance to a target device, target node, or target runtime instance. Cross-business domain migration can refer to the migration of an agent task from one business system, tenant domain, permission domain, or policy domain to another. Cross-organizational boundary migration can refer to the migration of an agent task from a runtime environment controlled by one organization to a runtime environment controlled by another organization. By performing cross-domain migration admission processing before transmission, it is possible to verify whether the target runtime environment meets the permission, budget, compliance, residency region, tenant isolation, and audit requirements carried by the task runtime encapsulated object, thus preventing the task runtime encapsulated object from being transmitted to a target runtime environment that does not meet the acceptance conditions.
[0075] In a preferred embodiment, step S3, which involves performing cross-domain migration admission processing on the task runtime encapsulated object based on the runtime constraint state and the target-side runtime environment, specifically includes: Step S301: Based on the running constraint state in the task running state encapsulation object, determine the migration constraint information corresponding to the agent task, and obtain the target side admission conditions corresponding to the target side running environment.
[0076] In some embodiments, the source-side runtime or migration gateway can parse the runtime constraint state in the task runtime encapsulation object to determine the migration constraint information corresponding to the agent task. The migration constraint information may include at least one of the following: data classification, compliance label, tenant boundary, residency region, purpose restriction, retention period, outbound restriction, audit level, source-side permission scope, permission chain, delegation token, budget status, migration route preference, and risk level. This migration constraint information characterizes the compliance, permission, budget, and path constraints that the agent task must meet during cross-domain migration.
[0077] For example, when the task runtime object carries compliance labels such as "personal sensitive information", "domestic processing only", "not allowed to be sent to partner domains", or "enhanced auditing needs to be enabled", migration constraint information can indicate that the task can only be migrated to the target side runtime environment that meets the corresponding data residency, tenant isolation and auditing requirements; when the task runtime object carries the remaining budget status and permission chain, migration constraint information can also indicate that the target side needs to have the corresponding budget quota and the minimum inheritable permission range.
[0078] In some embodiments, the migration gateway may also obtain the target-side admission conditions corresponding to the target-side operating environment. The target-side admission conditions may include whether the target-side operating environment is in the target-side whitelist, whether there is a trusted relationship between the target side and the source side, whether the target side meets the data residency and tenant isolation requirements, whether the target side supports the corresponding audit level, whether the target side has the required model capabilities, tool capabilities, storage capabilities and network capabilities, whether the target side has available budget quotas, and whether there is an available migration link between the source side and the target side that meets the security requirements.
[0079] Step S302: Based on the migration constraint information and the target-side admission conditions, perform cross-domain migration admission verification and migration path selection on the task runtime encapsulated object to obtain the cross-domain migration admission result.
[0080] In some embodiments, the migration gateway can match migration constraint information with target-side admission conditions to perform cross-domain migration admission verification on task runtime encapsulated objects. This cross-domain migration admission verification is a pre-processing governance verification before the transmission of task runtime encapsulated objects, used to determine whether the target-side runtime environment has the conditions to receive and accept the task runtime encapsulated object. Cross-domain migration admission verification may include at least one of the following: compliance label verification, residency and tenant boundary verification, target-side trust verification, permission chain validity verification, budget acceptability verification, target-side capability verification, and migration link availability verification.
[0081] Among them, compliance label verification can be used to determine whether the data classification, compliance label, purpose restriction, retention period, outbound restriction and audit level carried by the task runtime encapsulated object match the target side access policy; residency and tenant boundary verification can be used to determine whether the target side runtime environment meets the residency region requirements, tenant isolation requirements and organizational boundary control requirements corresponding to the task runtime encapsulated object; target side trust verification can be used to determine whether the target side runtime environment belongs to the preset target side whitelist, or whether there is a trusted relationship with the source side runtime, source side domain or organizational-level policy center; permission chain validity verification can be used to determine whether the permission chain, authorization certificate or delegation token in the task runtime encapsulated object is still in a valid state and whether it can be recognized by the target side runtime environment; budget acceptability verification can be used to determine whether the target side has the budget quota or budget mapping conditions required to accept the task to continue running; target side capability verification can be used to determine whether the target side has the ability to parse the task runtime encapsulated object, parse the migrateable resource reference, rebuild or proxy tool call status and accept the task to continue running; migration link availability verification can be used to determine whether the candidate migration link meets the requirements of transmission security, link availability, migration latency and relay policy.
[0082] It should be noted that the permission chain validity check and budget inheritability check in this step are mainly used to determine whether the task runtime encapsulated object has the migration admission conditions; the actual inheritable permission range and usable budget state on the target side can be further determined in the subsequent target side state reconstruction process based on the target side's allowed permission range, compliance restrictions and budget remapping rules.
[0083] In some embodiments, the migration gateway can directly eliminate candidate target-side operating environments or candidate migration paths that do not meet hard compliance constraints, target-side whitelists, residency regions, tenant boundaries, or trust relationship requirements. For candidate migration paths that meet hard constraints, the migration gateway can further make a comprehensive selection based on trustworthiness, residency constraint matching degree, availability, latency, and risk. For example, the target migration path can be determined according to the following calculation formula: in, Indicates time Selected target migration path; Indicates at time The set of candidate migration paths that satisfy hard admission constraints; Indicates candidate migration paths The credibility of the target-side operating environment; Indicates candidate migration paths The degree of matching between the residency area, tenant boundaries, and purpose restrictions; Indicates candidate migration paths Link availability or target-side resource availability; Indicates candidate migration paths Transmission delay or relay cost; Indicates candidate migration paths Compliance risks, security risks, or external risks; , , , and These represent the weight coefficients of the corresponding scoring items.
[0084] In some embodiments, , , , and Each value can be normalized to a preset range. Trustworthiness, residency constraint matching, and availability are positive scoring items; higher values indicate a more suitable candidate migration path as the target migration path. Latency and risk are negative scoring items; higher values indicate higher transmission costs or migration risks for the candidate migration path. Through this method, migration paths with higher trustworthiness, better residency constraint matching, more available links, lower latency, and lower risk can be prioritized while meeting compliance and trust bottom lines.
[0085] Step S303: If the cross-domain migration admission result indicates that migration is allowed, determine whether the task runtime encapsulated object satisfies the cross-domain migration admission requirement.
[0086] In some embodiments, after obtaining the cross-domain migration admission result, the migration gateway can determine whether the task runtime encapsulated object meets the cross-domain migration admission requirements based on the cross-domain migration admission result. The cross-domain migration admission result may include at least one of the following: allow migration, allow restricted migration, refuse migration, or await approval. Allowing restricted migration can be understood as a restricted form of allowing migration.
[0087] If the cross-domain migration admission result indicates that migration is allowed, it means that the target-side runtime environment meets the compliance label, residency region, tenant boundary, permission chain, budget acceptance conditions, target-side capability conditions, and migration link conditions carried by the task runtime encapsulated object. The migration gateway can determine that the task runtime encapsulated object meets the cross-domain migration admission requirements. At this time, the migration gateway can associate at least one of the following with the admission conclusion, target-side runtime identifier, target migration path identifier, migration random number, policy version, audit level, and target-side reconstruction preference with the task runtime encapsulated object or admission record for subsequent transmission and target-side reconstruction.
[0088] If the cross-domain migration admission result indicates that restricted migration is allowed, it means that the target-side runtime environment meets the basic admission conditions, but needs to accept the agent task under restricted permissions, restricted budget, restricted toolset, restricted resource resolution scope, or enhanced auditing conditions. In this case, the migration gateway can write the corresponding restrictive conditions into the admission record or the target-side reconstruction preference, and determine that the task runtime encapsulation object meets the conditional cross-domain migration admission requirements.
[0089] If the cross-domain migration admission result indicates a rejection or pending approval, the migration gateway can determine that the task's runtime encapsulated object does not meet the current cross-domain migration admission requirements and will not proceed to the subsequent transmission process. Reasons for rejection or pending approval may include at least one of the following: the target side is not in the whitelist, the trust relationship is not satisfied, the residency region does not match, the tenant boundary is not satisfied, the permission chain is invalid, the budget is unavailable, the target side's runtime capability is insufficient, the migration path is unavailable, or manual approval is required. The migration gateway can write these reasons into the admission failure log and notify the source-side runtime to retain its runtime state, suspend the agent task, or wait for supplementary authorization.
[0090] In the solution provided in this embodiment, through steps S301 to S303, migration constraint information is determined based on the runtime constraint status in the task runtime encapsulated object. Combined with the admission conditions of the target-side runtime environment, cross-domain migration admission verification and migration path selection are performed. Before the task runtime encapsulated object is transmitted, it can be determined whether the target-side runtime environment meets requirements such as compliance labels, residency region, tenant boundary, permission chain, budget acceptance, target-side capabilities, and migration link. Therefore, it can prevent the task runtime encapsulated object from being sent to a target-side runtime environment that does not meet the acceptance conditions, reducing the risks of invalid migration, compliance mismatch, permission mismatch, budget mismatch, and the inability of the target side to rebuild and continue running. This improves the security, controllability, and traceability of the cross-domain migration process.
[0091] In some embodiments, if the task runtime encapsulated object meets the cross-domain migration admission criteria, the migration gateway can transfer the task runtime encapsulated object to the target runtime based on the target migration path determined in the cross-domain migration admission results. The migration gateway can establish a secure transmission session between the source runtime and the target runtime based on the task runtime encapsulated object identifier, the source runtime identifier, the target runtime identifier, the target migration path identifier, the migration random number, the transmission validity period, and the transmission policy.
[0092] In some embodiments, the migration gateway can transmit the task runtime encapsulated object based on link encryption, and record at least one of the following during transmission: target migration path, transmission start time, transmission end time, link status, migration random number verification result, retransmission count, transmission result, and failure reason, to form transmission data or migration log. For situations where the task runtime encapsulated object data volume is large or the migration link stability is low, the migration gateway can also fragment the task runtime encapsulated object for transmission, configuring each fragment with a fragment sequence number, fragment summary, task runtime encapsulated object identifier, and migration random number, enabling the target side to identify whether each fragment belongs to the same task runtime encapsulated object during runtime, and to reassemble them after reception.
[0093] After receiving the task runtime encapsulated object, the target runtime can return a reception confirmation message to the migration gateway or the source runtime. The reception confirmation message may include at least one of the following: task runtime encapsulated object identifier, migration random number, target runtime identifier, reception time, reception status, and target migration path identifier. It should be noted that the reception confirmation message primarily indicates that the task runtime encapsulated object has arrived at the target runtime; it does not indicate that the target runtime has completed integrity verification, environment discovery, state reconstruction, or resume scheduling. Signature verification, replay protection verification, and target-side state reconstruction of the task runtime encapsulated object can be performed in subsequent steps.
[0094] In some embodiments, before the source-side runtime receives the reception confirmation information returned by the target-side runtime, the source-side runtime may retain the source-side runtime state or the most recently secured encapsulated object to avoid unrecoverable situations after transmission failure. If the reception confirmation information is not received within a preset confirmation time limit, or if the task runtime encapsulated object identifier, migration random number, or target migration path identifier in the reception confirmation information is inconsistent with the current migration, the migration gateway may determine that the transmission is abnormal and perform at least one of the following actions: backup path retransmission, delayed migration, migration rejection, or retention of the source-side runtime state.
[0095] In some embodiments, after the target-side runtime returns a reception confirmation, the source-side runtime can determine the handling method for the source-side instance based on the migration strategy. If the target-side runtime has only completed the reception confirmation but has not yet completed stable reconstruction, the source-side runtime can retain the source-side instance or suspend it; if the target-side runtime completes the reception confirmation and subsequently enters a stable continuation state, the source-side runtime can destroy the source-side instance or only retain the most recently securely encapsulated object. This avoids dual-active conflicts caused by the source-side runtime and the target-side runtime simultaneously continuing to execute the same agent task, and also preserves the fallback basis in case of target-side reception failure, reconstruction failure, or continuation failure.
[0096] In the solution provided in this embodiment, after the task runtime encapsulated object meets the cross-domain migration admission requirements, the migration gateway performs link encryption transmission, migration random number verification, reception confirmation, transmission data recording, and source-side instance retention or suspension control based on the target migration path. This improves the security, traceability, and failure recovery of the task runtime encapsulated object cross-domain transmission process and reduces the risks of transmission failure, duplicate reception, migration object mismatch, and dual-active execution on the source and target sides.
[0097] Step S4: During target-side runtime, based on the task runtime encapsulation object and target-side runtime environment, the target-side state of the agent task is reconstructed and the target-side runtime constraints are determined to obtain the target-side runnable state.
[0098] In some embodiments, after receiving the task runtime encapsulation object, the target-side runtime does not directly resume the execution of the agent task. Instead, it first verifies, parses, reconstructs, and recalculates the constraints of the task runtime encapsulation object. The target-side state reconstruction can be performed by the reconstruction orchestration module in the target-side runtime, and the target-side runtime constraints can be determined jointly by the target-side runtime and the compliance and permission engine, budget and quota module. This process avoids the target side restarting the task solely based on text context or task logs; instead, it restores the executable running state of the agent task based on the verified task runtime encapsulation object.
[0099] In a preferred embodiment, step S4 specifically includes: Step S401: Perform integrity verification and anti-replay verification on the task runtime encapsulated object, and after the verification passes, determine the available runtime capabilities of the target side based on the target side runtime environment.
[0100] In some embodiments, the target-side runtime can first read the integrity proof information in the task runtime encapsulation object, and then perform integrity verification and anti-replay verification on the task runtime encapsulation object based on the integrity proof information. Integrity verification can be used to determine whether the task runtime encapsulation object has been tampered with during cross-domain transmission; anti-replay verification can be used to determine whether the migration random number, the task runtime encapsulation object identifier, or the transmission record has been reused.
[0101] In some embodiments, if the verification fails, the target-side runtime may refuse to rebuild and generate a verification failure record. If the verification passes, the target-side runtime may further determine the available runtime capabilities of the target side based on the target-side runtime environment. Available runtime capabilities of the target side may include at least one of the following: available model capabilities, tool capabilities, storage capabilities, network access capabilities, resource resolution capabilities, security isolation capabilities, auditing capabilities, and budget handling capabilities. The target-side runtime may organize the above capabilities into a target-side capability description for use in subsequent resource reference resolution, tool call state reconstruction, permission scope determination, and budget remapping.
[0102] Step S402: Based on the available runtime capabilities of the target side, perform reference resolution processing on the external resource association state in the task runtime encapsulation object to obtain the target side resource access state, and perform reconstruction and adaptation processing on the tool call state in the task runtime encapsulation object to obtain the target side tool call state.
[0103] In some embodiments, the target-side runtime can perform reference resolution processing on the external resource association state in the task runtime encapsulation object based on the available runtime capabilities of the target side. The external resource association state can be represented as a portable resource reference. The target-side runtime can determine whether the target side can resolve the corresponding resource based on the resource identifier, content hash, storage domain, access ticket, and validity period in the portable resource reference, and establish the target-side resource access state if compliance and pre-restricted permissions are met.
[0104] In some embodiments, for data pointers pointing to original data in the external resource association state, the target-side runtime may also perform a data pointer resolution permission check before parsing the corresponding original data. For ease of explanation, the subscripts in the following formulas are... This indicates the current migration and reconstruction time, or the state time corresponding to the encapsulated object in the current task runtime state. For example, data pointer resolution permissions can be determined according to the following formula: in, Indicates time The corresponding data pointer parsing permission result; This indicates an indicator function that takes the value 1 if all conditions within the parentheses are met, and 0 otherwise. Indicates the data classification level corresponding to the data to be parsed; Indicates the data classification level that the target operating environment is allowed to process; This indicates the required geographic location for the data to be parsed; This indicates the geographical range of data that the target operating environment is allowed to handle; This indicates the purpose of data processing for this continued run; This represents the set of data processing purposes allowed by the target-side operating environment.
[0105] In this embodiment, if Then, the target-side runtime can parse the corresponding data pointer within the target-side permission scope and establish the target-side resource access state; if In this case, the target side should not directly parse the corresponding raw data pointer during runtime. Instead, it can mark the corresponding resource as a digest replacement state, a controlled fragment access state, a delayed parsing state, or a state awaiting additional authorization. This avoids raw data that does not meet constraints related to data classification, residency region, or processing purpose from being directly sent out due to cross-domain migration.
[0106] In some embodiments, the target-side resource access status may include at least one of the following: resolved status, restricted access status, delayed resolution status, digest replacement status, and inaccessible status. For resources that can be directly resolved on the target side, the target-side runtime can generate target-side accessible resource binding relationships; for resources that require supplementary authorization, cross-domain data approval, or access ticket updates, the target-side runtime can mark them as delayed resolution; for resources that cannot be resolved across domains but can be understood by the task through digests, the target-side runtime can use digest replacement; for resources that do not meet compliance or permission requirements, the target-side runtime can mark them as inaccessible and provide this result for subsequent resume strategy selection.
[0107] In some embodiments, the target-side runtime can also perform reconstruction and adaptation processing on the tool invocation state in the task runtime encapsulation object. The tool invocation state can be represented as a portable tool invocation description, including at least one of the following: tool identifier, tool version, invocation stage, session alias, invocation parameter summary, return status, idempotency flag, proxy strategy, rebinding strategy, and suspension flag. For the first... The target-side tool invocation state can be reconstructed as follows: in, Indicates the first The tool call status is reconstructed on the target side; Indicates tool identifier; Indicates the tool version; Indicates the scope of the tools that are allowed to be used; Indicates idempotency; Indicates the current migration and reconstruction time. The target-side operating environment or available operating capabilities on the target side; Indicates the current migration and reconstruction time. The following is the strategy information applicable to this migration and rebuild.
[0108] In some embodiments, when a native tool compatible with the source tool exists on the target side, the target-side runtime can perform native rebinding; when no natively compatible tool exists on the target side but the original tool can be accessed through a source-side proxy or intermediate proxy, the target-side runtime can switch to proxy mode; when an alternative tool with equivalent functionality but a different interface exists on the target side, the target-side runtime can switch to alternative mode; when the tool call state cannot be safely rebuilt, the target-side runtime can mark the corresponding tool call state as suspended. For tool calls with external side effects, such as email sending, work order submission, purchase order placement, and database writing, the target-side runtime prioritizes retaining and verifying a unified idempotent identifier to avoid repeatedly executing the same external state change operation after migration.
[0109] By reconstructing and adapting the tool invocation state, the target runtime can perform native rebinding, proxy reconstruction, alternative reconstruction, or suspension processing on the source tool invocation state based on the available runtime capabilities of the target side. Therefore, even if the target runtime environment is not completely isomorphic to the source runtime environment, the continuity of the task tool invocation chain can be maintained through proxy or alternative tool handle mechanisms, reducing the risk of task interruption due to incompatibility of target tools. Simultaneously, by retaining and verifying idempotency flags, the risk of tool calls with external side effects being repeatedly executed after migration can be reduced.
[0110] Step S403: Based on the running constraint state in the task running state encapsulation object and the target side running environment, perform constraint synthesis on the source side permission range, the target side allowed permission range and compliance restriction conditions to obtain the target side permission range, and perform budget remapping on the source side remaining budget and the target side budget quota to obtain the target side budget state.
[0111] In some embodiments, the target-side runtime can determine the target-side permission scope based on the runtime constraint state in the task runtime encapsulation object and the target-side runtime environment. The target-side permission scope is not a direct copy of the source-side permission scope, but is calculated jointly based on source-side authorization, target-side allowed permission scope, compliance gating rules, task scope, explicit delegation, and revocation rules. For example, the target-side permission scope can be determined according to the following formula: in, Indicates time The corresponding target-side permission scope; Indicates the scope of permissions on the source side; This represents the set of permissions allowed by the target runtime environment; This represents a set of compliance gating permissions formed by compliance tags, data categories, residency regions, tenant boundaries, purpose restrictions, and outbound restrictions; This indicates the scope of tasks that the agent's task is allowed to execute on the target side; Indicates the scope of explicit delegation; This indicates the scope of permissions that have been revoked, expired, or denied by the target.
[0112] In some embodiments, through the above-described permission constraint synthesis, the target-side runtime can implement the principles of least inheritance, rejection priority, scope contraction, explicit delegation, and expiration. For cross-organizational migration scenarios, the target-side runtime can default to permission degradation, restoring the necessary operational permissions for the agent's task continuation only when a delegation token or authorization certificate recognized by the target organization exists. If the calculated target-side permission scope is an empty set, or lacks the critical permissions necessary for continuation, the target-side runtime can record this result as a permission constraint anomaly for subsequent continuation strategy selection or anomaly handling. Thus, source-side permissions can be contracted and validated during the target-side state reconstruction phase, preventing unrestricted replication of source-side permissions to the target-side runtime environment. This ensures that permission governance constraints take effect during runtime migration, improving the security and controllability of cross-domain continuation.
[0113] In some embodiments, the target-side runtime can also perform budget remapping on the remaining budget on the source side and the budget quota on the target side to obtain the target-side budget status. Budget categories may include at least one of token, time, computing power, cost, energy consumption, and risk limits. Regarding budget categories... The target-side budget status can be determined using the following formula: in, Indicates time The target side in the budget category Available budget; Indicates the source side in the budget category The remaining budget; Indicates the encapsulation process in the budget category The costs incurred; Indicates the transmission process in the budget category The costs incurred; Indicates the target side in the budget category The maximum allowed amount; Indicates budget category The corresponding budget conversion factor.
[0114] In some embodiments, through budget remapping, the target-side runtime can constrain the agent task's continued operation on the target side to the target-side budget quota, instead of directly using the source-side budget. If the target-side budget state is lower than a preset minimum execution threshold, or if there is a conflict between the target-side budget quota and the remaining budget on the source side, the target-side runtime can mark the budget result as a restricted budget state for subsequent processing such as safe continuation, degraded continuation, pausing high-cost operations, or waiting for budget increases. By remapping the remaining budget on the source side and the target-side budget quota, resource consumption during the agent task's continued operation can be constrained when the target side's computing power, time, cost, energy consumption, or risk limits are limited, reducing the risk of budget runaway and high-cost operation runaway, and allowing the agent task to continue running on the target side within an acceptable budget range.
[0115] Step S404: Based on the task execution status, target-side resource access status, target-side tool invocation status, target-side permission scope, and target-side budget status in the task running state encapsulation object, generate the target-side continue running status.
[0116] In some embodiments, the target-side runtime can reconstruct the target-side execution context based on the task execution state encapsulated in the task runtime object. The target-side runtime can combine the aforementioned task execution state with the target-side resource access state, target-side tool invocation state, target-side permission scope, and target-side budget state to generate a target-side continueable state. Specifically, the target-side execution context can be used to determine from which task execution breakpoint the agent task should continue running on the target side; the target-side resource access state can be used to determine which external resources are accessible, have limited access, are subject to delayed resolution, or are inaccessible during task continuation; the target-side tool invocation state can be used to determine which tool invocations on the target side can be re-bound, proxied, replaced, or suspended; and the target-side permission scope and target-side budget state can jointly limit the scope of operations and resource consumption that can be executed during target-side continuation.
[0117] In some embodiments, if there are restrictions in the target-side resource access status, target-side tool invocation status, target-side permission scope, or target-side budget status, the target-side runtime can write the restrictions into the target-side continue-running status instead of directly discarding the corresponding task execution information in this step. In this way, subsequent continue-running scheduling steps can select different modes such as full continue-running, degraded continue-running, safe continue-running, or isolated continue-running based on the target-side continue-running status.
[0118] In the solution provided in this embodiment, through steps S401 to S404, the target-side runtime first verifies the task runtime encapsulated object and determines its available runtime capabilities. Then, it parses, reconstructs, and adapts resource references and tool call states, while simultaneously synthesizing and remapping target-side constraints on permissions and budgets. This avoids tampered, expired, or reused encapsulated objects from entering the continuation process, reducing the risks of resource unreachability, tool handle failure, permission overreach, and budget mismanagement. It enables the agent task to form a continueable state on the target side constrained by resources, tools, permissions, and budget, improving the reliability, security, and controllability of state reconstruction and continuation after cross-domain migration.
[0119] Step S5: Based on the target-side continueable state, continue running the agent task from the task execution breakpoint corresponding to the source-side running state while the target side is running.
[0120] In some embodiments, after the target-side runtime generates a target-side continueable state, it can first perform a continueability evaluation on the target-side continueable state, then determine the target continueability strategy based on the continueability evaluation results, and restore the execution context and continue scheduling the agent task according to the target continueability strategy. That is to say, the target-side runtime does not directly continue execution after completing state reconstruction, but determines whether the agent task is suitable for full continueability, degraded continueability, safe continueability, or isolated continueability on the target side based on the results of resource resolution, tool reconstruction, permission inheritance, budget remapping, checkpoint matching, and risk states.
[0121] In a preferred embodiment, step S5 specifically includes: Step S501: Generate the continued running evaluation result based on the state reconstruction result in the target side's continueable running state and the target side's running constraints.
[0122] In some embodiments, the target-side runtime can generate a continuation evaluation result based on the state reconstruction result in the target-side continueable state and the target-side runtime constraints. The continuation evaluation result can be used to characterize the feasibility of the agent task continuing to run from the task execution breakpoint corresponding to the source-side runtime state on the target side. The state reconstruction result may include at least one of the following: resource reference resolution result, tool call state reconstruction result, checkpoint matching result, and conflict detection result; the target-side runtime constraints may include at least one of the following: target-side permission scope, target-side budget state, compliance restrictions, and risk control conditions.
[0123] In some embodiments, the endurance assessment result may include an endurance score. For clarity, the subscripts in the following formulas are... This indicates the current time of the continuation evaluation, or the state time corresponding to the encapsulated object of the current task runtime. For example, the continuation score can be determined according to the following formula: in, Indicates time The corresponding endurance score; This indicates the degree to which external resource references are resolved, restricted in access, or can be handled alternatively on the target side; This indicates the degree to which the tool invocation status has completed native rebinding, proxy reconstruction, alternative reconstruction, or controllable suspension on the target side; This indicates the degree to which the target side's permission scope satisfies the task's need to continue running; This indicates the degree of matching between the target-side execution context and the task execution breakpoint corresponding to the source-side running state; This indicates the degree of state conflicts, resource conflicts, tool conflicts, strategy conflicts, or active-active conflicts that exist during the target-side reconstruction process; Indicates the degree to which a task runtime encapsulated object, access ticket, delegation token, or resource reference has expired; to These represent the weight coefficients of the corresponding scoring items.
[0124] In some embodiments, the degree of resource reference resolution, the degree of tool reconstruction, the degree of permission approval, and the degree of checkpoint matching can be used as positive scoring items, while the degree of conflict and the degree of expiration can be used as negative scoring items. The target-side runtime can use the above-mentioned continuation scoring to comprehensively incorporate resource, tool, permission, checkpoint, conflict, and timeliness factors into the continuation feasibility judgment, avoiding directly continuing the agent task based solely on the text context recovery result.
[0125] Step S502: Determine the target continuation strategy based on the continuation assessment results. The target continuation strategy includes a complete continuation strategy, a downgraded continuation strategy, a safe continuation strategy, or an isolated continuation strategy.
[0126] In some embodiments, the target runtime can determine the target persistence strategy based on persistence score, target permission scope, target budget status, and target risk status. For example, the target persistence mode can be determined as follows: in, Indicates time The corresponding target continuation mode; This function represents the function for selecting the continuation mode. Indicates the endurance score; Indicates the scope of permissions on the target side; This indicates the target-side budget status, which can be composed of the target-side available budget corresponding to each budget category. This indicates the risk status of the target side continuing to run. The value can be full, partial, safe, or quarantine; where full corresponds to a full continuation strategy, partial corresponds to a degraded continuation strategy, safe corresponds to a safe continuation strategy, and quarantine corresponds to an isolated continuation strategy.
[0127] In some embodiments, if the continuation score meets the full continuation threshold, the target-side permission scope and target-side budget status both meet the continuation requirements, and the target-side continuation risk status does not exceed the preset risk limit, then the target-side runtime can determine that the target continuation strategy is a full continuation strategy. If a small number of non-critical resources are inaccessible, non-critical tools cannot be rebuilt, or some budgets are limited, but the main flow of the agent task can still continue to execute, then the target-side runtime can determine that the target continuation strategy is a degraded continuation strategy. If the target side only allows low-risk, read-only, pure computation, or operations that do not change the external state to continue execution, then the target-side runtime can determine that the target continuation strategy is a safe continuation strategy. If critical resources cannot be resolved, critical permissions are missing, reconstruction conflicts are high, the target-side environment and the task runtime encapsulated object declaration are inconsistent, or supplementary authorization, supplementary data, or manual confirmation is required, then the target-side runtime can determine that the target continuation strategy is an isolated continuation strategy.
[0128] Step S503: According to the target continuation strategy, restore the execution context of the agent task to the task execution breakpoint corresponding to the source side running state, and continue to schedule the agent task under the target side running constraints.
[0129] In some embodiments, the target-side runtime can restore the execution context in the target-side continueable state to the task execution breakpoint corresponding to the source-side runtime state according to the target continuation strategy. The execution context may include at least one of the following: plan stack, current execution position, pending task queue, checkpoint chain, and pending tool events. The target-side runtime can also use the target-side resource access state, target-side tool invocation state, target-side permission scope, and target-side budget state as scheduling constraints to enable the agent task to continue execution under the target-side runtime constraints.
[0130] When the target continuation strategy is a full continuation strategy, the target runtime can continue scheduling agent tasks according to the execution context corresponding to the task execution breakpoint, and use the recovered resources and tools within the target runtime constraints. When the target continuation strategy is a degraded continuation strategy, the target runtime can use digest substitution, delayed resolution, or unresolved dependency marking for inaccessible resources, and use proxy tools, alternative tools, or suspension for unreconstructable tools, while continuing to execute task fragments that do not depend on restricted items. When the target continuation strategy is a safe continuation strategy, the target runtime can only schedule read-only operations, pure computational operations, low-risk tool calls, or task steps that do not change the external state, and suspend high-cost operations or operations with external side effects. When the target continuation strategy is an isolated continuation strategy, the target runtime can place agent tasks in an isolated observation state, prohibiting them from directly executing external state-changing operations, and awaiting supplementary authorization, supplementary data, or manual confirmation.
[0131] In the solution provided in this embodiment, through steps S501 to S503, the target-side runtime first generates a continuation evaluation result based on the target-side's continueable state, then determines the target continuation strategy based on the continuation score, permissions, budget, and risk, and resumes scheduling the agent task from the task execution breakpoint according to the corresponding strategy. This avoids blindly continuing execution when resources, tools, permissions, or budget are insufficient, allowing the agent task to select an appropriate continuation method on the target side based on recoverability and operational constraints. This reduces the risks of continuation failure, repeated execution, unauthorized operations, and loss of control in high-risk operations, improving the stability, security, and controllability of continuation after cross-domain migration.
[0132] In a preferred embodiment, a continuation audit record is generated during the continuation of an agent task, and in the event of a continuation anomaly, anomaly handling is performed based on the continuation audit record, target-side running constraints, and the most recently secure encapsulated object, so as to achieve responsibility tracking and failure recovery during the cross-domain continuation of an agent task.
[0133] During the continued runtime, the target-side runtime can execute rollback trigger checks according to preset cycles, critical event triggers, or abnormal event triggers. For ease of explanation, the moment when the target-side runtime executes a rollback trigger check is denoted as... For example, the rollback trigger condition can be determined by the following calculation formula: in, Indicates time The corresponding rollback trigger result; Indicates an indicator function, symbol " The parentheses indicate a logical OR, meaning that the value is 1 if any condition within the parentheses is met, and 0 otherwise. This indicates the signature verification result; a value of 0 indicates that the signature verification failed. Indicates whether a replay attack was detected; Indicates the endurance score; Indicates the preset rollback threshold; This indicates that the target side's permission scope is an empty set.
[0134] In some embodiments, in addition to the rollback triggering conditions described above, the target runtime may also trigger exception handling if it detects that a resource reference cannot be resolved, a tool handle is incompatible, the target budget is lower than the minimum execution threshold, the target environment and the task runtime encapsulated object declaration are inconsistent, a critical authorization is revoked, or there is a risk of repeated execution of external side effects. Exception handling may include refusing to continue execution, switching to a safe execution strategy, switching to an isolated execution strategy, enabling digest replacement, delaying resolution, suspending related tool calls, entering a manual approval process, or rolling back to the most recently safe encapsulated object.
[0135] For example, if digest or signature verification fails, the target runtime can refuse to continue running and roll back to the most recently secure encapsulated object, while recording the failure digest, certificate chain information, target domain information, and timestamp; if duplicate migration random numbers are detected or the task runtime encapsulated object has expired, the target runtime can refuse to receive and issue an alert, while recording source link, target link, and random number conflict information; if resource references cannot be resolved, the target runtime can enable digest replacement, delayed resolution, or downgraded resumption, and record the unresolvable resource and the reason for tag restrictions; if tool handles are incompatible, the target runtime can switch to proxy mode, replacement mode, or suspend related steps, and record the tool identifier, tool version, and replacement path; if the budget is insufficient or quota conflicts occur, the target runtime can switch to a secure resumption strategy, suspend high-cost operations, or wait for budget increases, and record the basis for budget recovery and contraction; if the target side permission scope is an empty set or critical permissions are revoked, the target runtime can refuse to continue running or transfer to manual approval, and record the revocation source and target constraints.
[0136] In some embodiments, the audit logs can be generated using a chained digest approach to improve their tamper-proof capability. For example, the first... An audit record can be determined using the following formula: in, Indicates the first A summary of the audit chain corresponding to each audit record; This indicates a summary of the audit chain corresponding to the previous audit record; Indicates the first One audit event; This indicates summary information related to the audit event; This indicates the time information corresponding to the audit event; This represents a hash function. By associating the current audit event with the summary of the previous audit chain, a continuous audit chain can be formed, reducing the risk that audit records may be deleted, tampered with, or inserted without being detected.
[0137] In the solution provided in this embodiment, by generating a continuation audit record during the continuation of the agent task, and by performing refusal to continue, policy switching, isolation processing, or rollback processing when a continuation anomaly is detected, the cross-domain migration continuation process can be made traceable and recoverable, reducing the risk of anomaly continuing to spread, state drifting further, and repeated execution of external side effects.
[0138] In summary, the method for cross-domain migration and continuation of agent runtime states provided in this application involves the following steps: When an agent task undergoes cross-domain migration, pre-migration state convergence processing is first performed on the source side runtime to ensure that the source side runtime state meets the migration consistency conditions. Then, a task runtime encapsulation object is generated based on the source side runtime state, including task execution state, external resource association state, tool invocation state, and runtime constraint state. Finally, cross-domain migration admission, target side state reconstruction, and target side runtime constraint determination are performed in conjunction with the runtime constraint state and the target side runtime environment. Therefore, this application enables agent tasks to maintain a consistent correspondence between task execution progress, external resource association, tool invocation state, and runtime constraints when migrating across devices, business domains, or organizational boundaries. This reduces the risks of post-migration state drift, duplicate execution, resource association failure, or runtime constraint mismatch, allowing the agent task to continue running from the task execution breakpoint corresponding to the source side runtime state on the target side runtime. This improves the continuity, stability, and controllability of agent task cross-domain migration continuation.
[0139] To further illustrate the application of this application's embodiments under different cross-domain boundaries, the following examples illustrate three scenarios: device boundary continuation, business domain boundary continuation, and organizational boundary continuation.
[0140] In one specific application embodiment, the method provided in this application can be applied to device boundary continuation scenarios. For example, an agent task executes a long document drafting task on a tablet device. This agent task has completed requirement decomposition, data retrieval, outline generation, and partial chapter writing, and has formed a current plan stack, document draft references, search result references, search session state, and remaining token budget state during runtime on the source side. When the tablet device detects that the battery level is below a preset threshold and detects that the user has already logged into the same tenant account on a desktop device, it can be determined that the cross-device migration trigger condition is met.
[0141] In this scenario, the source-side runtime corresponding to the tablet device can perform pre-migration state convergence processing, pausing the agent task to initiate new external state change operations, and converging the current plan stack, chapter writing progress, document draft references, search result references, search session state, and budget state. Subsequently, the source-side runtime generates a task runtime encapsulation object based on the converged source-side runtime state. The document draft and search results can be written to the task runtime encapsulation object without being copied as a whole from the original files; instead, they are converted into controlled file references, working memory pointers, or search result pointers. Local file access handles and search session handles can be converted into transferable tool call descriptions recognizable by the target side. The remaining token budget can be written to the task runtime encapsulation object as part of the runtime constraint state.
[0142] After receiving the task runtime encapsulation object on the target side of the desktop device, the runtime can first perform integrity checks and anti-replay checks. Upon successful verification, it parses necessary document draft references and search result pointers according to the permission policy under the same tenant account, rebinds file access permissions and search tool call status, and maps the remaining token budget to the target side budget. Subsequently, the target side runtime can restore the execution context of the agent task to the chapter writing breakpoint corresponding to the source side runtime state based on the target side's continueable status, and continue executing subsequent chapter writing tasks. This embodiment maintains the continuity of long-cycle agent tasks when switching user devices, avoiding users having to re-upload attachments, re-search materials, or regenerate documents from scratch on the desktop device, while also reducing unnecessary copying of original attachments between devices.
[0143] In another specific application embodiment, the method provided in this application can be applied to scenarios where operations continue at the business domain boundary. For example, a customer service quality inspection intelligent agent originally runs in a normal business domain. During the processing of call logs, customer service conversations, and work order summaries, it identifies a large number of personal information fields or sensitive business information fields. At this time, the system can determine the triggering conditions for migration to a higher security domain based on data classification, compliance tags, or risk levels.
[0144] In this scenario, the source-side runtime in the ordinary business domain can enter the state convergence window to converge the dialogue analysis status, work order summary references, model inference progress, risk budget status, and generated tool call results of the customer service quality inspection task, and generate a task runtime encapsulation object. This task runtime encapsulation object can carry compliance tags such as "personal sensitive information," "specific region-only parsing," and "audit level upgrade," and convert call records, work order content, or external knowledge base results into controlled resource references or summary references, instead of directly writing all raw sensitive data into the task runtime encapsulation object.
[0145] When performing cross-domain migration access processing, the migration gateway can verify compliance tags, residency requirements, audit levels, and high-security domain access conditions. If the high-security domain meets the access conditions, the task runtime encapsulation object is transmitted to the target runtime in the corresponding high-security domain. Upon receiving the object, the target runtime can parse relevant resource references while meeting data residency requirements, processing purpose restrictions, and access control conditions. It then reduces the external network tool permissions from the source side to internal network alternative tool permissions usable within the high-security domain. Subsequently, the target runtime can continue executing the quality inspection conclusion generation task within the constraints of target-side permission scope, risk budget, and audit requirements. This embodiment allows for the migration of intelligent agent tasks involving sensitive information to a higher-security business domain without interrupting business operations, while simultaneously achieving access control reduction, tool substitution, and minimal data migration.
[0146] In another specific application embodiment, the method provided in this application can be applied to organizational boundary continuation scenarios. For example, a supply chain collaborative intelligent agent executes a procurement clarification task within Party A's organization. During execution, some clarification issues need to be delegated to external partners for further processing. However, this task also involves data that should not be exposed externally, such as Party A's internal budget details, procurement strategies, and supplier evaluation information. In this case, the system can determine that the cross-organizational boundary migration trigger conditions are met.
[0147] In this scenario, the source-side runtime corresponding to the client organization can perform state convergence processing before migration and, based on data classification and outbound strategies, categorize task states into a set of outbound clarification issues and a set of non-outbound internal budget details. For the outbound clarification issue set, it can be written into the task runtime encapsulation object as the task execution state or controlled resource reference required for continued execution on the target side. For the non-outbound internal budget detail set, only the summary, controlled references, or constraint labels can be retained, without writing the original details into the task runtime encapsulation object for the collaborating organization. Simultaneously, the source-side runtime can convert collaborative interface tools, task states, and budget constraints into migrateable tool call descriptions and runtime constraint states.
[0148] After the collaborating organization receives the task runtime encapsulated object, the target-side runtime can determine the target-side permission scope based on the delegate token approved by the collaborating organization, the target-side allowed permission scope, and compliance gating rules, and perform target-side emphasis mapping on the budget status. The collaborating organization only obtains the minimum permissions and minimum budget necessary to handle the clarification issue, and can continue to complete the clarification issue processing through the collaboration interface proxy tool. After the collaborating organization completes the processing, it can generate a result encapsulated object and send it back to the client organization, where the client organization's runtime will perform verification, parsing, and result merging. Through this embodiment, task continuation can be achieved in cross-organizational collaboration processes, instead of directly sending out complete business data, thereby reducing the risk of sensitive data being exposed and transferred across organizations, and supporting permission contraction, budget control, and audit trails in multi-party collaboration processes.
[0149] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this application. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this application.
[0150] Furthermore, some embodiments of this application also provide an electronic device. The electronic device can be various forms of digital computer, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, etc. The electronic device can also be various forms of mobile devices, such as cellular phones, smartphones, wearable devices, and other similar computing devices.
[0151] The electronic device includes: one or more processors; and a memory storing computer program instructions, which, when executed, cause the processor to perform a method for cross-domain migration and continuation of the runtime state of an intelligent agent as provided in any one or more of the above embodiments. Figure 3An exemplary structural diagram of the electronic device is disclosed. The electronic device includes one or more processors 1101, a memory 1102, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses 1105 and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In some other embodiments, multiple processors and / or multiple buses 1105 can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations. The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.
[0152] The electronic device may further include an input device 1103 and an output device 1104. The processor 1101, memory 1102, input device 1103, and output device 1104 may be connected via a bus 1105 or other means. Figure 3 Taking the connection between China and Israel via bus 1105 as an example.
[0153] Input device 1103 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as a touch screen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 1104 may include a display device, auxiliary lighting device (e.g., LED), and haptic feedback device (e.g., vibration motor). The display device may include, but is not limited to, a liquid crystal display, a light-emitting diode display, and a plasma display. In some embodiments, the display device may be a touch screen.
[0154] To provide interaction with the user, the electronic device can be a computer. The computer has: a display device (e.g., a cathode ray tube or LCD monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback); and input from the user can be received in any form (e.g., voice input or tactile input).
[0155] In this embodiment, a computer-readable medium stores a computer program / instruction, which, when executed by a processor, implements a method for cross-domain migration and continuation of the runtime state of an intelligent agent provided in any one or more of the above embodiments. The computer-readable medium may be included in the electronic device described in the above embodiments; or it may exist independently and not be assembled into that device. The computer-readable medium carries one or more computer-readable instructions.
[0156] The memory 1102 can serve as a non-transitory computer-readable storage medium, used to store non-transitory software programs, non-transitory computer-executable programs, and modules. The processor 1101 executes various functional applications and data processing of the server by running the non-transitory software programs, instructions, and modules stored in the memory 1102, thereby implementing the program instructions / modules corresponding to the methods provided in any one or more of the embodiments described above in this application.
[0157] The memory 1102 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 1102 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 1102 may optionally include memory remotely located relative to the processor 1101, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0158] It should be noted that the computer-readable medium described in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. Computer-readable media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0159] Computer-readable media include permanent and non-permanent, removable and non-removable media, which can store information by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technologies, read-only optical discs, digital versatile optical discs or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0160] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including local area networks (LANs) or wide area networks (WANs), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0161] In the above embodiments, all or part of the implementation can be achieved through software, hardware, firmware, or any combination thereof. For example, it can be implemented using an application-specific integrated circuit (ASIC), a general-purpose computer, or any other similar hardware device. In some embodiments, the software program of this application can be executed by a processor to implement the above steps or functions. Similarly, the software program of this application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drives, floppy disks, and similar devices. In addition, some steps or functions of this application can be implemented in hardware, for example, as circuitry that cooperates with a processor to perform the various steps or functions.
[0162] The computer program product provided in this application includes one or more computer programs / instructions. When executed by a processor, these computer programs / instructions generate, in whole or in part, the processes or functions described in this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0163] The flowcharts or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-specific system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0164] The scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to encompass all variations falling within the meaning and scope of equivalents of the claims. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. Terms such as "first," "second," etc., are used only to distinguish descriptions and do not indicate any particular order, nor should they be construed as indicating or implying relative importance.
[0165] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily made by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims, and the above embodiments should be regarded as exemplary and non-limiting.
Claims
1. A method for cross-domain migration and continuation of an agent runtime state, characterized in that, include: In response to the cross-domain migration triggering condition of the agent task, the agent task is subjected to pre-migration state convergence processing during source-side runtime to obtain the source-side runtime state that satisfies the migration consistency condition. Based on the source-side running status, a task running state encapsulation object is generated. The task running state encapsulation object includes the task execution status, external resource association status, tool invocation status, and running constraint status required for the agent task to continue running on the target side. Based on the aforementioned operational constraints and the target-side operational environment, cross-domain migration admission processing is performed on the task runtime encapsulated object, and if the task runtime encapsulated object meets the cross-domain migration admission requirements, the task runtime encapsulated object is transmitted to the target-side runtime environment. When the target side is running, based on the task running state encapsulation object and the target side running environment, the target side state of the agent task is reconstructed and the target side running constraints are determined to obtain the target side runnable state; Based on the target-side continueable state, the agent task can continue running from the task execution breakpoint corresponding to the source-side running state when the target-side is running. 2.The method of claim 1, wherein, The step of performing pre-migration state convergence processing on the agent task during source-side runtime to obtain a source-side runtime state that satisfies the migration consistency condition includes: During runtime on the source side, a state convergence window is established, and within the state convergence window, the agent task is paused from initiating new external state change operations, while allowing already initiated read operations or computation operations that do not change the external state to continue execution. The task execution state, external resource association state, tool invocation state, and running constraint state related to task continuation in the intelligent agent task are converged. If the task execution state, external resource association state, tool invocation state, running constraint state, and initiated external state change operations all satisfy the migration consistency condition after the convergence process, the source-side running state after the convergence process is determined as the source-side running state that satisfies the migration consistency condition. 3.The method of claim 2, wherein, The pre-migration state convergence process employs a phased freezing mechanism, which includes a first freezing phase and a second freezing phase executed sequentially within the same state convergence window, and is specifically implemented in the following manner: In response to the agent task entering the transition state, a freeze period identifier corresponding to the state convergence window is created. The freeze period identifier is used to associate and record the state convergence results generated within the state convergence window. During the first freezing phase, the agent task is suspended from initiating new external state change operations, while read operations or computational operations that do not change the external state are allowed to continue to be executed. The execution records and external interaction results generated by the agent task before the migration are also consistent and solidified. In the second freezing phase, the task execution state is sealed, the external resource association state is converted to a portable reference, the tool call state is converted to a portable tool call description, and the running constraint state is locked. 4.The method of claim 1, wherein, The step of generating a task runtime encapsulation object based on the source-side runtime state includes: Based on the source-side operating state, determine the set of states required for the target-side continuation of the agent task. The external resource association states in the state set are referenced to obtain portable resource references, and the tool call states in the state set are descriptively processed to obtain portable tool call descriptions. According to predetermined field rules, the task execution status, the portable resource reference, the portable tool call description, and the running constraint status in the status set are standardized and encapsulated to obtain standardized encapsulated data. The standardized encapsulated data undergoes integrity processing, including digest calculation and signature processing, to obtain the task runtime encapsulated object carrying integrity proof information. 5.The method of claim 1, wherein, The step of performing cross-domain migration admission processing on the task runtime encapsulated object based on the runtime constraint state and the target-side runtime environment includes: Based on the running constraint state in the task running state encapsulation object, determine the migration constraint information corresponding to the agent task, and obtain the target side admission conditions corresponding to the target side running environment; Based on the migration constraint information and the target-side admission conditions, cross-domain migration admission verification and migration path selection are performed on the task runtime encapsulation object to obtain the cross-domain migration admission result. If the cross-domain migration admission result indicates that migration is allowed, the task runtime encapsulated object is determined to satisfy the cross-domain migration admission. 6.The method of claim 1, wherein, The step of reconstructing the target-side state of the agent task and determining the target-side running constraints based on the task running state encapsulation object and the target-side running environment during runtime on the target side, to obtain the target-side sustainable running state, includes: The task runtime encapsulation object is subjected to integrity verification and replay protection verification, and after the verification is passed, the available runtime capabilities of the target side are determined based on the target side runtime environment; Based on the available runtime capabilities of the target side, the external resource association status in the task runtime encapsulation object is referenced and resolved to obtain the target side resource access status. The tool call status in the task runtime encapsulation object is then reconstructed and adapted to obtain the target side tool call status. Based on the running constraint state in the task running state encapsulation object and the target side running environment, the source side permission range, the target side allowed permission range and compliance restriction conditions are constrained and synthesized to obtain the target side permission range, and the remaining budget on the source side and the budget quota on the target side are remapped to obtain the target side budget state. Based on the task execution status, target-side resource access status, target-side tool invocation status, target-side permission scope, and target-side budget status in the task running state encapsulation object, the target-side continue-running status is generated.
7. The method for cross-domain migration and continuation of runtime state of an intelligent agent according to claim 1, characterized in that, The step of continuing the agent task from the task execution breakpoint corresponding to the source-side running state when running on the target side, based on the target-side continueable running state, includes: Based on the state reconstruction results and target-side operational constraints in the target-side sustainable running state, a sustainable running evaluation result is generated; Based on the endurance assessment results, a target endurance strategy is determined, which includes a full endurance strategy, a downgraded endurance strategy, a safe endurance strategy, or an isolated endurance strategy. According to the target continuation strategy, the execution context of the agent task is restored to the task execution breakpoint corresponding to the source side running state, and the agent task continues to be scheduled under the target side running constraints.
8. An electronic device, characterized in that, The electronic device includes: One or more processors; and a memory storing computer program instructions, which, when executed, cause the processors to perform the agent runtime state cross-domain migration and continuation method as described in any one of claims 1-7.
9. A computer-readable storage medium having a computer program and / or instructions stored thereon, characterized in that, When the computer program and / or instructions are executed by the processor, they implement the method for cross-domain migration and continuation of the runtime state of an intelligent agent as described in any one of claims 1-7.
10. A computer program product comprising a computer program and / or instructions, characterized in that, When the computer program and / or instructions are executed by the processor, they implement the method for cross-domain migration and continuation of the runtime state of an intelligent agent as described in any one of claims 1-7.
